Package base :: Package plugins :: Package node
[hide private]

Package node

source code

The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.
See Also:
Drupy Homepage, Drupal Homepage
Notes:

Author: Brendon Crawford

Copyright: 2008 Brendon Crawford

Contact: message144 at users dot sourceforge dot net

Version: 0.1

Functions [hide private]
 
hook_help(path, arg)
Implementation of hook_help().
source code
 
hook_theme()
Implementation of hook_theme().
source code
 
hook_cron()
Implementation of hook_cron().
source code
 
title_list(result, title=None)
Gather a listing of links to nodes.
source code
 
theme_list(items, title=None)
Format a listing of links to nodes.
source code
 
tag_new(nid)
Update the 'last viewed' timestamp of the specified node for current user.
source code
 
last_viewed(nid)
Retrieves the timestamp at which the current user last viewed the specified node.
source code
 
mark(nid, timestamp)
Decide on the type of marker to be displayed for a given node.
source code
 
teaser_js(form, form_state)
See if the user used JS to submit a teaser.
source code
 
teaser_include_verify(form, form_state)
Ensure value of "teaser_include" checkbox is consistent with other form data.
source code
 
teaser(body, format=None, size=None)
Generate a teaser for a node body.
source code
 
get_types(op='types', node=None, reset=False)
Builds a list of available node types, and returns all of part of this list in the specified format.
source code
 
types_rebuild()
Resets the database cache of node types, and saves all new or non-modified module-defined node types to the database.
source code
 
type_save(info)
Saves a node type to the database.
source code
 
type_delete(type_)
Deletes a node type from the database.
source code
 
type_update_nodes(old_type, type_)
Updates all nodes of one type to be of another type.
source code
 
_types_build()
Builds and returns the list of available node types.
source code
 
_type_set_defaults(info)
Set default values for a node type defined through hook_node_info().
source code
 
hook(node, hook_)
Determine whether a node hook exists.
source code
 
invoke(node, hook_, a2=None, a3=None, a4=None)
Invoke a node hook.
source code
 
invoke_nodeapi(node, op, a3=None, a4=None)
Invoke a hook_nodeapi() operation in all modules.
source code
 
load(param=[], revision=None, reset=None) source code
 
validate(node, form=[])
Perform validation checks on the given node.
source code
 
submit(node)
Prepare node for save and allow modules to make changes.
source code
 
save(node)
Save a node object into the database.
source code
 
_save_revision(node, uid, update=None)
Helper function to save a revision with the uid of the current user.
source code
 
delete(nid)
Delete a node.
source code
 
view(node, teaser=False, page=False, links=True)
Generate a display of the given node.
source code
 
prepare(node, teaser=False)
Apply filters and build the node's standard elements.
source code
 
build_content(node, teaser=False, page=False)
Builds a structured array representing the node's content.
source code
 
show(node, cid, message=False)
Generate a page displaying a single node, along with its comments.
source code
 
theme_log_message(log) source code
 
hook_perm()
Implementation of hook_perm().
source code
 
_rankings()
Gather the rankings from the the hook_ranking implementations.
source code
 
hook_search(op='search', keys=None)
Implementation of hook_search().
source code
 
hook_ranking()
Implementation of hook_ranking().
source code
 
hook_user(op, edit, user)
Implementation of hook_user().
source code
 
theme_search_admin(form)
Theme the content ranking part of the search settings admin page.
source code
 
comment_mode(nid)
Retrieve the comment mode for the given node ID (none, read, or read/write).
source code
 
hook_link(type_, node=None, teaser=False)
Implementation of hook_link().
source code
 
_revision_access(node, op='view') source code
 
_add_access() source code
 
hook_menu()
Implementation of hook_menu().
source code
 
page_title(node)
Title callback.
source code
 
hook_init()
Implementation of hook_init().
source code
 
last_changed(nid) source code
 
revision_list(node)
Return a list of all the existing revision numbers.
source code
 
hook_block(op='list', delta='')
Implementation of hook_block().
source code
 
feed(nids=False, channel=[])
A generic function for generating RSS feeds from a set of nodes.
source code
 
page_default()
Menu callback; Generate a listing of promoted nodes.
source code
 
page_view(node, cid=None)
Menu callback; view a single node.
source code
 
hook_update_index()
Implementation of hook_update_index().
source code
 
_index_node(node)
Index a single node.
source code
 
hook_form_alter(form, form_state, form_id)
Implementation of hook_form_alter().
source code
 
search_validate(form, form_state)
Form API callback for the search form.
source code
 
