From b094ff12d4614bc091b4f3506fea2fef8d13b929 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 21 Oct 2010 11:55:09 +0000 Subject: [PATCH] - Patch #930670 by David_Rothstein: table-based dashboard admin page should be linked to from the dashboard only (not from the rest of the admin UI). --- modules/dashboard/dashboard.module | 24 ++++++++++++------------ modules/dashboard/dashboard.test | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/dashboard/dashboard.module b/modules/dashboard/dashboard.module index 48dfb7abdd1..b1e66e531a5 100644 --- a/modules/dashboard/dashboard.module +++ b/modules/dashboard/dashboard.module @@ -19,7 +19,7 @@ function dashboard_help($path, $arg) { $output .= ''; return $output; - case 'admin/structure/dashboard': + case 'admin/dashboard/configure': // @todo This assumes the current page is being displayed using the same // theme that the dashboard is displayed in. $output = '

' . t('Rearrange blocks for display on the dashboard. Disabling a block makes it available on the main blocks administration page.', array('@dashboard-url' => url('admin/dashboard'), '@blocks-url' => url("admin/structure/block/list/{$GLOBALS['theme_key']}"))) . '

'; @@ -31,12 +31,6 @@ function dashboard_help($path, $arg) { * Implements hook_menu(). */ function dashboard_menu() { - $items['admin/structure/dashboard'] = array( - 'title' => 'Dashboard', - 'description' => 'Configure which blocks can be shown on the dashboard.', - 'page callback' => 'dashboard_admin_blocks', - 'access arguments' => array('administer blocks'), - ); $items['admin/dashboard'] = array( 'title' => 'Dashboard', 'description' => 'View and customize your dashboard.', @@ -46,6 +40,13 @@ function dashboard_menu() { // the top corner of the window as a convenient "home link". 'weight' => -15, ); + $items['admin/dashboard/configure'] = array( + 'title' => 'Configure available dashboard blocks', + 'description' => 'Configure which blocks can be shown on the dashboard.', + 'page callback' => 'dashboard_admin_blocks', + 'access arguments' => array('administer blocks'), + 'type' => MENU_VISIBLE_IN_BREADCRUMB, + ); $items['admin/dashboard/customize'] = array( 'title' => 'Customize dashboard', 'description' => 'Customize your dashboard.', @@ -250,7 +251,7 @@ function dashboard_admin($launch_customize = FALSE) { ); $build = array( '#theme' => 'dashboard_admin', - '#message' => t('To customize the dashboard page, move blocks to the dashboard regions on the Dashboard administration page, or enable JavaScript on this page to use the drag-and-drop interface.', array('@dashboard' => url('admin/structure/dashboard'))), + '#message' => t('To customize the dashboard page, move blocks to the dashboard regions on the Dashboard administration page, or enable JavaScript on this page to use the drag-and-drop interface.', array('@dashboard' => url('admin/dashboard/configure'))), '#access' => user_access('administer blocks'), '#attached' => array( 'js' => array( @@ -277,7 +278,6 @@ function dashboard_admin($launch_customize = FALSE) { function dashboard_admin_blocks() { global $theme_key; drupal_theme_initialize(); - drupal_set_title(t('Configure available dashboard blocks')); module_load_include('inc', 'block', 'block.admin'); // Prepare the blocks for the current theme, and remove those that are @@ -330,10 +330,10 @@ function dashboard_form_dashboard_admin_display_form_alter(&$form, &$form_state) // dashboard blocks administration page. foreach ($form['blocks'] as &$block) { if (isset($block['configure']['#href'])) { - $block['configure']['#options']['query']['destination'] = 'admin/structure/dashboard'; + $block['configure']['#options']['query']['destination'] = 'admin/dashboard/configure'; } if (isset($block['delete']['#href'])) { - $block['delete']['#options']['query']['destination'] = 'admin/structure/dashboard'; + $block['delete']['#options']['query']['destination'] = 'admin/dashboard/configure'; } } } @@ -598,7 +598,7 @@ function theme_dashboard_region($variables) { */ function theme_dashboard_disabled_blocks($variables) { extract($variables); - $output = '

' . t('Drag and drop these blocks to the columns below. Changes are automatically saved. More options are available on the configuration page.', array('@dashboard-url' => url('admin/structure/dashboard'))) . '

'; + $output = '

' . t('Drag and drop these blocks to the columns below. Changes are automatically saved. More options are available on the configuration page.', array('@dashboard-url' => url('admin/dashboard/configure'))) . '

'; $output .= '
'; foreach ($blocks as $block) { $output .= theme('dashboard_disabled_block', array('block' => $block)); diff --git a/modules/dashboard/dashboard.test b/modules/dashboard/dashboard.test index 9c03d75c2d3..965caa897aa 100644 --- a/modules/dashboard/dashboard.test +++ b/modules/dashboard/dashboard.test @@ -65,7 +65,7 @@ class DashboardBlocksTestCase extends DrupalWebTestCase { $dashboard_regions = dashboard_region_descriptions(); // Ensure blocks can be placed in dashboard regions. - $this->drupalGet('admin/structure/dashboard'); + $this->drupalGet('admin/dashboard/configure'); foreach ($dashboard_regions as $region => $description) { $elements = $this->xpath('//option[@value=:region]', array(':region' => $region)); $this->assertTrue(!empty($elements), t('%region is an available choice on the dashboard block configuration page.', array('%region' => $region)));