home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (dashboard.api.php)

This example Drupal source code file (dashboard.api.php) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

function, hook_dashboard_regions_alter, my, php, region, return, unset

The dashboard.api.php Drupal example source code

<?php
// $Id: dashboard.api.php,v 1.1 2009/10/18 11:20:26 dries Exp $

/**
 * @file
 * Hooks provided by the Dashboard module.
 */

/**
 * @addtogroup hooks
 * @{
 */

/**
 * Adds regions to the dashboard.
 *
 * @return
 *   An array whose keys are the names of the dashboard regions and whose
 *   values are the titles that will be displayed in the blocks administration
 *   interface. The keys are also used as theme wrapper functions.
 */
function hook_dashboard_regions() {
  // Define a new dashboard region. Your module can also then define
  // theme_mymodule_dashboard_region() as a theme wrapper function to control
  // the region's appearance.
  return array('mymodule_dashboard_region' => "My module's dashboard region");
}

/**
 * Alter dashboard regions provided by modules.
 *
 * @param $regions
 *   An array containing all dashboard regions, in the format provided by
 *   hook_dashboard_regions().
 */
function hook_dashboard_regions_alter($regions) {
  // Remove the sidebar region defined by the core dashboard module.
  unset($regions['dashboard_sidebar']);
}

/**
 * @} End of "addtogroup hooks".
 */

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal dashboard.api.php source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.