Files
pmgr/site/views/elements/maps.ctp

20 lines
815 B
PHP

<?php /* -*- mode:PHP -*- */
// Define the table columns
$cols = array();
$cols['ID'] = array('index' => 'Map.id', 'formatter' => 'id');
$cols['Name'] = array('index' => 'Map.name', 'formatter' => 'longname');
$cols['Site Area'] = array('index' => 'SiteArea.name', 'formatter' => 'longname');
$cols['Width'] = array('index' => 'Map.width', 'formatter' => 'number');
$cols['Depth'] = array('index' => 'Map.depth', 'formatter' => 'number');
$cols['Comment'] = array('index' => 'Map.comment', 'formatter' => 'comment');
// Render the grid
$grid
->columns($cols)
->sortField('Name')
->defaultFields(array('ID', 'Name'))
->searchFields(array('Name'))
->render($this, isset($config) ? $config : null,
array_diff(array_keys($cols), array()));