/** * Creates a model for getModel(). Called only for each new $action. * * The parameters allow you to easily adapt the model to the current action. The $detailed * parameter was added, because the most common use of action is a split between detailed * and summarized actions. * * @param boolean $detailed True when the current action is not in $summarizedActions. * @param string $action The current action. * @return \MUtil_Model_ModelAbstract */ protected function createModel($detailed, $action) { $model = new \Gems_Model_JoinModel('log_maint', 'gems__log_setup', 'gls', true); $model->set('gls_name', 'label', $this->_('Action'), 'elementClass', 'create' == $action ? 'Text' : 'Exhibitor', 'validators[unique]', $model->createUniqueValidator('gls_name')); $model->set('gls_when_no_user', 'label', $this->_('Log when no user'), 'description', $this->_('Always log this action, even when no one is logged in.'), 'elementClass', 'CheckBox', 'multiOptions', $this->util->getTranslated()->getYesNo()); $model->set('gls_on_action', 'label', $this->_('Log view'), 'description', $this->_('Always log when viewed / opened.'), 'elementClass', 'CheckBox', 'multiOptions', $this->util->getTranslated()->getYesNo()); $model->set('gls_on_post', 'label', $this->_('Log change tries'), 'description', $this->_('Log when trying to change the data.'), 'elementClass', 'CheckBox', 'multiOptions', $this->util->getTranslated()->getYesNo()); $model->set('gls_on_change', 'label', $this->_('Log data change'), 'description', $this->_('Log when data changes.'), 'elementClass', 'CheckBox', 'multiOptions', $this->util->getTranslated()->getYesNo()); return $model; }