Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
node.module 97.59 KiB
<?php
// $Id$
/**
* @file
* The core that allows content to be submitted to the site. Modules and
* scripts may programmatically submit nodes using the usual form API pattern.
*/
/**
* Nodes changed before this time are always marked as read.
*
* Nodes changed after this time may be marked new, updated, or read, depending
* on their state for the current user. Defaults to 30 days ago.
*/
define('NODE_NEW_LIMIT', REQUEST_TIME - 30 * 24 * 60 * 60);
/**
* Node is being built before being viewed normally.
*/
define('NODE_BUILD_NORMAL', 0);
/**
* Node is being built before being previewed.
*/
define('NODE_BUILD_PREVIEW', 1);
/**
* Node is being built before being indexed by search module.
*/
define('NODE_BUILD_SEARCH_INDEX', 2);
/**
* Node is being built before being displayed as a search result.
*/
define('NODE_BUILD_SEARCH_RESULT', 3);
/**
* Node is being built before being displayed as part of an RSS feed.
*/
define('NODE_BUILD_RSS', 4);
/**
* Node is being built before being printed.
*/
define('NODE_BUILD_PRINT', 5);
/**
* Implementation of hook_help().
*/
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/build/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>';