/**
  * Creates the model
  *
  * @return \MUtil_Model_ModelAbstract
  */
 protected function createModel()
 {
     // Replace two checkboxes with on radio button control
     $this->model->set('ggp_staff_members', 'elementClass', 'Hidden');
     $this->model->setOnSave('ggp_staff_members', array($this, 'saveIsStaff'));
     $this->model->set('ggp_respondent_members', 'elementClass', 'Hidden');
     $this->model->setOnSave('ggp_respondent_members', array($this, 'saveIsRespondent'));
     $options = array('1' => $this->model->get('ggp_staff_members', 'label'), '2' => $this->model->get('ggp_respondent_members', 'label'));
     $this->model->set('staff_respondent', 'label', $this->_('Can be assigned to'), 'elementClass', 'Radio', 'multiOptions', $options, 'order', $this->model->getOrder('ggp_staff_members') + 1);
     $this->model->setOnLoad('staff_respondent', array($this, 'loadStaffRespondent'));
     return $this->model;
 }
 /**
  * Appends the needed fields for this config to the $bridge
  *
  * @param \MUtil_Model_ModelAbstract $orgModel
  */
 public function addConfigFields(\MUtil_Model_ModelAbstract $orgModel)
 {
     $configModel = $this->getConfigModel(true);
     $order = $orgModel->getOrder('gor_user_class') + 1;
     foreach ($configModel->getItemNames() as $name) {
         $orgModel->set($name, 'order', $order++, 'tab', 'access');
         $orgModel->set($name, $configModel->get($name));
     }
 }
Пример #3
0
 /**
  * Helper function to sort translator table by model order
  *
  * @param string $a
  * @param string $b
  * @return int
  */
 protected function _sortTranslatorTable($a, $b)
 {
     $ao = $this->targetModel->getOrder($a);
     $bo = $this->targetModel->getOrder($b);
     if ($ao < $bo) {
         return -1;
     } elseif ($ao > $bo) {
         return 1;
     } else {
         return 0;
     }
 }