drupal/modules/help/help.module

132 lines
5.8 KiB
Plaintext
Raw Normal View History

Welp. Large commit ahead. CHANGES: - Added "read" and "write" permissions into drupal but removed it again because - when finished after 3 hours of work - it was considered nothing but added complexity that didn't buy us anything. :I (I'll explain this in detail on the mailing list, I guess.) - Added a very simple help.module to group all available documentation on a single page. - Fixed bug in node_control(), book.module: UnConeD forgot to global $user when updating the combobox code. - Removed static wishlist.module: in future, the wishlist can be maintained as a page in our collaborative book. - Revised most of settings.module: tidied up the code and the descriptions to accompany the settings and introduced a new "default maximum number of nodes to display on the main page" variable. - Revised most of comment.module: the administration interface looks better now, integrated node permissions, and -finally- made it possible to delete comments. - Polished on: + account.module + structure.module + locale.module + module.module + forum.module - Form-ified: + account.php + account.module + setting.module + cvs.module + submit.php + comment.module + forum.module + book.module + page.module + locale.module - Updated CHANGELOG INFO: - Designed a "generic tracker system with optional backends" on paper. The idea is to allow registered users to hot-list certain topics, individual nodes or threads (comments) and to "plug-in" output backends like - for instance - an e-mail digest. The design requires "intelligent blocks" though. TODO: - I want to tidy up the headline.module and backend.class as well as merge in headlineRSS10.module. Julian spent quite some time working on headline.module but I'm not sure what he changed and whether he'd contribute it back?
2001-04-30 17:19:27 +00:00
<?php
// $Id$
Welp. Large commit ahead. CHANGES: - Added "read" and "write" permissions into drupal but removed it again because - when finished after 3 hours of work - it was considered nothing but added complexity that didn't buy us anything. :I (I'll explain this in detail on the mailing list, I guess.) - Added a very simple help.module to group all available documentation on a single page. - Fixed bug in node_control(), book.module: UnConeD forgot to global $user when updating the combobox code. - Removed static wishlist.module: in future, the wishlist can be maintained as a page in our collaborative book. - Revised most of settings.module: tidied up the code and the descriptions to accompany the settings and introduced a new "default maximum number of nodes to display on the main page" variable. - Revised most of comment.module: the administration interface looks better now, integrated node permissions, and -finally- made it possible to delete comments. - Polished on: + account.module + structure.module + locale.module + module.module + forum.module - Form-ified: + account.php + account.module + setting.module + cvs.module + submit.php + comment.module + forum.module + book.module + page.module + locale.module - Updated CHANGELOG INFO: - Designed a "generic tracker system with optional backends" on paper. The idea is to allow registered users to hot-list certain topics, individual nodes or threads (comments) and to "plug-in" output backends like - for instance - an e-mail digest. The design requires "intelligent blocks" though. TODO: - I want to tidy up the headline.module and backend.class as well as merge in headlineRSS10.module. Julian spent quite some time working on headline.module but I'm not sure what he changed and whether he'd contribute it back?
2001-04-30 17:19:27 +00:00
/**
* @file
* Manages displaying online help.
*/
/**
* Implementation of hook_menu().
*/
function help_menu() {
$items['admin/help'] = array(
'title' => 'Help',
'page callback' => 'help_main',
'access arguments' => array('access administration pages'),
'weight' => 9,
);
foreach (module_implements('help', TRUE) as $module) {
$items['admin/help/'. $module] = array(
'title' => $module,
'page callback' => 'help_page',
'page arguments' => array(2),
'type' => MENU_CALLBACK,
);
}
return $items;
}
2004-05-17 22:00:06 +00:00
/**
* Menu callback; prints a page listing a glossary of Drupal terminology.
*/
function help_main() {
// Add CSS
drupal_add_css(drupal_get_path('module', 'help') .'/help.css', 'module', 'all', FALSE);
$output = t('
<h2>Help topics</h2>
<p>Help is available on the following items:</p>
!help_pages
<h2>Glossary of Drupal terminology</h2>
<dl>
<dt>Block</dt><dd>A small box containing information or content placed in a region of a web page (e.g. in a sidebar, below or above the content, or in any other region the current theme allows).</dd>
<dt>Comment</dt><dd>Text attached to a post intended to clarify, explain, criticize, or express an opinion on the original post.</dd>
<dt>Node</dt><dd>The basic unit of content in Drupal, often referred to as a "post". All content that can be created using the "create content" menu is a node. Keep in mind that comments, blocks, and users are <em>not</em> nodes.</dd>
<dt>Published</dt><dd>A post that is viewable by every visitor of the site, regardless of whether he is logged in (see also "Unpublished").</dd>
<dt>Role</dt><dd>A classification users are placed into for the purpose of setting users\' permissions. A user receives the combined permissions of all roles to which he or she is subscribed.</dd>
2007-07-02 14:41:37 +00:00
<dt>Taxonomy</dt><dd>A categorization system that allows the building of complex hierarchical or relational structures and tagging of content (see <a href="@taxonomy">taxonomy help</a>).</dd>
<dt>Unpublished</dt><dd>A post 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 currently 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 <em>not</em> currently logged in with that account. A visitor is also called an "anonymous user".</dd>
</dl>', array('!help_pages' => help_links_as_list(), '@taxonomy' => url('admin/help/taxonomy')));
return $output;
}
function help_links_as_list() {
$empty_arg = drupal_help_arg();
$module_info = module_rebuild_cache();
$modules = array();
foreach (module_implements('help', TRUE) as $module) {
if (module_invoke($module, 'help', "admin/help#$module", $empty_arg)) {
$modules[] = $module;
}
}
sort($modules);
// Output pretty four-column list
$break = ceil(count($modules) / 4);
2006-10-14 06:07:14 +00:00
$output = '<div class="clear-block"><div class="help-items"><ul>';
foreach ($modules as $i => $module) {
$output .= '<li>'. l($module_info[$module]->info['name'], 'admin/help/'. $module) .'</li>';
if (($i + 1) % $break == 0) {
$output .= '</ul></div><div class="help-items'. ($i + 1 == $break * 3 ? ' help-items-last' : '') .'"><ul>';
}
}
2006-10-14 06:07:14 +00:00
$output .= '</ul></div></div>';
return $output;
}
2004-05-17 22:00:06 +00:00
/**
* Implementation of hook_help().
*/
function help_help($path, $arg) {
switch ($path) {
case 'admin/help':
$output = t('<p>This guide explains what the various modules in <a href="@Drupal">Drupal</a> do and how to configure them. Additionally, you will find a glossary of basic Drupal terminology to help get you started.</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>
', array('@Drupal' => 'http://drupal.org', '@handbook' => 'http://drupal.org/handbook'));
return $output;
case 'admin/help#help':
$output = '<p>'. t('The help module displays context sensitive help information. Users can learn how to use modules and accomplish tasks quicker with less errors by clicking on links in provided by the help module.') .'</p>';
$output .= t("<p>Modules can make documentation available to other modules with this module. All user help should be presented using this module. Some examples of help: </p>
<ul>
<li>The module's help text, displayed on the <a href=\"@help\">help page</a> and through the module's individual help link.</li>
<li>More elaborate help text on sites a module defines.</li>
<li>The help for a distributed authorization module (if applicable).</li>
</ul>
", array('@help' => url('admin/help')));
$output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="@help">Help page</a>.', array('@help' => 'http://drupal.org/handbook/modules/help/')) .'</p>';
return $output;
}
Welp. Large commit ahead. CHANGES: - Added "read" and "write" permissions into drupal but removed it again because - when finished after 3 hours of work - it was considered nothing but added complexity that didn't buy us anything. :I (I'll explain this in detail on the mailing list, I guess.) - Added a very simple help.module to group all available documentation on a single page. - Fixed bug in node_control(), book.module: UnConeD forgot to global $user when updating the combobox code. - Removed static wishlist.module: in future, the wishlist can be maintained as a page in our collaborative book. - Revised most of settings.module: tidied up the code and the descriptions to accompany the settings and introduced a new "default maximum number of nodes to display on the main page" variable. - Revised most of comment.module: the administration interface looks better now, integrated node permissions, and -finally- made it possible to delete comments. - Polished on: + account.module + structure.module + locale.module + module.module + forum.module - Form-ified: + account.php + account.module + setting.module + cvs.module + submit.php + comment.module + forum.module + book.module + page.module + locale.module - Updated CHANGELOG INFO: - Designed a "generic tracker system with optional backends" on paper. The idea is to allow registered users to hot-list certain topics, individual nodes or threads (comments) and to "plug-in" output backends like - for instance - an e-mail digest. The design requires "intelligent blocks" though. TODO: - I want to tidy up the headline.module and backend.class as well as merge in headlineRSS10.module. Julian spent quite some time working on headline.module but I'm not sure what he changed and whether he'd contribute it back?
2001-04-30 17:19:27 +00:00
}
2004-05-17 22:00:06 +00:00
/**
* Menu callback; prints a page listing general help for a module.
2004-05-17 22:00:06 +00:00
*/
function help_page($name) {
$output = '';
if (module_hook($name, 'help')) {
$module = drupal_parse_info_file(drupal_get_path('module', $name) .'/'. $name .'.info');
drupal_set_title($module['name']);
$temp = module_invoke($name, 'help', "admin/help#$name", drupal_help_arg());
if (empty($temp)) {
$output .= t("No help is available for module %module.", array('%module' => $module['name']));
}
else {
$output .= $temp;
2004-05-17 22:00:06 +00:00
}
$admin_tasks = system_get_module_admin_tasks($name);
ksort($admin_tasks);
$output .= theme('item_list', $admin_tasks, t('@module administration pages', array('@module' => $module['name'])));
2004-05-17 22:00:06 +00:00
}
return $output;
}