diff options
Diffstat (limited to 'modules/block')
-rw-r--r-- | modules/block/block.admin.inc | 18 | ||||
-rw-r--r-- | modules/block/block.module | 28 | ||||
-rw-r--r-- | modules/block/block.test | 40 |
3 files changed, 43 insertions, 43 deletions
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc index 0f80a4b00..cc97d5227 100644 --- a/modules/block/block.admin.inc +++ b/modules/block/block.admin.inc @@ -7,7 +7,7 @@ */ /** - * Menu callback for admin/build/block. + * Menu callback for admin/structure/block. */ function block_admin_display($theme = NULL) { global $custom_theme; @@ -43,7 +43,7 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) { // Build the form tree. $form = array( - '#action' => arg(4) ? url('admin/build/block/list/' . $theme_key) : url('admin/build/block'), + '#action' => arg(4) ? url('admin/structure/block/list/' . $theme_key) : url('admin/structure/block'), '#tree' => TRUE, ); @@ -76,12 +76,12 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) { ); $form[$key]['configure'] = array( '#markup' => l(t('configure'), - 'admin/build/block/configure/' . $block['module'] . '/' . $block['delta']), + 'admin/structure/block/configure/' . $block['module'] . '/' . $block['delta']), ); if ($block['module'] == 'block') { $form[$key]['delete'] = array( '#markup' => l(t('delete'), - 'admin/build/block/delete/' . $block['delta']), + 'admin/structure/block/delete/' . $block['delta']), ); } } @@ -119,7 +119,7 @@ function block_admin_display_form_submit($form, &$form_state) { } /** - * Helper function for sorting blocks on admin/build/block. + * Helper function for sorting blocks on admin/structure/block. * * Active blocks are sorted by region, then by weight. * Disabled blocks are sorted by name. @@ -354,7 +354,7 @@ function block_admin_configure_submit($form, &$form_state) { module_invoke($form_state['values']['module'], 'block_save', $form_state['values']['delta'], $form_state['values']); drupal_set_message(t('The block configuration has been saved.')); cache_clear_all(); - $form_state['redirect'] = 'admin/build/block'; + $form_state['redirect'] = 'admin/structure/block'; } } @@ -426,7 +426,7 @@ function block_add_block_form_submit($form, &$form_state) { drupal_set_message(t('The block has been created.')); cache_clear_all(); - $form_state['redirect'] = 'admin/build/block'; + $form_state['redirect'] = 'admin/structure/block'; } /** @@ -437,7 +437,7 @@ function block_box_delete(&$form_state, $bid = 0) { $form['info'] = array('#type' => 'hidden', '#value' => $box['info'] ? $box['info'] : $box['title']); $form['bid'] = array('#type' => 'hidden', '#value' => $bid); - return confirm_form($form, t('Are you sure you want to delete the block %name?', array('%name' => $box['info'])), 'admin/build/block', '', t('Delete'), t('Cancel')); + return confirm_form($form, t('Are you sure you want to delete the block %name?', array('%name' => $box['info'])), 'admin/structure/block', '', t('Delete'), t('Cancel')); } /** @@ -453,7 +453,7 @@ function block_box_delete_submit($form, &$form_state) { ->execute(); drupal_set_message(t('The block %name has been removed.', array('%name' => $form_state['values']['info']))); cache_clear_all(); - $form_state['redirect'] = 'admin/build/block'; + $form_state['redirect'] = 'admin/structure/block'; return; } diff --git a/modules/block/block.module b/modules/block/block.module index f561685b9..bdc511cc7 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -66,7 +66,7 @@ define('BLOCK_CACHE_GLOBAL', 0x0008); function block_help($path, $arg) { switch ($path) { case 'admin/help#block': - $output = '<p>' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Garland, for example, implements the regions "left sidebar", "right sidebar", "content", "header", and "footer", and a block may appear in any one of these areas. The <a href="@blocks">blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/build/block'))) . '</p>'; + $output = '<p>' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Garland, for example, implements the regions "left sidebar", "right sidebar", "content", "header", and "footer", and a block may appear in any one of these areas. The <a href="@blocks">blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/structure/block'))) . '</p>'; $output .= '<p>' . t('Although blocks are usually generated automatically by modules (like the <em>User login</em> block, for example), administrators can also define custom blocks. Custom blocks have a title, description, and body. The body of the block can be as long as necessary, and can contain content supported by any available <a href="@text-format">text format</a>.', array('@text-format' => url('admin/settings/filter'))) . '</p>'; $output .= '<p>' . t('When working with blocks, remember that:') . '</p>'; $output .= '<ul><li>' . t('since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis.') . '</li>'; @@ -78,12 +78,12 @@ function block_help($path, $arg) { $output .= '<li>' . t('some dynamic blocks, such as those generated by modules, will be displayed only on certain pages.') . '</li></ul>'; $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@block">Block module</a>.', array('@block' => 'http://drupal.org/handbook/modules/block/')) . '</p>'; return $output; - case 'admin/build/block': + case 'admin/structure/block': $output = '<p>' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. To change the region or order of a block, grab a drag-and-drop handle under the <em>Block</em> column and drag the block to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the <em>Save blocks</em> button at the bottom of the page.') . '</p>'; - $output .= '<p>' . t('Click the <em>configure</em> link next to each block to configure its specific title and visibility settings. Use the <a href="@add-block">add block page</a> to create a custom block.', array('@add-block' => url('admin/build/block/add'))) . '</p>'; + $output .= '<p>' . t('Click the <em>configure</em> link next to each block to configure its specific title and visibility settings. Use the <a href="@add-block">add block page</a> to create a custom block.', array('@add-block' => url('admin/structure/block/add'))) . '</p>'; return $output; - case 'admin/build/block/add': - return '<p>' . t('Use this page to create a new custom block. New blocks are disabled by default, and must be moved to a region on the <a href="@blocks">blocks administration page</a> to be visible.', array('@blocks' => url('admin/build/block'))) . '</p>'; + case 'admin/structure/block/add': + return '<p>' . t('Use this page to create a new custom block. New blocks are disabled by default, and must be moved to a region on the <a href="@blocks">blocks administration page</a> to be visible.', array('@blocks' => url('admin/structure/block'))) . '</p>'; } } @@ -120,38 +120,38 @@ function block_permission() { * Implement hook_menu(). */ function block_menu() { - $items['admin/build/block'] = array( + $items['admin/structure/block'] = array( 'title' => 'Blocks', 'description' => 'Configure what block content appears in your site\'s sidebars and other regions.', 'page callback' => 'block_admin_display', 'access arguments' => array('administer blocks'), ); - $items['admin/build/block/list'] = array( + $items['admin/structure/block/list'] = array( 'title' => 'List', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10, ); - $items['admin/build/block/list/js'] = array( + $items['admin/structure/block/list/js'] = array( 'title' => 'JavaScript List Form', 'page callback' => 'block_admin_display_js', 'access arguments' => array('administer blocks'), 'type' => MENU_CALLBACK, ); - $items['admin/build/block/configure'] = array( + $items['admin/structure/block/configure'] = array( 'title' => 'Configure block', 'page callback' => 'drupal_get_form', 'page arguments' => array('block_admin_configure'), 'access arguments' => array('administer blocks'), 'type' => MENU_CALLBACK, ); - $items['admin/build/block/delete'] = array( + $items['admin/structure/block/delete'] = array( 'title' => 'Delete block', 'page callback' => 'drupal_get_form', 'page arguments' => array('block_box_delete'), 'access arguments' => array('administer blocks'), 'type' => MENU_CALLBACK, ); - $items['admin/build/block/add'] = array( + $items['admin/structure/block/add'] = array( 'title' => 'Add block', 'page callback' => 'drupal_get_form', 'page arguments' => array('block_add_block_form'), @@ -160,7 +160,7 @@ function block_menu() { ); $default = variable_get('theme_default', 'garland'); foreach (list_themes() as $key => $theme) { - $items['admin/build/block/list/' . $key] = array( + $items['admin/structure/block/list/' . $key] = array( 'title' => check_plain($theme->info['name']), 'page arguments' => array($key), 'type' => $key == $default ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK, @@ -250,7 +250,7 @@ function block_page_alter($page) { // Append region description if we are rendering the block admin page. $item = menu_get_item(); - if ($item['path'] == 'admin/build/block' && isset($visible_regions[$region])) { + if ($item['path'] == 'admin/structure/block' && isset($visible_regions[$region])) { $description = '<div class="block-region">' . $all_regions[$region] . '</div>'; $page[$region]['block_description'] = array( '#markup' => $description, @@ -384,7 +384,7 @@ function block_box_form($edit = array()) { '#title' => t('Block description'), '#default_value' => $edit['info'], '#maxlength' => 64, - '#description' => t('A brief description of your block. Used on the <a href="@overview">blocks administration page</a>.', array('@overview' => url('admin/build/block'))), + '#description' => t('A brief description of your block. Used on the <a href="@overview">blocks administration page</a>.', array('@overview' => url('admin/structure/block'))), '#required' => TRUE, '#weight' => -19, ); diff --git a/modules/block/block.test b/modules/block/block.test index 9996b6fa9..6459fc663 100644 --- a/modules/block/block.test +++ b/modules/block/block.test @@ -37,12 +37,12 @@ class BlockTestCase extends DrupalWebTestCase { * Test creating custom block (i.e. box), moving it to a specific region and then deleting it. */ function testBox() { - // Add a new box by filling out the input form on the admin/build/block/add page. + // Add a new box by filling out the input form on the admin/structure/block/add page. $box = array(); $box['info'] = $this->randomName(8); $box['title'] = $this->randomName(8); $box['body'] = $this->randomName(32); - $this->drupalPost('admin/build/block/add', $box, t('Save block')); + $this->drupalPost('admin/structure/block/add', $box, t('Save block')); // Confirm that the box has been created, and then query the created bid. $this->assertText(t('The block has been created.'), t('Box successfully created.')); @@ -60,7 +60,7 @@ class BlockTestCase extends DrupalWebTestCase { // Delete the created box & verify that it's been deleted and no longer appearing on the page. $this->clickLink(t('delete')); - $this->drupalPost('admin/build/block/delete/' . $bid, array(), t('Delete')); + $this->drupalPost('admin/structure/block/delete/' . $bid, array(), t('Delete')); $this->assertRaw(t('The block %title has been removed.', array('%title' => $box['info'])), t('Box successfully deleted.')); $this->assertNoText(t($box['title']), t('Box no longer appears on page.')); } @@ -69,19 +69,19 @@ class BlockTestCase extends DrupalWebTestCase { * Test creating custom block (i.e. box) using Full HTML. */ function testBoxFormat() { - // Add a new box by filling out the input form on the admin/build/block/add page. + // Add a new box by filling out the input form on the admin/structure/block/add page. $box = array(); $box['info'] = $this->randomName(8); $box['title'] = $this->randomName(8); $box['body'] = '<h1>Full HTML</h1>'; $box['body_format'] = 2; - $this->drupalPost('admin/build/block/add', $box, t('Save block')); + $this->drupalPost('admin/structure/block/add', $box, t('Save block')); // Set the created box to a specific region. $bid = db_query("SELECT bid FROM {box} WHERE info = :info", array(':info' => $box['info']))->fetchField(); $edit = array(); $edit['block_' . $bid . '[region]'] = 'left'; - $this->drupalPost('admin/build/block', $edit, t('Save blocks')); + $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); // Confirm that the box is being displayed using configured text format. $this->assertRaw('<h1>Full HTML</h1>', t('Box successfully being displayed using Full HTML.')); @@ -90,9 +90,9 @@ class BlockTestCase extends DrupalWebTestCase { // but can still submit the form without errors. $block_admin = $this->drupalCreateUser(array('administer blocks')); $this->drupalLogin($block_admin); - $this->drupalGet('admin/build/block/configure/block/' . $bid); + $this->drupalGet('admin/structure/block/configure/block/' . $bid); $this->assertNoText(t('Block body')); - $this->drupalPost('admin/build/block/configure/block/' . $bid, array(), t('Save block')); + $this->drupalPost('admin/structure/block/configure/block/' . $bid, array(), t('Save block')); $this->assertNoText(t('Please ensure that each block description is unique.')); // Confirm that the box is still being displayed using configured text format. @@ -113,7 +113,7 @@ class BlockTestCase extends DrupalWebTestCase { $edit = array(); $edit['pages'] = 'user*'; $edit['roles[2]'] = TRUE; - $this->drupalPost('admin/build/block/configure/' . $block['module'] . '/' . $block['delta'], $edit, t('Save block')); + $this->drupalPost('admin/structure/block/configure/' . $block['module'] . '/' . $block['delta'], $edit, t('Save block')); // Move block to the left sidebar. $this->moveBlockToRegion($block, $this->regions[1]); @@ -141,7 +141,7 @@ class BlockTestCase extends DrupalWebTestCase { $block['title'] = $this->randomName(8); // Set block title to confirm that interface works and override any custom titles. - $this->drupalPost('admin/build/block/configure/' . $block['module'] . '/' . $block['delta'], array('title' => $block['title']), t('Save block')); + $this->drupalPost('admin/structure/block/configure/' . $block['module'] . '/' . $block['delta'], array('title' => $block['title']), t('Save block')); $this->assertText(t('The block configuration has been saved.'), t('Block title set.')); $bid = db_query("SELECT bid FROM {block} WHERE module = :module AND delta = :delta", array( ':module' => $block['module'], @@ -159,7 +159,7 @@ class BlockTestCase extends DrupalWebTestCase { // Set the block to the disabled region. $edit = array(); $edit[$block['module'] . '_' . $block['delta'] . '[region]'] = '-1'; - $this->drupalPost('admin/build/block', $edit, t('Save blocks')); + $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); // Confirm that the block was moved to the proper region. $this->assertText(t('The block settings have been updated.'), t('Block successfully move to disabled region.')); @@ -172,10 +172,10 @@ class BlockTestCase extends DrupalWebTestCase { // For convenience of developers, put the navigation block back. $edit = array(); $edit[$block['module'] . '_' . $block['delta'] . '[region]'] = 'left'; - $this->drupalPost('admin/build/block', $edit, t('Save blocks')); + $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); $this->assertText(t('The block settings have been updated.'), t('Block successfully move to left region.')); - $this->drupalPost('admin/build/block/configure/' . $block['module'] . '/' . $block['delta'], array('title' => 'Navigation'), t('Save block')); + $this->drupalPost('admin/structure/block/configure/' . $block['module'] . '/' . $block['delta'], array('title' => 'Navigation'), t('Save block')); $this->assertText(t('The block configuration has been saved.'), t('Block title set.')); } @@ -188,7 +188,7 @@ class BlockTestCase extends DrupalWebTestCase { // Set the created block to a specific region. $edit = array(); $edit[$block['module'] . '_' . $block['delta'] . '[region]'] = $region['name']; - $this->drupalPost('admin/build/block', $edit, t('Save blocks')); + $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); // Confirm that the block was moved to the proper region. $this->assertText(t('The block settings have been updated.'), t('Block successfully moved to %region_name region.', array( '%region_name' => $region['name']))); @@ -217,8 +217,8 @@ class NonDefaultBlockAdmin extends DrupalWebTestCase { function testNonDefaultBlockAdmin() { $admin_user = $this->drupalCreateUser(array('administer blocks', 'administer site configuration')); $this->drupalLogin($admin_user); - $this->drupalPost('admin/build/themes', array('status[stark]' => 1), t('Save configuration')); - $this->drupalGet('admin/build/block/list/stark'); + $this->drupalPost('admin/structure/themes', array('status[stark]' => 1), t('Save configuration')); + $this->drupalGet('admin/structure/block/list/stark'); $this->assertRaw('stark/layout.css', t('Stark CSS found')); } } @@ -258,7 +258,7 @@ class NewDefaultThemeBlocks extends DrupalWebTestCase { // Turn on the Stark theme and ensure that it contains all of the blocks // that Garland did. - $this->drupalPost('admin/build/themes', array('theme_default' => 'stark'), t('Save configuration')); + $this->drupalPost('admin/structure/themes', array('theme_default' => 'stark'), t('Save configuration')); $result = db_query("SELECT * FROM {block} WHERE theme='stark'"); foreach ($result as $block) { unset($block->theme, $block->bid); @@ -288,13 +288,13 @@ class BlockAdminThemeTestCase extends DrupalWebTestCase { $this->drupalLogin($admin_user); // Ensure that access to block admin page is denied when theme is disabled. - $this->drupalGet('admin/build/block/list/stark'); + $this->drupalGet('admin/structure/block/list/stark'); $this->assertResponse(403, t('The block admin page for a disabled theme can not be accessed')); // Enable admin theme and confirm that tab is accessible. $edit['admin_theme'] = 'stark'; - $this->drupalPost('admin/build/themes', $edit, t('Save configuration')); - $this->drupalGet('admin/build/block/list/stark'); + $this->drupalPost('admin/structure/themes', $edit, t('Save configuration')); + $this->drupalGet('admin/structure/block/list/stark'); $this->assertResponse(200, t('The block admin page for the admin theme can be accessed')); } } |