From abfcdce7b166bbcb6dc4a71fbe7b63570c840711 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 17 Jun 2009 04:34:42 +0800 Subject: Refactor common xxx_menu() code into private _menu() helper. Signed-off-by: Tim Almdal --- modules/gallery/libraries/Theme_View.php | 41 +++++++------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 484b93b0..31c2faa7 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -109,50 +109,27 @@ class Theme_View_Core extends View { } public function album_menu() { - $menu = Menu::factory("root"); - gallery_menu::album($menu, $this); - - foreach (module::active() as $module) { - if ($module->name == "gallery") { - continue; - } - $class = "{$module->name}_menu"; - if (method_exists($class, "album")) { - call_user_func_array(array($class, "album"), array(&$menu, $this)); - } - } - - print $menu; + $this->_menu("album"); } public function tag_menu() { - $menu = Menu::factory("root"); - gallery_menu::tag($menu, $this); - - foreach (module::active() as $module) { - if ($module->name == "gallery") { - continue; - } - $class = "{$module->name}_menu"; - if (method_exists($class, "tag")) { - call_user_func_array(array($class, "tag"), array(&$menu, $this)); - } - } - - print $menu; + $this->_menu("tag"); } public function photo_menu() { - $menu = Menu::factory("root"); - gallery_menu::photo($menu, $this); + $this->_menu("photo"); + } + private function _menu($type) { + $menu = Menu::factory("root"); + call_user_func_array(array("gallery_menu", $type), array(&$menu, $this)); foreach (module::active() as $module) { if ($module->name == "gallery") { continue; } $class = "{$module->name}_menu"; - if (method_exists($class, "photo")) { - call_user_func_array(array($class, "photo"), array(&$menu, $this)); + if (method_exists($class, $type)) { + call_user_func_array(array($class, $type), array(&$menu, $this)); } } -- cgit v1.2.3 From c2880f2f77eabccd8eb01acfd3e1f31364f37c0a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 17 Jun 2009 04:43:31 +0800 Subject: Warn the end user not to run test or package targets. Signed-off-by: Tim Almdal --- index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 50c08886..7def7d16 100644 --- a/index.php +++ b/index.php @@ -65,7 +65,10 @@ if (PHP_SAPI == "cli") { break; default: - print "Usage: php index.php { upgrade | package | test }\n"; + print "To upgrade:\n php index.php upgrade\n\n\n"; + print "Developer-only features:\n ** CAUTION! THESE FEATURES -WILL- DAMAGE YOUR INSTALL **\n"; + print " php index.php package # create new installer files\n"; + print " php index.php test # run unit tests\n"; exit(1); } } else { -- cgit v1.2.3 From 4fd479347111758f19ab77cd3d7ec4e1b6f09a2b Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Wed, 17 Jun 2009 05:12:40 +0800 Subject: Fix html bug in l10n message Signed-off-by: Tim Almdal --- modules/comment/views/admin_block_recent_comments.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/comment/views/admin_block_recent_comments.html.php b/modules/comment/views/admin_block_recent_comments.html.php index 8b9634c5..edaa19ae 100644 --- a/modules/comment/views/admin_block_recent_comments.html.php +++ b/modules/comment/views/admin_block_recent_comments.html.php @@ -8,8 +8,8 @@ width="32" height="32" /> created) ?> - %author_name said %comment_text", - array("author_name" => p::clean($comment->author_name()), + %author_name said %comment_text', + array("author_name" => p::clean($comment->author_name()), "comment_text" => text::limit_words(p::clean($comment->text), 50))); ?> -- cgit v1.2.3