* Provide example help for the advanced help module.
*/
/**
* Implements hook_admin_paths().
*
* Force help pages for this modile to be rendered in admin theme.
*/
functionhelp_example_admin_paths(){
$paths=array(
'help/help_example/*'=>TRUE,
);
return$paths;
}
/**
* Implements hook_menu().
*/
...
...
@@ -22,13 +34,60 @@ function help_example_menu() {
* Topic index callback.
*/
functionhelp_example_index_page(){
// Create the question mark icon.
$output=theme('advanced_help_topic',array(
$output='<p>'.t('Read the source code of the module <strong>Help example</strong> to learn how to create themed and plain links to help topics, and how to render help in the adminstrative theme.').'</p>';
$output.='<p>'.t('Two popup examples:').'<br />';
// Create the question mark icon for the topic.
$toc_qm=theme('advanced_help_topic',array(
'module'=>'help_example',
'topic'=>'toc',
'type'=>'icon',
));
// Append some explanatory text.
$output.=$toc_qm.' '.t('Click the help icon on the left to view a popup of the example module index page.');
$output.='<br />';
$topic_qm=theme('advanced_help_topic',array(
'module'=>'help_example',
'topic'=>'about-example',
'type'=>'icon',
));
$output.=$topic_qm.' '.t('Click the help icon on the left to view a popup of the first help topic.');
// Create the question mark icon for the topic.
$toc_qm=theme('advanced_help_topic',array(
'module'=>'help_example',
'topic'=>'toc',
'type'=>'icon',
));
// Append some explanatory text.
$output.=' '.t('Click the help icon on the left to view a popup help page.');
$output.='</p>';
$output.='</p>';
$topic_title=theme('advanced_help_topic',array(
'module'=>'help_example',
'topic'=>'lorem',
'type'=>'title',
));
$output.=t('Link to a popup of the topic with the title: ').$topic_title.'.';
$output.='</p>';
$output.='</p>';
$topic_title=theme('advanced_help_topic',array(
'module'=>'help_example',
'topic'=>'etiam',
'type'=>'anchor text',
));
$output.=t('Link to a popup of the third topic with user defined ').$topic_title.'.';
$output.='</p>';
$output.='<p>'.t('Examples of unthemed links to help pages:').'<br />';
$output.=t('Link to <a href="@url">the example module index page</a>.<br />',array('@url'=>'/admin/help/ah/help_example'));
$output.=t('Link to the <a href="@url">first help topic</a>.',array('@url'=>'/help/help_example/about-example'));