Commit a3bd80b2 authored by Dries's avatar Dries

- Patch by Al: don't translate all help text upon every page view!
parent 334f24b4
......@@ -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;
}
}
......
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment