node_help
- Versions
- 4.6 – 5
node_help($section)- 6 – 7
node_help($path, $arg)
Implement hook_help().
Code
modules/node/node.module, line 65
<?php
function node_help($path, $arg) {
// Remind site administrators about the {node_access} table being flagged
// for rebuild. We don't need to issue the message on the confirm form, or
// while the rebuild is being processed.
if ($path != 'admin/reports/status/rebuild' && $path != 'batch' && strpos($path, '#') === FALSE
&& user_access('access administration pages') && node_access_needs_rebuild()) {
if ($path == 'admin/reports/status') {
$message = t('The content access permissions need to be rebuilt.');
}
else {
$message = t('The content access permissions need to be rebuilt. Please visit <a href="@node_access_rebuild">this page</a>.', array('@node_access_rebuild' => url('admin/reports/status/rebuild')));
}
drupal_set_message($message, 'error');
}
switch ($path) {
case 'admin/help#node':
$output = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The node module manages the creation, editing, deletion, and display of all content on your site.') . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Publishing content') . '</dt>';
$output .= '<dd>' . t('When new content is created, the node module records basic information about the content item including the author, date of creation, and the type of content. It also tracks the <em>publishing options</em> which define whether or not the content is published, promoted to the front page of the site, and/or sticky at the top of content lists. Revision control of content edits is also available. Default settings can be configured for each <a href="@content-type">type of content</a> on your site.', array('@content-type' => url('admin/structure/types'))) . '</dd>';
$output .= '<dt>' . t('Administering content') . '</dt>';
$output .= '<dd>' . t('The administrative <a href="@content">content page</a> allows you to review and manage your site content.', array('@content' => url('admin/content'))) . '</dd>';
$output .= '<dt>' . t('User permissions') . '</dt>';
$output .= '<dd>' . t('The node module makes a number of permissions available for each content type, which may be set by role on the <a href="@permissions">permissions page</a>.', array('@permissions' => url('admin/settings/permissions'))) . '</dd>';
$output .= '</dl>';
return $output;
case 'admin/content':
// Return a non-null value so that the 'more help' link is shown.
return ' ';
case 'admin/structure/types/add':
return '<p>' . t('Individual content types can have different fields, behaviors, and permissions assigned to them.') . '</p>';
case 'admin/structure/types/manage/' . $arg[3] . '/fields':
return '<p>' . t('This form lets you add, edit, and arrange fields within the %type content type.', array('%type' => node_type_get_name($arg[3]))) . '</p>';
case 'admin/structure/types/manage/' . $arg[3] . '/display':
return '<p>' . t('This form lets you configure how fields should be displayed when %type content is rendered in the following contexts.', array('%type' => node_type_get_name($arg[3]))) . '</p>';
case 'admin/structure/types/manage/' . $arg[3] . '/display/' . $arg[5]:
return '<p>' . t('This form lets you configure how fields should be displayed when %type content is rendered in the following contexts.', array('%type' => node_type_get_name($arg[3]))) . '</p>';
case 'node/%/revisions':
return '<p>' . t('The revisions let you track differences between multiple versions of your content.') . '</p>';
case 'node/%/edit':
$node = node_load($arg[1]);
$type = node_type_get_type($node);
return (!empty($type->help) ? '<p>' . filter_xss_admin($type->help) . '</p>' : '');
}
if ($arg[0] == 'node' && $arg[1] == 'add' && $arg[2]) {
$type = node_type_get_type(str_replace('-', '_', $arg[2]));
return (!empty($type->help) ? '<p>' . filter_xss_admin($type->help) . '</p>' : '');
}
}
?>Login or register to post comments 