From a3bd80b2677ad9890f2d2070f050d37db38431bc Mon Sep 17 00:00:00 2001 From: Dries Buytaert <dries@buytaert.net> Date: Sat, 14 Aug 2004 07:22:39 +0000 Subject: [PATCH] - Patch by Al: don't translate all help text upon every page view! --- modules/help.module | 16 +++++++++------- modules/help/help.module | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/modules/help.module b/modules/help.module index d223d006a2ba..5c68212dfff2 100644 --- a/modules/help.module +++ b/modules/help.module @@ -13,12 +13,11 @@ function help_menu() { foreach (module_list() as $name) { if (module_hook($name, 'help')) { - if (module_invoke($name, 'help', "admin/help#$name")) { - $items[] = array('path' => 'admin/help/' . $name, - 'title' => t($name), - 'callback' => 'help_page', - 'access' => user_access('access administration pages')); - } + $items[] = array('path' => 'admin/help/' . $name, + 'title' => t($name), + 'callback' => 'help_page', + 'type' => MENU_CALLBACK, + 'access' => user_access('access administration pages')); } } return $items; @@ -84,7 +83,10 @@ function help_page() { $name = arg(2); if (module_hook($name, 'help')) { $temp = module_invoke($name, 'help', "admin/help#$name"); - if (!empty($temp)) { + if (empty($temp)) { + $output .= t("No help is available for module %module.", array('%module' => $name)); + } + else { $output .= $temp; } } diff --git a/modules/help/help.module b/modules/help/help.module index d223d006a2ba..5c68212dfff2 100644 --- a/modules/help/help.module +++ b/modules/help/help.module @@ -13,12 +13,11 @@ function help_menu() { foreach (module_list() as $name) { if (module_hook($name, 'help')) { - if (module_invoke($name, 'help', "admin/help#$name")) { - $items[] = array('path' => 'admin/help/' . $name, - 'title' => t($name), - 'callback' => 'help_page', - 'access' => user_access('access administration pages')); - } + $items[] = array('path' => 'admin/help/' . $name, + 'title' => t($name), + 'callback' => 'help_page', + 'type' => MENU_CALLBACK, + 'access' => user_access('access administration pages')); } } return $items; @@ -84,7 +83,10 @@ function help_page() { $name = arg(2); if (module_hook($name, 'help')) { $temp = module_invoke($name, 'help', "admin/help#$name"); - if (!empty($temp)) { + if (empty($temp)) { + $output .= t("No help is available for module %module.", array('%module' => $name)); + } + else { $output .= $temp; } } -- GitLab