Commit 7630e47d authored by Dries's avatar Dries
Browse files

- Patch #1332658 by sven.lauer, David_Rothstein, xjm: Clean up API docs for dashboard module.

parent 615bbeaa
/**
* @file
* Right-to-left specific stylesheet for the Dashboard module.
*/
#dashboard div.dashboard-region {
float: right;
}
......
......@@ -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
......
/**
* @file
* Stylesheet for the Dashboard module.
*/
#dashboard div.dashboard-region {
float: left;
min-height: 1px;
......
/**
* @file
* Attaches 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 = [];
......
<?php
/**
* @file
* Provides a dashboard page in the administrative interface.
*/
/**
* Implements hook_help().
*/
......@@ -263,10 +268,12 @@ function dashboard_forms() {
}
/**
* Dashboard page callback.
* Page callback: Displays the 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 +305,12 @@ 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.
*
* 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 +462,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 +471,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 +493,9 @@ 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.
*
* @see dashboard_menu()
*/
function dashboard_show_disabled() {
global $theme_key;
......@@ -506,12 +516,14 @@ 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.
*
* @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 +545,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 +642,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 +664,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:
......
......@@ -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 administrative blocks are available for the dashboard.
*/
function testBlockAvailability() {
// Test "Recent comments", which should be available (defined as
......
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