1
0

Minor updates to address Bharat's review comments. Thanks Bharat!

This commit is contained in:
Chad Kieffer 2010-12-30 14:48:19 -07:00
parent ebbf15ff64
commit 828ece294e
3 changed files with 6 additions and 8 deletions

View File

@ -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);
}

View File

@ -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";
}

View File

@ -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"));
}
}