From 766554602262fb586a3d907c35e9b3e1612a5443 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 11 Jul 2009 08:24:22 -0700 Subject: [PATCH] Clean up style --- .../controllers/admin_google_analytics.php | 30 ++++++++----------- .../helpers/google_analytics_installer.php | 25 +++++----------- .../helpers/google_analytics_menu.php | 9 +++--- .../helpers/google_analytics_theme.php | 18 +++++------ modules/google_analytics/module.info | 4 +-- 5 files changed, 35 insertions(+), 51 deletions(-) diff --git a/modules/google_analytics/controllers/admin_google_analytics.php b/modules/google_analytics/controllers/admin_google_analytics.php index 84489520..cf3eef5a 100644 --- a/modules/google_analytics/controllers/admin_google_analytics.php +++ b/modules/google_analytics/controllers/admin_google_analytics.php @@ -1,4 +1,5 @@ -_get_view(); } - public function handler() - { + public function handler() { access::verify_csrf(); $form = $this->_get_form(); - - if ($form->validate()) - { - module::set_var("google_analytics", "code", $form->google_analytics_code->inputs["analytics_code"]->value); + if ($form->validate()) { + module::set_var( + "google_analytics", "code", $form->google_analytics_code->analytics_code->value); url::redirect("admin/google_analytics"); } print $this->_get_view($form); } - private function _get_view($form=null) - { + private function _get_view($form=null) { $v = new Admin_View("admin.html"); $v->content = new View("admin_google_analytics.html"); $v->content->form = empty($form) ? $this->_get_form() : $form; return $v; } - - private function _get_form() - { - $form = new Forge("admin/google_analytics/handler", "", "post", - array("id" => "gAdminForm")); + + private function _get_form() { + $form = new Forge("admin/google_analytics/handler", "", "post", array("id" => "gAdminForm")); $group = $form->group("google_analytics_code"); $group->input("analytics_code")->label(t('Enter the Web-Property-ID given by Google.'))->rules("required")->value(module::get_var("google_analytics", "code")); $group->submit("submit")->value(t("Save")); diff --git a/modules/google_analytics/helpers/google_analytics_installer.php b/modules/google_analytics/helpers/google_analytics_installer.php index a0395899..54d5b8e2 100644 --- a/modules/google_analytics/helpers/google_analytics_installer.php +++ b/modules/google_analytics/helpers/google_analytics_installer.php @@ -1,4 +1,5 @@ -get("settings_menu") ->append(Menu::factory("link") - ->id("google_analytics_menu") - ->label(t("Google Analytics")) - ->url(url::site("admin/google_analytics"))); + ->id("google_analytics_menu") + ->label(t("Google Analytics")) + ->url(url::site("admin/google_analytics"))); } } diff --git a/modules/google_analytics/helpers/google_analytics_theme.php b/modules/google_analytics/helpers/google_analytics_theme.php index 0a512389..b8933ba6 100644 --- a/modules/google_analytics/helpers/google_analytics_theme.php +++ b/modules/google_analytics/helpers/google_analytics_theme.php @@ -1,4 +1,5 @@ - - '; - - return $google_code; + + return $google_code; } - } diff --git a/modules/google_analytics/module.info b/modules/google_analytics/module.info index 3d4af688..dade4fd6 100644 --- a/modules/google_analytics/module.info +++ b/modules/google_analytics/module.info @@ -1,3 +1,3 @@ name = Google Analytics -description = Renders the Google Analytics Code at the end of the page. -version = 1.2 \ No newline at end of file +description = Renders the Google Analytics Code at the end of the page. (by mcp) +version = 1.2