@@ -12,58 +12,58 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class CustomSiteConfig extends DataExtension |
| 14 | 14 | { |
| 15 | - private static $db = array( |
|
| 16 | - 'GACode' => 'Varchar(16)', |
|
| 17 | - 'FacebookURL' => 'Varchar(256)', // multitude of ways to link to Facebook accounts, best to leave it open. |
|
| 18 | - 'TwitterUsername' => 'Varchar(16)', // max length of Twitter username 15 |
|
| 19 | - ); |
|
| 15 | + private static $db = array( |
|
| 16 | + 'GACode' => 'Varchar(16)', |
|
| 17 | + 'FacebookURL' => 'Varchar(256)', // multitude of ways to link to Facebook accounts, best to leave it open. |
|
| 18 | + 'TwitterUsername' => 'Varchar(16)', // max length of Twitter username 15 |
|
| 19 | + ); |
|
| 20 | 20 | |
| 21 | - public function updateCMSFields(FieldList $fields) |
|
| 22 | - { |
|
| 23 | - $fields->addFieldToTab( |
|
| 24 | - 'Root.Main', |
|
| 25 | - $gaCode = TextField::create( |
|
| 26 | - 'GACode', |
|
| 27 | - _t(__CLASS__ . '.GaField', 'Google Analytics account') |
|
| 28 | - ) |
|
| 29 | - ); |
|
| 21 | + public function updateCMSFields(FieldList $fields) |
|
| 22 | + { |
|
| 23 | + $fields->addFieldToTab( |
|
| 24 | + 'Root.Main', |
|
| 25 | + $gaCode = TextField::create( |
|
| 26 | + 'GACode', |
|
| 27 | + _t(__CLASS__ . '.GaField', 'Google Analytics account') |
|
| 28 | + ) |
|
| 29 | + ); |
|
| 30 | 30 | |
| 31 | - $gaCode->setDescription( |
|
| 32 | - DBField::create_field('HTMLFragment', _t( |
|
| 33 | - __CLASS__ . '.GaFieldDesc', |
|
| 34 | - 'Account number to be used all across the site (in the format <strong>UA-XXXXX-X</strong>)' |
|
| 35 | - )) |
|
| 36 | - ); |
|
| 31 | + $gaCode->setDescription( |
|
| 32 | + DBField::create_field('HTMLFragment', _t( |
|
| 33 | + __CLASS__ . '.GaFieldDesc', |
|
| 34 | + 'Account number to be used all across the site (in the format <strong>UA-XXXXX-X</strong>)' |
|
| 35 | + )) |
|
| 36 | + ); |
|
| 37 | 37 | |
| 38 | - $fields->findOrMakeTab('Root.SocialMedia', _t(__CLASS__ . '.SocialMediaTab', 'Social Media')); |
|
| 38 | + $fields->findOrMakeTab('Root.SocialMedia', _t(__CLASS__ . '.SocialMediaTab', 'Social Media')); |
|
| 39 | 39 | |
| 40 | - $fields->addFieldToTab( |
|
| 41 | - 'Root.SocialMedia', |
|
| 42 | - $facebookURL = TextField::create( |
|
| 43 | - 'FacebookURL', |
|
| 44 | - _t(__CLASS__ . '.FbField', 'Facebook UID or username') |
|
| 45 | - ) |
|
| 46 | - ); |
|
| 47 | - $facebookURL->setDescription( |
|
| 48 | - DBField::create_field('HTMLFragment', _t( |
|
| 49 | - __CLASS__ . '.FbFieldDesc', |
|
| 50 | - 'Facebook link (everything after the "http://facebook.com/", eg http://facebook.com/' |
|
| 51 | - . '<strong>username</strong> or http://facebook.com/<strong>pages/108510539573</strong>)' |
|
| 52 | - )) |
|
| 53 | - ); |
|
| 40 | + $fields->addFieldToTab( |
|
| 41 | + 'Root.SocialMedia', |
|
| 42 | + $facebookURL = TextField::create( |
|
| 43 | + 'FacebookURL', |
|
| 44 | + _t(__CLASS__ . '.FbField', 'Facebook UID or username') |
|
| 45 | + ) |
|
| 46 | + ); |
|
| 47 | + $facebookURL->setDescription( |
|
| 48 | + DBField::create_field('HTMLFragment', _t( |
|
| 49 | + __CLASS__ . '.FbFieldDesc', |
|
| 50 | + 'Facebook link (everything after the "http://facebook.com/", eg http://facebook.com/' |
|
| 51 | + . '<strong>username</strong> or http://facebook.com/<strong>pages/108510539573</strong>)' |
|
| 52 | + )) |
|
| 53 | + ); |
|
| 54 | 54 | |
| 55 | - $fields->addFieldToTab( |
|
| 56 | - 'Root.SocialMedia', |
|
| 57 | - $twitterUsername = TextField::create( |
|
| 58 | - 'TwitterUsername', |
|
| 59 | - _t(__CLASS__ . '.TwitterField', 'Twitter username') |
|
| 60 | - ) |
|
| 61 | - ); |
|
| 62 | - $twitterUsername->setDescription( |
|
| 63 | - DBField::create_field('HTMLFragment', _t( |
|
| 64 | - __CLASS__ . '.TwitterFieldDesc', |
|
| 65 | - 'Twitter username (eg, http://twitter.com/<strong>username</strong>)' |
|
| 66 | - )) |
|
| 67 | - ); |
|
| 68 | - } |
|
| 55 | + $fields->addFieldToTab( |
|
| 56 | + 'Root.SocialMedia', |
|
| 57 | + $twitterUsername = TextField::create( |
|
| 58 | + 'TwitterUsername', |
|
| 59 | + _t(__CLASS__ . '.TwitterField', 'Twitter username') |
|
| 60 | + ) |
|
| 61 | + ); |
|
| 62 | + $twitterUsername->setDescription( |
|
| 63 | + DBField::create_field('HTMLFragment', _t( |
|
| 64 | + __CLASS__ . '.TwitterFieldDesc', |
|
| 65 | + 'Twitter username (eg, http://twitter.com/<strong>username</strong>)' |
|
| 66 | + )) |
|
| 67 | + ); |
|
| 68 | + } |
|
| 69 | 69 | } |