diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc
index 72adc34..b741a24 100644
--- a/modules/node/content_types.inc
+++ b/modules/node/content_types.inc
@@ -7,6 +7,8 @@
/**
* Displays the content type admin overview page.
+ *
+ * @see node_menu()
*/
function node_overview_types() {
$types = node_type_get_types();
@@ -54,7 +56,7 @@ function node_overview_types() {
}
/**
- * Returns HTML for a node type description for the content type admin overview page.
+ * Returns HTML for a node type description for the content type admin page.
*
* @param $variables
* An associative array containing:
@@ -409,7 +411,15 @@ function node_type_reset($type) {
}
/**
- * Menu callback; delete a single content type.
+ * Form constructor for the content type delete form.
+ *
+ * @param $type
+ * Content type object.
+ *
+ * @return
+ * Form array for delete confirmation form.
+ *
+ * @see node_type_delete_confirm_submit()
*/
function node_type_delete_confirm($form, &$form_state, $type) {
$form['type'] = array('#type' => 'value', '#value' => $type->type);
@@ -429,7 +439,7 @@ function node_type_delete_confirm($form, &$form_state, $type) {
}
/**
- * Process content type delete confirm submissions.
+ * Form submission handler for node_type_delete_confirm().
*/
function node_type_delete_confirm_submit($form, &$form_state) {
node_type_delete($form_state['values']['type']);
diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc
index a1967c4..c20097d 100644
--- a/modules/node/node.admin.inc
+++ b/modules/node/node.admin.inc
@@ -6,7 +6,10 @@
*/
/**
- * Menu callback: confirm rebuilding of permissions.
+ * Form constructor for the permission rebuild confirmation form.
+ *
+ * @see node_menu()
+ * @see node_configure_rebuild_confirm_submit()
*/
function node_configure_rebuild_confirm() {
return confirm_form(array(), t('Are you sure you want to rebuild the permissions on site content?'),
@@ -14,7 +17,7 @@ function node_configure_rebuild_confirm() {
}
/**
- * Handler for wipe confirmation
+ * Form submission handler for node_configure_rebuild_confirm().
*/
function node_configure_rebuild_confirm_submit($form, &$form_state) {
node_access_rebuild(TRUE);
@@ -65,7 +68,10 @@ function node_node_operations() {
}
/**
- * List node administration filters that can be applied.
+ * Lists node administration filters that can be applied.
+ *
+ * @return
+ * Associative array of filters.
*/
function node_filters() {
// Regular filters
@@ -110,7 +116,7 @@ function node_filters() {
}
/**
- * Apply filters for node administration filters based on session.
+ * Applies filters for the node administration overview based on session.
*
* @param $query
* A SelectQuery to which the filters should be applied.
@@ -133,7 +139,15 @@ function node_build_filter_query(SelectQueryInterface $query) {
}
/**
- * Return form for node administration filters.
+ * Returns the node administration filters form object to node_admin_content().
+ *
+ * @see node_multiple_delete_confirm()
+ * @see node_multiple_delete_confirm_submit()
+ * @see node_admin_nodes()
+ * @see node_admin_nodes_submit()
+ * @see node_admin_nodes_validate()
+ * @see node_filter_form_submit()
+ * @ingroup forms
*/
function node_filter_form() {
$session = isset($_SESSION['node_overview_filter']) ? $_SESSION['node_overview_filter'] : array();
@@ -208,7 +222,15 @@ function node_filter_form() {
}
/**
- * Process result from node administration filter form.
+ * Form submission handler for node_filter_form().
+ *
+ * @see node_admin_content()
+ * @see node_multiple_delete_confirm()
+ * @see node_multiple_delete_confirm_submit()
+ * @see node_admin_nodes()
+ * @see node_admin_nodes_submit()
+ * @see node_admin_nodes_validate()
+ * @see node_filter_form()
*/
function node_filter_form_submit($form, &$form_state) {
$filters = node_filters();
@@ -237,18 +259,19 @@ function node_filter_form_submit($form, &$form_state) {
}
/**
- * Make mass update of nodes, changing all nodes in the $nodes array
- * to update them with the field values in $updates.
+ * Updates all nodes in the passed-in array with the passed-in field values.
*
* IMPORTANT NOTE: This function is intended to work when called
- * from a form submit handler. Calling it outside of the form submission
+ * from a form submission handler. Calling it outside of the form submission
* process may not work correctly.
*
* @param array $nodes
* Array of node nids to update.
* @param array $updates
- * Array of key/value pairs with node field names and the
- * value to update that field to.
+ * Array of key/value pairs with node field names and the value to update
+ * that field to.
+ *
+ * @ingroup batch
*/
function node_mass_update($nodes, $updates) {
// We use batch processing to prevent timeout when updating a large number
@@ -279,7 +302,14 @@ function node_mass_update($nodes, $updates) {
}
/**
- * Node Mass Update - helper function.
+ * Updates individual nodes when fewer than 10 are queued.
+ *
+ * @param $nid
+ * ID of node to update.
+ * @param $updates
+ * Associative array of updates.
+ *
+ * @see node_mass_update()
*/
function _node_mass_update_helper($nid, $updates) {
$node = node_load($nid, NULL, TRUE);
@@ -293,7 +323,7 @@ function _node_mass_update_helper($nid, $updates) {
}
/**
- * Node Mass Update Batch operation
+ * Executes a batch operation for node_mass_update().
*/
function _node_mass_update_batch_process($nodes, $updates, &$context) {
if (!isset($context['sandbox']['progress'])) {
@@ -324,7 +354,7 @@ function _node_mass_update_batch_process($nodes, $updates, &$context) {
}
/**
- * Node Mass Update Batch 'finished' callback.
+ * Reports the 'finished' status of batch operation for node_mass_update().
*/
function _node_mass_update_batch_finished($success, $results, $operations) {
if ($success) {
@@ -339,7 +369,16 @@ function _node_mass_update_batch_finished($success, $results, $operations) {
}
/**
- * Menu callback: content administration.
+ * Form constructor for the content administration form.
+ *
+ * @see node_multiple_delete_confirm()
+ * @see node_multiple_delete_confirm_submit()
+ * @see node_admin_nodes()
+ * @see node_admin_nodes_submit()
+ * @see node_admin_nodes_validate()
+ * @see node_filter_form()
+ * @see node_filter_form_submit()
+ * @see node_menu()
*/
function node_admin_content($form, $form_state) {
if (isset($form_state['values']['operation']) && $form_state['values']['operation'] == 'delete') {
@@ -353,7 +392,15 @@ function node_admin_content($form, $form_state) {
}
/**
- * Form builder: Builds the node administration overview.
+ * Returns the admin form object to node_admin_content().
+ *
+ * @see node_multiple_delete_confirm()
+ * @see node_multiple_delete_confirm_submit()
+ * @see node_admin_nodes_submit()
+ * @see node_admin_nodes_validate()
+ * @see node_filter_form()
+ * @see node_filter_form_submit()
+ * @ingroup forms
*/
function node_admin_nodes() {
$admin_access = user_access('administer nodes');
@@ -522,10 +569,17 @@ function node_admin_nodes() {
}
/**
- * Validate node_admin_nodes form submissions.
+ * Form validation handler for node_admin_nodes().
*
- * Check if any nodes have been selected to perform the chosen
+ * Checks if any nodes have been selected to perform the chosen
* 'Update option' on.
+ *
+ * @see node_multiple_delete_confirm()
+ * @see node_multiple_delete_confirm_submit()
+ * @see node_admin_nodes()
+ * @see node_admin_nodes_submit()
+ * @see node_filter_form()
+ * @see node_filter_form_submit()
*/
function node_admin_nodes_validate($form, &$form_state) {
// Error if there are no items to select.
@@ -535,9 +589,16 @@ function node_admin_nodes_validate($form, &$form_state) {
}
/**
- * Process node_admin_nodes form submissions.
+ * Form submission handler for node_admin_nodes().
*
- * Execute the chosen 'Update option' on the selected nodes.
+ * Executes the chosen 'Update option' on the selected nodes.
+ *
+ * @see node_multiple_delete_confirm()
+ * @see node_multiple_delete_confirm_submit()
+ * @see node_admin_nodes()
+ * @see node_admin_nodes_validate()
+ * @see node_filter_form()
+ * @see node_filter_form_submit()
*/
function node_admin_nodes_submit($form, &$form_state) {
$operations = module_invoke_all('node_operations');
@@ -563,6 +624,19 @@ function node_admin_nodes_submit($form, &$form_state) {
}
}
+/**
+ * Multiple node deletion confirmation form for node_admin_content().
+ *
+ * @param array $nodes
+ * Array of node nids to update.
+ *
+ * @see node_multiple_delete_confirm_submit()
+ * @see node_admin_nodes()
+ * @see node_admin_nodes_submit()
+ * @see node_admin_nodes_validate()
+ * @see node_filter_form()
+ * @see node_filter_form_submit()
+ */
function node_multiple_delete_confirm($form, &$form_state, $nodes) {
$form['nodes'] = array('#prefix' => '
', '#tree' => TRUE);
// array_filter returns only elements with TRUE values
@@ -586,6 +660,16 @@ function node_multiple_delete_confirm($form, &$form_state, $nodes) {
t('Delete'), t('Cancel'));
}
+/**
+ * Form submission handler for node_multiple_delete_confirm().
+ *
+ * @see node_multiple_delete_confirm()
+ * @see node_admin_nodes()
+ * @see node_admin_nodes_submit()
+ * @see node_admin_nodes_validate()
+ * @see node_filter_form()
+ * @see node_filter_form_submit()
+ */
function node_multiple_delete_confirm_submit($form, &$form_state) {
if ($form_state['values']['confirm']) {
node_delete_multiple(array_keys($form_state['values']['nodes']));
diff --git a/modules/node/node.install b/modules/node/node.install
index 8505234..b27474a 100644
--- a/modules/node/node.install
+++ b/modules/node/node.install
@@ -470,7 +470,7 @@ function node_update_dependencies() {
}
/**
- * Utility function: fetch the node types directly from the database.
+ * Fetches node types directly from the database.
*
* This function is valid for a database schema version 7000.
*
diff --git a/modules/node/node.module b/modules/node/node.module
index 290df41..0f0f6c1 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -2,60 +2,72 @@
/**
* @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.
+ * The core module that allows content to be submitted to the site.
+ *
+ * Modules and scripts may programmatically submit nodes using the usual form
+ * API pattern.
*/
/**
- * Node is not published.
+ * Denotes that the node is not published.
*/
define('NODE_NOT_PUBLISHED', 0);
/**
- * Node is published.
+ * Denotes that the node is published.
*/
define('NODE_PUBLISHED', 1);
/**
- * Node is not promoted to front page.
+ * Denotes that the node is not promoted to the front page.
*/
define('NODE_NOT_PROMOTED', 0);
/**
- * Node is promoted to front page.
+ * Denotes that the node is promoted to the front page.
*/
define('NODE_PROMOTED', 1);
/**
- * Node is not sticky at top of the page.
+ * Denotes that the node is not sticky at the top of the page.
*/
define('NODE_NOT_STICKY', 0);
/**
- * Node is sticky at top of the page.
+ * Denotes that the node is sticky at the top of the page.
*/
define('NODE_STICKY', 1);
/**
- * Nodes changed before this time are always marked as read.
+ * Denotes the time cutoff for nodes 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.
+ * 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);
/**
- * Modules should return this value from hook_node_access() to allow access to a node.
+ * Denotes that access is allowed for a node.
+ *
+ * Modules should return this value from hook_node_access() to allow access to a
+ * node.
*/
define('NODE_ACCESS_ALLOW', 'allow');
/**
- * Modules should return this value from hook_node_access() to deny access to a node.
+ * Denotes that access is denied for a node.
+ *
+ * Modules should return this value from hook_node_access() to deny access to a
+ * node.
*/
define('NODE_ACCESS_DENY', 'deny');
/**
- * Modules should return this value from hook_node_access() to not affect node access.
+ * Denotes that access is unaffected for a node.
+ *
+ * Modules should return this value from hook_node_access() to indicate no
+ * effect on node access.
*/
define('NODE_ACCESS_IGNORE', NULL);
@@ -277,7 +289,7 @@ function node_admin_paths() {
* field is available, a title attribute will be added to show the number of
* comments.
* @param $title
- * A heading for the resulting list.
+ * (optional) A heading for the resulting list.
*
* @return
* A renderable array containing a list of linked node titles fetched from
@@ -295,7 +307,7 @@ function node_title_list($result, $title = NULL) {
}
/**
- * Update the 'last viewed' timestamp of the specified node for current user.
+ * Updates the 'last viewed' timestamp of the specified node for current user.
*
* @param $node
* A node object.
@@ -314,8 +326,7 @@ function node_tag_new($node) {
}
/**
- * Retrieves the timestamp at which the current user last viewed the
- * specified node.
+ * Retrieves the timestamp for the current user's last view of a specified node.
*/
function node_last_viewed($nid) {
global $user;
@@ -329,12 +340,13 @@ function node_last_viewed($nid) {
}
/**
- * Decide on the type of marker to be displayed for a given node.
+ * Decides on the type of marker to be displayed for a given node.
*
* @param $nid
* Node ID whose history supplies the "last viewed" timestamp.
* @param $timestamp
* Time which is compared against node's "last viewed" timestamp.
+ *
* @return
* One of the MARK constants.
*/
@@ -358,7 +370,7 @@ function node_mark($nid, $timestamp) {
}
/**
- * Extract the type name.
+ * Extracts the type name.
*
* @param $node
* Either a string or object, containing the node type information.
@@ -466,7 +478,7 @@ function node_types_rebuild() {
}
/**
- * Menu argument loader: loads a node type by string.
+ * Menu argument loader: Loads a node type by string.
*
* @param $name
* The machine-readable name of a node type to load, where '_' is replaced
@@ -539,12 +551,12 @@ function node_type_save($info) {
}
/**
- * Add default body field to a node type.
+ * Adds the default body field to a node type.
*
* @param $type
* A node type object.
* @param $label
- * The label for the body instance.
+ * (optional) The label for the body instance.
*
* @return
* Body field instance.
@@ -654,6 +666,7 @@ function node_type_update_nodes($old_type, $type) {
*
* @param $rebuild
* TRUE to rebuild node types. Equivalent to calling node_types_rebuild().
+ *
* @return
* An object with two properties:
* - names: Associative array of the names of node types, keyed by the type.
@@ -760,8 +773,8 @@ function node_type_cache_reset() {
* which prevents users from changing the machine name of the type.
*
* @param $info
- * An object or array containing values to override the defaults. See
- * hook_node_info() for details on what the array elements mean.
+ * (optional) An object or array containing values to override the defaults.
+ * See hook_node_info() for details on what the array elements mean.
*
* @return
* A node type object, with missing values in $info set to their defaults.
@@ -844,7 +857,7 @@ function node_rdf_mapping() {
}
/**
- * Determine whether a node hook exists.
+ * Determines whether a node hook exists.
*
* @param $node
* A node object or a string containing the node type.
@@ -859,7 +872,7 @@ function node_hook($node, $hook) {
}
/**
- * Invoke a node hook.
+ * Invokes a node hook.
*
* @param $node
* A node object or a string containing the node type.
@@ -867,6 +880,7 @@ function node_hook($node, $hook) {
* A string containing the name of the hook.
* @param $a2, $a3, $a4
* Arguments to pass on to the hook, after the $node argument.
+ *
* @return
* The returned value of the invoked hook.
*/
@@ -879,17 +893,14 @@ function node_invoke($node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
}
/**
- * Load node entities from the database.
+ * Loads node entities from the database.
*
* This function should be used whenever you need to load more than one node
* from the database. Nodes are loaded into memory and will not require
* database access if loaded again during the same page request.
*
- * @see entity_load()
- * @see EntityFieldQuery
- *
* @param $nids
- * An array of node IDs.
+ * (optional) An array of node IDs.
* @param $conditions
* (deprecated) An associative array of conditions on the {node}
* table, where the keys are the database fields and the values are the
@@ -897,26 +908,29 @@ function node_invoke($node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
* EntityFieldQuery to retrieve a list of entity IDs loadable by
* this function.
* @param $reset
- * Whether to reset the internal node_load cache.
+ * (optional) Whether to reset the internal node_load cache.
*
* @return
* An array of node objects indexed by nid.
*
* @todo Remove $conditions in Drupal 8.
+ *
+ * @see entity_load()
+ * @see EntityFieldQuery
*/
function node_load_multiple($nids = array(), $conditions = array(), $reset = FALSE) {
return entity_load('node', $nids, $conditions, $reset);
}
/**
- * Load a node object from the database.
+ * Loads a node object from the database.
*
* @param $nid
- * The node ID.
+ * (optional) The node ID.
* @param $vid
- * The revision ID.
+ * (optional) The revision ID.
* @param $reset
- * Whether to reset the node_load_multiple cache.
+ * (optional) Whether to reset the node_load_multiple() cache.
*
* @return
* A fully-populated node object, or FALSE if the node is not found.
@@ -933,6 +947,9 @@ function node_load($nid = NULL, $vid = NULL, $reset = FALSE) {
*
* Fills in a few default values, and then invokes hook_prepare() on the node
* type module, and hook_node_prepare() on all modules.
+ *
+ * @param $node
+ * The node object.
*/
function node_object_prepare($node) {
// Set up default values, if required.
@@ -962,7 +979,9 @@ function node_object_prepare($node) {
}
/**
- * Perform validation checks on the given node.
+ * Performs validation checks on the given node.
+ *
+ * @see node_form_validate()
*/
function node_validate($node, $form, &$form_state) {
$type = node_type_get_type($node);
@@ -999,7 +1018,7 @@ function node_validate($node, $form, &$form_state) {
}
/**
- * Prepare node for saving by populating author and creation date.
+ * Prepares a node for saving by populating author and creation date.
*/
function node_submit($node) {
// A user might assign the node author by entering a user name in the node
@@ -1020,7 +1039,7 @@ function node_submit($node) {
}
/**
- * Save changes to a node or add a new node.
+ * Saves changes to a node or add a new node.
*
* @param $node
* The $node object to be saved. If $node->nid is
@@ -1155,9 +1174,21 @@ function node_save($node) {
}
/**
- * Helper function to save a revision with the uid of the current user.
+ * Saves a revision with the ID of the current user.
*
* The resulting revision ID is available afterward in $node->vid.
+ *
+ * @param $node
+ * The node object to be processed.
+ * @param $uid
+ * User ID of the current user.
+ * @param $update
+ * (optional) To indicate that this is a new record to be inserted, omit this
+ * argument. If this is an update, this argument specifies the primary keys'
+ * field names. If there is only 1 field in the key, you may pass in a string;
+ * if there are multiple fields in the key, pass in an array.
+ *
+ * @see node_save()
*/
function _node_save_revision($node, $uid, $update = NULL) {
$temp_uid = $node->uid;
@@ -1173,7 +1204,7 @@ function _node_save_revision($node, $uid, $update = NULL) {
}
/**
- * Delete a node.
+ * Deletes a node.
*
* @param $nid
* A node ID.
@@ -1183,7 +1214,7 @@ function node_delete($nid) {
}
/**
- * Delete multiple nodes.
+ * Deletes multiple nodes.
*
* @param $nids
* An array of node IDs.
@@ -1236,10 +1267,13 @@ function node_delete_multiple($nids) {
}
/**
- * Delete a node revision.
+ * Deletes a node revision.
*
* @param $revision_id
* The revision ID to delete.
+ *
+ * @return
+ * TRUE if the revision deletion was successful.
*/
function node_revision_delete($revision_id) {
if ($revision = node_load(NULL, $revision_id)) {
@@ -1261,12 +1295,12 @@ function node_revision_delete($revision_id) {
}
/**
- * Generate an array for rendering the given node.
+ * Generates an array for rendering the given node.
*
* @param $node
* A node object.
* @param $view_mode
- * View mode, e.g. 'full', 'teaser'...
+ * (optional) View mode, e.g., 'full', 'teaser'... Defaults to 'full.'
* @param $langcode
* (optional) A language code to use for rendering. Defaults to the global
* content language of the current request.
@@ -1331,7 +1365,7 @@ function node_view($node, $view_mode = 'full', $langcode = NULL) {
* @param $node
* A node object.
* @param $view_mode
- * View mode, e.g. 'full', 'teaser'...
+ * (optional) View mode, e.g., 'full', 'teaser'... Defaults to 'full.'
* @param $langcode
* (optional) A language code to use for rendering. Defaults to the global
* content language of the current request.
@@ -1387,14 +1421,18 @@ function node_build_content($node, $view_mode = 'full', $langcode = NULL) {
}
/**
- * Generate an array which displays a node detail page.
+ * Generates an array which displays a node detail page.
*
* @param $node
* A node object.
* @param $message
- * A flag which sets a page title relevant to the revision being viewed.
+ * (optional) A flag which sets a page title relevant to the revision being
+ * viewed.
+ *
* @return
* A $page element suitable for use by drupal_render().
+ *
+ * @see node_menu()
*/
function node_show($node, $message = FALSE) {
if ($message) {
@@ -1411,10 +1449,13 @@ function node_show($node, $message = FALSE) {
}
/**
- * Returns whether the current page is the full page view of the passed-in node.
+ * Checks whether the current page is the full page view of the passed-in node.
*
* @param $node
* A node object.
+ *
+ * @return
+ * The ID of the node if this is a full page view, otherwise FALSE.
*/
function node_is_page($node) {
$page_node = menu_get_object();
@@ -1422,16 +1463,17 @@ function node_is_page($node) {
}
/**
- * Process variables for node.tpl.php
+ * Processes variables for node.tpl.php
*
* Most themes utilize their own copy of node.tpl.php. The default is located
* inside "modules/node/node.tpl.php". Look in there for the full list of
* variables.
*
- * The $variables array contains the following arguments:
- * - $node
- * - $view_mode
- * - $page
+ * @param $variables
+ * An associative array with the following arguments:
+ * - node: A node object.
+ * - view_mode: View mode, e.g. 'full', 'teaser'...
+ * - page: Flag for the full page state.
*
* @see node.tpl.php
*/
@@ -1544,7 +1586,7 @@ function node_permission() {
}
/**
- * Gather the rankings from the the hook_ranking implementations.
+ * Gathers the rankings from the the hook_ranking implementations.
*
* @param $query
* A query object that has been extended with the Search DB Extender.
@@ -1791,6 +1833,7 @@ function node_user_delete($account) {
* An associative array containing:
* - form: A render element representing the form.
*
+ * @see node_search_admin()
* @ingroup themeable
*/
function theme_node_search_admin($variables) {
@@ -1880,6 +1923,14 @@ function _node_revision_access($node, $op = 'view', $account = NULL) {
return $access[$cid];
}
+/**
+ * Access callback: Checks whether the user has permission to add a node.
+ *
+ * @return
+ * TRUE if the user has permission, otherwise FALSE.
+ *
+ * @see node_menu()
+ */
function _node_add_access() {
$types = node_type_get_types();
foreach ($types as $type) {
@@ -1985,8 +2036,8 @@ function node_menu() {
'type' => MENU_CALLBACK,
);
// @todo Remove this loop when we have a 'description callback' property.
- // Reset internal static cache of _node_types_build(), forces to rebuild the
- // node type information.
+ // Reset the internal static cache of _node_types_build() and forces a
+ // rebuild of the node type information.
node_type_cache_reset();
foreach (node_type_get_types() as $type) {
$type_url_str = str_replace('_', '-', $type->type);
@@ -2094,14 +2145,22 @@ function node_menu_local_tasks_alter(&$data, $router_item, $root_path) {
}
/**
- * Title callback for a node type.
+ * Title callback: Provides the title for a node type edit form.
+ *
+ * @param $type
+ * The node type object.
*/
function node_type_page_title($type) {
return $type->name;
}
/**
- * Title callback.
+ * Title callback: Displays the node's title.
+ *
+ * @param $node
+ * The node object.
+ *
+ * @see node_menu()
*/
function node_page_title($node) {
return $node->title;
@@ -2121,7 +2180,7 @@ function node_last_changed($nid) {
}
/**
- * Return a list of all the existing revision numbers.
+ * Returns a list of all the existing revision numbers for the node passed in.
*/
function node_revision_list($node) {
$revisions = array();
@@ -2305,22 +2364,18 @@ function theme_node_recent_content($variables) {
}
/**
- * Implements hook_form_FORMID_alter().
+ * Implements hook_form_FORM_ID_alter() for block_add_block_form().
*
* Adds node-type specific visibility options to add block form.
- *
- * @see block_add_block_form()
*/
function node_form_block_add_block_form_alter(&$form, &$form_state) {
node_form_block_admin_configure_alter($form, $form_state);
}
/**
- * Implements hook_form_FORMID_alter().
+ * Implements hook_form_FORM_ID_alter() for block_admin_configure().
*
* Adds node-type specific visibility options to block configuration form.
- *
- * @see block_admin_configure()
*/
function node_form_block_admin_configure_alter(&$form, &$form_state) {
$default_type_options = db_query("SELECT type FROM {block_node_type} WHERE module = :module AND delta = :delta", array(
@@ -2346,9 +2401,7 @@ function node_form_block_admin_configure_alter(&$form, &$form_state) {
}
/**
- * Form submit handler for block configuration form.
- *
- * @see node_form_block_admin_configure_alter()
+ * Form submission handler for node_form_block_admin_configure_alter().
*/
function node_form_block_admin_configure_submit($form, &$form_state) {
db_delete('block_node_type')
@@ -2367,20 +2420,18 @@ function node_form_block_admin_configure_submit($form, &$form_state) {
}
/**
- * Implements hook_form_FORMID_alter().
+ * Implements hook_form_FORM_ID_alter() for block_custom_block_delete().
*
* Adds node specific submit handler to delete custom block form.
*
- * @see block_custom_block_delete()
+ * @see node_form_block_custom_block_delete_submit()
*/
function node_form_block_custom_block_delete_alter(&$form, &$form_state) {
$form['#submit'][] = 'node_form_block_custom_block_delete_submit';
}
/**
- * Form submit handler for custom block delete form.
- *
- * @see node_form_block_custom_block_delete_alter()
+ * Form submission handler for node_form_block_custom_block_delete_alter().
*/
function node_form_block_custom_block_delete_submit($form, &$form_state) {
db_delete('block_node_type')
@@ -2392,7 +2443,7 @@ function node_form_block_custom_block_delete_submit($form, &$form_state) {
/**
* Implements hook_modules_uninstalled().
*
- * Cleanup {block_node_type} table from modules' blocks.
+ * Cleans up the {block_node_type} table from modules' blocks.
*/
function node_modules_uninstalled($modules) {
db_delete('block_node_type')
@@ -2403,8 +2454,8 @@ function node_modules_uninstalled($modules) {
/**
* Implements hook_block_list_alter().
*
- * Check the content type specific visibilty settings.
- * Remove the block if the visibility conditions are not met.
+ * Checks the content type specific visibility settings and removes the block
+ * if the visibility conditions are not met.
*/
function node_block_list_alter(&$blocks) {
global $theme_key;
@@ -2463,14 +2514,16 @@ function node_block_list_alter(&$blocks) {
* header, with Content Type set to RSS/XML.
*
* @param $nids
- * An array of node IDs (nid). Defaults to FALSE so empty feeds can be
- * generated with passing an empty array, if no items are to be added
+ * (optional) An array of node IDs (nid). Defaults to FALSE so empty feeds can
+ * be generated with passing an empty array, if no items are to be added
* to the feed.
* @param $channel
* An associative array containing title, link, description and other keys,
* to be parsed by format_rss_channel() and format_xml_elements().
* A list of channel elements can be found at the @link http://cyber.law.harvard.edu/rss/rss.html RSS 2.0 Specification. @endlink
* The link should be an absolute URL.
+ *
+ * @see node_menu()
*/
function node_feed($nids = FALSE, $channel = array()) {
global $base_url, $language_content;
@@ -2543,14 +2596,14 @@ function node_feed($nids = FALSE, $channel = array()) {
}
/**
- * Construct a drupal_render() style array from an array of loaded nodes.
+ * Constructs a drupal_render() style array from an array of loaded nodes.
*
* @param $nodes
* An array of nodes as returned by node_load_multiple().
* @param $view_mode
- * View mode, e.g. 'full', 'teaser'...
+ * (optional) View mode, e.g. 'full', 'teaser'... Defaults to 'teaser.'
* @param $weight
- * An integer representing the weight of the first node in the list.
+ * (optional) Integer representing the weight of the first node in the list.
* @param $langcode
* (optional) A language code to use for rendering. Defaults to the global
* content language of the current request.
@@ -2572,7 +2625,7 @@ function node_view_multiple($nodes, $view_mode = 'teaser', $weight = 0, $langcod
}
/**
- * Menu callback; Generate a listing of promoted nodes.
+ * Generates a listing of promoted nodes.
*/
function node_page_default() {
$select = db_select('node', 'n')
@@ -2622,7 +2675,10 @@ function node_page_default() {
}
/**
- * Menu callback; view a single node.
+ * Displays a single node.
+ *
+ * @param $node
+ * The node object.
*/
function node_page_view($node) {
// If there is a menu link to this node, the link becomes the last part
@@ -2651,7 +2707,7 @@ function node_update_index() {
}
/**
- * Index a single node.
+ * Indexes a single node.
*
* @param $node
* The node to index.
@@ -2682,6 +2738,8 @@ function _node_index_node($node) {
/**
* Implements hook_form_FORM_ID_alter().
+ *
+ * @see node_search_validate()
*/
function node_form_search_form_alter(&$form, $form_state) {
if (isset($form['module']) && $form['module']['#value'] == 'node' && user_access('use advanced search')) {
@@ -2755,7 +2813,7 @@ function node_form_search_form_alter(&$form, $form_state) {
}
/**
- * Form API callback for the search form. Registered in node_form_alter().
+ * Form validation handler for node_form_search_form_alter().
*/
function node_search_validate($form, &$form_state) {
// Initialize using any existing basic search keywords.
@@ -2842,8 +2900,7 @@ function node_search_validate($form, &$form_state) {
*/
/**
- * Determine whether the current user may perform the given operation on the
- * specified node.
+ * Access callback: Checks a user's permission for performing a node operation.
*
* @param $op
* The operation to be performed on the node. Possible values are:
@@ -2852,13 +2909,16 @@ function node_search_validate($form, &$form_state) {
* - "delete"
* - "create"
* @param $node
- * The node object on which the operation is to be performed, or node type
- * (e.g. 'forum') for "create" operation.
+ * The node object on which the operation is to be performed, or the node type
+ * (e.g., 'forum') for the 'create' operation.
* @param $account
- * Optional, a user object representing the user for whom the operation is to
+ * (optional) A user object representing the user for whom the operation is to
* be performed. Determines access for a user other than the current user.
+ *
* @return
* TRUE if the operation may be performed, FALSE otherwise.
+ *
+ * @see node_menu()
*/
function node_access($op, $node, $account = NULL) {
$rights = &drupal_static(__FUNCTION__, array());
@@ -2989,6 +3049,7 @@ function node_node_access($node, $op, $account) {
*
* @param $type
* The machine-readable name of the node type.
+ *
* @return array
* An array of permission names and descriptions.
*/
@@ -3045,7 +3106,7 @@ function node_permissions_get_configured_types() {
}
/**
- * Fetch an array of permission IDs granted to the given user ID.
+ * Fetches an array of permission IDs granted to the given user ID.
*
* The implementation here provides only the universal "all" grant. A node
* access module should implement hook_node_grants() to provide a grant
@@ -3058,8 +3119,9 @@ function node_permissions_get_configured_types() {
* @param $op
* The operation that the user is trying to perform.
* @param $account
- * The user object for the user performing the operation. If omitted, the
- * current user is used.
+ * (optional) The user object for the user performing the operation. If
+ * omitted, the current user is used.
+ *
* @return
* An associative array in which the keys are realms, and the values are
* arrays of grants for those realms.
@@ -3091,8 +3153,8 @@ function node_access_grants($op, $account = NULL) {
* added to the query.
*
* @param $account
- * The user object for the user whose access is being checked. If omitted,
- * the current user is used.
+ * (optional) The user object for the user whose access is being checked. If
+ * omitted, the current user is used.
*
* @return
* TRUE if 'view' access to all nodes is granted, FALSE otherwise.
@@ -3385,10 +3447,11 @@ function node_access_acquire_grants($node, $delete = TRUE) {
* is a module-defined id to define grant privileges. each grant_* field
* is a boolean value.
* @param $realm
- * If provided, only read/write grants for that realm.
+ * (optional) If provided, read/write grants for that realm only.
* @param $delete
- * If false, do not delete records. This is only for optimization purposes,
- * and assumes the caller has already performed a mass delete of some form.
+ * (optional) If false, does not delete records. This is only for optimization
+ * purposes, and assumes the caller has already performed a mass delete of
+ * some form.
*/
function node_access_write_grants($node, $grants, $realm = NULL, $delete = TRUE) {
if ($delete) {
@@ -3417,8 +3480,7 @@ function node_access_write_grants($node, $grants, $realm = NULL, $delete = TRUE)
}
/**
- * Flag / unflag the node access grants for rebuilding, or read the current
- * value of the flag.
+ * Toggles or reads the value of a flag for rebuilding the node access grants.
*
* When the flag is set, a message is displayed to users with 'access
* administration pages' permission, pointing to the 'rebuild' confirm form.
@@ -3429,9 +3491,10 @@ function node_access_write_grants($node, $grants, $realm = NULL, $delete = TRUE)
* should be used instead.
*
* @param $rebuild
- * (Optional) The boolean value to be written.
- * @return
- * (If no value was provided for $rebuild) The current value of the flag.
+ * (optional) The boolean value to be written.
+ *
+ * @return
+ * The current value of the flag if no value was provided for $rebuild.
*/
function node_access_needs_rebuild($rebuild = NULL) {
if (!isset($rebuild)) {
@@ -3446,19 +3509,17 @@ function node_access_needs_rebuild($rebuild = NULL) {
}
/**
- * Rebuild the node access database. This is occasionally needed by modules
- * that make system-wide changes to access levels.
+ * Rebuilds the node access database.
*
- * When the rebuild is required by an admin-triggered action (e.g module
- * settings form), calling node_access_needs_rebuild(TRUE) instead of
- * node_access_rebuild() lets the user perform his changes and actually
+ * This rebuild is occasionally needed by modules that make system-wide changes
+ * to access levels. When the rebuild is required by an admin-triggered action
+ * (e.g module settings form), calling node_access_needs_rebuild(TRUE) instead
+ * of node_access_rebuild() lets the user perform his changes and actually
* rebuild only once he is done.
*
* Note : As of Drupal 6, node access modules are not required to (and actually
* should not) call node_access_rebuild() in hook_enable/disable anymore.
*
- * @see node_access_needs_rebuild()
- *
* @param $batch_mode
* Set to TRUE to process in 'batch' mode, spawning processing over several
* HTTP requests (thus avoiding the risk of PHP timeout if the site has a
@@ -3466,6 +3527,7 @@ function node_access_needs_rebuild($rebuild = NULL) {
* hook_update_N and any form submit handler are safe contexts to use the
* 'batch mode'. Less decidable cases (such as calls from hook_user,
* hook_taxonomy, etc...) might consider using the non-batch mode.
+ * @see node_access_needs_rebuild()
*/
function node_access_rebuild($batch_mode = FALSE) {
db_delete('node_access')->execute();
@@ -3606,6 +3668,7 @@ function node_content_form($node, $form_state) {
/**
* Implements hook_forms().
+ *
* All node forms share the same form handler.
*/
function node_forms() {
@@ -3690,6 +3753,12 @@ function node_action_info() {
/**
* Sets the status of a node to 1 (published).
*
+ * @param $node
+ * A node object.
+ * @param $context
+ * (optional) Array of additional information about what triggered the action.
+ * Not used for this action.
+ *
* @ingroup actions
*/
function node_publish_action($node, $context = array()) {
@@ -3700,6 +3769,12 @@ function node_publish_action($node, $context = array()) {
/**
* Sets the status of a node to 0 (unpublished).
*
+ * @param $node
+ * A node object.
+ * @param $context
+ * (optional) Array of additional information about what triggered the action.
+ * Not used for this action.
+ *
* @ingroup actions
*/
function node_unpublish_action($node, $context = array()) {
@@ -3720,6 +3795,12 @@ function node_make_sticky_action($node, $context = array()) {
/**
* Sets the sticky-at-top-of-list property of a node to 0.
*
+ * @param $node
+ * A node object.
+ * @param $context
+ * (optional) Array of additional information about what triggered the action.
+ * Not used for this action.
+ *
* @ingroup actions
*/
function node_make_unsticky_action($node, $context = array()) {
@@ -3730,6 +3811,12 @@ function node_make_unsticky_action($node, $context = array()) {
/**
* Sets the promote property of a node to 1.
*
+ * @param $node
+ * A node object.
+ * @param $context
+ * (optional) Array of additional information about what triggered the action.
+ * Not used for this action.
+ *
* @ingroup actions
*/
function node_promote_action($node, $context = array()) {
@@ -3740,6 +3827,12 @@ function node_promote_action($node, $context = array()) {
/**
* Sets the promote property of a node to 0.
*
+ * @param $node
+ * A node object.
+ * @param $context
+ * (optional) Array of additional information about what triggered the action.
+ * Not used for this action.
+ *
* @ingroup actions
*/
function node_unpromote_action($node, $context = array()) {
@@ -3750,6 +3843,9 @@ function node_unpromote_action($node, $context = array()) {
/**
* Saves a node.
*
+ * @param $node
+ * The node to be saved.
+ *
* @ingroup actions
*/
function node_save_action($node) {
@@ -3763,9 +3859,13 @@ function node_save_action($node) {
* @param $node
* A node object to modify.
* @param $context
- * Array with the following elements:
- * - 'owner_uid': User ID to assign to the node.
+ * Array of additional information about what triggered the action. Includes
+ * the following elements:
+ * - owner_uid: User ID to assign to the node.
*
+ * @see node_assign_owner_action_form()
+ * @see node_assign_owner_action_validate()
+ * @see node_assign_owner_action_submit()
* @ingroup actions
*/
function node_assign_owner_action($node, $context) {
@@ -3775,7 +3875,16 @@ function node_assign_owner_action($node, $context) {
}
/**
- * Generates the settings form for node_assign_owner_action().
+ * Form constructor for the settings form for node_assign_owner_action().
+ *
+ * @param $context
+ * Array of additional information about what triggered the action. Includes
+ * the following elements:
+ * - owner_uid: User ID to assign to the node.
+ *
+ * @see node_assign_owner_action_submit()
+ * @see node_assign_owner_action_validate()
+ * @ingroup forms
*/
function node_assign_owner_action_form($context) {
$description = t('The username of the user to which you would like to assign ownership.');
@@ -3815,7 +3924,9 @@ function node_assign_owner_action_form($context) {
}
/**
- * Validates settings form for node_assign_owner_action().
+ * Form validation handler for node_assign_owner_action_form().
+ *
+ * @see node_assign_owner_action_submit()
*/
function node_assign_owner_action_validate($form, $form_state) {
$exists = (bool) db_query_range('SELECT 1 FROM {users} WHERE name = :name', 0, 1, array(':name' => $form_state['values']['owner_name']))->fetchField();
@@ -3825,7 +3936,9 @@ function node_assign_owner_action_validate($form, $form_state) {
}
/**
- * Saves settings form for node_assign_owner_action().
+ * Form submission handler for node_assign_owner_action_form().
+ *
+ * @see node_assign_owner_action_validate()
*/
function node_assign_owner_action_submit($form, $form_state) {
// Username can change, so we need to store the ID, not the username.
@@ -3847,7 +3960,7 @@ function node_unpublish_by_keyword_action_form($context) {
}
/**
- * Saves settings form for node_unpublish_by_keyword_action().
+ * Form submission handler for node_unpublish_by_keyword_action().
*/
function node_unpublish_by_keyword_action_submit($form, $form_state) {
return array('keywords' => drupal_explode_tags($form_state['values']['keywords']));
@@ -3859,10 +3972,14 @@ function node_unpublish_by_keyword_action_submit($form, $form_state) {
* @param $node
* A node object to modify.
* @param $context
- * Array with the following elements:
- * - 'keywords': Array of keywords. If any keyword is present in the rendered
+ * Array of additional information about what triggered the action. Includes
+ * the following elements:
+ * - keywords: Array of keywords. If any keyword is present in the rendered
* node, the node's status flag is set to unpublished.
*
+ * @see node_unpublish_by_keyword_action_form()
+ * @see node_unpublish_by_keyword_action_submit()
+ *
* @ingroup actions
*/
function node_unpublish_by_keyword_action($node, $context) {
@@ -3921,6 +4038,9 @@ function node_modules_enabled($modules) {
*/
class NodeController extends DrupalDefaultEntityController {
+ /**
+ * Overrides DrupalDefaultEntityController::attachLoad().
+ */
protected function attachLoad(&$nodes, $revision_id = FALSE) {
// Create an array of nodes for each content type and pass this to the
// object type specific callback.
@@ -3943,6 +4063,9 @@ class NodeController extends DrupalDefaultEntityController {
parent::attachLoad($nodes, $revision_id);
}
+ /**
+ * Overrides DrupalDefaultEntityController::buildQuery().
+ */
protected function buildQuery($ids, $conditions = array(), $revision_id = FALSE) {
// Ensure that uid is taken from the {node} table,
// alias timestamp to revision_timestamp and add revision_uid.
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 89a1593..769976f 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -2,12 +2,18 @@
/**
* @file
- * Page callbacks for adding, editing, deleting, and revisions management for content.
+ * Callbacks for adding, editing, and deleting content and managing revisions.
+ *
+ * Also includes validation, submission and other helper functions.
+ *
+ * @see node_menu()
*/
/**
- * Menu callback; presents the node editing form.
+ * Presents the node editing form.
+ *
+ * @see node_menu()
*/
function node_page_edit($node) {
$type_name = node_type_get_name($node);
@@ -15,6 +21,11 @@ function node_page_edit($node) {
return drupal_get_form($node->type . '_node_form', $node);
}
+/**
+ * Presents the node add form.
+ *
+ * @see node_menu()
+ */
function node_add_page() {
$item = menu_get_item();
$content = system_admin_menu_block($item);
@@ -33,6 +44,7 @@ function node_add_page() {
* An associative array containing:
* - content: An array of content types.
*
+ * @see node_add_page()
* @ingroup themeable
*/
function theme_node_add_list($variables) {
@@ -55,7 +67,15 @@ function theme_node_add_list($variables) {
/**
- * Returns a node submission form.
+ * Provides the node submission form.
+ *
+ * @param $type
+ * The node type for the submitted node.
+ *
+ * @return
+ * Returns a node submission form.
+ *
+ * @see node_menu()
*/
function node_add($type) {
global $user;
@@ -68,6 +88,14 @@ function node_add($type) {
return $output;
}
+/**
+ * Form validation handler for node_form().
+ *
+ * @see node_form_delete_submit()
+ * @see node_form_build_preview()
+ * @see node_form_submit()
+ * @see node_form_submit_build_node()
+ */
function node_form_validate($form, &$form_state) {
// $form_state['node'] contains the actual entity being edited, but we must
// not update it with form values that have not yet been validated, so we
@@ -78,7 +106,17 @@ function node_form_validate($form, &$form_state) {
}
/**
- * Generate the node add/edit form array.
+ * Form constructor for the node add/edit form.
+ *
+ * @param array $nodes
+ * Array of node nids to update.
+ *
+ * @see node_form_delete_submit()
+ * @see node_form_build_preview()
+ * @see node_form_validate()
+ * @see node_form_submit()
+ * @see node_form_submit_build_node()
+ * @ingroup forms
*/
function node_form($form, &$form_state, $node) {
global $user;
@@ -304,7 +342,12 @@ function node_form($form, &$form_state, $node) {
}
/**
- * Button submit function: handle the 'Delete' button on the node form.
+ * Form submission handler for the 'Delete' button for node_form().
+ *
+ * @see node_form_build_preview()
+ * @see node_form_validate()
+ * @see node_form_submit()
+ * @see node_form_submit_build_node()
*/
function node_form_delete_submit($form, &$form_state) {
$destination = array();
@@ -316,7 +359,14 @@ function node_form_delete_submit($form, &$form_state) {
$form_state['redirect'] = array('node/' . $node->nid . '/delete', array('query' => $destination));
}
-
+/**
+ * Form submission handler for the 'Preview' button for node_form().
+ *
+ * @see node_form_delete_submit()
+ * @see node_form_validate()
+ * @see node_form_submit()
+ * @see node_form_submit_build_node()
+ */
function node_form_build_preview($form, &$form_state) {
$node = node_form_submit_build_node($form, $form_state);
$form_state['node_preview'] = node_preview($node);
@@ -324,7 +374,15 @@ function node_form_build_preview($form, &$form_state) {
}
/**
- * Generate a node preview.
+ * Generates a node preview.
+ *
+ * @param $node
+ * The node to preview.
+ *
+ * @return
+ * Themed node preview.
+ *
+ * @see node_form_build_preview()
*/
function node_preview($node) {
if (node_access('create', $node) || node_access('update', $node)) {
@@ -370,6 +428,7 @@ function node_preview($node) {
* An associative array containing:
* - node: The node object which is being previewed.
*
+ * @see node_preview()
* @ingroup themeable
*/
function theme_node_preview($variables) {
@@ -400,6 +459,14 @@ function theme_node_preview($variables) {
return $output;
}
+/**
+ * Form submission handler that saves the node for node_form().
+ *
+ * @see node_form_delete_submit()
+ * @see node_form_build_preview()
+ * @see node_form_validate()
+ * @see node_form_submit_build_node()
+ */
function node_form_submit($form, &$form_state) {
$node = node_form_submit_build_node($form, $form_state);
$insert = empty($node->nid);
@@ -441,6 +508,10 @@ function node_form_submit($form, &$form_state) {
* before proceeding to the next step.
*
* @see node_form()
+ * @see node_form_delete_submit()
+ * @see node_form_build_preview()
+ * @see node_form_validate()
+ * @see node_form_submit()
*/
function node_form_submit_build_node($form, &$form_state) {
// @todo Legacy support for modules that extend the node form with form-level
@@ -465,7 +536,12 @@ function node_form_submit_build_node($form, &$form_state) {
}
/**
- * Menu callback -- ask for confirmation of node deletion
+ * Form constructor for the node deletion confirmation form.
+ *
+ * @param array $nodes
+ * Array of node nids to update.
+ *
+ * @see node_menu()
*/
function node_delete_confirm($form, &$form_state, $node) {
$form['#node'] = $node;
@@ -481,7 +557,7 @@ function node_delete_confirm($form, &$form_state, $node) {
}
/**
- * Execute node deletion
+ * Form submission handler for node_delete_confirm().
*/
function node_delete_confirm_submit($form, &$form_state) {
if ($form_state['values']['confirm']) {
@@ -495,7 +571,9 @@ function node_delete_confirm_submit($form, &$form_state) {
}
/**
- * Generate an overview table of older revisions of a node.
+ * Generates an overview table of older revisions of a node.
+ *
+ * @see node_menu()
*/
function node_revision_overview($node) {
drupal_set_title(t('Revisions for %title', array('%title' => $node->title)), PASS_THROUGH);
@@ -546,13 +624,21 @@ function node_revision_overview($node) {
}
/**
- * Ask for confirmation of the reversion to prevent against CSRF attacks.
+ * Form constructor for the reversion confirmation form.
+ *
+ * This form prevents against CSRF attacks.
+ *
+ * @see node_menu()
+ * @see node_revision_revert_confirm_submit()
*/
function node_revision_revert_confirm($form, $form_state, $node_revision) {
$form['#node_revision'] = $node_revision;
return confirm_form($form, t('Are you sure you want to revert to the revision from %revision-date?', array('%revision-date' => format_date($node_revision->revision_timestamp))), 'node/' . $node_revision->nid . '/revisions', '', t('Revert'), t('Cancel'));
}
+/**
+ * Form submission handler for node_revision_revert_confirm().
+ */
function node_revision_revert_confirm_submit($form, &$form_state) {
$node_revision = $form['#node_revision'];
$node_revision->revision = 1;
@@ -565,11 +651,22 @@ function node_revision_revert_confirm_submit($form, &$form_state) {
$form_state['redirect'] = 'node/' . $node_revision->nid . '/revisions';
}
+/**
+ * Form constructor for the revision deletion confirmation form.
+ *
+ * This form prevents against CSRF attacks.
+ *
+ * @see node_menu()
+ * @see node_revision_delete_confirm_submit()
+ */
function node_revision_delete_confirm($form, $form_state, $node_revision) {
$form['#node_revision'] = $node_revision;
return confirm_form($form, t('Are you sure you want to delete the revision from %revision-date?', array('%revision-date' => format_date($node_revision->revision_timestamp))), 'node/' . $node_revision->nid . '/revisions', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}
+/**
+ * Form submission handler for node_revision_delete_confirm().
+ */
function node_revision_delete_confirm_submit($form, &$form_state) {
$node_revision = $form['#node_revision'];
node_revision_delete($node_revision->vid);
diff --git a/modules/node/tests/node_access_test.module b/modules/node/tests/node_access_test.module
index 813bf92..80d69ea 100644
--- a/modules/node/tests/node_access_test.module
+++ b/modules/node/tests/node_access_test.module
@@ -73,7 +73,7 @@ function node_access_test_permission() {
/**
* Implements hook_menu().
*
- * Sets up a page that lists nodes.
+ * Sets up a test page that lists nodes.
*/
function node_access_test_menu() {
$items = array();
@@ -93,13 +93,15 @@ function node_access_test_menu() {
}
/**
- * Page callback for node access test page.
+ * Creates the node access test page.
*
* Page should say "No nodes" if there are no nodes, and "Yes, # nodes" (with
* the number filled in) if there were nodes the user could access. Also, the
* database query is shown, and a list of the node IDs, for debugging purposes.
* And if there is a query exception, the page says "Exception" and gives the
* error.
+ *
+ * @see node_access_test_menu()
*/
function node_access_test_page() {
$output = '';
@@ -133,13 +135,15 @@ function node_access_test_page() {
}
/**
- * Page callback for node access entity test page.
+ * Creates the node access entity test page.
*
* Page should say "No nodes" if there are no nodes, and "Yes, # nodes" (with
* the number filled in) if there were nodes the user could access. Also, the
* database query is shown, and a list of the node IDs, for debugging purposes.
* And if there is a query exception, the page says "Exception" and gives the
* error.
+ *
+ * @see node_access_test_menu()
*/
function node_access_entity_test_page() {
$output = '';