Commit eec97006 authored by webchick's avatar webchick

Issue #1884860 by tim.plunkett: Remove 'block' prefix from BlockInterface method names.

parent c1b49a02
......@@ -24,9 +24,9 @@
class AggregatorCategoryBlock extends BlockBase {
/**
* Overrides \Drupal\block\BlockBase::blockSettings().
* Overrides \Drupal\block\BlockBase::settings().
*/
public function blockSettings() {
public function settings() {
// By default, the block will contain 10 feed items.
return array(
'block_count' => 10,
......@@ -62,9 +62,9 @@ public function blockSubmit($form, &$form_state) {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
$id = $this->getPluginId();
if ($category = db_query('SELECT cid, title, block FROM {aggregator_category} WHERE cid = :cid', array(':cid' => $id))->fetchObject()) {
$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, $this->configuration['block_count'], array(':cid' => $category->cid));
......
......@@ -24,9 +24,9 @@
class AggregatorFeedBlock extends BlockBase {
/**
* Overrides \Drupal\block\BlockBase::blockSettings().
* Overrides \Drupal\block\BlockBase::settings().
*/
public function blockSettings() {
public function settings() {
// By default, the block will contain 10 feed items.
return array(
'block_count' => 10,
......@@ -62,9 +62,9 @@ public function blockSubmit($form, &$form_state) {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
// Plugin IDs look something like this: aggregator_feed_block:1.
list(, $id) = explode(':', $this->getPluginId());
if ($feed = db_query('SELECT fid, title, block FROM {aggregator_feed} WHERE block <> 0 AND fid = :fid', array(':fid' => $id))->fetchObject()) {
......
......@@ -105,9 +105,9 @@ public function blockSubmit($form, &$form_state) {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
// Populate the block with the user-defined block body.
return array(
'#theme' => 'custom_block_block',
......
......@@ -48,7 +48,7 @@ public function __construct(array $configuration, $plugin_id, DiscoveryInterface
*
* @see \Drupal\block\BlockBase::settings().
*/
public function blockSettings() {
public function settings() {
return array();
}
......@@ -68,7 +68,7 @@ public function getConfig() {
if (empty($this->configuration)) {
// If the plugin configuration is not already set, initialize it with the
// default settings for the block plugin.
$this->configuration = $this->blockSettings();
$this->configuration = $this->settings();
// @todo This loads the default subject. Is this the right place to do so?
$definition = $this->getDefinition();
......
......@@ -29,7 +29,7 @@ interface BlockInterface {
* @todo Consider merging this with the general plugin configuration member
* variable and its getter/setter in http://drupal.org/node/1764380.
*/
public function blockSettings();
public function settings();
/**
* Indicates whether the block should be shown.
......@@ -100,6 +100,6 @@ public function submit($form, &$form_state);
*
* @see \Drupal\block\BlockRenderController
*/
public function blockBuild();
public function build();
}
......@@ -72,7 +72,7 @@ public function view(EntityInterface $entity, $view_mode = 'full', $langcode = N
public function viewMultiple(array $entities = array(), $view_mode = 'full', $langcode = NULL) {
$build = array();
foreach ($entities as $entity_id => $entity) {
$build[$entity_id] = $entity->getPlugin()->blockBuild();
$build[$entity_id] = $entity->getPlugin()->build();
// Allow blocks to be empty, do not add in the defaults.
if (!empty($build[$entity_id])) {
$build[$entity_id] = $this->getBuildDefaults($entity, $view_mode, $langcode) + $build[$entity_id];
......
......@@ -23,20 +23,20 @@
class TestCacheBlock extends BlockBase {
/**
* Overrides \Drupal\block\BlockBase::blockSettings().
* Overrides \Drupal\block\BlockBase::settings().
*
* Sets a different caching strategy for testing purposes.
*/
public function blockSettings() {
public function settings() {
return array(
'cache' => DRUPAL_CACHE_PER_ROLE,
);
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
return array(
'#children' => state()->get('block_test.content'),
);
......
......@@ -23,9 +23,9 @@
class BookNavigationBlock extends BlockBase {
/**
* Overrides \Drupal\block\BlockBase::blockSettings().
* Overrides \Drupal\block\BlockBase::settings().
*/
public function blockSettings() {
public function settings() {
return array(
'cache' => DRUPAL_CACHE_PER_PAGE | DRUPAL_CACHE_PER_ROLE,
'block_mode' => "all pages",
......@@ -59,9 +59,9 @@ public function blockSubmit($form, &$form_state) {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
$current_bid = 0;
if ($node = menu_get_object()) {
$current_bid = empty($node->book['bid']) ? 0 : $node->book['bid'];
......
......@@ -23,9 +23,9 @@
class RecentCommentsBlock extends BlockBase {
/**
* Overrides \Drupal\block\BlockBase::blockSettings().
* Overrides \Drupal\block\BlockBase::settings().
*/
public function blockSettings() {
public function settings() {
return array(
'block_count' => 10,
);
......@@ -59,9 +59,9 @@ public function blockSubmit($form, &$form_state) {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
return array(
'#theme' => 'comment_block',
'#number' => $this->configuration['block_count'],
......
......@@ -22,9 +22,9 @@
class ActiveTopicsBlock extends ForumBlockBase {
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
$query = db_select('forum_index', 'f')
->fields('f')
->addTag('node_access')
......
......@@ -15,9 +15,9 @@
abstract class ForumBlockBase extends BlockBase {
/**
* Overrides \Drupal\block\BlockBase::blockSettings().
* Overrides \Drupal\block\BlockBase::settings().
*/
public function blockSettings() {
public function settings() {
return array(
'cache' => DRUPAL_CACHE_CUSTOM,
'properties' => array(
......
......@@ -22,9 +22,9 @@
class NewTopicsBlock extends ForumBlockBase {
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
$query = db_select('forum_index', 'f')
->fields('f')
->addTag('node_access')
......
......@@ -31,9 +31,9 @@ function blockAccess() {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
$build = array();
$path = drupal_is_front_page() ? '<front>' : current_path();
list($plugin_id, $type) = explode(':', $this->getPluginId());
......
......@@ -24,9 +24,9 @@
class MenuBlock extends SystemMenuBlock {
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
list($plugin, $menu) = explode(':', $this->getPluginId());
return menu_tree($menu);
}
......
......@@ -23,9 +23,9 @@
class RecentContentBlock extends BlockBase {
/**
* Overrides \Drupal\block\BlockBase::blockSettings().
* Overrides \Drupal\block\BlockBase::settings().
*/
public function blockSettings() {
public function settings() {
return array(
'block_count' => 10,
);
......@@ -59,9 +59,9 @@ public function blockSubmit($form, &$form_state) {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
if ($nodes = node_get_recent($this->configuration['block_count'])) {
return array(
'#theme' => 'node_recent_block',
......
......@@ -23,9 +23,9 @@
class SyndicateBlock extends BlockBase {
/**
* Overrides \Drupal\block\BlockBase::blockSettings().
* Overrides \Drupal\block\BlockBase::settings().
*/
public function blockSettings() {
public function settings() {
return array(
'block_count' => 10,
);
......@@ -39,9 +39,9 @@ public function blockAccess() {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
return array(
'#theme' => 'feed_icon',
'#url' => 'rss.xml',
......
......@@ -30,9 +30,9 @@ class PollRecentBlock extends BlockBase {
protected $record;
/**
* Overrides \Drupal\block\BlockBase::blockSettings().
* Overrides \Drupal\block\BlockBase::settings().
*/
public function blockSettings() {
public function settings() {
return array(
'properties' => array(
'administrative' => TRUE,
......@@ -65,9 +65,9 @@ public function blockAccess() {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
$poll = node_load($this->record);
if ($poll->nid) {
$poll = poll_block_latest_poll_view($poll);
......
......@@ -30,9 +30,9 @@ public function blockAccess() {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
return array(drupal_get_form('search_block_form'));
}
......
......@@ -23,9 +23,9 @@
class ShortcutsBlock extends BlockBase {
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
return array(
shortcut_renderable_links(shortcut_current_displayed_set()),
);
......
......@@ -44,9 +44,9 @@ class StatisticsPopularBlock extends BlockBase {
protected $last_list;
/**
* Overrides \Drupal\block\BlockBase::blockSettings().
* Overrides \Drupal\block\BlockBase::settings().
*/
public function blockSettings() {
public function settings() {
return array(
'top_day_num' => 0,
'top_all_num' => 0,
......@@ -116,9 +116,9 @@ public function blockSubmit($form, &$form_state) {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
$content = array();
if ($this->day_list) {
......
......@@ -38,9 +38,9 @@ public function blockAccess() {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
return array(
'#children' => $this->help,
);
......
......@@ -23,9 +23,9 @@
class SystemMainBlock extends BlockBase {
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
return array(
drupal_set_page_content()
);
......
......@@ -33,9 +33,9 @@ public function blockAccess() {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
list($plugin, $derivative) = explode(':', $this->getPluginId());
// Derivatives are prefixed with 'menu-'.
$menu = substr($derivative, 5);
......
......@@ -23,9 +23,9 @@
class SystemPoweredByBlock extends BlockBase {
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
return array(
'#children' => theme('system_powered_by'),
);
......
......@@ -30,9 +30,9 @@ public function blockAccess() {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
$form = drupal_get_form('user_login_form');
unset($form['name']['#attributes']['autofocus']);
unset($form['name']['#description']);
......
......@@ -23,9 +23,9 @@
class UserNewBlock extends BlockBase {
/**
* Overrides \Drupal\block\BlockBase::blockSettings().
* Overrides \Drupal\block\BlockBase::settings().
*/
public function blockSettings() {
public function settings() {
return array(
'properties' => array(
'administrative' => TRUE
......@@ -62,9 +62,9 @@ public function blockSubmit($form, &$form_state) {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
// Retrieve a list of new users who have accessed the site successfully.
$items = db_query_range('SELECT uid, name FROM {users} WHERE status <> 0 AND access <> 0 ORDER BY created DESC', 0, $this->configuration['whois_new_count'])->fetchAll();
$build = array(
......
......@@ -26,9 +26,9 @@
class UserOnlineBlock extends BlockBase {
/**
* Overrides \Drupal\block\BlockBase::blockSettings().
* Overrides \Drupal\block\BlockBase::settings().
*/
public function blockSettings() {
public function settings() {
return array(
'properties' => array(
'administrative' => TRUE
......@@ -76,9 +76,9 @@ public function blockSubmit($form, &$form_state) {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
// Count users active within the defined period.
$interval = REQUEST_TIME - $this->configuration['seconds_online'];
......
......@@ -70,9 +70,9 @@ public function blockForm($form, &$form_state) {
}
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
$output = $this->view->executeDisplay($this->displayID);
// Set the label to the title configured in the view.
$this->entity->set('label', filter_xss_admin($this->view->getTitle()));
......
......@@ -23,9 +23,9 @@
class ViewsExposedFilterBlock extends ViewsBlock {
/**
* Implements \Drupal\block\BlockBase::blockBuild().
* Implements \Drupal\block\BlockBase::build().
*/
public function blockBuild() {
public function build() {
$type = 'exp';
$output = $this->view->display_handler->viewSpecialBlocks($type);
// Before returning the block output, convert it to a renderable array with
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment