git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@77 97e9348a-65ac-dc4b-aefc-98561f571b83
60 lines
1.8 KiB
PHP
60 lines
1.8 KiB
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
if (isset($heading))
|
|
echo $heading;
|
|
elseif (!isset($caption))
|
|
echo '<h2>'.__('Maps',true).'</h2>';
|
|
|
|
$headers = array('ID', 'Name', 'Area', 'Width', 'Depth', 'Comment');
|
|
$column_class = array();
|
|
foreach (array_intersect($headers, array('ID')) AS $k => $v) {
|
|
$column_class[$k] = 'id';
|
|
}
|
|
foreach (array_intersect($headers, array('Comment')) AS $k => $v) {
|
|
$column_class[$k] = 'slack';
|
|
}
|
|
|
|
if (isset($paginator)) {
|
|
echo $paginator->counter(array(
|
|
'format' => __('Page %page% of %pages%, showing %current% records (%start% - %end%) of %count% total', true)));
|
|
|
|
$headers = array($paginator->sort('id'),
|
|
$paginator->sort('name'),
|
|
$paginator->sort('site_area_id'),
|
|
$paginator->sort('width'),
|
|
$paginator->sort('depth'),
|
|
$paginator->sort('comment'));
|
|
}
|
|
|
|
$rows = array();
|
|
foreach ($maps as $map) {
|
|
$rows[] = array($html->link($map['Map']['id'],
|
|
array('controller' => 'maps',
|
|
'action' => 'view',
|
|
$map['Map']['id'])),
|
|
$html->link($map['Map']['name'],
|
|
array('controller' => 'maps',
|
|
'action' => 'view',
|
|
$map['Map']['id'])),
|
|
$map['SiteArea']['name'],
|
|
$map['Map']['width'] / 12,
|
|
$map['Map']['depth'] / 12,
|
|
$map['Map']['comment']);
|
|
}
|
|
|
|
echo $this->element('table',
|
|
array('class' => 'item map list',
|
|
'headers' => $headers,
|
|
'rows' => $rows,
|
|
'column_class' => $column_class));
|
|
|
|
if (isset($paginator)) {
|
|
echo('<div class="paging">' . "\n");
|
|
echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));
|
|
echo(' | ');
|
|
echo $paginator->numbers();
|
|
echo(' | ');
|
|
echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));
|
|
echo('</div>' . "\n");
|
|
}
|