diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index 0626f72..144b1cb 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -403,7 +403,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."))); } @@ -411,7 +411,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 2b98d2a..b9da3a8 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 a3d59b0..1cbdc1c 100644 --- a/core/modules/block/block.api.php +++ b/core/modules/block/block.api.php @@ -202,8 +202,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. * @@ -219,7 +219,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', @@ -229,7 +229,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', @@ -256,7 +256,7 @@ function hook_block_view($delta = '') { * @param $data * An array of data, as returned from the hook_block_view() implementation of * the module that defined the block: - * - subject: The default localized title of the block. + * - default_title: The default 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. @@ -290,7 +290,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. @@ -310,7 +310,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 97f59e9..7b785d1 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) @@ -892,7 +892,7 @@ function block_block_list_alter(&$blocks) { } /** - * Builds the content and subject for a block. + * Builds the content and default_title for a block. * * For cacheable blocks, this is called during #pre_render. * @@ -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/block.test b/core/modules/block/block.test index e6b2e42..501fc7e 100644 --- a/core/modules/block/block.test +++ b/core/modules/block/block.test @@ -94,7 +94,7 @@ class BlockTestCase extends WebTestBase { // 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']), t('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'], t('block_block_view() provides correct block content.')); // Check whether the block can be moved to all available regions. diff --git a/core/modules/block/block.tpl.php b/core/modules/block/block.tpl.php index 78387a8..ff38d86 100644 --- a/core/modules/block/block.tpl.php +++ b/core/modules/block/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. @@ -47,8 +47,8 @@
> -subject): ?> - >subject ?> +default_title): ?> + >default_title ?> diff --git a/core/modules/book/book.module b/core/modules/book/book.module index bbdfab3..51b6307 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -285,7 +285,7 @@ function book_block_view($delta = '') { } if (variable_get('book_block_mode', 'all pages') == '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) { @@ -321,7 +321,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 58ea4a6..7e7d4e9 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -470,7 +470,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 28e7f17..4b3cb44 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -695,7 +695,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 7acc783..d856022 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -470,7 +470,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 3c3881d..4388825 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -2057,7 +2057,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', @@ -2067,7 +2067,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 2e36e0b..e995c53 100644 --- a/core/modules/poll/poll.module +++ b/core/modules/poll/poll.module @@ -143,7 +143,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 1ad7a85..52f27cc 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 ef1bceb..8e4856f 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -368,7 +368,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 ebc5dcf..d115787 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -2125,22 +2125,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 cfde270..12f2b14 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -1130,7 +1130,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'] = drupal_get_form('user_login_block'); } return $block; @@ -1141,7 +1141,7 @@ function user_block_view($delta = '') { $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(); $output = theme('user_list', array('users' => $items)); - $block['subject'] = t('Who\'s new'); + $block['default_title'] = t('Who\'s new'); $block['content'] = $output; } return $block; @@ -1164,7 +1164,7 @@ function user_block_view($delta = '') { $output .= theme('user_list', array('users' => $items)); } - $block['subject'] = t('Who\'s online'); + $block['default_title'] = t('Who\'s online'); $block['content'] = $output; } return $block;