Code coverage for /20080809/modules/block/block-admin-display-form.tpl.php

Line #Times calledCode
1
<?php
2
// $Id: block-admin-display-form.tpl.php,v 1.6 2008/05/15 21:30:02 dries
Exp $
3
4
/**
5
 * @file
6
 * Default theme implementation to configure blocks.
7
 *
8
 * Available variables:
9
 * - $block_regions: An array of regions. Keyed by name with the title as
value.
10
 * - $block_listing: An array of blocks keyed by region and then delta.
11
 * - $form_submit: Form submit button.
12
 *
13
 * Each $block_listing[$region] contains an array of blocks for that
region.
14
 *
15
 * Each $data in $block_listing[$region] contains:
16
 * - $data->region_title: Region title for the listed block.
17
 * - $data->block_title: Block title.
18
 * - $data->region_select: Drop-down menu for assigning a region.
19
 * - $data->weight_select: Drop-down menu for setting weights.
20
 * - $data->configure_link: Block configuration link.
21
 * - $data->delete_link: For deleting user added blocks.
22
 *
23
 * @see template_preprocess_block_admin_display_form()
24
 * @see theme_block_admin_display()
25
 */
26
?>
27
<?php
28
  // Add table javascript.
2920
  drupal_add_js('misc/tableheader.js');
3020
  drupal_add_js(drupal_get_path('module', 'block') . '/block.js');
3120
  foreach ($block_regions as $region => $title) {
3220
    drupal_add_tabledrag('blocks', 'match', 'sibling',
'block-region-select', 'block-region-' . $region, NULL, FALSE);
3320
    drupal_add_tabledrag('blocks', 'order', 'sibling', 'block-weight',
'block-weight-' . $region);
3420
  }
35
?>
36
<table id="blocks" class="sticky-enabled">
37
  <thead>
38
    <tr>
3920
      <th><?php print t('Block'); ?></th>
4020
      <th><?php print t('Region'); ?></th>
4120
      <th><?php print t('Weight'); ?></th>
4220
      <th colspan="2"><?php print t('Operations'); ?></th>
43
    </tr>
44
  </thead>
45
  <tbody>
4620
    <?php $row = 0; ?>
4720
    <?php foreach ($block_regions as $region => $title): ?>
4820
      <tr class="region region-<?php print $region?>">
4920
        <td colspan="5" class="region"><?php print $title; ?></td>
50
      </tr>
5120
      <tr class="region-message region-<?php print $region?>-message <?php
print empty($block_listing[$region]) ? 'region-empty' : 'region-populated';
?>">
5220
        <td colspan="5"><em><?php print t('No blocks in this region');
?></em></td>
53
      </tr>
5420
      <?php foreach ($block_listing[$region] as $delta => $data): ?>
5520
      <tr class="draggable <?php print $row % 2 == 0 ? 'odd' : 'even';
?><?php print $data->row_class ? ' ' . $data->row_class : ''; ?>">
5620
        <td class="block"><?php print $data->block_title; ?></td>
5720
        <td><?php print $data->region_select; ?></td>
5820
        <td><?php print $data->weight_select; ?></td>
5920
        <td><?php print $data->configure_link; ?></td>
6020
        <td><?php print $data->delete_link; ?></td>
61
      </tr>
6220
      <?php $row++; ?>
6320
      <?php endforeach; ?>
6420
    <?php endforeach; ?>
65
  </tbody>
66
</table>
67
6820
<?php print $form_submit; ?>
6920