=== modified file 'includes/theme.inc'
--- includes/theme.inc 2009-10-14 10:56:35 +0000
+++ includes/theme.inc 2009-10-14 16:57:57 +0000
@@ -1363,6 +1363,29 @@ function theme_status_messages($variable
/**
* Return a themed set of links.
*
+ * This is the "fallback" theme implementation for theming links. For specific
+ * function calls of theme_links(), this can be overridden by registering and
+ * defining more-specific "named" theme implementations. The possible named
+ * theme implementations of theme_links() in core are:
+ * - theme_blog_node_links()
+ * - theme_book_node_links()
+ * - theme_comment_links()
+ * - theme_comment_node_links()
+ * - theme_forum_links()
+ * - theme_locale_block_links()
+ * - theme_node_admin_links()
+ * - theme_node_links()
+ * - theme_poll_results_links()
+ * - theme_statistics_node_links()
+ * - theme_main_menu_links()
+ * - theme_secondary_menu_links()
+ * - theme_toolbar_menu_links()
+ * - theme_toolbar_user_links()
+ * - theme_toolbar_shortcuts_links()
+ * - theme_translation_node_links()
+ * - theme_update_version_links()
+ * - theme_upload_node_links()
+ *
* @param $variables
* An associative array containing:
* - links: A keyed array of links to be themed. The key for each link is used
@@ -1393,6 +1416,25 @@ function theme_status_messages($variable
*
* @return
* A string containing an unordered list of links.
+ *
+ * @see theme_blog_node_links()
+ * @see theme_book_node_links()
+ * @see theme_comment_links()
+ * @see theme_comment_node_links()
+ * @see theme_forum_links()
+ * @see theme_locale_block_links()
+ * @see theme_node_admin_links()
+ * @see theme_node_links()
+ * @see theme_poll_results_links()
+ * @see theme_statistics_node_links
+ * @see theme_main_menu_links()
+ * @see theme_secondary_menu_links()
+ * @see theme_toolbar_menu_links()
+ * @see theme_toolbar_user_links()
+ * @see theme_toolbar_shortcuts_links()
+ * @see theme_translation_node_links()
+ * @see theme_update_version_links()
+ * @see theme_upload_node_links()
*/
function theme_links($variables) {
$links = $variables['links'];
=== added file 'modules/blog/blog.api.php'
--- modules/blog/blog.api.php 1970-01-01 00:00:00 +0000
+++ modules/blog/blog.api.php 2009-10-14 14:00:42 +0000
@@ -0,0 +1 @@
+ array('title' => t("Read !username's latest blog entries.", array('!username' => $node->name))),
);
$node->content['links']['blog'] = array(
- '#theme' => 'links',
+ '#theme' => array('blog_node_links', 'links'),
'#links' => $links,
'#attributes' => array('class' => array('links', 'inline')),
);
=== added file 'modules/book/book.api.php'
--- modules/book/book.api.php 1970-01-01 00:00:00 +0000
+++ modules/book/book.api.php 2009-10-14 14:00:49 +0000
@@ -0,0 +1 @@
+content['links']['book'] = array(
- '#theme' => 'links',
+ '#theme' => array('book_node_links', 'links'),
'#links' => $links,
'#attributes' => array('class' => array('links', 'inline')),
);
=== modified file 'modules/comment/comment.api.php'
--- modules/comment/comment.api.php 2009-10-10 13:37:07 +0000
+++ modules/comment/comment.api.php 2009-10-14 12:37:10 +0000
@@ -3,7 +3,7 @@
/**
* @file
- * Hooks provided by the Comment module.
+ * Hooks and named theme implementations provided by the Comment module.
*/
/**
@@ -111,3 +111,38 @@ function hook_comment_delete($comment) {
/**
* @} End of "addtogroup hooks".
*/
+
+/**
+ * @addtogroup themable
+ * @{
+ */
+
+/**
+ * A named implementation of theme_links() used by comment_build_content().
+ *
+ * If a module or theme registers this theme hook, this named implementation
+ * will be used instead of the fallback theme implementation of theme_links().
+ *
+ * @see theme_links()
+ * @see comment_build_content()
+ */
+function theme_comment_links($variables) {
+ return theme_links($variables);
+}
+
+/**
+ * A named implementation of theme_links() used by comment_node_view().
+ *
+ * If a module or theme registers this theme hook, this named implementation
+ * will be used instead of the fallback theme implementation of theme_links().
+ *
+ * @see theme_links()
+ * @see comment_node_view()
+ */
+function theme_comment_node_links($variables) {
+ return theme_links($variables);
+}
+
+/**
+ * @} End of "addtogroup themable".
+ */
=== modified file 'modules/comment/comment.module'
--- modules/comment/comment.module 2009-10-13 05:17:15 +0000
+++ modules/comment/comment.module 2009-10-14 14:42:29 +0000
@@ -568,7 +568,7 @@ function comment_node_view($node, $build
}
$node->content['links']['comment'] = array(
- '#theme' => 'links',
+ '#theme' => array('comment_node_links', 'links'),
'#links' => $links,
'#attributes' => array('class' => array('links', 'inline')),
);
@@ -848,7 +848,7 @@ function comment_build_content($comment,
if (empty($comment->in_preview)) {
$comment->content['links']['comment'] = array(
- '#theme' => 'links',
+ '#theme' => array('comment_links', 'links'),
'#links' => comment_links($comment, $node),
'#attributes' => array('class' => array('links', 'inline')),
);
=== added file 'modules/forum/forum.api.php'
--- modules/forum/forum.api.php 1970-01-01 00:00:00 +0000
+++ modules/forum/forum.api.php 2009-10-14 14:00:56 +0000
@@ -0,0 +1,29 @@
+
- $links)); ?>
+ $links)); ?>
=== modified file 'modules/locale/locale.api.php'
--- modules/locale/locale.api.php 2009-10-09 16:33:13 +0000
+++ modules/locale/locale.api.php 2009-10-14 12:46:26 +0000
@@ -3,7 +3,7 @@
/**
* @file
- * Hooks provided by the Locale module.
+ * Hooks and named theme implementations provided by the Locale module.
*/
/**
@@ -139,3 +139,25 @@ function hook_language_negotiation_info_
/**
* @} End of "addtogroup hooks".
*/
+
+/**
+ * @addtogroup themable
+ * @{
+ */
+
+/**
+ * A named implementation of theme_links() used by locale_block_view().
+ *
+ * If a module or theme registers this theme hook, this named implementation
+ * will be used instead of the fallback theme implementation of theme_links().
+ *
+ * @see theme_links()
+ * @see locale_block_view()
+ */
+function theme_locale_block_links($variables) {
+ return theme_links($variables);
+}
+
+/**
+ * @} End of "addtogroup themable".
+ */
=== modified file 'modules/locale/locale.module'
--- modules/locale/locale.module 2009-10-13 21:34:14 +0000
+++ modules/locale/locale.module 2009-10-14 14:42:29 +0000
@@ -836,7 +836,7 @@ function locale_block_view($type) {
if (isset($links->links) && count($links->links > 1)) {
$class = "language-switcher-{$links->provider}";
$variables = array('links' => $links->links, 'attributes' => array('class' => array($class)));
- $block['content'] = theme('links', $variables);
+ $block['content'] = theme(array('locale_block_links', 'links'), $variables);
$block['subject'] = t('Languages');
return $block;
}
=== modified file 'modules/node/node.admin.inc'
--- modules/node/node.admin.inc 2009-10-11 03:07:16 +0000
+++ modules/node/node.admin.inc 2009-10-14 14:42:29 +0000
@@ -377,7 +377,7 @@ function node_admin_content($form, $form
// Show the 'add new content' link.
$form['add_content'] = array(
'#access' => _node_add_access(),
- '#markup' => theme('links', array('links' => array(array('title' => t('Add new content'), 'href' => 'node/add')), 'attributes' => array('class' => array('action-links')))),
+ '#markup' => theme(array('node_admin_links', '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';
=== modified file 'modules/node/node.api.php'
--- modules/node/node.api.php 2009-10-10 21:39:01 +0000
+++ modules/node/node.api.php 2009-10-14 14:42:29 +0000
@@ -3,7 +3,7 @@
/**
* @file
- * Hooks provided by the Node module.
+ * Hooks and named theme implementations provided by the Node module.
*/
/**
@@ -977,3 +977,38 @@ function hook_view($node, $build_mode =
/**
* @} End of "addtogroup hooks".
*/
+
+/**
+ * @addtogroup themable
+ * @{
+ */
+
+/**
+ * A named implementation of theme_links() used by node_admin_content().
+ *
+ * If a module or theme registers this theme hook, this named implementation
+ * will be used instead of the fallback theme implementation of theme_links().
+ *
+ * @see theme_links()
+ * @see node_admin_content()
+ */
+function theme_node_admin_links($variables) {
+ return theme_links($variables);
+}
+
+/**
+ * A named implementation of theme_links() used by node_build_content().
+ *
+ * If a module or theme registers this theme hook, this named implementation
+ * will be used instead of the fallback theme implementation of theme_links().
+ *
+ * @see theme_links()
+ * @see node_build_content()
+ */
+function theme_node_links($variables) {
+ return theme_links($variables);
+}
+
+/**
+ * @} End of "addtogroup themable".
+ */
=== modified file 'modules/node/node.module'
--- modules/node/node.module 2009-10-11 03:07:16 +0000
+++ modules/node/node.module 2009-10-14 14:42:29 +0000
@@ -1161,7 +1161,7 @@ function node_build_content($node, $buil
);
}
$node->content['links']['node'] = array(
- '#theme' => 'links',
+ '#theme' => array('node_links', 'links'),
'#links' => $links,
'#attributes' => array('class' => array('links', 'inline')),
);
=== added file 'modules/poll/poll.api.php'
--- modules/poll/poll.api.php 1970-01-01 00:00:00 +0000
+++ modules/poll/poll.api.php 2009-10-14 14:01:08 +0000
@@ -0,0 +1 @@
+ $variables['raw_links']));
+ $variables['links'] = theme(array('poll_results_links', 'links'), array('links' => $variables['raw_links']));
if (isset($variables['vote']) && $variables['vote'] > -1 && user_access('cancel own vote')) {
$variables['cancel_form'] = drupal_render(drupal_get_form('poll_cancel_form', $variables['nid']));
}
=== added file 'modules/statistics/statistics.api.php'
--- modules/statistics/statistics.api.php 1970-01-01 00:00:00 +0000
+++ modules/statistics/statistics.api.php 2009-10-14 14:01:19 +0000
@@ -0,0 +1 @@
+content['links']['statistics'] = array(
- '#theme' => 'links',
+ '#theme' => array('statistics_node_links', 'links'),
'#links' => $links,
'#attributes' => array('class' => array('links', 'inline')),
);
=== modified file 'modules/system/page.tpl.php'
--- modules/system/page.tpl.php 2009-10-11 06:05:53 +0000
+++ modules/system/page.tpl.php 2009-10-14 09:48:30 +0000
@@ -92,7 +92,7 @@
- $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'clearfix')), 'heading' => t('Main menu'))); ?>
+ $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'clearfix')), 'heading' => t('Main menu'))); ?>
@@ -129,7 +129,7 @@
=== modified file 'modules/system/system.api.php'
--- modules/system/system.api.php 2009-10-14 10:56:35 +0000
+++ modules/system/system.api.php 2009-10-14 16:57:57 +0000
@@ -3,7 +3,7 @@
/**
* @file
- * Hooks provided by Drupal core and the System module.
+ * Hooks and named theme implementations provided by Drupal core and the System module.
*/
/**
@@ -2509,3 +2509,38 @@ function hook_date_formats_alter(&$forma
/**
* @} End of "addtogroup hooks".
*/
+
+/**
+ * @addtogroup themable
+ * @{
+ */
+
+/**
+ * A named implementation of theme_links() used by page.tpl.php.
+ *
+ * If a module or theme registers this theme hook, this named implementation
+ * will be used instead of the fallback theme implementation of theme_links().
+ *
+ * @see theme_links()
+ * @see page.tpl.php
+ */
+function theme_main_menu_links($variables) {
+ return theme_links($variables);
+}
+
+/**
+ * A named implementation of theme_links() used by page.tpl.php.
+ *
+ * If a module or theme registers this theme hook, this named implementation
+ * will be used instead of the fallback theme implementation of theme_links().
+ *
+ * @see theme_links()
+ * @see page.tpl.php
+ */
+function theme_secondary_menu_links($variables) {
+ return theme_links($variables);
+}
+
+/**
+ * @} End of "addtogroup themable".
+ */
=== added file 'modules/toolbar/toolbar.api.php'
--- modules/toolbar/toolbar.api.php 1970-01-01 00:00:00 +0000
+++ modules/toolbar/toolbar.api.php 2009-10-14 14:01:38 +0000
@@ -0,0 +1 @@
+ 'links',
+ '#theme' => array('toolbar_menu_links', 'links'),
'#links' => $links,
'#attributes' => array('id' => 'toolbar-menu'),
);
// Add logout & user account links
$build['toolbar_user'] = array(
- '#theme' => 'links',
+ '#theme' => array('toolbar_user_links', 'links'),
'#links' => array(
'account' => array(
'title' => t('Hello @username', array('@username' => $user->name)),
@@ -105,7 +105,7 @@ function toolbar_build() {
$shortcuts = menu_tree_all_data('admin_shortcuts');
$shortcuts = toolbar_menu_navigation_links($shortcuts);
$build['toolbar_shortcuts'] = array(
- '#theme' => 'links',
+ '#theme' => array('toolbar_shortcuts_links', 'links'),
'#links' => $shortcuts,
'#attributes' => array('id' => 'toolbar-shortcuts'),
);
=== added file 'modules/translation/translation.api.php'
--- modules/translation/translation.api.php 1970-01-01 00:00:00 +0000
+++ modules/translation/translation.api.php 2009-10-14 14:01:45 +0000
@@ -0,0 +1 @@
+language]);
$node->content['links']['translation'] = array(
- '#theme' => 'links',
+ '#theme' => array('translation_node_links', 'links'),
'#links' => $links,
'#attributes' => array('class' => array('links', 'inline')),
);
=== modified file 'modules/update/update.api.php'
--- modules/update/update.api.php 2009-08-22 14:34:17 +0000
+++ modules/update/update.api.php 2009-10-14 13:15:32 +0000
@@ -3,7 +3,7 @@
/**
* @file
- * Hooks provided by the Update Status module.
+ * Hooks and named theme implementations provided by the Update Status module.
*/
/**
@@ -107,3 +107,25 @@ function hook_update_status_alter(&$proj
/**
* @} End of "addtogroup hooks".
*/
+
+/**
+ * @addtogroup themable
+ * @{
+ */
+
+/**
+ * A named implementation of theme_links() used by theme_update_version().
+ *
+ * If a module or theme registers this theme hook, this named implementation
+ * will be used instead of the fallback theme implementation of theme_links().
+ *
+ * @see theme_links()
+ * @see theme_update_version()
+ */
+function theme_update_version_links($variables) {
+ return theme_links($variables);
+}
+
+/**
+ * @} End of "addtogroup themable".
+ */
=== modified file 'modules/update/update.report.inc'
--- modules/update/update.report.inc 2009-10-13 02:14:05 +0000
+++ modules/update/update.report.inc 2009-10-14 14:42:29 +0000
@@ -302,7 +302,7 @@ function theme_update_version($variables
'title' => t('Release notes'),
'href' => $version['release_link'],
);
- $output .= theme('links', array('links' => $links));
+ $output .= theme(array('update_version_links', 'links'), array('links' => $links));
$output .= '';
$output .= '';
$output .= "\n";
=== added file 'modules/upload/upload.api.php'
--- modules/upload/upload.api.php 1970-01-01 00:00:00 +0000
+++ modules/upload/upload.api.php 2009-10-14 14:01:57 +0000
@@ -0,0 +1 @@
+ 'attachments'
);
$node->content['links']['upload_attachments'] = array(
- '#theme' => 'links',
+ '#theme' => array('upload_node_links', 'links'),
'#links' => $links,
'#attributes' => array('class' => array('links', 'inline')),
);
=== modified file 'themes/garland/template.php'
--- themes/garland/template.php 2009-10-09 00:59:53 +0000
+++ themes/garland/template.php 2009-10-14 09:50:32 +0000
@@ -38,7 +38,7 @@ function garland_process_html(&$vars) {
function garland_preprocess_page(&$vars) {
$vars['tabs2'] = menu_secondary_local_tasks();
if (isset($vars['main_menu'])) {
- $vars['primary_nav'] = theme('links', array(
+ $vars['primary_nav'] = theme(array('main_menu_links', 'links'), array(
'links' => $vars['main_menu'],
'attributes' => array(
'class' => array('links', 'main-menu'),
@@ -54,7 +54,7 @@ function garland_preprocess_page(&$vars)
$vars['primary_nav'] = FALSE;
}
if (isset($vars['secondary_menu'])) {
- $vars['secondary_nav'] = theme('links', array(
+ $vars['secondary_nav'] = theme(array('secondary_menu_links', 'links'), array(
'links' => $vars['secondary_menu'],
'attributes' => array(
'class' => array('links', 'secondary-menu'),