Commit a10eac32 authored by Dries's avatar Dries
Browse files

- Patch #21517 by Stefan and TDobes: theme system improvements.

parent 8bedd376
......@@ -25,20 +25,6 @@
* @} End of "Content markers".
*/
/**
* Hook Help - returns theme specific help and information.
*
* @param section defines the @a section of the help to be returned.
*
* @return a string containing the help output.
*/
function theme_help($section) {
switch ($section) {
case 'admin/themes#description':
return t('The base theme');
}
}
/**
* Initialize the theme system by loading the theme.
*
......@@ -395,11 +381,9 @@ function theme_page($content) {
$output .= $tabs;
}
if ($help = menu_get_active_help()) {
$output .= '<small>'. $help .'</small><hr />';
}
$output .= theme('help');
$output .= theme_status_messages();
$output .= theme('status_messages');
$output .= "\n<!-- begin content -->\n";
$output .= $content;
......@@ -488,6 +472,17 @@ function theme_breadcrumb($breadcrumb) {
return '<div class="breadcrumb">'. implode($breadcrumb, ' &raquo; ') .'</div>';
}
/**
* Return a themed help message.
*
* @return a string containing the helptext for the current page.
*/
function theme_help() {
if ($help = menu_get_active_help()) {
return '<div class="help">'. $help .'</div>';
}
}
/**
* Return a themed node.
*
......
......@@ -63,7 +63,7 @@
<!-- END: tabs -->
<!-- END: title -->
<!-- BEGIN: help -->
<div id="help">{help}</div>
{help}
<!-- END: help -->
<!-- BEGIN: message -->
{message}
......
......@@ -74,11 +74,9 @@ function chameleon_page($content) {
$output .= $tabs;
}
if ($help = menu_get_active_help()) {
$output .= "<div id=\"help\">$help</div><hr />";
}
$output .= theme('help');
$output .= theme_status_messages();
$output .= theme('status_messages');
$output .= "\n<!-- begin content -->\n";
$output .= $content;
......@@ -140,7 +138,6 @@ function chameleon_node($node, $main = 0, $page = 0) {
}
function chameleon_comment($comment, $link = "") {
$submitted = array(t('By %author at %date', array('%author' => format_name($comment), '%date' => format_date($comment->timestamp. 'small'))));
$links = array($link);
......@@ -152,4 +149,11 @@ function chameleon_comment($comment, $link = "") {
return $output;
}
function chameleon_help() {
if ($help = menu_get_active_help()) {
return '<div class="help">'. $help .'</div><hr />';
}
}
?>
......@@ -150,12 +150,12 @@ function xtemplate_page($content) {
$xtemplate->template->parse("header.title");
}
if ($help = menu_get_active_help()) {
if ($help = theme('help')) {
$xtemplate->template->assign("help", $help);
$xtemplate->template->parse("header.help");
}
if ($message = theme_status_messages()) {
if ($message = theme('status_messages')) {
$xtemplate->template->assign("message", $message);
$xtemplate->template->parse("header.message");
}
......
......@@ -79,8 +79,8 @@
<!-- END: tabs -->
<!-- END: title -->
<!-- BEGIN: help -->
<div id="help">{help}</div>
<!-- BEGIN: help -->
{help}
<!-- END: help -->
<!-- BEGIN: message -->
{message}
......
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