private function onAdd() { $form = $this->getForm(); if (false !== ($errors = $form->validate($this->module))) { return $errors . $this->templateAdd(); } $cat = new GWF_Category(array('cat_tree_id' => 0, 'cat_tree_key' => $form->getVar('key'), 'cat_tree_pid' => 0, 'cat_tree_left' => 0, 'cat_tree_right' => 0, 'cat_group' => $form->getVar('group'))); if (false === $cat->insert()) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)) . $this->templateAdd(); } $cat->rebuildFullTree(); return $this->module->message('msg_added'); }