block-admin-display-form.tpl.php

  1. drupal
    1. 6 modules/block/block-admin-display-form.tpl.php
    2. 7 modules/block/block-admin-display-form.tpl.php
    3. 8 core/modules/block/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.

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->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

core/modules/block/block-admin-display-form.tpl.php
View source
  1. <?php
  2. /**
  3. * @file
  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. *
  11. * Each $block_listing[$region] contains an array of blocks for that region.
  12. *
  13. * Each $data in $block_listing[$region] contains:
  14. * - $data->region_title: Region title for the listed block.
  15. * - $data->block_title: Block title.
  16. * - $data->region_select: Drop-down menu for assigning a region.
  17. * - $data->weight_select: Drop-down menu for setting weights.
  18. * - $data->configure_link: Block configuration link.
  19. * - $data->delete_link: For deleting user added blocks.
  20. *
  21. * @see template_preprocess_block_admin_display_form()
  22. * @see theme_block_admin_display()
  23. *
  24. * @ingroup themeable
  25. */
  26. ?>
  27. <table id="blocks" class="sticky-enabled">
  28. <thead>
  29. <tr>
  30. <th><?php print t('Block'); ?></th>
  31. <th><?php print t('Region'); ?></th>
  32. <th><?php print t('Weight'); ?></th>
  33. <th colspan="2"><?php print t('Operations'); ?></th>
  34. </tr>
  35. </thead>
  36. <tbody>
  37. <?php $row = 0; ?>
  38. <?php foreach ($block_regions as $region => $title): ?>
  39. <tr class="region-title region-title-<?php print $region?>">
  40. <td colspan="5"><?php print $title; ?></td>
  41. </tr>
  42. <tr class="region-message region-<?php print $region?>-message <?php print empty($block_listing[$region]) ? 'region-empty' : 'region-populated'; ?>">
  43. <td colspan="5"><em><?php print t('No blocks in this region'); ?></em></td>
  44. </tr>
  45. <?php foreach ($block_listing[$region] as $delta => $data): ?>
  46. <tr class="draggable <?php print $row % 2 == 0 ? 'odd' : 'even'; ?><?php print $data->row_class ? ' ' . $data->row_class : ''; ?>">
  47. <td class="block"><?php print $data->block_title; ?></td>
  48. <td><?php print $data->region_select; ?></td>
  49. <td><?php print $data->weight_select; ?></td>
  50. <td><?php print $data->configure_link; ?></td>
  51. <td><?php print $data->delete_link; ?></td>
  52. </tr>
  53. <?php $row++; ?>
  54. <?php endforeach; ?>
  55. <?php endforeach; ?>
  56. </tbody>
  57. </table>
  58. <?php print $form_submit; ?>

Related topics

Login or register to post comments