diff -u b/core/includes/common.inc b/core/includes/common.inc --- b/core/includes/common.inc +++ b/core/includes/common.inc @@ -2390,29 +2390,6 @@ } /** - * Build a structured text element to be rendered later. - * - * @param $name - * Unique text name - * @param $text - * HTML text - * @param $variables - * Optional variables for text replacement - * - * @return - * Text array - */ -function text($name, $text, $variables = array(), $options = array()) { - return array( - '#type' => 'text', - '#name' => $name, - '#text' => $text, - '#variables' => $variables, - '#options' => $options, - ); -} - -/** * Delivers a page callback result to the browser in the appropriate format. * * This function is most commonly called by menu_execute_active_handler(), but @@ -2526,6 +2503,46 @@ } /** + * Process a text element. + */ +function drupal_pre_render_text($elements) { + $text = $elements['#text']; + if ($elements['#localize']) { + $function = isset($elements['#localize_function']) ? $elements['#localize_function'] : get_t(); + $text = call_user_func($function, $text, $elements['#variables'], $elements['#options']); + } + elseif ($elements['#replace'] && !empty($elements['#variables'])) { + $text = format_string($text, $elements['#variables']); + } + $elements['#children'] = $text; + return $elements; +} + +/** + * Build a structured text element to be rendered later. + * @param $name + * Unique text name + * @param $text + * HTML text + * @param array $variables + * Optional variables for text replacement + * @param array $options + * Optional options for text replacement + * + * @return array + * Text array + */ +function text($name, $text, $variables = array(), $options = array()) { + return array( + '#type' => 'text', + '#name' => $name, + '#text' => $text, + '#variables' => $variables, + '#options' => $options, + ); +} + +/** * Deletes old cached JavaScript files and variables. */ function drupal_clear_js_cache() { @@ -5704,23 +5721,6 @@ } /** - * Process a text element. - */ -function drupal_pre_render_text($elements) { - $text = $elements['#text']; - if ($elements['#localize']) { - $function = isset($elements['#localize_function']) ? $elements['#localize_function'] : get_t(); - $text = call_user_func($function, $text, $elements['#variables'], $elements['#options']); - } - elseif ($elements['#replace'] && !empty($elements['#variables'])) { - $text = format_string($text, $elements['#variables']); - } - $elements['#children'] = $text; - return $elements; -} - - -/** * Renders the page, including all theming. * * @param $page reverted: --- b/core/includes/menu.inc +++ a/core/includes/menu.inc @@ -1690,6 +1690,7 @@ * Returns the help associated with the active menu item. */ function menu_get_active_help() { + $output = ''; $router_path = menu_tab_root_path(); // We will always have a path unless we are on a 403 or 404. if (!$router_path) { @@ -1698,21 +1699,14 @@ $arg = drupal_help_arg(arg(NULL)); - $build = array(); foreach (module_implements('help') as $module) { $function = $module . '_help'; // Lookup help for this path. if ($help = $function($router_path, $arg)) { + $output .= $help . "\n"; - if (is_array($help)) { - $build[$module] = $help; - } - else { - $build[$module]['#markup'] = $help . "\n"; - } } } + return $output; - - return $build; } /** diff -u b/core/includes/theme.inc b/core/includes/theme.inc --- b/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2305,16 +2305,16 @@ } /** - * Returns HTML for a text element + * @} End of "ingroup themeable". */ -function theme_text($variables) { - $element = $variables['element']; + } /** - * @} End of "ingroup themeable". + * Returns HTML for a text element */ - +function theme_text($variables) { + $element = $variables['element']; } /** reverted: --- b/core/modules/help/help.admin.inc +++ a/core/modules/help/help.admin.inc @@ -30,17 +30,17 @@ * @see help_menu() */ function help_page($name) { + $output = ''; - $build = array(); if (module_hook($name, 'help')) { $info = system_get_info('module'); drupal_set_title($info[$name]['name']); $temp = module_invoke($name, 'help', "admin/help#$name", drupal_help_arg()); if (empty($temp)) { + $output .= t("No help is available for module %module.", array('%module' => $info[$name]['name'])); - $build['nohelp']['#markup'] = t("No help is available for module %module.", array('%module' => $info[$name]['name'])); } else { + $output .= $temp; - $build['help'] = $temp; } // Only print list of administration pages if the module in question has @@ -51,14 +51,10 @@ foreach ($admin_tasks as $task) { $links[] = l($task['title'], $task['link_path'], $task['localized_options']); } + $output .= theme('item_list', array('items' => $links, 'title' => t('@module administration pages', array('@module' => $info[$name]['name'])))); - $build['admin'] = array( - '#theme' => 'item_list', - '#items' => $links, - '#title' => t('@module administration pages', array('@module' => $info[$name]['name'])) - ); } } + return $output; - return $build; } /**