コード例 #1
0
 public function afterRegistry()
 {
     parent::afterRegistry();
     // Load the display dateformat
     $dateOptions = \MUtil_Model_Bridge_FormBridge::getFixedOptions('date');
     $this->_dateFormat = $dateOptions['dateFormat'];
     $this->creator = \Gems_Html::init();
     // find the menu items only once for more efficiency
     $this->_trackAnswer = $this->findMenuItem('track', 'answer');
     $this->_trackEdit = $this->findMenuItem('track', 'edit-track');
     $this->_trackDelete = $this->findMenuItem('track', 'delete-track');
     $this->_surveyAnswer = $this->findMenuItem('survey', 'answer');
     $this->_takeSurvey = $this->findMenuItem('ask', 'take');
 }
コード例 #2
0
 /**
  * Returns an array of elements for check fields during password reset and/or
  * 'label name' => 'required value' pairs. vor asking extra questions before allowing
  * a password change.
  *
  * Default is asking for the username but you can e.g. ask for someones birthday.
  *
  * @return array Of 'label name' => 'required values' or \Zend_Form_Element elements
  */
 protected function loadResetPasswordCheckFields()
 {
     // CHECK ON SOMEONES BIRTHDAY
     // Birthdays are usually not defined for staff but the do exist for respondents
     if ($value = $this->_getVar('user_birthday')) {
         $label = $this->_('Your birthday');
         $birthdayElem = new \Gems_JQuery_Form_Element_DatePicker('birthday');
         $birthdayElem->setLabel($label)->setOptions(\MUtil_Model_Bridge_FormBridge::getFixedOptions('date'))->setStorageFormat(\Zend_Date::ISO_8601);
         if ($format = $birthdayElem->getDateFormat()) {
             $valueFormatted = \MUtil_Date::format($value, $format, $birthdayElem->getStorageFormat());
         } else {
             $valueFormatted = $value;
         }
         $validator = new \Zend_Validate_Identical($valueFormatted);
         $validator->setMessage(sprintf($this->_('%s is not correct.'), $label), \Zend_Validate_Identical::NOT_SAME);
         $birthdayElem->addValidator($validator);
         return array($birthdayElem);
     }
     // */
     return array($this->_('Username') => $this->getLoginName());
 }
コード例 #3
0
 public function afterRegistry()
 {
     parent::afterRegistry();
     // Load the display dateformat
     $dateOptions = \MUtil_Model_Bridge_FormBridge::getFixedOptions('date');
     $this->_dateFormat = $dateOptions['dateFormat'];
     $this->creator = \Gems_Html::init();
 }