summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/content_types.inc9
-rw-r--r--modules/node/node.admin.inc18
-rw-r--r--modules/node/node.module26
-rw-r--r--modules/node/node.pages.inc26
4 files changed, 47 insertions, 32 deletions
diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc
index ccbd5fe07..4634d62e5 100644
--- a/modules/node/content_types.inc
+++ b/modules/node/content_types.inc
@@ -16,10 +16,10 @@ function node_overview_types() {
$rows = array();
foreach ($names as $key => $name) {
- $type = $types[$key];
+ $type = $types[$key];
if (node_hook($type->type, 'form')) {
$type_url_str = str_replace('_', '-', $type->type);
- $row = array(theme('node_admin_overview', $name, $type));
+ $row = array(theme('node_admin_overview', array('name' => $name, 'type' => $type)));
// Set the edit column.
$row[] = array('data' => l(t('edit'), 'admin/structure/types/manage/' . $type_url_str));
@@ -47,7 +47,10 @@ function node_overview_types() {
return $build;
}
-function theme_node_admin_overview($name, $type) {
+function theme_node_admin_overview($variables) {
+ $name = $variables['name'];
+ $type = $variables['type'];
+
$output = check_plain($name);
$output .= ' <small> (Machine name: ' . check_plain($type->type) . ')</small>';
$output .= '<div class="description">' . filter_xss_admin($type->description) . '</div>';
diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc
index 618f0b25c..2fd2a54a5 100644
--- a/modules/node/node.admin.inc
+++ b/modules/node/node.admin.inc
@@ -192,8 +192,10 @@ function node_filter_form() {
*
* @ingroup themeable
*/
-function theme_node_filter_form($form) {
+function theme_node_filter_form($variables) {
+ $form = $variables['form'];
$output = '';
+
$output .= '<div id="node-admin-filter">';
$output .= drupal_render($form['filters']);
$output .= '</div>';
@@ -206,8 +208,10 @@ function theme_node_filter_form($form) {
*
* @ingroup themeable
*/
-function theme_node_filters($form) {
+function theme_node_filters($variables) {
+ $form = $variables['form'];
$output = '';
+
$output .= '<ul class="clearfix">';
if (!empty($form['current'])) {
foreach (element_children($form['current']) as $key) {
@@ -358,7 +362,7 @@ function _node_mass_update_batch_finished($success, $results, $operations) {
else {
drupal_set_message(t('An error occurred and processing did not complete.'), 'error');
$message = format_plural(count($results), '1 item successfully processed:', '@count items successfully processed:');
- $message .= theme('item_list', $results);
+ $message .= theme('item_list', array('items' => $results));
drupal_set_message($message);
}
}
@@ -373,7 +377,7 @@ function node_admin_content($form, $form_state) {
// Show the 'add new content' link.
$form['add_content'] = array(
'#access' => _node_add_access(),
- '#markup' => theme('links', array(array('title' => t('Add new content'), 'href' => 'node/add')), array('class' => array('action-links'))),
+ '#markup' => theme('links', array('links' => array(array('title' => t('Add new content'), 'href' => 'node/add')), 'attributes' => array('class' => array('action-links')))),
);
$form[] = node_filter_form();
$form['#submit'][] = 'node_filter_form_submit';
@@ -443,9 +447,9 @@ function node_admin_nodes() {
foreach ($result as $node) {
$l_options = empty($node->language) ? array() : array('language' => $languages[$node->language]);
$options[$node->nid] = array(
- 'title' => l($node->title, 'node/' . $node->nid, $l_options) . ' ' . theme('mark', node_mark($node->nid, $node->changed)),
+ 'title' => l($node->title, 'node/' . $node->nid, $l_options) . ' ' . theme('mark', array('type' => node_mark($node->nid, $node->changed))),
'type' => check_plain(node_type_get_name($node)),
- 'author' => theme('username', $node),
+ 'author' => theme('username', array('account' => $node)),
'status' => $node->status ? t('published') : t('not published'),
'changed' => format_date($node->changed, 'short'),
);
@@ -460,7 +464,7 @@ function node_admin_nodes() {
'#options' => $options,
'#empty' => t('No content available.'),
);
- $form['pager'] = array('#markup' => theme('pager', NULL));
+ $form['pager'] = array('#markup' => theme('pager', array('tags' => NULL)));
return $form;
}
diff --git a/modules/node/node.module b/modules/node/node.module
index 2933e7599..adec8fc2c 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -270,7 +270,7 @@ function node_title_list($result, $title = NULL) {
$num_rows = TRUE;
}
- return $num_rows ? theme('node_list', $items, $title) : FALSE;
+ return $num_rows ? theme('node_list', array('items' => $items, 'title' => $title)) : FALSE;
}
/**
@@ -278,8 +278,8 @@ function node_title_list($result, $title = NULL) {
*
* @ingroup themeable
*/
-function theme_node_list($items, $title = NULL) {
- return theme('item_list', $items, $title);
+function theme_node_list($variables) {
+ return theme('item_list', $variables);
}
/**
@@ -1162,7 +1162,7 @@ function template_preprocess_node(&$variables) {
$node = $variables['node'];
$variables['date'] = format_date($node->created);
- $variables['name'] = theme('username', $node);
+ $variables['name'] = theme('username', array('account' => $node));
$variables['node_url'] = url('node/' . $node->nid);
$variables['title'] = check_plain($node->title);
$variables['page'] = (bool)menu_get_object();
@@ -1185,7 +1185,7 @@ function template_preprocess_node(&$variables) {
// Display post information only on certain node types.
if (variable_get('node_submitted_' . $node->type, TRUE)) {
$variables['display_submitted'] = TRUE;
- $variables['user_picture'] = theme_get_setting('toggle_node_user_picture') ? theme('user_picture', $node) : '';
+ $variables['user_picture'] = theme_get_setting('toggle_node_user_picture') ? theme('user_picture', array('account' => $node)) : '';
}
else {
$variables['display_submitted'] = FALSE;
@@ -1220,8 +1220,8 @@ function template_preprocess_node(&$variables) {
*
* @ingroup themeable
*/
-function theme_node_log_message($log) {
- return '<div class="log"><div class="title">' . t('Log') . ':</div>' . $log . '</div>';
+function theme_node_log_message($variables) {
+ return '<div class="log"><div class="title">' . t('Log') . ':</div>' . $variables['log'] . '</div>';
}
/**
@@ -1411,7 +1411,7 @@ function node_search_execute($keys = NULL) {
'link' => url('node/' . $item->sid, array('absolute' => TRUE)),
'type' => check_plain(node_type_get_name($node)),
'title' => $node->title,
- 'user' => theme('username', $node),
+ 'user' => theme('username', array('account' => $node)),
'date' => $node->changed,
'node' => $node,
'extra' => $extra,
@@ -1520,7 +1520,9 @@ function node_user_cancel($edit, $account, $method) {
*
* @ingroup themeable
*/
-function theme_node_search_admin($form) {
+function theme_node_search_admin($variables) {
+ $form = $variables['form'];
+
$output = drupal_render($form['info']);
$header = array(t('Factor'), t('Weight'));
@@ -1531,7 +1533,7 @@ function theme_node_search_admin($form) {
$row[] = drupal_render($form['factors'][$key]);
$rows[] = $row;
}
- $output .= theme('table', $header, $rows);
+ $output .= theme('table', array('header' => $header, 'rows' => $rows));
$output .= drupal_render_children($form);
return $output;
@@ -1819,7 +1821,7 @@ function node_block_info() {
*/
function node_block_view($delta = '') {
$block['subject'] = t('Syndicate');
- $block['content'] = theme('feed_icon', url('rss.xml'), t('Syndicate'));
+ $block['content'] = theme('feed_icon', array('url' => url('rss.xml'), 'title' => t('Syndicate')));
return $block;
}
@@ -1967,7 +1969,7 @@ function node_page_default() {
$default_links[] = l(t('Change the default front page'), 'admin/config/system/site-information');
}
if (!empty($default_links)) {
- $default_message .= theme('item_list', $default_links);
+ $default_message .= theme('item_list', array('items' => $default_links));
}
$build['default_message'] = array(
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 82b6c9628..bd59747df 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -24,7 +24,7 @@ function node_add_page() {
$item = array_shift($content);
drupal_goto($item['href']);
}
- return theme('node_add_list', $content);
+ return theme('node_add_list', array('content' => $content));
}
/**
@@ -32,7 +32,8 @@ function node_add_page() {
*
* @ingroup themeable
*/
-function theme_node_add_list($content) {
+function theme_node_add_list($variables) {
+ $content = $variables['content'];
$output = '';
if ($content) {
@@ -318,7 +319,9 @@ function node_form_build_preview($form, &$form_state) {
*
* @ingroup themeable
*/
-function theme_node_form($form) {
+function theme_node_form($variables) {
+ $form = $variables['form'];
+
$output = "\n<div class=\"node-form\">\n";
$output .= " <div class=\"standard\">\n";
@@ -361,7 +364,7 @@ function node_preview($node) {
if (!form_get_errors()) {
$cloned_node = clone $node;
$cloned_node->in_preview = TRUE;
- $output = theme('node_preview', $cloned_node);
+ $output = theme('node_preview', array('node' => $cloned_node));
}
drupal_set_title(t('Preview'), PASS_THROUGH);
@@ -372,12 +375,15 @@ function node_preview($node) {
/**
* Display a node preview for display during node creation and editing.
*
- * @param $node
- * The node object which is being previewed.
+ * @param $variables
+ * An associative array containing:
+ * - node: The node object which is being previewed.
*
* @ingroup themeable
*/
-function theme_node_preview($node) {
+function theme_node_preview($variables) {
+ $node = $variables['node'];
+
$output = '<div class="preview">';
$preview_trimmed_version = FALSE;
@@ -504,13 +510,13 @@ function node_revision_overview($node) {
$operations = array();
if ($revision->current_vid > 0) {
- $row[] = array('data' => t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'short'), "node/$node->nid"), '!username' => theme('username', $revision)))
+ $row[] = array('data' => t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'short'), "node/$node->nid"), '!username' => theme('username', array('account' => $revision))))
. (($revision->log != '') ? '<p class="revision-log">' . filter_xss($revision->log) . '</p>' : ''),
'class' => array('revision-current'));
- $operations[] = array('data' => theme('placeholder', t('current revision')), 'class' => array('revision-current'), 'colspan' => 2);
+ $operations[] = array('data' => theme('placeholder', array('text' => t('current revision'))), 'class' => array('revision-current'), 'colspan' => 2);
}
else {
- $row[] = t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'short'), "node/$node->nid/revisions/$revision->vid/view"), '!username' => theme('username', $revision)))
+ $row[] = t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'short'), "node/$node->nid/revisions/$revision->vid/view"), '!username' => theme('username', array('account' => $revision))))
. (($revision->log != '') ? '<p class="revision-log">' . filter_xss($revision->log) . '</p>' : '');
if ($revert_permission) {
$operations[] = l(t('revert'), "node/$node->nid/revisions/$revision->vid/revert");