[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/modules/block/ -> block-admin-display-form.tpl.php (source)

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


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7