block-admin-display-form.tpl.php

  1. 7.x drupal-7.x/modules/block/block-admin-display-form.tpl.php
  2. 6.x drupal-6.x/modules/block/block-admin-display-form.tpl.php

block-admin-display-form.tpl.php Default theme implementation to configure blocks.

Available variables:

  • $block_regions: An array of regions. Keyed by name with the title as value.
  • $block_listing: An array of blocks keyed by region and then delta.
  • $form_submit: Form submit button.
  • $throttle: TRUE or FALSE depending on throttle module being enabled.

Each $block_listing[$region] contains an array of blocks for that region.

Each $data in $block_listing[$region] contains:

  • $data->region_title: Region title for the listed block.
  • $data->block_title: Block title.
  • $data->region_select: Drop-down menu for assigning a region.
  • $data->weight_select: Drop-down menu for setting weights.
  • $data->throttle_check: Checkbox to enable throttling.
  • $data->configure_link: Block configuration link.
  • $data->delete_link: For deleting user added blocks.

See also

template_preprocess_block_admin_display_form()

theme_block_admin_display()

File

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