/** * 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'); }
/** * 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; }
/** * 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; }
/** * 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'); }