From 828ece294ec2227bf0fda25a46e9bdeb8392a303 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Thu, 30 Dec 2010 14:48:19 -0700 Subject: [PATCH] Minor updates to address Bharat's review comments. Thanks Bharat! --- 3.1/modules/bitly/controllers/admin_bitly.php | 2 +- 3.1/modules/bitly/helpers/bitly.php | 2 +- 3.1/modules/bitly/helpers/bitly_event.php | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/3.1/modules/bitly/controllers/admin_bitly.php b/3.1/modules/bitly/controllers/admin_bitly.php index 4f82f913..8ebaaff4 100644 --- a/3.1/modules/bitly/controllers/admin_bitly.php +++ b/3.1/modules/bitly/controllers/admin_bitly.php @@ -84,7 +84,7 @@ class Admin_Bitly_Controller extends Admin_Controller { $link = ORM::factory("bitly_link")->where("item_id", "=", 1)->find(); if ($link->loaded()) { - $view->content->g3_url = bitly::bitly_link($link->hash); + $view->content->g3_url = bitly::url($link->hash); } else if ($valid_config && !empty($login) && !empty($api_key) && !empty($domain)) { $view->content->g3_url = bitly::shorten_url(1); } diff --git a/3.1/modules/bitly/helpers/bitly.php b/3.1/modules/bitly/helpers/bitly.php index f89093e8..5f99d87c 100644 --- a/3.1/modules/bitly/helpers/bitly.php +++ b/3.1/modules/bitly/helpers/bitly.php @@ -213,7 +213,7 @@ class bitly_Core { * @param string $hash * @return string */ - static function bitly_link($hash) { + static function url($hash) { if (!empty($hash)) { return "http://" . module::get_var("bitly", "domain") . "/$hash"; } diff --git a/3.1/modules/bitly/helpers/bitly_event.php b/3.1/modules/bitly/helpers/bitly_event.php index 899357ce..9a55fe95 100644 --- a/3.1/modules/bitly/helpers/bitly_event.php +++ b/3.1/modules/bitly/helpers/bitly_event.php @@ -19,8 +19,6 @@ */ class bitly_event_Core { - public static $shorten_link_text = "Shorten link with bit.ly"; - static function admin_menu($menu, $theme) { $menu->get("settings_menu") ->append(Menu::factory("link") @@ -35,8 +33,8 @@ class bitly_event_Core { $menu->get("options_menu") ->append(Menu::factory("link") ->id("bitly") - ->label(t(self::$shorten_link_text)) - ->url(url::site("bitly/shorten/{$theme->item->id}?csrf=$theme->csrf")) + ->label(t("Shorten link with bit.ly")) + ->url(url::site("bitly/shorten/{$theme->item->id}?csrf={$theme->csrf}")) ->css_id("g-bitly-shorten") ->css_class("g-bitly-shorten ui-icon-link")); } @@ -48,8 +46,8 @@ class bitly_event_Core { $menu->get("options_menu") ->append(Menu::factory("link") ->id("bitly") - ->label(t(self::$shorten_link_text)) - ->url(url::site("bitly/shorten/$item->id?csrf=$theme->csrf")) + ->label(t("Shorten link with bit.ly")) + ->url(url::site("bitly/shorten/{$item->id}?csrf={$theme->csrf}")) ->css_class("g-bitly-shorten ui-icon-link")); } }