diff --git a/core/modules/dashboard/dashboard.api.php b/core/modules/dashboard/dashboard.api.php index 00bfde5..623dd30 100644 --- a/core/modules/dashboard/dashboard.api.php +++ b/core/modules/dashboard/dashboard.api.php @@ -11,7 +11,7 @@ */ /** - * Adds regions to the dashboard. + * Add regions to the dashboard. * * @return * An array whose keys are the names of the dashboard regions and whose diff --git a/core/modules/dashboard/dashboard.css b/core/modules/dashboard/dashboard.css index 9996ba9..e949640 100644 --- a/core/modules/dashboard/dashboard.css +++ b/core/modules/dashboard/dashboard.css @@ -1,3 +1,8 @@ +/** + * @file + * Stylesheet for the Dashboard module. + */ + #dashboard div.dashboard-region { float: left; min-height: 1px; diff --git a/core/modules/dashboard/dashboard.js b/core/modules/dashboard/dashboard.js index ebecbf6..3d85faf 100644 --- a/core/modules/dashboard/dashboard.js +++ b/core/modules/dashboard/dashboard.js @@ -1,7 +1,12 @@ +/** + * @file + * Ataches behaviors for the Dashboard module. + */ + (function ($) { /** - * Implementation of Drupal.behaviors for dashboard. + * Implements Drupal.behaviors for the Dashboard module. */ Drupal.behaviors.dashboard = { attach: function (context, settings) { @@ -39,7 +44,7 @@ Drupal.behaviors.dashboard = { }, /** - * Enter "customize" mode by displaying disabled blocks. + * Enters "customize" mode by displaying disabled blocks. */ enterCustomizeMode: function () { $('#dashboard').addClass('customize-mode customize-inactive'); @@ -51,7 +56,7 @@ Drupal.behaviors.dashboard = { }, /** - * Exit "customize" mode by simply forcing a page refresh. + * Exits "customize" mode by simply forcing a page refresh. */ exitCustomizeMode: function () { $('#dashboard').removeClass('customize-mode customize-inactive'); @@ -60,7 +65,7 @@ Drupal.behaviors.dashboard = { }, /** - * Helper for enterCustomizeMode; sets up drag-and-drop and close button. + * Sets up the drag-and-drop behavior and the 'close' button. */ setupDrawer: function () { $('div.customize .canvas-content input').click(Drupal.behaviors.dashboard.exitCustomizeMode); @@ -84,7 +89,7 @@ Drupal.behaviors.dashboard = { }, /** - * While dragging, make the block appear as a disabled block + * Makes the block appear as a disabled block while dragging. * * This function is called on the jQuery UI Sortable "start" event. * @@ -104,8 +109,7 @@ Drupal.behaviors.dashboard = { }, /** - * While dragging, adapt block's width to the width of the region it is moved - * into. + * Adapts block's width to the region it is moved into while dragging. * * This function is called on the jQuery UI Sortable "over" event. * @@ -127,8 +131,7 @@ Drupal.behaviors.dashboard = { }, /** - * While dragging, adapt block's position to stay connected with the position - * of the mouse pointer. + * Adapts a block's position to stay connected with the mouse pointer. * * This function is called on the jQuery UI Sortable "sort" event. * @@ -146,7 +149,7 @@ Drupal.behaviors.dashboard = { }, /** - * Send block order to the server, and expand previously disabled blocks. + * Sends block order to the server, and expands previously disabled blocks. * * This function is called on the jQuery UI Sortable "update" event. * @@ -198,8 +201,10 @@ Drupal.behaviors.dashboard = { }, /** - * Return the current order of the blocks in each of the sortable regions, - * in query string format. + * Returns the current order of the blocks in each of the sortable regions. + * + * @return + * The current order of the blocks, in query string format. */ getOrder: function () { var order = []; diff --git a/core/modules/dashboard/dashboard.module b/core/modules/dashboard/dashboard.module index 1216cc0..3956e6d 100644 --- a/core/modules/dashboard/dashboard.module +++ b/core/modules/dashboard/dashboard.module @@ -263,10 +263,14 @@ function dashboard_forms() { } /** - * Dashboard page callback. + * Page callback: Displays the dashboard. + * + * Path: admin/dashboard * * @param $launch_customize * Whether to launch in customization mode right away. TRUE or FALSE. + * + * @see dashboard_menu() */ function dashboard_admin($launch_customize = FALSE) { $js_settings = array( @@ -298,11 +302,14 @@ function dashboard_admin($launch_customize = FALSE) { } /** - * Menu page callback: builds the page for administering dashboard blocks. + * Page callback: Builds the page for administering dashboard blocks. + * + * Path: admin/dashboard/configure * * This page reuses the Block module's administration form but limits editing * to blocks that are available to appear on the dashboard. * + * @see dashboard_menu() * @see block_admin_display() * @see block_admin_display_form() * @see dashboard_form_dashboard_admin_display_form_alter() @@ -454,7 +461,7 @@ function dashboard_is_visible() { } /** - * Return an array of dashboard region descriptions, keyed by region name. + * Returns an array of dashboard region descriptions, keyed by region name. */ function dashboard_region_descriptions() { $regions = module_invoke_all('dashboard_regions'); @@ -463,7 +470,7 @@ function dashboard_region_descriptions() { } /** - * Return an array of dashboard region names. + * Returns an array of dashboard region names. */ function dashboard_regions() { $regions = &drupal_static(__FUNCTION__); @@ -485,7 +492,11 @@ function dashboard_dashboard_regions() { } /** - * Ajax callback to show disabled blocks in the dashboard customization mode. + * Ajax callback: Shows disabled blocks in the dashboard customization mode. + * + * Path: admin/dashboard/drawer + * + * @see dashboard_menu() */ function dashboard_show_disabled() { global $theme_key; @@ -506,12 +517,16 @@ function dashboard_show_disabled() { } /** - * Ajax callback to display the rendered contents of a specific block. + * Ajax callback: Displays the rendered contents of a specific block. + * + * Path: admin/dashboard/block-content/%/% * * @param $module * The block's module name. * @param $delta * The block's delta. + * + * @see dashboard_menu() */ function dashboard_show_block_content($module, $delta) { drupal_theme_initialize(); @@ -533,7 +548,7 @@ function dashboard_show_block_content($module, $delta) { } /** - * Set the new weight of each region according to the drag-and-drop order. + * Sets the new weight of each region according to the drag-and-drop order. */ function dashboard_update() { drupal_theme_initialize(); @@ -630,7 +645,7 @@ function theme_dashboard_region($variables) { } /** - * Returns HTML for a set of disabled blocks, for display in dashboard customization mode. + * Returns HTML for disabled blocks, for use in dashboard customization mode. * * @param $variables * An associative array containing: @@ -652,7 +667,7 @@ function theme_dashboard_disabled_blocks($variables) { } /** - * Returns HTML for a disabled block, for display in dashboard customization mode. + * Returns HTML for a disabled block, for use in dashboard customization mode. * * @param $variables * An associative array containing: diff --git a/core/modules/dashboard/dashboard.test b/core/modules/dashboard/dashboard.test index 7cb93f9..faed200 100644 --- a/core/modules/dashboard/dashboard.test +++ b/core/modules/dashboard/dashboard.test @@ -5,6 +5,9 @@ * Tests for dashboard.module. */ +/** + * Tests the Dashboard module blocks. + */ class DashboardBlocksTestCase extends DrupalWebTestCase { public static function getInfo() { return array( @@ -33,7 +36,7 @@ class DashboardBlocksTestCase extends DrupalWebTestCase { } /** - * Test adding a block to the dashboard and checking access to it. + * Tests adding a block to the dashboard and checking access to it. */ function testDashboardAccess() { // Add a new custom block to a dashboard region. @@ -58,7 +61,7 @@ class DashboardBlocksTestCase extends DrupalWebTestCase { } /** - * Test that dashboard regions are displayed or hidden properly. + * Tests that dashboard regions are displayed or hidden properly. */ function testDashboardRegions() { $dashboard_regions = dashboard_region_descriptions(); @@ -80,8 +83,7 @@ class DashboardBlocksTestCase extends DrupalWebTestCase { } /** - * Test that the dashboard module can be disabled and enabled again, - * retaining its blocks. + * Tests that the dashboard module can be re-enabled, retaining its blocks. */ function testDisableEnable() { // Add a new custom block to a dashboard region. @@ -113,8 +115,7 @@ class DashboardBlocksTestCase extends DrupalWebTestCase { } /** - * Test that defining a block with ['properties']['administrative'] = TRUE - * adds it as an available block for the dashboard. + * Tests that administator-only blocks are available for the dashboard. */ function testBlockAvailability() { // Test "Recent comments", which should be available (defined as