public function articleForm() { $form = new \Ease\TWB\Form('NewsArticle'); $form->addItem(new \Ease\Html\InputHiddenTag('id', $this->newsEngine->getMyKey())); $form->addInput(new \Ease\Html\InputTextTag('name'), _('Name')); $form->addInput(new WISWYG('text'), _('Text')); $form->addItem(new \Ease\TWB\SubmitButton('Ok', 'success')); $form->fillUp($this->newsEngine->getData()); return $form; }
public function articleForm() { $form = new \Ease\TWB\Form('NewsArticle'); $form->addItem(new \Ease\Html\InputHiddenTag('id', $this->newsEngine->getMyKey())); $form->addInput(new \Ease\Html\InputTextTag('title'), _('Name')); $form->addInput(new WISWYG('text'), _('Text')); $form->addInput(new \Ease\Html\Select('language', ['cs' => _('Czech'), 'en' => _('English')]), _('Language')); $form->addItem(new \Ease\TWB\SubmitButton('Ok', 'success')); $form->fillUp($this->newsEngine->getData()); return $form; }
if (!isset($_POST['CurrentPassword'])) { $oUser->addStatusMessage(_('Please enter current passweod')); $formOK = false; } else { if (!$oUser->PasswordValidation($_POST['CurrentPassword'], $oUser->getDataValue($oUser->passwordColumn))) { $oUser->addStatusMessage(_('Current password is invalid'), 'warning'); $formOK = false; } } $oPage->addItem(new PageTop(_('User password change'))); if ($formOK && isset($_POST)) { $oUser->setDataValue($oUser->passwordColumn, $oUser->EncryptPassword($_POST['password'])); if ($oUser->saveToSQL()) { $oUser->addStatusMessage(_('Password was changed'), 'success'); $email = $oPage->addItem(new \Ease\Mail($oUser->getDataValue($oUser->mailColumn), _('Changed password'))); $email->addItem(_('Dear user, your password was changed') . "\n"); $email->addItem(_('Login') . ': ' . $oUser->getUserLogin() . "\n"); $email->addItem(_('Password') . ': ' . $_POST['password'] . "\n"); $email->send(); } } else { $pwchform = new \Ease\TWB\Form('PwCh'); $pwchform->addInput(new \Ease\Html\InputPasswordTag('CurrentPassword'), _('Current password')); $pwchform->addInput(new \Ease\Html\InputPasswordTag('password'), _('New Password')); $pwchform->addInput(new \Ease\Html\InputPasswordTag('passwordConfirm'), _('New Password confirmation')); $pwchform->addItem(new \Ease\TWB\SubmitButton(_('Change the password'), 'success')); $pwchform->fillUp($_POST); $oPage->column2->addItem(new \Ease\TWB\Panel(_('Password Change'), 'warning', $pwchform)); } $oPage->addItem(new PageBottom()); $oPage->draw();