Source of file GoogleTrackEvent.php
Size: 1,167 Bytes - Last Modified: 2021-12-23T10:36:30+00:00
/var/www/docs.ssmods.com/process/src/code/models/GoogleTrackEvent.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 | <?php /** * Created by Nivanka Fonseka (nivanka@silverstripers.com). * User: nivankafonseka * Date: 2/3/15 * Time: 4:44 PM * To change this template use File | Settings | File Templates. */ class GoogleTrackEvent extends DataObject { private static $db = array( 'Target' => 'Varchar(300)', 'EventType' => 'Enum("Click,Hover", "Click")', 'Category' => 'Varchar(100)', 'Action' => 'Varchar(100)', 'Label' => 'Varchar(100)' ); private static $has_one = array( 'SiteConfig' => 'SiteConfig' ); private static $many_many = array( 'Pages' => 'SiteTree' ); private static $summary_fields = array( 'Target', 'EventType', 'Category', 'Action', 'Label' ); public function getCMSFields(){ $fields = parent::getCMSFields(); $fields->removeByName('SiteConfigID'); if($targetField = $fields->dataFieldByName('Target')){ $targetField->setRightTitle('ID or CSS class to find the dom element'); } $fields->removeByName('Pages'); $fields->addFieldToTab('Root.Main', TreeMultiselectField::create('Pages', 'Select Pages (leave empty for all the pages)')->setSourceObject('SiteTree')); return $fields; } } |