示例#1
0
 public function renderStatic(html_form $form, $name, $input, $label, model_editor $editor, model_editor_field $field)
 {
     $classes = implode(' ', array_filter(array($this->class, 'texteditor')));
     $form->setRow($name, $label, markup::inline($input, 'static'), $this->isMandatory, null, null, $classes);
     return $this;
 }
示例#2
0
文件: date.php 项目: cepharum/txf
 public function renderStatic(html_form $form, $name, $input, $label, model_editor $editor, model_editor_field $field)
 {
     $value = $this->formatValue($name, $input, $editor, $field);
     $classes = array($this->class, 'date', preg_replace('/\\W/', '', $this->staticFormat));
     $classes = implode(' ', array_filter($classes));
     $form->setRow($name, $label, markup::inline($value, 'static'), $this->isMandatory, null, null, $classes);
     return $this;
 }
示例#3
0
文件: manager.php 项目: cepharum/txf
 /**
  * Creates HTML form used to ask user for providing current and new password
  * to set.
  *
  * This form should provide a user's properties "loginname", "name", "email"
  * and "password" (with its repetition in "repeat"). In addition it might
  * manage "lock" including to send unlock mail to given mail address (see
  * below).
  *
  * The form should use property "submit" with proper values for selecting
  * actions (see docs on isValidAction() for complete list):
  *
  *   "save" for saving changes to existing user or create new user
  *   "cancel" for reverting any changes to existing user
  *   "unlock" for sending unlock mail to existing user
  *
  * @param string $formName name of HTML form
  * @param string[] $user properties of user as read from datasource
  * @return html_form created instance of HTML form
  */
 protected function createForm($formName, $user = array())
 {
     return html_form::create($formName)->setTexteditRow('name', \de\toxa\txf\_L('full name'), input::vget('name', $user['name']))->setTexteditRow('loginname', \de\toxa\txf\_L('login name'), input::vget('loginname', $user['loginname']))->setPasswordRow('password', \de\toxa\txf\_L('password'), '')->setPasswordRow('repeat', \de\toxa\txf\_L('repeat password'), '')->setTexteditRow('email', \de\toxa\txf\_L('e-mail'), input::vget('email', $user['email']))->setButtonRow('submit', \de\toxa\txf\_L('Save User'), 'save')->setButtonRow('submit', \de\toxa\txf\_L('Cancel'), 'cancel');
 }
示例#4
0
文件: related.php 项目: cepharum/txf
 public function renderStatic(html_form $form, $name, $value, $label, model_editor $editor, model_editor_field $field)
 {
     $available = $this->getSelectableOptions();
     $value = array_map(function ($selected) use($available) {
         return $available[$selected];
     }, (array) $value);
     $classes = implode(' ', array_filter(array($this->class, 'related')));
     $list = markup::bullets($value, $classes);
     $form->setRow($name, $label, $list, $this->isMandatory(), $this->hint, null, $classes);
     return $this;
 }
示例#5
0
文件: option.php 项目: cepharum/txf
 public function renderStatic(html_form $form, $name, $input, $label, model_editor $editor, model_editor_field $field)
 {
     $classes = implode(' ', array_filter(array($this->class, 'option')));
     $form->setRow($name, $label, markup::inline($input ? \de\toxa\txf\_L('yes') : \de\toxa\txf\_L('no'), 'static'), null, null, $classes);
     return $this;
 }
示例#6
0
文件: editor.php 项目: cepharum/txf
 /**
  * Retrieves form to use on current editor instance.
  *
  * @return html_form
  */
 public function form()
 {
     if (!$this->form instanceof html_form) {
         $this->form = html_form::create($this->formName);
     }
     return $this->form;
 }
示例#7
0
文件: login.php 项目: cepharum/txf
 /**
  * Creates HTML form used to ask user for providing login credentials.
  *
  * This form should use parameter "name" for login name of user, "token" for
  * password of user and "submit" with value "login" or "cancel" for
  * selecting whether user actually wants to authenticate or not.
  *
  * @param string $formName name of HTML form
  * @return html_form created instance of HTML form
  */
 protected function createForm($formName)
 {
     $form = html_form::create($formName);
     $form->setTexteditRow('name', \de\toxa\txf\_L('login name'));
     $form->setPasswordRow('token', \de\toxa\txf\_L('password'), '');
     $form->setButtonRow('submit', \de\toxa\txf\_L('Authenticate'), 'login');
     $form->setButtonRow('submit', \de\toxa\txf\_L('Cancel'), 'cancel');
     return $form;
 }
示例#8
0
文件: password.php 项目: cepharum/txf
 /**
  * Creates HTML form used to ask user for providing current and new password
  * to set.
  *
  * This form should use parameter "old" for user's current password, "new"
  * for password to be set, "repeat" for repetition of password to be set
  * (required for excluding typos on blindly entering it) and "submit" with
  * value "change" or "cancel" for selecting whether user actually wants to
  * change password or not.
  *
  * @param string $formName name of HTML form
  * @return html_form created instance of HTML form
  */
 protected function createForm($formName)
 {
     return html_form::create($formName)->post()->setPasswordRow('old', \de\toxa\txf\_L('current password'))->setPasswordRow('new', \de\toxa\txf\_L('new password'), '')->setPasswordRow('repeat', \de\toxa\txf\_L('repeat password'), '')->setButtonRow('submit', \de\toxa\txf\_L('Change Password'), 'change')->setButtonRow('submit', \de\toxa\txf\_L('Cancel'), 'cancel');
 }
示例#9
0
文件: hidden.php 项目: cepharum/txf
 public function renderStatic(html_form $form, $name, $input, $label, model_editor $editor, model_editor_field $field)
 {
     $form->setHidden($name, $input);
     return $this;
 }