コード例 #1
0
ファイル: Settings.class.php プロジェクト: nonconforme/nreeda
 /**
  * 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;
 }
コード例 #2
0
ファイル: Settings.class.php プロジェクト: nonconforme/nreeda
 /**
  * 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;
 }
コード例 #3
0
ファイル: Login.class.php プロジェクト: nonconforme/nreeda
 /**
  * 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;
 }
コード例 #4
0
ファイル: Install.class.php プロジェクト: nonconforme/nreeda
 /**
  * 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;
 }
コード例 #5
0
ファイル: User.class.php プロジェクト: nonconforme/nreeda
 /**
  * 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;
 }