Commit b094ff12 authored by Dries's avatar Dries
Browse files

- Patch #930670 by David_Rothstein: table-based dashboard admin page should be...

- 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).
parent 87e40b04
......@@ -19,7 +19,7 @@ function dashboard_help($path, $arg) {
$output .= '</dl>';
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 = '<p>' . t('Rearrange blocks for display on the <a href="@dashboard-url">dashboard</a>. Disabling a block makes it available on the main <a href="@blocks-url">blocks administration page</a>.', array('@dashboard-url' => url('admin/dashboard'), '@blocks-url' => url("admin/structure/block/list/{$GLOBALS['theme_key']}"))) . '</p>';
......@@ -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 <a href="@dashboard">Dashboard administration page</a>, 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 <a href="@dashboard">Dashboard administration page</a>, 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 = '<div class="canvas-content"><p>' . t('Drag and drop these blocks to the columns below. Changes are automatically saved. More options are available on the <a href="@dashboard-url">configuration page</a>.', array('@dashboard-url' => url('admin/structure/dashboard'))) . '</p>';
$output = '<div class="canvas-content"><p>' . t('Drag and drop these blocks to the columns below. Changes are automatically saved. More options are available on the <a href="@dashboard-url">configuration page</a>.', array('@dashboard-url' => url('admin/dashboard/configure'))) . '</p>';
$output .= '<div id="disabled-blocks"><div class="region disabled-blocks clearfix">';
foreach ($blocks as $block) {
$output .= theme('dashboard_disabled_block', array('block' => $block));
......
......@@ -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)));
......
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