diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index 047026a..d13bee8 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -405,7 +405,7 @@ function aggregator_block_view($delta = '') { switch ($type) { case 'feed': if ($feed = db_query('SELECT fid, title, block FROM {aggregator_feed} WHERE block <> 0 AND fid = :fid', array(':fid' => $id))->fetchObject()) { - $block['subject'] = check_plain($feed->title); + $block['default_title'] = check_plain($feed->title); $result = db_query_range("SELECT * FROM {aggregator_item} WHERE fid = :fid ORDER BY timestamp DESC, iid DESC", 0, $feed->block, array(':fid' => $id)); $read_more = theme('more_link', array('url' => 'aggregator/sources/' . $feed->fid, 'title' => t("View this feed's recent news."))); } @@ -413,7 +413,7 @@ function aggregator_block_view($delta = '') { case 'category': if ($category = db_query('SELECT cid, title, block FROM {aggregator_category} WHERE cid = :cid', array(':cid' => $id))->fetchObject()) { - $block['subject'] = check_plain($category->title); + $block['default_title'] = check_plain($category->title); $result = db_query_range('SELECT i.* FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON ci.iid = i.iid WHERE ci.cid = :cid ORDER BY i.timestamp DESC, i.iid DESC', 0, $category->block, array(':cid' => $category->cid)); $read_more = theme('more_link', array('url' => 'aggregator/categories/' . $category->cid, 'title' => t("View this category's recent news."))); } diff --git a/core/modules/block/block.admin.inc b/core/modules/block/block.admin.inc index cc4bd71..c030d99 100644 --- a/core/modules/block/block.admin.inc +++ b/core/modules/block/block.admin.inc @@ -276,7 +276,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) { '#value' => $block->delta, ); - // Get the block subject for the page title. + // Get the block default_title for the page title. $info = module_invoke($block->module, 'block_info'); if (isset($info[$block->delta])) { drupal_set_title(t("'%name' block", array('%name' => $info[$block->delta]['info'])), PASS_THROUGH); diff --git a/core/modules/block/block.api.php b/core/modules/block/block.api.php index b734685..dee2b15 100644 --- a/core/modules/block/block.api.php +++ b/core/modules/block/block.api.php @@ -203,8 +203,8 @@ function hook_block_save($delta = '', $edit = array()) { * * @return * An array containing the following elements: - * - subject: The default localized title of the block. If the block does not - * have a default title, this should be set to NULL. + * - default_title: The default localized title of the block. If the block + * does not have a default title, this should be set to NULL. * - content: The content of the block's body. This may be a renderable array * (preferable) or a string containing rendered HTML content. * @@ -220,7 +220,7 @@ function hook_block_view($delta = '') { switch ($delta) { case 'syndicate': - $block['subject'] = t('Syndicate'); + $block['default_title'] = t('Syndicate'); $block['content'] = array( '#theme' => 'feed_icon', '#url' => 'rss.xml', @@ -230,7 +230,7 @@ function hook_block_view($delta = '') { case 'recent': if (user_access('access content')) { - $block['subject'] = t('Recent content'); + $block['default_title'] = t('Recent content'); if ($nodes = node_get_recent(variable_get('node_recent_block_count', 10))) { $block['content'] = array( '#theme' => 'node_recent_block', @@ -291,7 +291,7 @@ function hook_block_view_alter(&$data, $block) { * @param $data * An array of data, as returned from the hook_block_view() implementation of * the module that defined the block: - * - subject: The localized title of the block. + * - default_title: The localized title of the block. * - content: Either a string or a renderable array representing the content * of the block. You should check that the content is an array before trying * to modify parts of the renderable structure. @@ -311,7 +311,7 @@ function hook_block_view_MODULE_DELTA_alter(&$data, $block) { // Change the title of the "somedelta" block provided by the "mymodule" // module. - $data['subject'] = t('New title of the block'); + $data['default_title'] = t('New title of the block'); } /** diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 0626c08..640b614 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -253,7 +253,7 @@ function block_block_save($delta = 0, $edit = array()) { */ function block_block_view($delta = '') { $block = db_query('SELECT body, format FROM {block_custom} WHERE bid = :bid', array(':bid' => $delta))->fetchObject(); - $data['subject'] = NULL; + $data['default_title'] = NULL; $data['content'] = check_markup($block->body, $block->format, '', TRUE); return $data; } @@ -759,7 +759,7 @@ function _block_load_blocks() { global $theme_key; $query = db_select('block', 'b'); - $query->addField('b', 'title', 'subject'); + $query->addField('b', 'title', 'default_title'); $result = $query ->fields('b') ->condition('b.theme', $theme_key) @@ -936,7 +936,7 @@ function _block_get_renderable_block($element) { if ($block->title) { // Check plain here to allow module generated titles to keep any // markup. - $block->subject = $block->title == '' ? '' : check_plain($block->title); + $block->default_title = $block->title == '' ? '' : check_plain($block->title); } // Add the content renderable array to the main element. diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php index 1b598e3..0fee7bd 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -103,7 +103,7 @@ function testCustomBlock() { // Check that block_block_view() returns the correct title and content. $data = block_block_view($bid); $format = db_query("SELECT format FROM {block_custom} WHERE bid = :bid", array(':bid' => $bid))->fetchField(); - $this->assertTrue(array_key_exists('subject', $data) && empty($data['subject']), 'block_block_view() provides an empty block subject, since custom blocks do not have default titles.'); + $this->assertTrue(array_key_exists('default_title', $data) && empty($data['default_title']), t('block_block_view() provides an empty block default_title, since custom blocks do not have default titles.')); $this->assertEqual(check_markup($custom_block['body[value]'], $format), $data['content'], 'block_block_view() provides correct block content.'); // Check whether the block can be moved to all available regions. diff --git a/core/modules/block/templates/block.tpl.php b/core/modules/block/templates/block.tpl.php index 895b49f..e12757a 100644 --- a/core/modules/block/templates/block.tpl.php +++ b/core/modules/block/templates/block.tpl.php @@ -5,7 +5,7 @@ * Default theme implementation to display a block. * * Available variables: - * - $block->subject: Block title. + * - $block->default_title: Block title. * - $content: Block content. * - $block->module: Module that generated the block. * - $block->delta: An ID for the block, unique within each module. @@ -44,8 +44,8 @@
> -subject): ?> - >subject ?> +default_title): ?> + >default_title ?> diff --git a/core/modules/book/book.module b/core/modules/book/book.module index fd4fac9..120bfcf 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -286,7 +286,7 @@ function book_block_view($delta = '') { } if (config('book.settings')->get('block.navigation.mode') == 'all pages') { - $block['subject'] = t('Book navigation'); + $block['default_title'] = t('Book navigation'); $book_menus = array(); $pseudo_tree = array(0 => array('below' => FALSE)); foreach (book_get_books() as $book_id => $book) { @@ -322,7 +322,7 @@ function book_block_view($delta = '') { $tree = menu_tree_all_data($node->book['menu_name'], $node->book); // There should only be one element at the top level. $data = array_shift($tree); - $block['subject'] = theme('book_title_link', array('link' => $data['link'])); + $block['default_title'] = theme('book_title_link', array('link' => $data['link'])); $block['content'] = ($data['below']) ? menu_tree_output($data['below']) : ''; } } diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 27ff7c3..9101db3 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -479,7 +479,7 @@ function comment_block_save($delta = '', $edit = array()) { */ function comment_block_view($delta = '') { if (user_access('access comments')) { - $block['subject'] = t('Recent comments'); + $block['default_title'] = t('Recent comments'); $block['content'] = theme('comment_block'); return $block; diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index f365491..9b9d146 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -703,7 +703,7 @@ function forum_block_view($delta = '') { break; } - $block['subject'] = $title; + $block['default_title'] = $title; // Cache based on the altered query. Enables us to cache with node access enabled. $block['content'] = drupal_render_cache_by_query($query, 'forum_block_view'); $block['content']['#access'] = user_access('access content'); diff --git a/core/modules/language/language.module b/core/modules/language/language.module index 5b62382..8f691df 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -541,7 +541,7 @@ function language_block_view($type) { $class = "language-switcher-{$links->method_id}"; $variables = array('links' => $links->links, 'attributes' => array('class' => array($class))); $block['content'] = theme('links__language_block', $variables); - $block['subject'] = t('Languages'); + $block['default_title'] = t('Languages'); return $block; } } diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 2dd1b57..d86f79e 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -2154,7 +2154,7 @@ function node_block_view($delta = '') { switch ($delta) { case 'syndicate': - $block['subject'] = t('Syndicate'); + $block['default_title'] = t('Syndicate'); $block['content'] = array( '#theme' => 'feed_icon', '#url' => 'rss.xml', @@ -2164,7 +2164,7 @@ function node_block_view($delta = '') { case 'recent': if (user_access('access content')) { - $block['subject'] = t('Recent content'); + $block['default_title'] = t('Recent content'); if ($nodes = node_get_recent(variable_get('node_recent_block_count', 10))) { $block['content'] = array( '#theme' => 'node_recent_block', diff --git a/core/modules/poll/poll.module b/core/modules/poll/poll.module index c85f121..c971984 100644 --- a/core/modules/poll/poll.module +++ b/core/modules/poll/poll.module @@ -151,7 +151,7 @@ function poll_block_view($delta = '') { $poll = node_load($record->nid); if ($poll->nid) { $poll = poll_block_latest_poll_view($poll); - $block['subject'] = t('Poll'); + $block['default_title'] = t('Poll'); $block['content'] = $poll->content; return $block; } diff --git a/core/modules/search/search.module b/core/modules/search/search.module index 315ae7a..87a783f 100644 --- a/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -149,7 +149,7 @@ function search_block_info() { */ function search_block_view($delta = '') { if (user_access('search content')) { - $block['subject'] = t('Search'); + $block['default_title'] = t('Search'); $block['content'] = drupal_get_form('search_block_form'); return $block; } diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module index 8469e52..dcba63f 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -370,7 +370,7 @@ function statistics_block_view($delta = '') { if (count($content)) { $block['content'] = $content; - $block['subject'] = t('Popular content'); + $block['default_title'] = t('Popular content'); return $block; } } diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 4524a49..db43cda 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -2510,22 +2510,22 @@ function system_block_view($delta = '') { $block = array(); switch ($delta) { case 'main': - $block['subject'] = NULL; + $block['default_title'] = NULL; $block['content'] = drupal_set_page_content(); return $block; case 'powered-by': - $block['subject'] = NULL; + $block['default_title'] = NULL; $block['content'] = theme('system_powered_by'); return $block; case 'help': - $block['subject'] = NULL; + $block['default_title'] = NULL; $block['content'] = menu_get_active_help(); return $block; default: // All system menu blocks. $system_menus = menu_list_system_menus(); if (isset($system_menus[$delta])) { - $block['subject'] = t($system_menus[$delta]); + $block['default_title'] = t($system_menus[$delta]); $block['content'] = menu_tree($delta); return $block; } diff --git a/core/modules/user/user.module b/core/modules/user/user.module index e42002b..8fb09f1 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -841,7 +841,7 @@ function user_block_view($delta = '') { // For usability's sake, avoid showing two login forms on one page. if (!$user->uid && !(arg(0) == 'user' && !is_numeric(arg(1)))) { - $block['subject'] = t('User login'); + $block['default_title'] = t('User login'); $block['content']['user_login_form'] = drupal_get_form('user_login_block'); } return $block; @@ -851,7 +851,7 @@ function user_block_view($delta = '') { // Retrieve a list of new users who have subsequently accessed the site successfully. $items = db_query_range('SELECT uid, name FROM {users} WHERE status <> 0 AND access <> 0 ORDER BY created DESC', 0, variable_get('user_block_whois_new_count', 5))->fetchAll(); - $block['subject'] = t('Who\'s new'); + $block['default_title'] = t('Who\'s new'); $block['content'] = array( '#theme' => 'item_list__user__new', '#items' => array(), @@ -871,7 +871,7 @@ function user_block_view($delta = '') { // rather than u.access because it is much faster. $authenticated_count = db_query("SELECT COUNT(DISTINCT s.uid) FROM {sessions} s WHERE s.timestamp >= :timestamp AND s.uid > 0", array(':timestamp' => $interval))->fetchField(); - $block['subject'] = t('Who\'s online'); + $block['default_title'] = t('Who\'s online'); $block['content'] = array( '#theme' => 'item_list__user__online', '#items' => array(),