Source of file Font.php
Size: 1,326 Bytes - Last Modified: 2018-07-02T11:52:21+00:00
/var/www/docs.ssmods.com/process/src/code/Font.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 | <?php class Font extends StyleObject { /** * FIELDS */ private static $db = array( 'Name' => 'Text', 'Value' => 'Text' ); private static $default_records = array( /*array ( 'Key' => 'Value', 'Key' => 'Value', ), array ( 'Key' => 'Value', 'Key' => 'Value', ), array ( 'Key' => 'Value', 'Key' => 'Value', ),*/ ); /** * CONFIGURATION */ private static $default_sort='Name ASC'; private static $summary_fields = array( 'Name' => 'Name', 'Value' => 'Value', 'CMSPreview' => 'Preview' ); /** * CMS FIELDS */ public function getCMSFields() { $fields = parent::getCMSFields(); /** * MAIN TAB */ $tab = 'Root.Main'; $field = new TextField('Name'); $fields->addFieldToTab($tab, $field); $field = new TextField('Value'); $fields->addFieldToTab($tab, $field); $html = ViewableData::renderWith('Font_CMS_Preview'); $field = new LiteralField('Preview', $html); $fields->addFieldToTab($tab, $field); return $fields; } public function getCMSPreview() { $html = ViewableData::renderWith('Font_CMS_Preview'); $obj = HTMLText::create(); $obj->setValue($html); return $obj; } } |