/** * Copy from \Zend_Translate_Adapter * * Translates the given string * returns the translation * * @param string $text Translation string * @param string|\Zend_Locale $locale (optional) Locale/Language to use, identical with locale * identifier, @see \Zend_Locale for more information * @return string */ public function _($text, $locale = null) { if (!$this->translateAdapter) { $this->initTranslateable(); } return $this->translateAdapter->_($text, $locale); }
/** * proxy for easy access to translations * * @param string $messageId Translation string * @param string|\Zend_Locale $locale (optional) Locale/Language to use, identical with locale * identifier, @see \Zend_Locale for more information * @return string */ private function _($messageId, $locale = null) { if ($this->translate) { return $this->translate->_($messageId, $locale); } return $messageId; }
public function afterRegistry() { parent::afterRegistry(); $this->setIfExists('gof_form_id', 'label', $this->translate->_('FormID')); $this->setIfExists('gof_form_version', 'label', $this->translate->_('Version')); $this->setIfExists('gof_form_title', 'label', $this->translate->_('Name')); $this->setIfExists('gof_form_active', 'label', $this->translate->_('Active'), 'elementClass', 'checkbox'); }
private function _addElementPerson() { $translate = Zend_Registry::get("Zend_Translate"); $url = new Zend_View_Helper_Url(); $urlSearch = $url->url(array('module' => 'persons', 'controller' => 'person', 'action' => 'search-form'), null, true); $urlNew = $url->url(array('module' => 'persons', 'controller' => 'person', 'action' => 'create'), null, true); $append = ''; if ($this->_action == self::ACTION_ADD) { $append .= '<a id="btnPersonSearch" href="' . $urlSearch . '" ' . ' rel="colorbox-search" search-return-id="id" search-return-value="person_name">' . '<i class="icon-search" rel="tooltip" data-original-title="' . $this->translate->_("Search person") . '"></i>' . '</a>'; } $this->addElement('text', 'person_name', array('label' => 'Person', 'value' => $this->_model ? $this->_model->getPerson()->getName() : '', 'dimension' => 6, 'disabled' => true, 'placeholder' => $translate->_('Use the links aside to search a person or create a new one'), 'append' => $append . ' | ' . '<a class="hide" id="btnPersonDetails" href="#" rel="colorbox-details">' . $this->translate->_("Details") . '</a>' . ' | ' . '<a class="hide" id="btnPersonCreate" href="' . $urlNew . '" rel="colorbox">' . '<i class="icon-plus-sign" rel="tooltip" data-original-title="' . $this->translate->_("Add new") . ' ' . $this->translate->_("person") . '"></i>' . '</a>')); }
/** * Get a model to store the config * * @param boolean $valueMask MAsk the password or if false decrypt it * @return \Gems_Model_JoinModel */ protected function getConfigModel($valueMask = true) { if (!$this->_configModel) { $model = new \MUtil_Model_TableModel('gems__radius_config', 'config'); // $model = new \Gems_Model_JoinModel('config', 'gems__radius_config', 'grcfg'); $model->setIfExists('grcfg_ip', 'label', $this->translate->_('IP address'), 'required', true); $model->setIfExists('grcfg_port', 'label', $this->translate->_('Port'), 'required', true); $model->setIfExists('grcfg_secret', 'label', $this->translate->_('Shared secret'), 'description', $this->translate->_('Enter only when changing'), 'elementClass', 'password', 'required', false, 'repeatLabel', $this->translate->_('Repeat password')); $type = new \Gems_Model_Type_EncryptedField($this->project, $valueMask); $type->apply($model, 'grcfg_secret', 'grcfg_encryption'); $this->_configModel = $model; } return $this->_configModel; }
private function _addElementHomeType() { $this->addElement('radio', 'home_type_choice', array('label' => 'Home type', 'value' => $this->_model ? $this->_model->getHome_type() : NULL, 'dimension' => 2, 'rel' => 'choice-for-another-element', 'data-target' => '#home_type')); $el = $this->getElement('home_type_choice'); $ops = Persons_Model_Home::toArrayType(); foreach ($ops as $key => $value) { $ops[$key] = $this->translate->_($value); } sort($ops); foreach ($ops as $op) { $el->addMultiOption($op, $op); } $el->addMultiOption('', 'another'); $this->addElement('text', 'home_type', array('label' => 'Home type', 'value' => $this->_model ? $this->_model->getHome_type() : '', 'dimension' => 6, 'required' => true, 'validators' => array(array('StringLength', false, array(0, isset($options['maxlength']) ? $options['maxlength'] : 50))), 'maxlength' => 50, 'readonly' => true)); }
/** * Proxy to the translate object * * @param string $messageId * @param type $locale * @return string */ protected function _($messageId, $locale = null) { return $this->translate->_($messageId, $locale); }
/** * Copy from \Zend_Translate_Adapter * * Translates the given string * returns the translation * * @param string $text Translation string * @param string|\Zend_Locale $locale (optional) Locale/Language to use, identical with locale * identifier, @see \Zend_Locale for more information * @return string */ public function _($text, $locale = null) { return $this->translateAdapter->_($text, $locale); }
/** * Get userclass / description array of available UserDefinitions for staff * * @return array */ public function getAvailableStaffDefinitions() { $definitions = array(self::USER_STAFF => $this->translate->_('Db storage'), 'RadiusUser' => $this->translate->_('Radius storage')); return $definitions; }
/** * Set the field values for a dutch zipcode * * @param \MUtil_Model_ModelAbstract $model * @param \Zend_Translate_Adapter $translator * @param string $fieldName */ public static function setDutchZipcode(\MUtil_Model_ModelAbstract $model, \Zend_Translate_Adapter $translator, $fieldName = 'grs_zipcode') { $model->set($fieldName, 'size', 7, 'description', $translator->_('E.g.: 0000 AA'), 'filter', new \Gems_Filter_DutchZipcode()); }