2001-04-30 17:19:27 +00:00
<?php
2001-10-20 18:57:09 +00:00
// $Id$
2001-04-30 17:19:27 +00:00
2004-08-21 06:42:38 +00:00
/**
* @file
* Manages displaying online help.
*/
2004-04-21 13:56:38 +00:00
/**
2004-06-18 15:04:37 +00:00
* Implementation of hook_menu().
2004-04-21 13:56:38 +00:00
*/
2004-09-16 07:17:56 +00:00
function help_menu($may_cache) {
2004-06-18 15:04:37 +00:00
$items = array();
2004-08-12 18:00:11 +00:00
2004-09-16 07:17:56 +00:00
if ($may_cache) {
$items[] = array('path' => 'admin/help', 'title' => t('help'),
'callback' => 'help_main',
'access' => user_access('access administration pages'),
'weight' => 9);
foreach (module_list() as $name) {
if (module_hook($name, 'help')) {
$items[] = array('path' => 'admin/help/' . $name,
'title' => t($name),
'callback' => 'help_page',
'type' => MENU_CALLBACK,
'access' => user_access('access administration pages'));
}
2004-08-10 05:44:17 +00:00
}
}
2004-09-16 07:17:56 +00:00
2004-06-18 15:04:37 +00:00
return $items;
2001-06-29 22:08:57 +00:00
}
2004-05-17 22:00:06 +00:00
/**
* Menu callback; prints a page listing a glossary of Drupal terminology.
*/
2004-08-10 05:44:17 +00:00
function help_main() {
2004-05-17 22:00:06 +00:00
$output = t("
2004-08-10 05:44:17 +00:00
<p>This guide explains what the various modules in <a href=\"%Drupal\">Drupal</a> do and how to configure them.</p>
<p>It is not a substitute for the <a href=\"%handbook\">Drupal handbook</a> available online and should be used in conjunction with it. The online reference handbook might be more up-to-date and has helpful user-contributed comments. It is your definitive reference point for all Drupal documentation.</p>
<h2>Help topics</h2>
<p>Help is available on the following items:</p>
%help_pages
<h2>Glossary of Drupal Terminology</h2><dl>
2004-01-23 18:42:43 +00:00
<dt>Block</dt><dd>A small box containing information or content placed in the left-hand or right-hand sidebar of a web page.</dd>
<dt>Comment</dt><dd>A note attached to a node. Usually intended to clarify, explain, criticize, or express an opinion on the original material.</dd>
<dt>Moderation</dt><dd>The activity of making sure a post to a Drupal site fits in with what is expected for that Drupal site.<dl>
<dt>Approved</dt><dd>A moderated post which has been accepted by the moderators for publication. (See published).</dd>
<dt>Waiting</dt><dd>A moderated post which is still being voted on to be accepted for publication. (See published.)</dd>
2004-10-19 18:02:31 +00:00
<dt>Node</dt><dd>The basic data unit in Drupal. Everything is a node or an extension of a node.</dd>
2004-01-23 18:42:43 +00:00
<dt>Public</dt><dd>See published.</dd>
<dt>Published</dt><dd>A node that is viewable by everyone. (See unpublished.)</dd>
<dt>Role</dt><dd>A classification users are placed into for the purpose of setting users' permissions.</dd>
<dt>Taxonomy</dt><dd>A division of a collection of things into ordered, classified groups. (See <a href=\"%taxonomy\">taxonomy help</a>.)</dd>
<dt>Unpublished</dt><dd>A node that is only viewable by administrators and moderators.</dd>
<dt>User</dt><dd>A person who has an account at your Drupal site, and is logged in with that account.</dd>
<dt>Visitor</dt><dd>A person who does not have an account at your Drupal site or a person who has an account at your Drupal site but is <u>not</u> logged in with that account. Also termed \"anonymous user\".</dd>
2004-10-04 18:32:05 +00:00
</dl>", array('%Drupal' => 'http://drupal.org', '%handbook' => 'http://drupal.org/handbook', '%help_pages' => help_links_as_list(), '%taxonomy' => url('admin/help/taxonomy')));
2003-06-05 18:09:39 +00:00
2004-05-17 22:00:06 +00:00
print theme('page', $output);
2003-06-05 18:09:39 +00:00
}
2004-08-10 05:44:17 +00:00
function help_links_as_list() {
$output = '<ul>';
foreach (module_list() as $name) {
if (module_hook($name, 'help')) {
if (module_invoke($name, 'help', "admin/help#$name")) {
2004-11-08 22:27:34 +00:00
$output .= '<li><a href="' . url("admin/help/$name") . '">' . t($name) . '</a></li>';
2004-08-10 05:44:17 +00:00
}
}
}
$output .= '</ul>';
return $output;
}
2004-05-17 22:00:06 +00:00
/**
* Implementation of hook_help().
*/
function help_help($section) {
2003-10-03 14:55:27 +00:00
switch ($section) {
2004-06-18 15:04:37 +00:00
case 'admin/modules#description':
2004-07-02 18:46:42 +00:00
return t('Manages displaying online help.');
2002-08-15 10:24:41 +00:00
}
2001-04-30 17:19:27 +00:00
}
2001-11-01 11:00:51 +00:00
2004-05-17 22:00:06 +00:00
/**
* Menu callback; prints a page listing general help for all modules.
*/
function help_page() {
2004-08-10 05:44:17 +00:00
$name = arg(2);
if (module_hook($name, 'help')) {
$temp = module_invoke($name, 'help', "admin/help#$name");
2004-08-14 07:22:39 +00:00
if (empty($temp)) {
$output .= t("No help is available for module %module.", array('%module' => $name));
}
else {
2004-08-10 05:44:17 +00:00
$output .= $temp;
2004-05-17 22:00:06 +00:00
}
}
print theme('page', $output);
2003-11-20 21:51:23 +00:00
}
2001-04-30 17:19:27 +00:00
?>