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

Dries's avatar
 
Dries committed
4
function help_link($type) {
Dries's avatar
Dries committed
5
  if ($type == "system" && user_access("access administration pages")) {
Dries's avatar
 
Dries committed
6 7
    menu("admin/help/glossary", t("glossary"), "help_glossary", 8);
    menu("admin/help", t("help"), "help_help", 9);
Dries's avatar
 
Dries committed
8 9 10
  }
}

Dries's avatar
 
Dries committed
11 12 13 14 15 16 17 18 19 20 21 22
function help_glossary() {

  $output .= "<h3>Glossary</h3><dl>";
  $output .= "<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>";
  $output .= "<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>";
  $output .= "<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>";
  $output .= "<dt>Approved</dt><dd>A moderated post which has been accepted by the moderators for publication. (See published).</dd>";
  $output .= "<dt>Waiting</dt><dd>A moderated post which is still being voted on to be accepted for publication. (See published.)</dd>";
  $output .= "<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>";
  $output .= "<dt>Node</dt><dd>The basic data unit in Drupal. Everything is a node or an extention of a node.</dd>";
  $output .= "<dt>Public</dt><dd>See published.</dd>";
  $output .= "<dt>Published</dt><dd>A node that is viewable by everyone. (See unpublished.)</dd>";
Dries's avatar
 
Dries committed
23
  $output .= "<dt>Role</dt><dd>A classification users are placed into for the purpose of setting users' permissions.</dd>";
Dries's avatar
 
Dries committed
24
  $output .= "<dt>Taxonomy</dt><dd>A division of a collection of things into ordered, classified groups. (See %taxonomy.)</dd>";
Dries's avatar
 
Dries committed
25 26
  $output .= "<dt>Unpublished</dt><dd>A node that is only viewable by administrators and moderators.</dd>";
  $output .= "<dt>User</dt><dd>A person who has an account at your Drupal site, and is logged in with that account.</dd>";
Dries's avatar
 
Dries committed
27
  $output .= "<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
28
  $output .= "</dl>";
Dries's avatar
 
Dries committed
29
  $output = t($output, array("%taxonomy" => l(t("taxonomy help"), "admin/taxonomy/help")));
Dries's avatar
 
Dries committed
30

Dries's avatar
 
Dries committed
31
  return $output;
Dries's avatar
 
Dries committed
32 33
}

Dries's avatar
 
Dries committed
34
function help_help($section = "admin/help#help") {
Dries's avatar
 
Dries committed
35
  $output = "";
Dries's avatar
 
Dries committed
36

Dries's avatar
 
Dries committed
37 38
  switch ($section) {

Dries's avatar
 
Dries committed
39
    case 'admin/help#help':
Dries's avatar
 
Dries committed
40
      foreach (module_list() as $name) {
Dries's avatar
 
Dries committed
41 42 43 44 45
        if ($name == 'help') {
          continue;
        }
        else if (module_hook($name, "help")) {
          $temp = module_invoke($name, "help", "admin/help#$name");
Dries's avatar
 
Dries committed
46 47 48 49 50 51
          if (!empty($temp)) {
            $links[] = l($name, "admin/help#$name");
            $output .= "<h2><a id=\"$name\">". ucfirst($name) ." module</a></h2>";
            $output .= $temp;
          }
        }
Dries's avatar
 
Dries committed
52
      }
Dries's avatar
 
Dries committed
53 54
      $output = "<small>". implode(" &middot; ", $links) ."</small><hr />". $output;
      break;
Dries's avatar
 
Dries committed
55 56
    case 'admin/system/modules#description':
      $output = t("Manages displaying online help.");
Dries's avatar
 
Dries committed
57
      break;
Dries's avatar
 
Dries committed
58
  }
Dries's avatar
 
Dries committed
59
  return $output;
Dries's avatar
 
Dries committed
60
}
Dries's avatar
 
Dries committed
61

Dries's avatar
 
Dries committed
62
?>