diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/block/block.module | 10 | ||||
-rw-r--r-- | modules/block/block.test | 6 |
2 files changed, 16 insertions, 0 deletions
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')); |