/** * Get form * * @return Form_Form */ public function getForm() { $form = new Form_Form("settings"); $field = new Form_Field_Hidden("save"); $field->setDefaultValue(1); $form->addField($field); $field = new Form_Field_Select("maxentrylifetime", t("admin.settings.2")); $field->attr->add("data-setting", 1); $field->addOption("", t("admin.settings.4")); $field->addOption("-1 month", "1 " . t("months")); $field->addOption("-2 month", "2 " . t("months")); $field->addOption("-3 month", "3 " . t("months")); $field->addOption("-6 month", "6 " . t("months")); $field->addOption("-1 year", "1 " . t("years")); $field->setDefaultValue(RDR_Setting::get($field->name)->value); $form->addField($field); $field = new Form_Field_Select("maxeventlifetime", t("admin.settings.3")); $field->attr->add("data-setting", 1); $field->addOption("", "1 " . t("days")); $field->addOption("-2 day", "2 " . t("days")); $field->addOption("-3 days", "3 " . t("days")); $field->addOption("-1 week", "1 " . t("weeks")); $field->setDefaultValue(RDR_Setting::get($field->name)->value); $form->addField($field); return $form; }
/** * Get form * * @return Form_Form */ public function getForm() { $form = new Form_Form("pwchange"); $field = new Form_Field_Hidden("save"); $field->setDefaultValue(1); $form->addField($field); $field = new Form_Field_Password("newpw", t("settings.2")); $form->addField($field); $field = new Form_Field_Password("newpw2", t("settings.3")); $form->addField($field); return $form; }
/** * Get form * * @return Form_Form */ public function getForm() { $form = new Form_Form("login"); $field = new Form_Field_Hidden("login"); $field->setDefaultValue(1); $form->addField($field); $field = new Form_Field_Text("username", t("username")); $form->addField($field); $field = new Form_Field_Password("password", t("password")); $form->addField($field); $field = new Form_Field_Checkbox("remember", t("login.2")); $form->addField($field); return $form; }
function defaultTemplate() { return parent::defaultTemplate(); }
public function render() { $url = $this->app->url(null, array($this->name => 'ajax')); if ($this->value) { // on add new and inserting allow empty start value $this->model->tryLoad($this->value); $name = $this->model->get($this->title_field); $this->other_field->set($name); } $this->other_field->js(true)->_load('autocomplete_univ')->_css('autocomplete')->univ()->myautocomplete($url, $this, $this->options, $this->id_field, $this->title_field); return parent::render(); }
/** * Get form * * @return Form_Form */ private function getForm() { $form = new Form_Form("install"); $validator = new Form_Validator_Required(); $validator->setErrorMessage(t("form.validator.required")); $field = new Form_Field_Hidden("install", ""); $field->setDefaultValue(1); $form->addField($field); $field = new Form_Field_Text("mysql-host", t("install.host")); $field->addValidator($validator); $field->setDefaultValue("localhost"); $form->addField($field); $field = new Form_Field_Text("mysql-db", t("install.db")); $field->addValidator($validator); $field->setDefaultValue("nreeda"); $form->addField($field); $field = new Form_Field_Text("mysql-user", t("install.user")); $field->addValidator($validator); $field->setDefaultValue("nreeda"); $form->addField($field); $field = new Form_Field_Password("mysql-pass", t("install.pw")); $form->addField($field); $field = new Form_Field_Text("admin-user", t("install.admin.user")); $field->addValidator($validator); $form->addField($field); $field = new Form_Field_Password("admin-pass", t("install.admin.pw")); $field->addValidator($validator); $form->addField($field); return $form; }
function init() { $this->name = $this->short_name = 'MAX_FILE_SIZE'; parent::init(); $this->no_save = true; }
/** * Get form * * @return Form_Form */ public function getForm() { $form = new Form_Form("user"); $field = new Form_Field_Hidden("save"); $field->setDefaultValue(1); $form->addField($field); $field = new Form_Field_Text("username", t("username")); $field->setDefaultValue($this->user->username); $field->setDbObjectMember($this->user); $form->addField($field); $field = new Form_Field_Password("password", t("password")); if (!$this->user->getId()) { $field->setDbObjectMember($this->user); } $form->addField($field); $field = new Form_Field_Password("password2", t("settings.3")); if (!$this->user->getId()) { $field->setDbObjectMember($this->user, "password"); } $form->addField($field); $field = new Form_Field_Select("role", t("admin.user.5")); $field->setDbObjectMember($this->user); $field->addOption(RDR_User::ROLE_USER, t("user." . RDR_User::ROLE_USER)); $field->addOption(RDR_User::ROLE_ADMIN, t("user." . RDR_User::ROLE_ADMIN)); $field->setDefaultValue($this->user->role); $form->addField($field); return $form; }
function render() { $l = $this->api->locate('addons', __NAMESPACE__, 'location'); $this->api->pathfinder->addLocation($this->api->locate('addons', __NAMESPACE__), array('template' => 'templates', 'css' => 'templates/css', 'js' => 'js'))->setParent($l); $url = $this->api->url(null, array($this->name => 'ajax')); if ($this->value) { // on add new and inserting allow empty start value $this->model->tryLoad($this->value); $name = $this->model->get($this->title_field); $this->other_field->set($name); } $this->other_field->js(true)->_load('autocomplete_univ6')->_css('autocomplete')->univ()->myautocomplete($url, $this, $this->options, $this->id_field, $this->title_field, $this->send_other_fields); return parent::render(); }