public function searchField($searchVariables) { $values = array(array(null, ''), array('1', __('Yes', 'Ip-admin', false)), array('0', __('No', 'Ip-admin', false))); $field = new \Ip\Form\Field\Select(array('label' => $this->label, 'name' => $this->field, 'values' => $values, 'value' => null, 'layout' => $this->layout, 'attributes' => $this->attributes)); if (isset($searchVariables[$this->field])) { $field->setValue($searchVariables[$this->field]); } return $field; }
public function searchField($searchVariables) { $values = array(array(null, 'Any')); $values = array_merge($values, $this->values); $field = new \Ip\Form\Field\Select(array('label' => $this->label, 'name' => $this->field, 'values' => $values, 'layout' => $this->layout, 'attributes' => $this->attributes)); if (!empty($searchVariables[$this->field])) { $field->setValue($searchVariables[$this->field]); } return $field; }
public static function getLanguageSelectForm() { //create form object $form = new \Ip\Form(); $form->setEnvironment(\Ip\Form::ENVIRONMENT_ADMIN); $form->addClass('ipsLanguageSelect'); //add text field to form object $field = new \Ip\Form\Field\Select(array('name' => 'languageCode', 'values' => self::getAvailableLocales())); $field->setValue(ipConfig()->adminLocale()); $form->addfield($field); return $form; }