diff --git a/modules/help/help.admin.inc b/modules/help/help.admin.inc
new file mode 100644
index 000000000000..2d41ffb32552
--- /dev/null
+++ b/modules/help/help.admin.inc
@@ -0,0 +1,85 @@
+Help topics
+
Help is available on the following items:
+ !help_pages
+ Glossary of Drupal terminology
+
+ - Block
- 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).
+ - Comment
- Text attached to a post intended to clarify, explain, criticize, or express an opinion on the original post.
+ - Node
- 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 not nodes.
+ - Published
- A post that is viewable by every visitor of the site, regardless of whether he is logged in (see also "Unpublished").
+ - Role
- 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.
+ - Taxonomy
- A categorization system that allows the building of complex hierarchical or relational structures and tagging of content (see taxonomy help).
+ - Unpublished
- A post that is only viewable by administrators and moderators.
+ - User
- A person who has an account at your Drupal site, and is currently logged in with that account.
+ - Visitor
- 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 not currently logged in with that account. A visitor is also called an "anonymous user".
+
', array('!help_pages' => help_links_as_list(), '@taxonomy' => url('admin/help/taxonomy')));
+
+ return $output;
+}
+
+/**
+ * Menu callback; prints a page listing general help for a module.
+ */
+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;
+ }
+
+ $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'])));
+ }
+ 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);
+ $output = '';
+ foreach ($modules as $i => $module) {
+ $output .= '- '. l($module_info[$module]->info['name'], 'admin/help/'. $module) .'
';
+ if (($i + 1) % $break == 0) {
+ $output .= '
';
+ }
+ }
+ $output .= '
';
+
+ return $output;
+}
+
diff --git a/modules/help/help.module b/modules/help/help.module
index 590d8d685e66..cd18f93224aa 100644
--- a/modules/help/help.module
+++ b/modules/help/help.module
@@ -15,6 +15,7 @@ function help_menu() {
'page callback' => 'help_main',
'access arguments' => array('access administration pages'),
'weight' => 9,
+ 'file' => 'help.admin.inc',
);
foreach (module_implements('help', TRUE) as $module) {
@@ -23,65 +24,13 @@ function help_menu() {
'page callback' => 'help_page',
'page arguments' => array(2),
'type' => MENU_CALLBACK,
+ 'file' => 'help.admin.inc',
);
}
return $items;
}
-/**
- * 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('
- Help topics
- Help is available on the following items:
- !help_pages
- Glossary of Drupal terminology
-
- - Block
- 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).
- - Comment
- Text attached to a post intended to clarify, explain, criticize, or express an opinion on the original post.
- - Node
- 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 not nodes.
- - Published
- A post that is viewable by every visitor of the site, regardless of whether he is logged in (see also "Unpublished").
- - Role
- 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.
- - Taxonomy
- A categorization system that allows the building of complex hierarchical or relational structures and tagging of content (see taxonomy help).
- - Unpublished
- A post that is only viewable by administrators and moderators.
- - User
- A person who has an account at your Drupal site, and is currently logged in with that account.
- - Visitor
- 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 not currently logged in with that account. A visitor is also called an "anonymous user".
-
', 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);
- $output = '';
- foreach ($modules as $i => $module) {
- $output .= '- '. l($module_info[$module]->info['name'], 'admin/help/'. $module) .'
';
- if (($i + 1) % $break == 0) {
- $output .= '
';
- }
- }
- $output .= '
';
-
- return $output;
-}
-
/**
* Implementation of hook_help().
*/
@@ -105,27 +54,3 @@ function help_help($path, $arg) {
return $output;
}
}
-
-/**
- * Menu callback; prints a page listing general help for a module.
- */
-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;
- }
-
- $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'])));
- }
- return $output;
-}