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; }
} } else { $oUser->addStatusMessage(_('This is not an web address!') . ': ' . $newURL, 'warning'); } } //Hlavička stránek $oPage->addItem(new PageTop(_('LinkQuick: Your URL shortener'))); $domains = Encoder::getDomainList(); $actualDomain = Encoder::getDomain(); if (!in_array($actualDomain, $domains)) { $domains[] = $actualDomain; } $domainTabs = new \Ease\TWB\Tabs('DomainTabs'); foreach ($domains as $domain) { $nextCode = Encoder::getNextCode($domain); $addNewForm = new \Ease\TWB\Form('AddNewURL' . $domain); $addNewForm->addInput(new \Ease\Html\InputTextTag('NewURL', $newURL, ['size' => 80, 'style' => 'font-size: 30px; height: 40px; width: 100%;']), _('URL to short')); $mailTo = ''; if ($oUser->getSettingValue('SendMail')) { $mailTo = $oUser->getUserEmail(); } // $AddNewFrame->addItem(new LQLabeledDateTimeSelector('ExpireDate'. str_replace('/','_',$Domain), $OPage->getRequestValue('ExpireDate'), _('Datum expirace'))); $addNewForm->addInput(new \Ease\Html\InputTextTag('Notify', $mailTo), _('Send email confirmation to'), $notify); $addNewForm->addItem(new \Ease\TWB\SubmitButton(_('OK'))); $addNewForm->addItem(new \Ease\Html\InputHiddenTag('Domain', $domain)); $addNewFrame = new \Ease\TWB\Panel(_('New shortcut') . ' ' . $domain, 'success', $addNewForm); $domainTabs->addTab($domain . $nextCode, $addNewFrame); } $oPage->container->addItem($domainTabs); $oPage->addItem(new PageBottom()); $oPage->draw();
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();