public function addFrame($name, $options = array())
{
if (!$this->model) {
throw $this->exception('Must set CRUD model first');
}
if (!is_array($options)) {
throw $this->exception('Must be array');
}
$s = $this->app->normalizeName($name);
if ($this->isEditing('fr_' . $s)) {
$n = $this->virtual_page->name . '_' . $s;
if ($_GET[$n]) {
$this->id = $_GET[$n];
$this->app->stickyGET($n);
}
return $this->virtual_page->getPage();
}
if ($this->isEditing()) {
return false;
}
$this->virtual_page->addColumn('fr_' . $s, $options['title'] ?: $name, array('descr' => $options['label'] ?: null, 'icon' => $options['icon'] ?: null), $this->grid);
}