* @package WB * @subpackage content */ /** * Load required class */ WBClass::load( 'WBContent', 'WBContent_TableEditor' ); /** * Content component: TableEditor_FAQ * * @version 0.1.1 * @package WB * @subpackage content */ class WBContent_TableEditor_FAQ extends WBContent_TableEditor { const TABLE_FAQ = 'faq'; const TABLE_FAQTYPE = 'faqtype'; /** * 2nd constructor * * Reset template folder */ protected function init() { parent::init(); $this->config['tmplDir'] = 'TableEditor/faq'; $this->config['translator'] = 'auto'; $this->config['searchfields'] = array(); $this->config['usefilter'] = 1; $this->config['addcurrentuser'] = 'never'; switch ($this->config['tableenv']) { case self::TABLE_FAQTYPE: $this->config['table'] = self::TABLE_FAQTYPE; $this->config['searchfields'] = array('faqtid', 'title'); break; default: case self::TABLE_FAQ: $this->config['table'] = self::TABLE_FAQ; $this->config['searchfields'] = array('faqid', 'question', 'answer', 'note'); break; } // tweak permissions if (!$this->isUserInGroup($this->config['requiredgroup'])) { $this->config['action'] = 'edit'; } } /** * location of form config * * Return sub directory where form element definitions are located * * @return string folder */ protected function getFormConfigDir() { return 'table/faq/' . $this->config['tableenv']; } }