/**
* Return the metadata for the table.
*
* @return array An array of the table metadata.
* @throws Hermes_Exception
*/
public function getMetaData()
{
if (is_null($this->_metaData)) {
list($app, $name) = explode('/', $this->_config['name']);
$args = array($name, $this->_config['params']);
$this->_metaData = $GLOBALS['registry']->callByPackage($app, 'getTableMetaData', $args);
// We need to make vars for the columns.
foreach ($this->_metaData['sections'] as $secname => $section) {
foreach ($section['columns'] as $col) {
$title = isset($col['title']) ? $col['title'] : '';
$typename = isset($col['type']) ? $col['type'] : 'text';
$params = isset($col['params']) ? $col['params'] : array();
// Column types which begin with % are pseudo-types handled
// directly.
if (substr($typename, 0, 1) != '%') {
// This type needs to be assigned by reference!
$type =& Horde_Form::getType($typename, $params);
$var = new Horde_Form_Variable($title, $col['name'], $type, false, true, '');
$this->_formVars[$secname][$col['name']] = $var;
}
}
}
}
return $this->_metaData;
}