diff --git a/app/controllers/admin/login_style.php b/app/controllers/admin/login_style.php index 615e777f7a79a500f4e80d1992fe97057ca97102..35cd7d820ffc651620e4aa001d1329178aeb769b 100644 --- a/app/controllers/admin/login_style.php +++ b/app/controllers/admin/login_style.php @@ -177,8 +177,8 @@ class Admin_LoginStyleController extends AuthenticatedController CSRFProtection::verifyRequest(); $entry->setData([ - 'title' => trim(Request::get('title')), - 'description' => trim(Request::get('description')), + 'title' => Request::i18n('title'), + 'description' => Request::i18n('description'), ]); if ($entry->store()) { diff --git a/app/views/admin/login_style/edit_faq.php b/app/views/admin/login_style/edit_faq.php index 066991a6b2b24ae3e94eb2db4f7f3f95989119a6..2c35afd12fbbd3e011dc1a4744ac696c4750f1ee 100644 --- a/app/views/admin/login_style/edit_faq.php +++ b/app/views/admin/login_style/edit_faq.php @@ -9,23 +9,25 @@ enctype="multipart/form-data" class="default"> <?= CSRFProtection::tokenTag() ?> - - <label class="studiprequired"> - <?= _('Titel') ?> - <span title="<?= _('Dies ist ein Pflichtfeld') ?>" aria-hidden="true" class="asterisk">*</span> - <input type="text" name="title" value="<?= htmlReady($entry->title) ?>" required> + <label> + <span class="required"> + <?= _('Titel') ?> + </span> + <?= I18N::input('title', $entry->title, ['required' => true]) ?> </label> - <label> - <span class="studiprequired"> + <span class="required"> <?= _('Text') ?> - <span title="<?= _('Dies ist ein Pflichtfeld') ?>" aria-hidden="true" class="asterisk">*</span> </span> - <textarea name="description" - class="add_toolbar wysiwyg" data-editor="toolbar=minimal"><?= htmlReady($entry->description)?></textarea> + <?= I18N::textarea('description', + $entry->description, + [ + 'class' => 'wysiwyg', + 'required' => true, + 'data-editor' => 'toolbar=small' + ] + ) ?> </label> - - <div data-dialog-button> <?= \Studip\Button::create(_('Speichern')) ?> </div> diff --git a/lib/models/LoginFaq.class.php b/lib/models/LoginFaq.class.php index 036f0f73178283b8992de27e6e3b88416c828ee1..d6cad4077f25c892adf7cb1efcef5564340f7077 100644 --- a/lib/models/LoginFaq.class.php +++ b/lib/models/LoginFaq.class.php @@ -25,7 +25,8 @@ class LoginFaq extends SimpleORMap { $config['db_table'] = 'login_faq'; - $config['i18n'] = ['title', 'description']; + $config['i18n_fields']['title'] = true; + $config['i18n_fields']['description'] = true; parent::configure($config); }