private function loadDataGridTemplates()
{
// no hooks so don't bother
if (!isset($this->information['templates'])) {
return;
}
// build data for display in datagrid
$templates = array();
foreach ($this->information['templates'] as $template) {
// set template name & path
$record['name'] = $template['label'];
$record['path'] = $template['path'];
// set positions
$record['positions'] = array();
foreach ($template['positions'] as $position) {
$record['positions'][] = $position['name'];
}
$record['positions'] = implode(', ', $record['positions']);
// add template to list
$templates[] = $record;
}
// create data grid
$this->dataGridTemplates = new BackendDataGridArray($templates);
// add label for path
$this->dataGridTemplates->setHeaderLabels(array('path' => BL::msg('PathToTemplate')));
// no paging
$this->dataGridTemplates->setPaging(false);
}