help.module 3.07 KB
Newer Older
Dries's avatar
 
Dries committed
1
<?php
2
// $Id$
Dries's avatar
 
Dries committed
3

Dries's avatar
 
Dries committed
4 5 6
/**
 * Implementation of hook_link().
 */
Dries's avatar
 
Dries committed
7
function help_link($type) {
Dries's avatar
 
Dries committed
8 9
  if ($type == 'system') {
    menu('admin/help/glossary', t('glossary'), user_access('access administration pages') ? 'help_glossary' : MENU_DENIED, 8);
Dries's avatar
Dries committed
10
    menu('admin/help', t('help'), user_access('access administration pages') ? 'help_page' : MENU_DENIED, 9);
Dries's avatar
 
Dries committed
11 12 13
  }
}

Dries's avatar
Dries committed
14 15 16
/**
 * Menu callback; prints a page listing a glossary of Drupal terminology.
 */
Dries's avatar
 
Dries committed
17
function help_glossary() {
Dries's avatar
Dries committed
18
  $output = t("
Dries's avatar
 
Dries committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
  <h3>Glossary</h3><dl>
  <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>
  <dt>Moderators</dt><dd>The group of Drupal users that reviews posts before they are published. These users have the \"access submission queue\" permission. (See Published).</dd></dl></dd>
  <dt>Node</dt><dd>The basic data unit in Drupal. Everything is a node or an extention of a node.</dd>
  <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>
Dries's avatar
Dries committed
34
  </dl>", array('%taxonomy' => url('admin/taxonomy/help')));
Dries's avatar
 
Dries committed
35

Dries's avatar
Dries committed
36
  print theme('page', $output);
Dries's avatar
 
Dries committed
37 38
}

Dries's avatar
Dries committed
39 40 41 42
/**
 * Implementation of hook_help().
 */
function help_help($section) {
Dries's avatar
 
Dries committed
43
  switch ($section) {
Dries's avatar
 
Dries committed
44
    case 'admin/system/modules#description':
Dries's avatar
Dries committed
45
      $output = t('Manages displaying online help.');
Dries's avatar
 
Dries committed
46
      break;
Dries's avatar
 
Dries committed
47
  }
Dries's avatar
 
Dries committed
48
  return $output;
Dries's avatar
 
Dries committed
49
}
Dries's avatar
 
Dries committed
50

Dries's avatar
Dries committed
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
/**
 * Menu callback; prints a page listing general help for all modules.
 */
function help_page() {
  foreach (module_list() as $name) {
    if (module_hook($name, 'help')) {
      $temp = module_invoke($name, 'help', "admin/help#$name");
      if (!empty($temp)) {
        $links[] = l($name, "admin/help#$name");
        $output .= "<h2><a id=\"$name\">". ucfirst($name) .' module</a></h2>';
        $output .= $temp;
      }
    }
  }
  $output = '<small>'. implode(' &middot; ', $links) .'</small><hr />'. $output;
  print theme('page', $output);
Dries's avatar
 
Dries committed
67 68
}

Dries's avatar
 
Dries committed
69
?>