| webmaster@1 | 1 <?php | 
| webmaster@1 | 2 // $Id: block-admin-display-form.tpl.php,v 1.3 2008/01/16 22:57:26 goba Exp $ | 
| webmaster@1 | 3 | 
| webmaster@1 | 4 /** | 
| webmaster@1 | 5  * @file block-admin-display-form.tpl.php | 
| webmaster@1 | 6  * Default theme implementation to configure blocks. | 
| webmaster@1 | 7  * | 
| webmaster@1 | 8  * Available variables: | 
| webmaster@1 | 9  * - $block_regions: An array of regions. Keyed by name with the title as value. | 
| webmaster@1 | 10  * - $block_listing: An array of blocks keyed by region and then delta. | 
| webmaster@1 | 11  * - $form_submit: Form submit button. | 
| webmaster@1 | 12  * - $throttle: TRUE or FALSE depending on throttle module being enabled. | 
| webmaster@1 | 13  * | 
| webmaster@1 | 14  * Each $block_listing[$region] contains an array of blocks for that region. | 
| webmaster@1 | 15  * | 
| webmaster@1 | 16  * Each $data in $block_listing[$region] contains: | 
| webmaster@1 | 17  * - $data->region_title: Region title for the listed block. | 
| webmaster@1 | 18  * - $data->block_title: Block title. | 
| webmaster@1 | 19  * - $data->region_select: Drop-down menu for assigning a region. | 
| webmaster@1 | 20  * - $data->weight_select: Drop-down menu for setting weights. | 
| webmaster@1 | 21  * - $data->throttle_check: Checkbox to enable throttling. | 
| webmaster@1 | 22  * - $data->configure_link: Block configuration link. | 
| webmaster@1 | 23  * - $data->delete_link: For deleting user added blocks. | 
| webmaster@1 | 24  * | 
| webmaster@1 | 25  * @see template_preprocess_block_admin_display_form() | 
| webmaster@1 | 26  * @see theme_block_admin_display() | 
| webmaster@1 | 27  */ | 
| webmaster@1 | 28 ?> | 
| webmaster@1 | 29 <?php | 
| webmaster@1 | 30   // Add table javascript. | 
| webmaster@1 | 31   drupal_add_js('misc/tableheader.js'); | 
| webmaster@1 | 32   drupal_add_js(drupal_get_path('module', 'block') .'/block.js'); | 
| webmaster@1 | 33   foreach ($block_regions as $region => $title) { | 
| webmaster@1 | 34     drupal_add_tabledrag('blocks', 'match', 'sibling', 'block-region-select', 'block-region-'. $region, NULL, FALSE); | 
| webmaster@1 | 35     drupal_add_tabledrag('blocks', 'order', 'sibling', 'block-weight', 'block-weight-'. $region); | 
| webmaster@1 | 36   } | 
| webmaster@1 | 37 ?> | 
| webmaster@1 | 38 <table id="blocks" class="sticky-enabled"> | 
| webmaster@1 | 39   <thead> | 
| webmaster@1 | 40     <tr> | 
| webmaster@1 | 41       <th><?php print t('Block'); ?></th> | 
| webmaster@1 | 42       <th><?php print t('Region'); ?></th> | 
| webmaster@1 | 43       <th><?php print t('Weight'); ?></th> | 
| webmaster@1 | 44       <?php if ($throttle): ?> | 
| webmaster@1 | 45         <th><?php print t('Throttle'); ?></th> | 
| webmaster@1 | 46       <?php endif; ?> | 
| webmaster@1 | 47       <th colspan="2"><?php print t('Operations'); ?></th> | 
| webmaster@1 | 48     </tr> | 
| webmaster@1 | 49   </thead> | 
| webmaster@1 | 50   <tbody> | 
| webmaster@1 | 51     <?php $row = 0; ?> | 
| webmaster@1 | 52     <?php foreach ($block_regions as $region => $title): ?> | 
| webmaster@1 | 53       <tr class="region region-<?php print $region?>"> | 
| webmaster@1 | 54         <td colspan="<?php print $throttle ? '6' : '5'; ?>" class="region"><?php print $title; ?></td> | 
| webmaster@1 | 55       </tr> | 
| webmaster@1 | 56       <tr class="region-message region-<?php print $region?>-message <?php print empty($block_listing[$region]) ? 'region-empty' : 'region-populated'; ?>"> | 
| webmaster@1 | 57         <td colspan="<?php print $throttle ? '6' : '5'; ?>"><em><?php print t('No blocks in this region'); ?></em></td> | 
| webmaster@1 | 58       </tr> | 
| webmaster@1 | 59       <?php foreach ($block_listing[$region] as $delta => $data): ?> | 
| webmaster@1 | 60       <tr class="draggable <?php print $row % 2 == 0 ? 'odd' : 'even'; ?><?php print $data->row_class ? ' '. $data->row_class : ''; ?>"> | 
| webmaster@1 | 61         <td class="block"><?php print $data->block_title; ?></td> | 
| webmaster@1 | 62         <td><?php print $data->region_select; ?></td> | 
| webmaster@1 | 63         <td><?php print $data->weight_select; ?></td> | 
| webmaster@1 | 64         <?php if ($throttle): ?> | 
| webmaster@1 | 65           <td><?php print $data->throttle_check; ?></td> | 
| webmaster@1 | 66         <?php endif; ?> | 
| webmaster@1 | 67         <td><?php print $data->configure_link; ?></td> | 
| webmaster@1 | 68         <td><?php print $data->delete_link; ?></td> | 
| webmaster@1 | 69       </tr> | 
| webmaster@1 | 70       <?php $row++; ?> | 
| webmaster@1 | 71       <?php endforeach; ?> | 
| webmaster@1 | 72     <?php endforeach; ?> | 
| webmaster@1 | 73   </tbody> | 
| webmaster@1 | 74 </table> | 
| webmaster@1 | 75 | 
| webmaster@1 | 76 <?php print $form_submit; ?> |