* @package WB * @subpackage content */ /** * Load required class */ WBClass::load('WBContent' , 'WBContent_TableEditor'); /** * Content component: TableEditor_Banner * * @version 0.3.1 * @package WB * @subpackage content */ class WBContent_TableEditor_Banner extends WBContent_TableEditor { const TABLE_BANNER = 'banner'; const TABLE_TEASER = 'teaser'; protected $config = array( 'action' => 'list', 'requiredgroup' => 'contenteditor', 'requiredgroupmanager' => 'contenteditor', 'showsomeoneelses' => 1, 'limit' => '20', 'goto' => '0', 'id' => '__new', 'managesortcolumn' => 'position', 'levels' => 1, 'order' => '', 'addcurrentuser' => 'never', 'searchfields' => array('title', 'urltext', 'brief'), 'usefilter' => 1, 'translator' => 'auto', 'database' => '__default', 'manadator' => '' ); /** * 2nd constructor * * Reset template folder */ protected function init() { parent::init(); $this->config['tmplDir'] = 'TableEditor/banner'; switch ($this->config['tableenv']) { case self::TABLE_TEASER: $this->config['table'] = self::TABLE_TEASER; break; default: case self::TABLE_BANNER: $this->config['tableenv'] = self::TABLE_BANNER; $this->config['table'] = self::TABLE_BANNER; 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/banner/' . $this->config['tableenv']; } }