Permalink
Browse files

MINOR: strict standard updates and updating to 3.0 API

  • Loading branch information...
1 parent f8de5b0 commit 0af3d61f8fa2c5a38e5c0b89c7aa1a52b06e3b15 @wilr wilr committed Jun 10, 2012
Showing with 21 additions and 25 deletions.
  1. +8 −11 code/GoogleAnalyzer.php
  2. +11 −12 code/GoogleConfig.php
  3. +2 −2 code/GoogleLogger.php
View
@@ -1,6 +1,9 @@
<?php
-class GoogleAnalyzer extends DataObjectDecorator {
+/**
+ * @package googleanalytics
+ */
+class GoogleAnalyzer extends DataExtension {
static public $sapphire_version;
@@ -9,13 +12,9 @@ class GoogleAnalyzer extends DataObjectDecorator {
public static $email;
public static $password;
- function extraStatics() {
- return array(
- 'has_many' => array(
- 'Events' => 'GoogleLogEvent',
- ),
- );
- }
+ public $has_many = array(
+ 'Events' => 'GoogleLogEvent',
+ );
/**
* for legacy reasons
@@ -48,10 +47,8 @@ public static function activate($profile = 'SiteConfig', $email = null, $passwor
Object::add_extension('SiteTree', 'GoogleAnalyzer');
}
- public function updateCMSFields(FieldSet $fields) {
-
+ public function updateCMSFields(FieldList $fields) {
$fields->addFieldToTab('Root', new Tab('GoogleAnalytics', 'Google Analytics'));
-
$fields->addFieldToTab("Root.GoogleAnalytics", new TabSet('Stats'));
$fields->addFieldToTab('Root.GoogleAnalytics.Stats', new Tab('Performance', 'Performance'));
$fields->addFieldToTab("Root.GoogleAnalytics.Stats.Performance", new GooglePerformanceChart($this->owner));
View
@@ -1,19 +1,18 @@
<?php
-class GoogleConfig extends DataObjectDecorator {
+/**
+ * @package googleanalytics
+ */
+class GoogleConfig extends DataExtension {
- function extraStatics() {
- return array(
- 'db' => array(
- 'GoogleAnalyticsCode' => 'Varchar',
- 'GoogleAnalyticsProfileId' => 'Varchar',
- 'GoogleAnalyticsEmail' => 'Varchar',
- 'GoogleAnalyticsPassword' => 'Varchar',
- ),
- );
- }
+ public $db = array(
+ 'GoogleAnalyticsCode' => 'Varchar',
+ 'GoogleAnalyticsProfileId' => 'Varchar',
+ 'GoogleAnalyticsEmail' => 'Varchar',
+ 'GoogleAnalyticsPassword' => 'Varchar',
+ );
- public function updateCMSFields(FieldSet $fields) {
+ public function updateCMSFields(FieldList $fields) {
$fields->addFieldToTab("Root", new Tab('GoogleAnalytics'));
$fields->addFieldToTab('Root.GoogleAnalytics', new TextField('GoogleAnalyticsCode', 'Google Analytics Code (UA-XXXXXX-X)'));
View
@@ -74,14 +74,14 @@ public function onAfterInit() {
/**
* @param bool
*/
- public function set_event_tracking_enabled($bool) {
+ public static function set_event_tracking_enabled($bool) {
self::$include_event_tracking = (bool) $bool;
}
/**
* @return bool
*/
- public function event_tracking_enabled() {
+ public static function event_tracking_enabled() {
return self::$include_event_tracking;
}
}

0 comments on commit 0af3d61

Please sign in to comment.