? mv_admin_block.patch ? sites/all/modules ? sites/all/themes ? sites/default/files ? sites/default/settings.php Index: modules/block/block.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.admin.inc,v retrieving revision 1.7 diff -u -p -r1.7 block.admin.inc --- modules/block/block.admin.inc 20 Aug 2007 06:41:38 -0000 1.7 +++ modules/block/block.admin.inc 31 Aug 2007 15:41:46 -0000 @@ -299,3 +299,62 @@ function block_box_delete_submit($form, $form_state['redirect'] = 'admin/build/block'; return; } + +/** + * Process variables for block-admin-display.tpl.php. + * + * The $variables array contains the following arguments: + * - $form + * + * @see block-admin-display.tpl.php + * @see theme_block_admin_display() + */ +function template_preprocess_block_admin_display(&$variables) { + global $theme_key; + + $variables['throttle'] = module_exists('throttle'); + $block_regions = system_region_list($theme_key); + + // Highlight regions on page to provide visual reference. + foreach ($block_regions as $key => $value) { + drupal_set_content($key, '
'. $value .'
'); + } + + // Setup to track previous region in loop. + $last_region = ''; + foreach (element_children($variables['form']) as $i) { + $block = &$variables['form'][$i]; + + // Only take form elements that are blocks. + if (isset($block['info'])) { + // Fetch region for current block. + $region = $block['region']['#default_value']; + + // Track first block listing to insert region header inside block_admin_display.tpl.php. + $is_region_first = FALSE; + if ($last_region != $region) { + $is_region_first = TRUE; + // Set region title. Block regions already translated. + if ($region != BLOCK_REGION_NONE) { + $region_title = drupal_ucfirst($block_regions[$region]); + } + else { + $region_title = t('Disabled'); + } + } + + $variables['block_listing'][$i]->is_region_first = $is_region_first; + $variables['block_listing'][$i]->region_title = $region_title; + $variables['block_listing'][$i]->block_title = drupal_render($block['info']); + $variables['block_listing'][$i]->region_select = drupal_render($block['region']) . drupal_render($block['theme']); + $variables['block_listing'][$i]->weight_select = drupal_render($block['weight']); + $variables['block_listing'][$i]->throttle_check = $variables['throttle'] ? drupal_render($block['throttle']) : ''; + $variables['block_listing'][$i]->configure_link = drupal_render($block['configure']); + $variables['block_listing'][$i]->delete_link = !empty($block['delete']) ? drupal_render($block['delete']) : ''; + + $last_region = $region; + } + } + + $variables['form_submit'] = drupal_render($variables['form']); +} Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.276 diff -u -p -r1.276 block.module --- modules/block/block.module 26 Aug 2007 07:46:10 -0000 1.276 +++ modules/block/block.module 31 Aug 2007 15:41:46 -0000 @@ -104,71 +104,13 @@ function block_theme() { return array( 'block_admin_display' => array( 'template' => 'block-admin-display', + 'file' => 'block.admin.inc', 'arguments' => array('form' => NULL), ), ); } /** - * Process variables for block-admin-display.tpl.php. - * - * The $variables array contains the following arguments: - * - $form - * - * @see block-admin-display.tpl.php - * @see theme_block_admin_display() - */ -function template_preprocess_block_admin_display(&$variables) { - global $theme_key; - - $variables['throttle'] = module_exists('throttle'); - $block_regions = system_region_list($theme_key); - - // Highlight regions on page to provide visual reference. - foreach ($block_regions as $key => $value) { - drupal_set_content($key, '
'. $value .'
'); - } - - // Setup to track previous region in loop. - $last_region = ''; - foreach (element_children($variables['form']) as $i) { - $block = &$variables['form'][$i]; - - // Only take form elements that are blocks. - if (isset($block['info'])) { - // Fetch region for current block. - $region = $block['region']['#default_value']; - - // Track first block listing to insert region header inside block_admin_display.tpl.php. - $is_region_first = FALSE; - if ($last_region != $region) { - $is_region_first = TRUE; - // Set region title. Block regions already translated. - if ($region != BLOCK_REGION_NONE) { - $region_title = drupal_ucfirst($block_regions[$region]); - } - else { - $region_title = t('Disabled'); - } - } - - $variables['block_listing'][$i]->is_region_first = $is_region_first; - $variables['block_listing'][$i]->region_title = $region_title; - $variables['block_listing'][$i]->block_title = drupal_render($block['info']); - $variables['block_listing'][$i]->region_select = drupal_render($block['region']) . drupal_render($block['theme']); - $variables['block_listing'][$i]->weight_select = drupal_render($block['weight']); - $variables['block_listing'][$i]->throttle_check = $variables['throttle'] ? drupal_render($block['throttle']) : ''; - $variables['block_listing'][$i]->configure_link = drupal_render($block['configure']); - $variables['block_listing'][$i]->delete_link = !empty($block['delete']) ? drupal_render($block['delete']) : ''; - - $last_region = $region; - } - } - - $variables['form_submit'] = drupal_render($variables['form']); -} - -/** * Implementation of hook_perm(). */ function block_perm() {