Same name and namespace in other branches
  1. 10 core/modules/node/node.module \node_help()
  2. 4.6.x modules/node.module \node_help()
  3. 4.7.x modules/node.module \node_help()
  4. 5.x modules/node/node.module \node_help()
  5. 7.x modules/node/node.module \node_help()
  6. 8.9.x core/modules/node/node.module \node_help()
  7. 9 core/modules/node/node.module \node_help()

Implementation of hook_help().

File

modules/node/node.module, line 27
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

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/content/node-settings/rebuild' && $path != 'batch' && strpos($path, '#') === FALSE && user_access('access administration pages') && node_access_needs_rebuild()) {
    if ($path == 'admin/content/node-settings') {
      $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/content/node-settings/rebuild'),
      ));
    }
    drupal_set_message($message, 'error');
  }
  switch ($path) {
    case 'admin/help#node':
      $output = '<p>' . t('The node module manages content on your site, and stores all posts (regardless of type) as a "node". In addition to basic publishing settings, including whether the post has been published, promoted to the site front page, or should remain present (or sticky) at the top of lists, the node module also records basic information about the author of a post. Optional revision control over edits is available. For additional functionality, the node module is often extended by other modules.') . '</p>';
      $output .= '<p>' . t('Though each post on your site is a node, each post is also of a particular <a href="@content-type">content type</a>. <a href="@content-type">Content types</a> are used to define the characteristics of a post, including the title and description of the fields displayed on its add and edit pages. Each content type may have different default settings for <em>Publishing options</em> and other workflow controls. By default, the two content types in a standard Drupal installation are <em>Page</em> and <em>Story</em>. Use the <a href="@content-type">content types page</a> to add new or edit existing content types. Additional content types also become available as you enable additional core, contributed and custom modules.', array(
        '@content-type' => url('admin/content/types'),
      )) . '</p>';
      $output .= '<p>' . t('The administrative <a href="@content">content page</a> allows you to review and manage your site content. The <a href="@post-settings">post settings page</a> sets certain options for the display of posts. 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(
        '@content' => url('admin/content/node'),
        '@post-settings' => url('admin/content/node-settings'),
        '@permissions' => url('admin/user/permissions'),
      )) . '</p>';
      $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@node">Node module</a>.', array(
        '@node' => 'http://drupal.org/handbook/modules/node/',
      )) . '</p>';
      return $output;
    case 'admin/content/node':
      return ' ';

    // Return a non-null value so that the 'more help' link is shown.
    case 'admin/content/types':
      return '<p>' . t('Below is a list of all the content types on your site. All posts that exist on your site are instances of one of these content types.') . '</p>';
    case 'admin/content/types/add':
      return '<p>' . t('To create a new content type, enter the human-readable name, the machine-readable name, and all other relevant fields that are on this page. Once created, users of your site will be able to create posts that are instances of this content type.') . '</p>';
    case 'node/%/revisions':
      return '<p>' . t('The revisions let you track differences between multiple versions of a post.') . '</p>';
    case 'node/%/edit':
      $node = node_load($arg[1]);
      $type = node_get_types('type', $node->type);
      return !empty($type->help) ? '<p>' . filter_xss_admin($type->help) . '</p>' : '';
  }
  if ($arg[0] == 'node' && $arg[1] == 'add' && $arg[2]) {
    $type = node_get_types('type', str_replace('-', '_', $arg[2]));
    return !empty($type->help) ? '<p>' . filter_xss_admin($type->help) . '</p>' : '';
  }
}