Source of file GoogleConfig.php
Size: 1,388 Bytes - Last Modified: 2021-12-24T06:19:21+00:00
/var/www/docs.ssmods.com/process/src/code/GoogleConfig.php
123456789101112131415161718192021222324252627282930313233343536373839 | <?php namespace BigforkGoogleAnalytics; use SilverStripe\Forms\FieldList; use SilverStripe\Forms\Tab; use SilverStripe\Forms\TextField; use SilverStripe\Forms\TextareaField; use SilverStripe\ORM\DataExtension; class GoogleConfig extends DataExtension { private static $db = [ 'GoogleAnalyticsTrackingID' => 'Varchar', 'GoogleAnalyticsParameters' => 'Text', 'GoogleAnalyticsConstructorParameters' => 'Text' ]; /** * @inheritdoc */ public function updateCMSFields(FieldList $fields) { $analyticsFields = FieldList::create( TextField::create("GoogleAnalyticsTrackingID", "Google Analytics Tracking ID") ->setDescription("e.g. UA-XXXXXX-X"), TextareaField::create("GoogleAnalyticsParameters", "Additional Parameters") ->setDescription("<strong>Advanced users only.</strong> If you do not know what this field does, please leave it blank."), TextareaField::create("GoogleAnalyticsConstructorParameters", "Constructor Parameters") ->setDescription("<strong>Advanced users only.</strong> If you do not know what this field does, please leave it blank. An object to be passed as an argument to ga.create()") ); $fields->addFieldToTab('Root', Tab::create('GoogleAnalytics')->setChildren($analyticsFields)); } } |