silverstripe-frameworktest/code/sifr/SifrPage.php

30 lines
858 B
PHP
Raw Normal View History

2017-01-15 09:19:56 +01:00
<?php
use SilverStripe\Forms\LiteralField;
2015-12-17 21:20:49 +01:00
class SifrPage extends Page
{
2017-01-15 09:19:56 +01:00
2015-12-17 21:20:49 +01:00
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.SifrSampleImage", new LiteralField("SifrSampleImage", '<p><img src="frameworktest/images/sifr_sample.png"/></p>'));
2017-01-15 09:19:56 +01:00
2015-12-17 21:20:49 +01:00
return $fields;
}
}
2017-01-15 09:19:56 +01:00
class SifrPage_Controller extends PageController
2015-12-17 21:20:49 +01:00
{
2017-01-15 09:19:56 +01:00
2015-12-17 21:20:49 +01:00
public function init()
{
parent::init();
2017-01-15 09:19:56 +01:00
2015-12-17 21:20:49 +01:00
Sifr::add_font('blackout', 'themes/fonts/blackout.swf');
Sifr::replace_element('blackout', 'h2', "'.sIFR-root { text-align: left; color: red;'");
Sifr::replace_element('blackout', 'h3', "'.sIFR-root { text-align: left; color: red;'");
Sifr::replace_element('blackout', 'h4', "'.sIFR-root { text-align: left; color: red;'");
Sifr::activate_sifr();
}
}