diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 0294385..d86c338 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -641,7 +641,9 @@ function forum_form_node_form_alter(&$form, &$form_state, $form_id) { } /** - * A #pre_render callback. Lists nodes based on the element's #query property. + * Render API callback: Lists nodes based on the element's #query property. + * + * This function can be used as a #pre_render callback. * * @see forum_block_view() */ diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php index fa2e955..1efaeae 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php @@ -98,7 +98,7 @@ public function testNewForumTopicsBlock() { } /** - * Test the "Active forum topics" block. + * Tests the "Active forum topics" block. */ public function testActiveForumTopicsBlock() { $this->drupalLogin($this->adminUser); diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php index f1664ca..dee29d3 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php @@ -12,7 +12,18 @@ */ class NodeBlockFunctionalTest extends NodeTestBase { + /** + * An administrative user for testing. + * + * @var \Drupal\user\Plugin\Core\Entity\User + */ protected $adminUser; + + /** + * An unprivileged user for testing. + * + * @var \Drupal\user\Plugin\Core\Entity\User + */ protected $webUser; /** diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeBlockTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeBlockTest.php index e176227..b738129 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeBlockTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeBlockTest.php @@ -30,7 +30,7 @@ public static function getInfo() { function setUp() { parent::setUp(); - // Create and login user. + // Create a user and log in. $admin_user = $this->drupalCreateUser(array('administer blocks')); $this->drupalLogin($admin_user); } diff --git a/core/modules/openid/openid.module b/core/modules/openid/openid.module index aa17768..232b41b 100644 --- a/core/modules/openid/openid.module +++ b/core/modules/openid/openid.module @@ -130,6 +130,8 @@ function openid_user_logout($account) { * Implements hook_block_view_MODULE_DELTA_alter(). * * Adds the OpenID login form to the user login block. + * + * @see \Drupal\user\Plugin\block\block\UserLoginBlock */ function openid_block_view_user_login_block_alter(&$build, $block) { // Only alter the block when it is non-empty, i.e. when no user is logged in. diff --git a/core/modules/poll/lib/Drupal/poll/Tests/PollBlockTest.php b/core/modules/poll/lib/Drupal/poll/Tests/PollBlockTest.php index 06a9f1c..49fa169 100644 --- a/core/modules/poll/lib/Drupal/poll/Tests/PollBlockTest.php +++ b/core/modules/poll/lib/Drupal/poll/Tests/PollBlockTest.php @@ -12,6 +12,11 @@ */ class PollBlockTest extends PollTestBase { + /** + * An administrative user for testing. + * + * @var Drupal\user\Plugin\Core\Entity\User + */ protected $adminUser; /** @@ -33,8 +38,8 @@ function setUp() { parent::setUp(); // Create and login user - $adminUser = $this->drupalCreateUser(array('administer blocks')); - $this->drupalLogin($adminUser); + $this->adminUser = $this->drupalCreateUser(array('administer blocks')); + $this->drupalLogin($this->adminUser); } /** diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module index f7a6c23..2142be4 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -410,6 +410,9 @@ function statistics_library_info() { /** * Implements hook_block_alter(). + * + * Removes the "popular" block from display if the module is not configured + * to count content views. */ function statistics_block_alter(&$definitions) { $statistics_count_content_views = config('statistics.settings')->get('count_content_views'); diff --git a/core/modules/system/lib/Drupal/system/Plugin/PluginUIBase.php b/core/modules/system/lib/Drupal/system/Plugin/PluginUIBase.php index 205fd56..54afffd 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/PluginUIBase.php +++ b/core/modules/system/lib/Drupal/system/Plugin/PluginUIBase.php @@ -11,8 +11,9 @@ use Drupal\Component\Plugin\Discovery\DiscoveryInterface; /** - * An abstract base class for use in creating sane default user interfaces for - * plugins of a particular type. + * Provides defaults for creating user interfaces for plugins of a given type. + * + * @todo This class needs more documetation and/or @see references. */ abstract class PluginUIBase extends PluginBase implements PluginUIInterface { @@ -50,8 +51,7 @@ public function formSubmit($form, &$form_state) { } /** - * Allows a given plugin to exclude various defintions form the user - * interface via whatever criteria make sense for that plugin. + * Allows a plugin to exclude certain defintions form the user interface. * * @param array $definitions * The plugin definitions provided by the plugin manager that this user @@ -65,7 +65,7 @@ protected function excludeDefinitions(array $definitions) { } /** - * Generic access check for use with plugins of this type. + * Checks access for plugins of this type. * * @return bool * Returns TRUE if plugins of this type can be accessed. @@ -76,8 +76,7 @@ public function access() { } /** - * A customized row method for displaying plugins for configuration within - * the user interface. + * Displays a plugin row for configuring plugins in the user interface. * * @param string $display_plugin_id * The ID of the specific plugin definition being passed to us. diff --git a/core/modules/system/lib/Drupal/system/Plugin/PluginUIInterface.php b/core/modules/system/lib/Drupal/system/Plugin/PluginUIInterface.php index 1a95690..9bc7629 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/PluginUIInterface.php +++ b/core/modules/system/lib/Drupal/system/Plugin/PluginUIInterface.php @@ -8,12 +8,14 @@ namespace Drupal\system\Plugin; /** - * Interface definition for Plugin UI plugins. + * Defines an interface for Plugin UI plugins. + * + * @todo This needs a lot more explanation. */ interface PluginUIInterface { /** - * Create a form array. + * Creates a form array. * * @param array $form * An associative array containing the structure of the form. @@ -22,6 +24,8 @@ * * @return array * Returns the form structure as an array. + * + * @todo Creates a form array for what? */ public function form($form, &$form_state); diff --git a/core/modules/system/lib/Drupal/system/Plugin/Type/PluginUIManager.php b/core/modules/system/lib/Drupal/system/Plugin/Type/PluginUIManager.php index a8f59bd..28725f4 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/Type/PluginUIManager.php +++ b/core/modules/system/lib/Drupal/system/Plugin/Type/PluginUIManager.php @@ -16,6 +16,8 @@ /** * Manages discovery and instantiation of Plugin UI plugins. + * + * @todo This class needs @see references and/or more documentation. */ class PluginUIManager extends PluginManagerBase { diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php index c7f87c4..b881393 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/TrailTest.php @@ -43,7 +43,6 @@ function setUp() { ); $this->drupalPost("admin/structure/block/manage/system_menu_block:menu-tools/{$default_theme}", $block, t('Save block')); - // This test puts menu links in the Administration menu and then tests for // their presence on the page, so we need to ensure that the Administration // block will be displayed in the default theme. diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 36154c5..2dbbcd7 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1123,6 +1123,9 @@ function system_menu() { /** * Proxies to the plugin class' form method. + * + * @todo This needs more explanation, an @see or two, and parameter + * documentation. Also "proxies" is a weird word to use. */ function system_plugin_ui_form($form, &$form_state, $plugin, $facet = NULL) { $plugin_ui = drupal_container()->get('plugin.manager.system.plugin_ui')->createInstance($plugin); @@ -1133,7 +1136,9 @@ function system_plugin_ui_form($form, &$form_state, $plugin, $facet = NULL) { } /** - * Page callback: Autocomplete any plugin system tied to a plugin UI plugin. + * Page callback: Autocompletes any plugin system tied to a plugin UI plugin. + * + * @todo This needs more explanation and parameter documentation. */ function system_plugin_autocomplete($plugin_id, $string = '') { $matches = array(); @@ -1151,7 +1156,10 @@ function system_plugin_autocomplete($plugin_id, $string = '') { } /** - * A simple wrapper function for proxying to the plugin class' access method. + * Checks access for a given plugin using the plugin's access() method. + * + * @todo This needs more explanation, some @see, and parameter documentation. + * @todo What the heck kind of parameter name is "facet"? */ function system_plugin_ui_access($plugin, $facet = NULL) { $plugin_ui = drupal_container()->get('plugin.manager.system.plugin_ui')->createInstance($plugin); diff --git a/core/modules/system/system.plugin.ui.css b/core/modules/system/system.plugin.ui.css index 207a6ee..c932788 100644 --- a/core/modules/system/system.plugin.ui.css +++ b/core/modules/system/system.plugin.ui.css @@ -26,4 +26,4 @@ #block-library .bottom-bar { width:100%; clear:both; -} \ No newline at end of file +} diff --git a/core/modules/user/lib/Drupal/user/Plugin/block/block/UserNewBlock.php b/core/modules/user/lib/Drupal/user/Plugin/block/block/UserNewBlock.php index 668187e..89b9131 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/block/block/UserNewBlock.php +++ b/core/modules/user/lib/Drupal/user/Plugin/block/block/UserNewBlock.php @@ -65,7 +65,7 @@ public function configureSubmit($form, &$form_state) { * Overrides \Drupal\block\BlockBase::build(). */ public function build() { - // Retrieve a list of new users who have subsequently accessed the site successfully. + // 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( '#theme' => 'item_list__user__new', diff --git a/core/modules/user/lib/Drupal/user/Plugin/block/block/UserOnlineBlock.php b/core/modules/user/lib/Drupal/user/Plugin/block/block/UserOnlineBlock.php index d3138b3..1253c71 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/block/block/UserOnlineBlock.php +++ b/core/modules/user/lib/Drupal/user/Plugin/block/block/UserOnlineBlock.php @@ -14,6 +14,9 @@ /** * Provides a "Who's online" block. * + * @todo Move this block to the Statistics module and remove its dependency on + * user_access(). + * * @Plugin( * id = "user_online_block", * subject = @Translation("Who's online"), @@ -74,9 +77,6 @@ public function configureSubmit($form, &$form_state) { /** * Overrides \Drupal\block\BlockBase::build(). - * - * @todo Move this block to statistics.module and remove dependency on - * user.access. */ public function build() { // Count users active within the defined period. diff --git a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php index 45db464..16ddf4a 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsBlock.php @@ -37,7 +37,7 @@ public function getDerivativeDefinition($derivative_id, array $base_plugin_defin */ public function getDerivativeDefinitions(array $base_plugin_definition) { foreach (views_get_all_views() as $view) { - // disabled views get nothing. + // Do not return results for disabled views. if (!$view->isEnabled()) { continue; } diff --git a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php index f0408f9..02180ec 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsExposedFilterBlock.php @@ -37,7 +37,7 @@ public function getDerivativeDefinition($derivative_id, array $base_plugin_defin */ public function getDerivativeDefinitions(array $base_plugin_definition) { foreach (views_get_all_views() as $view) { - // disabled views get nothing. + // Do not return results for disabled views. if (!$view->isEnabled()) { continue; } diff --git a/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsExposedFilterBlock.php b/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsExposedFilterBlock.php index d35fe36..835978a 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsExposedFilterBlock.php +++ b/core/modules/views/lib/Drupal/views/Plugin/block/block/ViewsExposedFilterBlock.php @@ -28,8 +28,8 @@ class ViewsExposedFilterBlock extends ViewsBlock { public function build() { $type = 'exp'; $output = $this->view->display_handler->viewSpecialBlocks($type); - // Before returning the block output, convert it to a renderable - // array with contextual links. + // Before returning the block output, convert it to a renderable array with + // contextual links. views_add_block_contextual_links($output, $this->view, $this->display_id, 'special_block_' . $type); $this->view->destroy(); return $output; diff --git a/core/modules/views/lib/Drupal/views/Tests/UI/OverrideDisplaysTest.php b/core/modules/views/lib/Drupal/views/Tests/UI/OverrideDisplaysTest.php index 193f0fb..1182a40 100644 --- a/core/modules/views/lib/Drupal/views/Tests/UI/OverrideDisplaysTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/UI/OverrideDisplaysTest.php @@ -67,8 +67,8 @@ function testOverrideDisplays() { $this->drupalGet(''); $this->assertText($original_title); - // Change the title for the page display only, and make sure that the original title - // still appears on the page. + // Change the title for the page display only, and make sure that the + // original title still appears on the page. $edit = array(); $edit['title'] = $new_title = $this->randomName(16); $edit['override[dropdown]'] = 'page_1'; diff --git a/core/profiles/standard/standard.install b/core/profiles/standard/standard.install index 784b5fd..c5f6d67 100644 --- a/core/profiles/standard/standard.install +++ b/core/profiles/standard/standard.install @@ -75,116 +75,6 @@ function standard_install() { theme_enable(array($default_theme)); theme_disable(array('stark')); - // Enable some standard blocks. - //$admin_theme = 'seven'; - //$blocks = array( - //array( - //'module' => 'system', - //'delta' => 'main', - //'theme' => $default_theme, - //'status' => 1, - //'weight' => 0, - //'region' => 'content', - //'pages' => '', - //'cache' => -1, - //), - //array( - //'module' => 'search', - //'delta' => 'form', - //'theme' => $default_theme, - //'status' => 1, - //'weight' => -1, - //'region' => 'sidebar_first', - //'pages' => '', - //'cache' => -1, - //), - //array( - //'module' => 'user', - //'delta' => 'login', - //'theme' => $default_theme, - //'status' => 1, - //'weight' => 0, - //'region' => 'sidebar_first', - //'pages' => '', - //'cache' => -1, - //), - //array( - //'module' => 'system', - //'delta' => 'menu-tools', - //'theme' => $default_theme, - //'status' => 1, - //'weight' => 0, - //'region' => 'sidebar_first', - //'pages' => '', - //'cache' => -1, - //), - //array( - //'module' => 'system', - //'delta' => 'menu-footer', - //'theme' => $default_theme, - //'status' => 1, - //'weight' => 0, - //'region' => 'footer', - //'pages' => '', - //'cache' => -1, - //), - //array( - //'module' => 'system', - //'delta' => 'powered-by', - //'theme' => $default_theme, - //'status' => 1, - //'weight' => 10, - //'region' => 'footer', - //'pages' => '', - //'cache' => -1, - //), - //array( - //'module' => 'system', - //'delta' => 'help', - //'theme' => $default_theme, - //'status' => 1, - //'weight' => 0, - //'region' => 'help', - //'pages' => '', - //'cache' => -1, - //), - //array( - //'module' => 'system', - //'delta' => 'main', - //'theme' => $admin_theme, - //'status' => 1, - //'weight' => 0, - //'region' => 'content', - //'pages' => '', - //'cache' => -1, - //), - //array( - //'module' => 'system', - //'delta' => 'help', - //'theme' => $admin_theme, - //'status' => 1, - //'weight' => 0, - //'region' => 'help', - //'pages' => '', - //'cache' => -1, - //), - //array( - //'module' => 'user', - //'delta' => 'login', - //'theme' => $admin_theme, - //'status' => 1, - //'weight' => 10, - //'region' => 'content', - //'pages' => '', - //'cache' => -1, - //), - //); - //$query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache')); - //foreach ($blocks as $block) { - //$query->values($block); - //} - //$query->execute(); - // Set front page to "node". config('system.site')->set('page.front', 'node')->save();