access(op, node, account=None)
Returns: True if the operation may be performed.
source code
 
_access_join_sql(node_alias='n', node_access_alias='na')
Generate an SQL join clause for use in fetching a node listing.
source code
 
_access_where_sql(op='view', node_access_alias='na', account=None)
Generate an SQL where clause for use in fetching a node listing.
source code
 
access_grants(op, account=None)
Fetch an array of permission IDs granted to the given user ID.
source code
 
access_view_all_nodes()
Determine whether the user has a global viewing grant for all nodes.
source code
 
hook_db_rewrite_sql(query, primary_table, primary_field)
Implementation of hook_db_rewrite_sql().
source code
 
access_acquire_grants(node)
This function will call module invoke to get a list of grants and then write them to the database.
source code
 
access_write_grants(node, grants, realm=None, delete=True)
This function will write a list of grants to the database, deleting any pre-existing grants.
source code
 
access_needs_rebuild(rebuild=None)
Flag / unflag the node access grants for rebuilding, or read the current value of the flag.
source code
 
access_rebuild(batch_mode=False)
Rebuild the node access database.
source code
 
_access_rebuild_batch_operation(context)
Batch operation for node_access_rebuild_batch.
source code
 
_access_rebuild_batch_finished(success, results, operations)
Post-processing for node_access_rebuild_batch.
source code
 
hook_content_access(op, node, account) source code
 
hook_content_form(node, form_state)
Implementation of hook_form().
source code
 
hook_forms()
Implementation of hook_forms().
source code
 
theme_submitted(node)
Format the "Submitted by username on date/time" for each node
source code
 
hook_hook_info()
Implementation of hook_hook_info().
source code
 
hook_action_info()
Implementation of hook_action_info().
source code
 
publish_action(node, context=[])
Implementation of a Drupal action.
source code
 
node_unpublish_action(node, context=[])
Implementation of a Drupal action.
source code
 
make_sticky_action(node, context=[])
Implementation of a Drupal action.
source code
 
make_unsticky_action(node, context=[])
Implementation of a Drupal action.
source code
 
promote_action(node, context=[])
Implementation of a Drupal action.
source code
 
unpromote_action(node, context=[])
Implementation of a Drupal action.
source code
 
save_action(node)
Implementation of a Drupal action.
source code
 
assign_owner_action(node, context)
Implementation of a configurable Drupal action.
source code
 
assign_owner_action_form(context) source code
 
assign_owner_action_validate(form, form_state) source code
 
assign_owner_action_submit(form, form_state) source code
 
unpublish_by_keyword_action_form(context) source code
 
unpublish_by_keyword_action_submit(form, form_state) source code
 
unpublish_by_keyword_action(node, context)
Implementation of a configurable Drupal action.
source code
 
list_permissions(type_)
Helper function to generate standard node permission list for a given type.
source code
Variables [hide private]
  __version__ = '$Revision: 1 $'
  NODE_NEW_LIMIT = 1219287516.52
  NODE_BUILD_NORMAL = 0
  NODE_BUILD_PREVIEW = 1
  NODE_BUILD_SEARCH_INDEX = 2
  NODE_BUILD_SEARCH_RESULT = 3
  NODE_BUILD_RSS = 4
  NODE_BUILD_PRINT = 5
Function Details [hide private]

title_list(result, title=None)

source code 
Gather a listing of links to nodes.
Parameters:
  • result - A DB result object from a query to fetch node objects. If your query joins the node_comment_statistics table so that the comment_count field is available, a title attribute will be added to show the number of comments.
  • title - A heading for the resulting list.
Returns:
An HTML list suitable as content for a block, or False if no result can fetch from DB result object.

mark(nid, timestamp)

source code 
Decide on the type of marker to be displayed for a given node.
Parameters:
  • nid - Node ID whose history supplies the "last viewed" timestamp.
  • timestamp - Time which is compared against node's "last viewed" timestamp.
Returns:
One of the MARK constants.

teaser_include_verify(form, form_state)

source code 
Ensure value of "teaser_include" checkbox is consistent with other form data. This handles two situations in which an unchecked checkbox is rejected: 1. The user defines a teaser (summary) but it is empty 2. The user does not define a teaser (summary) (in this case an unchecked checkbox would cause the body to be empty, or missing the auto-generated teaser). If JavaScript is active then it is used to force the checkbox to be checked when hidden, and so the second case will not arise. In either case a warning message is output.

teaser(body, format=None, size=None)

source code 
Generate a teaser for a node body. If the end of the teaser is not indicated using the