summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-03-12 05:14:14 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-03-12 05:14:14 +0000
commitaaf9a83db6c30255a685ffbc2420da7791dcab7a (patch)
tree8dbf248a4267c6c55c35fd7cde055ecc202490d7
parentf79e4f3420b06fd87dc29b0f631b8e960b97999f (diff)
downloadbrdo-aaf9a83db6c30255a685ffbc2420da7791dcab7a.tar.gz
brdo-aaf9a83db6c30255a685ffbc2420da7791dcab7a.tar.bz2
#556872 by Davy Van Den Bremt, pwolanin, sun, and eojthebrave: Fixed Action links do not work on all levels (example: 'add block' action link does not appear).
-rw-r--r--includes/menu.inc8
-rw-r--r--modules/block/block.module10
-rw-r--r--modules/block/block.test6
3 files changed, 21 insertions, 3 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index c3ba10123..a8df5ba87 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -1704,10 +1704,12 @@ function menu_local_tasks($level = 0) {
$tasks[$item['path']] = $item;
}
// Find all tabs below the current path.
- $path = $router_item['path'];
+ $path = ($router_item['type'] == MENU_DEFAULT_LOCAL_TASK ? $router_item['tab_parent'] : $router_item['path']);
// Tab parenting may skip levels, so the number of parts in the path may not
// equal the depth. Thus we use the $depth counter (offset by 1000 for ksort).
$depth = 1001;
+ $actions['count'] = 0;
+ $actions['output'] = array();
while (isset($children[$path])) {
$tabs_current = array();
$actions_current = array();
@@ -1752,8 +1754,8 @@ function menu_local_tasks($level = 0) {
$path = $next_path;
$tabs[$depth]['count'] = $tab_count;
$tabs[$depth]['output'] = $tabs_current;
- $actions['count'] = $action_count;
- $actions['output'] = $actions_current;
+ $actions['count'] += $action_count;
+ $actions['output'] = array_merge($actions['output'], $actions_current);
$depth++;
}
$data['actions'] = $actions;
diff --git a/modules/block/block.module b/modules/block/block.module
index 19e81f55e..1acda1cd7 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -127,6 +127,16 @@ function block_menu() {
'access arguments' => array($theme),
'file' => 'block.admin.inc',
);
+ if ($key != $default_theme) {
+ $items['admin/structure/block/list/' . $key . '/add'] = array(
+ 'title' => 'Add block',
+ 'page callback' => 'drupal_get_form',
+ 'page arguments' => array('block_add_block_form'),
+ 'access arguments' => array('administer blocks'),
+ 'type' => MENU_LOCAL_ACTION,
+ 'file' => 'block.admin.inc',
+ );
+ }
$items['admin/structure/block/demo/' . $key] = array(
'title' => check_plain($theme->info['name']),
'page callback' => 'block_admin_demo',
diff --git a/modules/block/block.test b/modules/block/block.test
index a3002d0db..19f52d970 100644
--- a/modules/block/block.test
+++ b/modules/block/block.test
@@ -44,6 +44,12 @@ class BlockTestCase extends DrupalWebTestCase {
* Test creating custom block, moving it to a specific region and then deleting it.
*/
function testCustomBlock() {
+ // Confirm that the add block link appears on block overview pages.
+ $this->drupalGet('admin/structure/block');
+ $this->assertRaw(l('Add block', 'admin/structure/block/add'), t('Add block link is present on block overview page for default theme.'));
+ $this->drupalGet('admin/structure/block/list/seven');
+ $this->assertRaw(l('Add block', 'admin/structure/block/list/seven/add'), t('Add block link is present on block overview page for non-default theme.'));
+
// Confirm that hidden regions are not shown as options for block placement
// when adding a new block.
theme_enable(array('stark'));