| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* This file is loosely derived from block-admin-display-form.tpl.php.
|
| 6 |
* It still uses the same css classes.
|
| 7 |
* Hence you will see the terms block and reference used interchangeably.
|
| 8 |
* You will also see region and zone used interchangeably.
|
| 9 |
*/
|
| 10 |
|
| 11 |
/**
|
| 12 |
* @file composite-layout-form.tpl.php
|
| 13 |
* Default theme implementation to configure layout.
|
| 14 |
*
|
| 15 |
* Available variables:
|
| 16 |
* - $layout_zones: An array of zones. Keyed by name with the title as value.
|
| 17 |
* - $zone_listing: An array of blocks keyed by region and then delta.
|
| 18 |
* - $form_submit: Form submit button and other required form fields.
|
| 19 |
*
|
| 20 |
* Each $zone_listing[$zone] contains an array of items for that region.
|
| 21 |
*
|
| 22 |
* Each $data in $zone_listing[$zone] contains:
|
| 23 |
* - $data->reference_title: Item title.
|
| 24 |
* - $data->zone_select: Drop-down menu for assigning a zone.
|
| 25 |
* - $data->weight_select: Drop-down menu for setting weights.
|
| 26 |
* - $data->configure_link: Configuration link.
|
| 27 |
* - $data->delete_link: For deleting user added items ??
|
| 28 |
*
|
| 29 |
* @see template_preprocess_composite_layout_form()
|
| 30 |
*/
|
| 31 |
?>
|
| 32 |
<?php
|
| 33 |
// Add table javascript.
|
| 34 |
drupal_add_js('misc/tableheader.js');
|
| 35 |
drupal_add_js(drupal_get_path('module', 'composite') .'/composite.js');
|
| 36 |
foreach ($layout_zones as $region => $title) {
|
| 37 |
drupal_add_tabledrag('blocks', 'match', 'sibling', 'block-region-select', 'block-region-'. $region, NULL, FALSE);
|
| 38 |
drupal_add_tabledrag('blocks', 'order', 'sibling', 'block-weight', 'block-weight-'. $region);
|
| 39 |
}
|
| 40 |
?>
|
| 41 |
<table id="blocks" class="sticky-enabled">
|
| 42 |
<thead>
|
| 43 |
<tr>
|
| 44 |
<th><?php print t('Item'); ?></th>
|
| 45 |
<th><?php print t('Zone'); ?></th>
|
| 46 |
<th><?php print t('Weight'); ?></th>
|
| 47 |
<th><?php print t('Additional settings'); ?></th>
|
| 48 |
<th></th>
|
| 49 |
</tr>
|
| 50 |
</thead>
|
| 51 |
<tbody>
|
| 52 |
<?php $row = 0; ?>
|
| 53 |
<?php foreach ($layout_zones as $zone => $title): ?>
|
| 54 |
<tr class="region region-<?php print $zone?>">
|
| 55 |
<td colspan="5" class="region"><?php print $title; ?></td>
|
| 56 |
</tr>
|
| 57 |
<tr class="region-message region-<?php print $zone?>-message <?php print empty($zone_listing[$zone]) ? 'region-empty' : 'region-populated'; ?>">
|
| 58 |
<td colspan="5"><em><?php print t('No items in this zone'); ?></em></td>
|
| 59 |
</tr>
|
| 60 |
<?php foreach ($zone_listing[$zone] as $delta => $data): ?>
|
| 61 |
<tr class="draggable <?php print $row % 2 == 0 ? 'odd' : 'even'; ?><?php print $data->row_class ? ' '. $data->row_class : ''; ?>">
|
| 62 |
<td class="block"><?php print $data->reference_title; ?></td>
|
| 63 |
<td><?php print $data->zone_select; ?></td>
|
| 64 |
<td><?php print $data->weight_select; ?></td>
|
| 65 |
<td><?php print $data->data_widget; ?></td>
|
| 66 |
<td><?php print $data->checkbox; ?></td>
|
| 67 |
</tr>
|
| 68 |
<?php $row++; ?>
|
| 69 |
<?php endforeach; ?>
|
| 70 |
<?php endforeach; ?>
|
| 71 |
</tbody>
|
| 72 |
</table>
|
| 73 |
|
| 74 |
<?php print $form_submit; ?>
|