Source of file SimpleBlock.php
Size: 0,750 Bytes - Last Modified: 2021-12-24T06:40:48+00:00
/var/www/docs.ssmods.com/process/src/code/SimpleBlock.php
1234567891011121314151617181920212223242526272829303132 | <?php class SimpleBlock extends DataObject { private static $db = array( 'Title' => 'Varchar(255)', 'Active' => 'Boolean', 'Link' => 'Varchar(255)', 'isLinkExternal' => 'Boolean' ); private static $has_one = array( 'Image' => 'Image' ); private static $defaults = array('Active' => 1); private static $summary_fields = array('Title', 'Active'); public function getCMSFields() { $fields = parent::getCMSFields(); $fields->dataFieldByName('Link')->setRightTitle('Fully qualified (http://www.google.com) or internal (section/page)'); $fields->dataFieldByName('isLinkExternal')->setTitle('Open link in new window?'); return $fields; } public function Target() { return $this->isLinkExternal ? '_blank' : '_self'; } } |