diff options
| author | Philipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de> | 2024-09-24 10:53:31 +0200 |
|---|---|---|
| committer | Philipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de> | 2024-09-24 10:53:31 +0200 |
| commit | 4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch) | |
| tree | 5c07151ae61276d334e88f6309c30d439a85c12e /templates | |
| parent | da0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff) | |
| parent | 97a188592c679890a25c37ab78463add76a52ff7 (diff) | |
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'templates')
32 files changed, 416 insertions, 421 deletions
diff --git a/templates/_standard_loginform.php b/templates/_standard_loginform.php index 51fc53b..4ae9f27 100644 --- a/templates/_standard_loginform.php +++ b/templates/_standard_loginform.php @@ -43,9 +43,10 @@ $password_tooltip_text = (string)Config::get()->PASSWORD_TOOLTIP_TEXT; name="password" autocomplete="current-password" size="20" - required> + required + > - <i id="password-toggle" tabindex="0" aria-role="button" class="enter-accessible"> + <i id="password-toggle" tabindex="0" role="button" class="enter-accessible"> <?= Icon::create('visibility-checked')->asImg(20, [ 'id ' => 'visible-password', 'title' => _('Passwort anzeigen'), diff --git a/templates/blubber/global_context.php b/templates/blubber/global_context.php index 77c4a29..4a52407 100644 --- a/templates/blubber/global_context.php +++ b/templates/blubber/global_context.php @@ -7,6 +7,8 @@ onClick="STUDIP.Blubber.followunfollow('global'); return false;" class="followunfollow<?= $unfollowed ? " unfollowed" : "" ?>" title="<?= _("Benachrichtigungen für diese Konversation abstellen.") ?>" + aria-pressed="<?= $unfollowed ? 'false' : 'true' ?>" + role="button" data-thread_id="global"> <?= Icon::create("decline")->asImg(20, ['class' => "follow text-bottom"]) ?> <?= Icon::create("notification2")->asImg(20, ['class' => "unfollow text-bottom"]) ?> diff --git a/templates/blubber/private_context.php b/templates/blubber/private_context.php index 5984f13..b9a5ba9 100644 --- a/templates/blubber/private_context.php +++ b/templates/blubber/private_context.php @@ -1,7 +1,7 @@ <div class="blubber_private_info indented"> <div class="icon"> - <?= Icon::create("group3", "info")->asImg(50, ['title' => _("Dies ist ein privater Blubber.")]) ?> + <?= Icon::create('group3', Icon::ROLE_INFO)->asImg(50, ['title' => _('Dies ist ein privater Blubber.')]) ?> </div> <ul class="clean members"> @@ -13,7 +13,7 @@ <? $user = User::find($mention['user_id']) ?> <? if ($user) : ?> <? if ($user->getId() !== $GLOBALS['user']->id && count($mentions) > 2) : ?> - <a class="float_right" href="<?= URLHelper::getLink("dispatch.php/blubber/write_to/".$user->getId()) ?>" data-dialog title="<?= _("Anblubbern") ?>"> + <a class="float_right" href="<?= URLHelper::getLink("dispatch.php/blubber/write_to/". $user->getId()) ?>" data-dialog title="<?= _("Anblubbern") ?>"> <?= Icon::create("blubber", "clickable")->asImg(20, ['class' => "text-bottom"]) ?> </a> <? endif ?> @@ -23,7 +23,7 @@ data-dialog="size=auto" title="<?= _("Gruppe verlassen") ?>" data-confirm="<?= _("Private Konversation wirklich verlassen?") ?>"> - <?= Icon::create("door-leave", "clickable")->asImg(20, ['class' => "text-bottom"]) ?> + <?= Icon::create('door-leave')->asImg(['class' => 'text-bottom']) ?> </a> <? endif ?> <a href="<?= URLHelper::getLink("dispatch.php/profile", ['username' => $user['username']]) ?>"> @@ -38,8 +38,8 @@ </li> <? endforeach ?> <li> - <a href="<?= URLHelper::getLink("dispatch.php/blubber/add_member_to_private/".$thread->getId()) ?>" data-dialog> - <?= Icon::create("add", "clickable")->asImg(25, ['class' => "text-bottom"]) ?> + <a href="<?= URLHelper::getLink("dispatch.php/blubber/add_member_to_private/".$thread->getId()) ?>" data-dialog="width=600;height=300"> + <?= Icon::create('add')->asImg(25, ['class' => 'text-bottom']) ?> </a> </li> </ul> @@ -53,4 +53,4 @@ <?= _("Aus diesem Blubber eine Studiengruppe machen.") ?> </a> </div> -<? endif ?>
\ No newline at end of file +<? endif ?> diff --git a/templates/check_object_exception.php b/templates/check_object_exception.php index 64a5188..bb54ddf 100644 --- a/templates/check_object_exception.php +++ b/templates/check_object_exception.php @@ -3,7 +3,7 @@ $current_page = _('Kein Objekt gewählt') ?> <?= MessageBox::exception(htmlReady($exception->getMessage()), [ _('Dieser Teil des Systems kann nur genutzt werden, wenn Sie vorher ein Objekt (Veranstaltung oder Einrichtung) gewählt haben.'), - sprintf(_('Dieser Fehler tritt auch auf, wenn Ihre Session abgelaufen ist. Bitte nutzen Sie in diesem Fall den untenstehenden Link, um zurück zur Anmeldung zu gelangen.'))]) ?> + sprintf(_('Dieser Fehler tritt auch auf, wenn Ihre Session abgelaufen ist. Bitte nutzen Sie in diesem Fall den folgenden Link, um zurück zur Anmeldung zu gelangen.'))]) ?> <? if ($last_edited = Request::get('content') . Request::get('description') . Request::get('body')) : ?> <p> diff --git a/templates/contentbar/contentbar.php b/templates/contentbar/contentbar.php index fef7fd8..f9b42ed 100644 --- a/templates/contentbar/contentbar.php +++ b/templates/contentbar/contentbar.php @@ -1,11 +1,11 @@ <?php /** - * @var TOCItem $toc - * @var Icon $icon - * @var Flexi_Template $breadcrumbs - * @var string $info - * @var ActionMenu $actionMenu - * @var Flexi_Template $ttpl + * @var TOCItem $toc + * @var Icon $icon + * @var Flexi\Template $breadcrumbs + * @var string $info + * @var ActionMenu $actionMenu + * @var Flexi\Template $ttpl */ ?> <section> diff --git a/templates/dates/seminar_html.php b/templates/dates/seminar_html.php index 47aa0aa..f227a57 100644 --- a/templates/dates/seminar_html.php +++ b/templates/dates/seminar_html.php @@ -55,11 +55,10 @@ if (!$dates['regular']['turnus_data'] && empty($dates['irregular'])) { } $irregular_rooms[$date['resource_id']]++; } elseif ($date['raum']) { - $temp = '(' . htmlReady($date['raum']) . ')'; - if (!isset($freetext_rooms[$temp])) { - $freetext_rooms[$temp] = 0; + if (!isset($freetext_rooms[$date['raum']])) { + $freetext_rooms[$date['raum']] = 0; } - $freetext_rooms[$temp]++; + $freetext_rooms[$date['raum']]++; } } // Remove invalid entry if present diff --git a/templates/debug/db-log.php b/templates/debug/db-log.php deleted file mode 100644 index 9797295..0000000 --- a/templates/debug/db-log.php +++ /dev/null @@ -1,55 +0,0 @@ -<? if (!empty($GLOBALS['DEBUG_ALL_DB_QUERIES'])) : ?> - <style> - #all_db_queries td:first-child { - border-left: 4px solid transparent; - border-right: 4px solid red; - } - #all_db_queries .sorm td:first-child { - border-left-color: blue; - } - #all_db_queries .prepared td:first-child { - border-right-color: green; - } - #all_db_queries .query { - white-space: pre-wrap; - } - #all_db_queries ul { - counter-reset: queries -1; - } - #all_db_queries li:hover { - text-decoration: underline; - } - #all_db_queries li::before { - content: "#" counter(queries); - counter-increment: queries; - } - #all_db_queries li::before, - #all_db_queries span { - font-weight: lighter; - } - </style> - <div style="display: none;" id="all_db_queries"> - <table class="default"> - <tbody> - <? foreach ((array) DBManager::get()->queries as $query) : ?> - <tr class="<?= $query['classes'] ?>"> - <td> - <code class="query"><?= htmlReady($query['query']) ?></code> - </td> - <? if ($GLOBALS['DEBUG_ALL_DB_QUERIES_WITH_TRACE']) : ?> - <td> - <ul class="list-unstyled"> - <? foreach ($query['trace'] as $i => $row): ?> - <li> - <?= $this->render_partial('debug/trace-row.php', $row) ?> - </li> - <? endforeach; ?> - </ul> - </td> - <? endif ?> - </tr> - <? endforeach ?> - </tbody> - </table> - </div> -<? endif ?> diff --git a/templates/debug/trace-row.php b/templates/debug/trace-row.php deleted file mode 100644 index f3d29be..0000000 --- a/templates/debug/trace-row.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -$file = ltrim(str_replace($GLOBALS['STUDIP_BASE_PATH'], '', $file), '/'); -$trac = htmlReady("https://develop.studip.de/trac/browser/trunk/{$file}#L{$line}"); -?> -<code> - <?= htmlReady(sprintf( - '%s(%s)', - isset($class) ? "{$class}{$type}{$function}" : $function, - implode(', ', array_map(function ($arg) { return is_object($arg) ? get_class($arg) : (string) $arg; }, $args)) - )) ?> -</code> -<span>called at</span> -<a href="<?= $trac ?>" target="_blank"><?= htmlReady("{$file}:{$line}") ?></a> diff --git a/templates/evaluation/config.php b/templates/evaluation/config.php deleted file mode 100644 index e328cf6..0000000 --- a/templates/evaluation/config.php +++ /dev/null @@ -1,125 +0,0 @@ -<? -# Lifter010: TODO - -use Studip\Button, Studip\LinkButton, Studip\ResetButton; - -$options = [ - 'show_total_stats' => _('Zeige Gesamtstatistik an'), - 'show_graphics' => _('Zeige Grafiken an'), - 'show_questions' => _('Zeige Fragen an'), - 'show_group_headline' => _('Zeige Gruppenüberschriften an'), - 'show_questionblock_headline' => _('Zeige Fragenblocküberschriften an'), -]; - -$graphtypes = [ - 'polscale_gfx_type' => [ - 'title' => _('Grafiktyp für Polskalen'), - 'options' => [ - 'bars' => _('Balken'), - 'pie' => _('Tortenstücke'), - 'lines' => _('Linien'), - 'linepoints' => _('Linienpunkte'), - 'area' => _('Bereich'), - 'points' => _('Punkte'), - 'thinbarline' => _('Linienbalken'), - ], - ], - 'likertscale_gfx_type' => [ - 'title' => _('Grafiktyp für Likertskalen'), - 'options' => [ - 'bars' => _('Balken'), - 'pie' => _('Tortenstücke'), - 'lines' => _('Linien'), - 'linepoints' => _('Linienpunkte'), - 'area' => _('Bereich'), - 'points' => _('Punkte'), - 'thinbarline' => _('Linienbalken'), - ], - ], - 'mchoice_scale_gfx_type' => [ - 'title' => _('Grafiktyp für Multiplechoice'), - 'options' => [ - 'bars' => _('Balken'), - 'points' => _('Punkte'), - 'thinbarline' => _('Linienbalken'), - ], - ], -]; -?> - -<form class="default" action="<?= URLHelper::getLink() ?>" method="post"> - <?= CSRFProtection::tokenTag() ?> - - <input type="hidden" name="template_id" value="<?= $templates['template_id'] ?>"> - <input type="hidden" name="eval_id" value="<?= $eval_id ?>"> - - <table class="default"> - <caption> - <?= _('Auswertungskonfiguration') ?> - </caption> - <colgroup> - <col width="50%"> - <col width="25%"> - <col width="25%"> - </colgroup> - <thead> - <tr> - <th><?= _('Optionen') ?></th> - <th style="text-align: center;"><?= _('Ja') ?></th> - <th style="text-align: center;"><?= _('Nein') ?></th> - </tr> - </thead> - <tbody> - <? foreach ($options as $option => $title): ?> - <tr> - <td><?= htmlReady($title) ?>:</td> - <td style="text-align: center;"> - <input type="radio" name="<?= $option ?>" value="1" - <? if ($templates[$option] || !$has_template) echo 'checked'; ?>> - </td> - <td style="text-align: center;"> - <input type="radio" name="<?= $option ?>" value="0" - <? if ($has_template && !$templates[$option]) echo 'checked'; ?>> - </td> - </tr> - <? endforeach; ?> - - <? foreach ($graphtypes as $type => $data): ?> - <tr> - <td> - <label for="<?= $type ?>"><?= htmlReady($data['title']) ?>:</label> - </td> - <td style="text-align: center;" colspan="2"> - <select class="size-s" id="<?= $type ?>" name="<?= $type ?>" style="120px"> - <? foreach ($data['options'] as $k => $v): ?> - <option value="<?= htmlReady($k) ?>" - <? if ($templates[$type] == $k) echo "selected"; ?>> - <?= htmlReady($v) ?> - </option> - <? endforeach; ?> - </select> - </td> - </tr> - <? endforeach; ?> - </tbody> - - <tfoot> - <tr> - <td> - <?= LinkButton::create('<< ' . _('Zurück'), - URLHelper::getURL('eval_summary.php', compact('eval_id'))) ?> - </td> - <td colspan="2" style="text-align: right;"> - <?= Button::createAccept(_('Speichern'), 'store') ?> - <?= ResetButton::createCancel(_('Zurücksetzen')) ?> - </td> - </tr> - </tfoot> - </table> -</form> - -<? -Helpbar::Get()->addPlainText(_('Information'), _('Auf dieser Seite können Sie die Auswertung Ihrer Evaluation konfigurieren.')); -Helpbar::Get()->addPlainText(_('Information'), ('Wählen Sie Ihre Einstellungen und drücken Sie auf "Template speichern". ' - .'Anschließend kommen Sie mit dem Button unten links zurück zu Ihrer Evaluation.')); -?> diff --git a/templates/filesystem/group_folder/edit.php b/templates/filesystem/group_folder/edit.php index 1d438bf..a5dc2f4 100644 --- a/templates/filesystem/group_folder/edit.php +++ b/templates/filesystem/group_folder/edit.php @@ -10,7 +10,7 @@ $groups = Statusgruppen::findBySeminar_id(Request::get('cid')); </option> <? endif; ?> <? foreach ($groups as $one_group): ?> - <option <?=(@$group->id === $one_group->id ? 'selected' : '')?> value="<?= htmlReady($one_group->id) ?>"> + <option <?= isset($group) && $group->id === $one_group->id ? 'selected' : '' ?> value="<?= htmlReady($one_group->id) ?>"> <?= htmlReady($one_group->name) ?> </option> <? endforeach; ?> diff --git a/templates/filesystem/homework_folder/description.php b/templates/filesystem/homework_folder/description.php index b3bc7f1..c47d6b0 100644 --- a/templates/filesystem/homework_folder/description.php +++ b/templates/filesystem/homework_folder/description.php @@ -1,14 +1,7 @@ <div style="font-style: italic"> <?=_("Dieser Ordner ist ein Hausaufgabenordner. Es können nur Dateien eingestellt werden.")?> </div> -<? if (!empty($own_files) && count($own_files) > 0) : ?> -<?= _("Sie selbst haben folgende Dateien in diesen Ordner eingestellt:") ?> - <ul> - <? foreach ($own_files as $own_file) :?> - <li><?=htmlReady($own_file->name)?> - <?=strftime('%x %X', $own_file->chdate)?></li> - <? endforeach ?> - </ul> -<? endif ?> + <? if ($folderdata['description']) : ?> <hr> <div> diff --git a/templates/filesystem/timed_folder/description.php b/templates/filesystem/timed_folder/description.php index ae5bd9e..396a286 100644 --- a/templates/filesystem/timed_folder/description.php +++ b/templates/filesystem/timed_folder/description.php @@ -36,17 +36,6 @@ <? endif ?> </div> -<? if (!empty($own_files) && count($own_files) > 0) : ?> - <div> - <?= _('Sie selbst haben folgende Dateien in diesen Ordner eingestellt:') ?> - <ul> - <? foreach ($own_files as $own_file) : ?> - <li><?= htmlReady($own_file->name) ?> - <?= strftime('%x %X', $own_file->chdate) ?></li> - <? endforeach ?> - </ul> - </div> -<? endif ?> - <? if ($folderdata['description']) : ?> <hr> <div> diff --git a/templates/filesystem/topic_folder/edit.php b/templates/filesystem/topic_folder/edit.php index 1ac39af..e4eb6b0 100644 --- a/templates/filesystem/topic_folder/edit.php +++ b/templates/filesystem/topic_folder/edit.php @@ -10,7 +10,7 @@ $topics = CourseTopic::findBySeminar_id($folder->range_id); </option> <? endif; ?> <? foreach ($topics as $one_topic): ?> - <option <?=(@$topic->id === $one_topic->id ? 'selected' : '')?> value="<?= htmlReady($one_topic->id) ?>"> + <option <?= isset($topic) && $topic->id === $one_topic->id ? 'selected' : '' ?> value="<?= htmlReady($one_topic->id) ?>"> <?= htmlReady($one_topic->title) ?> </option> <? endforeach; ?> diff --git a/templates/footer.php b/templates/footer.php index 164b054..63cb064 100644 --- a/templates/footer.php +++ b/templates/footer.php @@ -9,29 +9,6 @@ htmlReady($GLOBALS['user']->perms)) ?> | <?= strftime('%x, %X') ?> - <? if (Studip\ENV === 'development'): ?> - [ - <? if (DBManager::get('studip') === DBManager::get('studip-slave')): ?> - <?= sprintf('%u db queries', DBManager::get('studip')->query_count) ?> - <? else: ?> - <?= sprintf( - 'M%u/S%u = %u db queries', - DBManager::get('studip')->query_count, - DBManager::get('studip-slave')->query_count, - DBManager::get('studip')->query_count + DBManager::get('studip-slave')->query_count - ) ?> - <? endif; ?> - / - <?= relsize(memory_get_peak_usage(true), false) ?> mem - / - <?= sprintf('%.5f sec', microtime(true) - $GLOBALS['STUDIP_STARTUP_TIME']) ?> - ] - <? if (!empty($GLOBALS['DEBUG_ALL_DB_QUERIES'])) : ?> - <a href="" onClick="jQuery('#all_db_queries').toggle(); return false;"> - <?= Icon::create("code", "info_alt")->asImg(16, ['class' => "text-bottom"]) ?> - </a> - <? endif ?> - <? endif; ?> </div> <? endif; ?> @@ -57,5 +34,4 @@ <? endif; ?> </footer> <? endif; ?> -<?= $this->render_partial('debug/db-log.php') ?> <!-- Ende Footer --> diff --git a/templates/forms/form.php b/templates/forms/form.php index 4745225..fe19404 100644 --- a/templates/forms/form.php +++ b/templates/forms/form.php @@ -1,4 +1,8 @@ -<? +<?php +/** + * @var \Studip\Forms\Form $form + */ + $inputs = []; $allinputs = $form->getAllInputs(); $required_inputs = []; diff --git a/templates/globalsearch/searchbar.php b/templates/globalsearch/searchbar.php index 93a8ab5..9aaa335 100644 --- a/templates/globalsearch/searchbar.php +++ b/templates/globalsearch/searchbar.php @@ -1,7 +1,17 @@ -<div id="globalsearch-searchbar" role="search" aria-label="<?= _('Globale Suche') ?>"> - <input class="hidden-small-down" type="text" name="globalsearchterm" id="globalsearch-input" - placeholder="<?= _('Was suchen Sie?') ?>" role="searchbox"> - <?= Icon::create('decline', Icon::ROLE_INACTIVE)->asInput([ +<div id="globalsearch-searchbar" + role="search" + aria-label="<?= _('Globale Suche') ?>"> + <input class="hidden-small-down" + type="text" + name="globalsearchterm" + id="globalsearch-input" + placeholder="<?= _('Was suchen Sie?') ?>" + role="combobox" + aria-haspopup="listbox" + aria-expanded="false" + aria-controls="globalsearch-list" + aria-label="Suche nach Objekten und Personen in Stud.IP"> + <?= Icon::create('decline')->asInput([ 'id' => 'globalsearch-clear', 'class' => 'hidden-small-down', 'alt' => _('Suche zurücksetzen'), @@ -10,7 +20,8 @@ 'id' => 'globalsearch-icon', 'alt' => _('Suche starten') ]) ?> - <div id="globalsearch-list"> + <div id="globalsearch-list" + role="listbox"> <a href="#" id="globalsearch-togglehints" data-toggle-text="<?= _('Tipps ausblenden') ?>"> <?= _('Tipps einblenden') ?> </a> diff --git a/templates/header.php b/templates/header.php index 5ff5a1f..711d517 100644 --- a/templates/header.php +++ b/templates/header.php @@ -66,18 +66,12 @@ if ($navigation) { 'username' => $user->username, 'perm' => $GLOBALS['perm']->get_perm() ]; - - $navWidget = Sidebar::get()->countWidgets(NavigationWidget::class); - $allWidgets = Sidebar::get()->countWidgets(); - $hasSidebar = $allWidgets - $navWidget > 0; ?> <? } else { $me = ['username' => 'nobody']; - $hasSidebar = false; } ?> <responsive-navigation :me="<?= htmlReady(json_encode($me)) ?>" context="<?= htmlReady(Context::get() ? Context::get()->getFullName() : '') ?>" - :has-sidebar="<?= $hasSidebar ? 'true' : 'false' ?>" :navigation="<?= htmlReady(json_encode(ResponsiveHelper::getNavigationObject($_COOKIE['responsive-navigation-hash'] ?? null))) ?>" ></responsive-navigation> </div> @@ -147,7 +141,8 @@ if ($navigation) { ngettext('%u Benachrichtigung', '%u Benachrichtigungen', count($notifications)), count($notifications) ) ?>" data-lastvisit="<?= $lastvisit ?>" - <?= count($notifications) == 0 ? 'disabled' : '' ?>> + <?= count($notifications) == 0 ? 'disabled' : '' ?> aria-controls="notification-list" + aria-expanded="false"> <span class="count" aria-hidden="true"><?= count($notifications) ?></span> </button> <input type="checkbox" id="notification_checkbox"> @@ -221,7 +216,9 @@ if ($navigation) { <!-- Main navigation and right-hand logo --> <nav id="navigation-level-1" aria-label="<?= _('Hauptnavigation') ?>"> - <? SkipLinks::addIndex(_('Hauptnavigation'), 'navigation-level-1', 2, false); ?> + <? if (!empty($header_nav['visible'])) : ?> + <? SkipLinks::addIndex(_('Hauptnavigation'), 'navigation-level-1', 2, false) ?> + <? endif ?> <ul id="navigation-level-1-items" <? if (count($header_nav['hidden']) > 0) echo 'class="overflown"'; ?>> <? foreach ($header_nav['visible'] as $path => $nav): ?> <?= $this->render_partial( @@ -282,7 +279,8 @@ if ($navigation) { <? $membership = CourseMember::find([Context::get()->id, $GLOBALS['user']->id]) ?> <? if ($membership) : ?> <a href="<?= URLHelper::getLink('dispatch.php/my_courses/groups') ?>" - data-dialog + data-dialog aria-label="<?= _('Gruppenzuordnung der Veranstaltung ändern') ?>" + title="<?= _('Gruppenzuordnung der Veranstaltung ändern') ?>" class="colorblock gruppe<?= $membership ? $membership['gruppe'] : 1 ?>"></a> <? endif ?> <? endif ?> @@ -301,10 +299,12 @@ if ($navigation) { </div> <? endif ?> - <? SkipLinks::addIndex(_('Zweite Navigationsebene'), 'navigation-level-2', 910) ?> <nav id="navigation-level-2" aria-label="<?= _('Zweite Navigationsebene') ?>"> <? if (PageLayout::isHeaderEnabled() /*&& isset($navigation)*/) : ?> + <? if (!empty($navigation)) : ?> + <? SkipLinks::addIndex(_('Zweite Navigationsebene'), 'navigation-level-2', 910) ?> + <? endif ?> <?= $this->render_partial('tabs', compact('navigation')) ?> <? endif; ?> </nav> diff --git a/templates/helpbar/helpbar.php b/templates/helpbar/helpbar.php index 6f80c4d..6f8efbb 100644 --- a/templates/helpbar/helpbar.php +++ b/templates/helpbar/helpbar.php @@ -1,13 +1,23 @@ +<?php +/** + * @var bool $open + * @var Widget[] $widgets + */ +?> <div class="helpbar-container"> - <?= SkipLinks::addIndex(_('Tipps & Hilfe'), 'helpbar_icon', 920) ?> - <a id="helpbar_icon" href="#" class="helpbar-toggler" data-toggles=".helpbar" title="<?= _('Hilfelasche anzeigen/verstecken') ?>"> + <? SkipLinks::addIndex(_('Tipps & Hilfe'), 'helpbar_icon', 920) ?> + <a id="helpbar_icon" href="#" class="helpbar-toggler" data-toggles=".helpbar" role="button" + title="<?= _('Hilfelasche anzeigen/verstecken') ?>" aria-controls="helpbar-content" + aria-expanded="<?= $open ? 'true' : 'false' ?>"> <?= Icon::create('question-circle')->asImg(24, ['alt' => '']) ?> </a> - <div class="helpbar" <? if (!$open) echo 'style="display: none"'; ?>> + <div class="helpbar" id="helpbar-content" <? if (!$open) echo 'style="display: none"'; ?>> <h2 class="helpbar-title"> <?= _('Tipps & Hilfe') ?> - <a href="#" class="helpbar-toggler" data-toggles=".helpbar" aria-hidden="true" title="<?= _('Hilfelasche verstecken') ?>"> + <a href="#" class="helpbar-toggler" data-toggles=".helpbar" aria-hidden="true" role="button" + title="<?= _('Hilfelasche verstecken') ?>" aria-controls="helpbar-content" + aria-expanded="<?= $open ? 'true' : 'false' ?>"> <?= Icon::create('decline-circle', Icon::ROLE_INFO_ALT)->asImg(24, ['alt' => '']) ?> </a> </h2> @@ -37,7 +47,7 @@ </ul> </div> </div> -<? if ($tour_data['active_tour_id']) : ?> +<? if (!empty($tour_data['active_tour_id'])) : ?> <script> STUDIP.Tour.init('<?=$tour_data['active_tour_id']?>', '<?=$tour_data['active_tour_step_nr']?>') </script> diff --git a/templates/layouts/base.php b/templates/layouts/base.php index 180e020..1f2ac32 100644 --- a/templates/layouts/base.php +++ b/templates/layouts/base.php @@ -53,7 +53,9 @@ $lang_attr = str_replace('_', '-', $_SESSION['_language']); 'ACTIONMENU_THRESHOLD' => Config::get()->ACTION_MENU_THRESHOLD, 'ENTRIES_PER_PAGE' => Config::get()->ENTRIES_PER_PAGE, 'OPENGRAPH_ENABLE' => Config::get()->OPENGRAPH_ENABLE, - 'COURSEWARE_CERTIFICATES_ENABLE' => Config::get()->COURSEWARE_CERTIFICATES_ENABLE + 'COURSEWARE_CERTIFICATES_ENABLE' => Config::get()->COURSEWARE_CERTIFICATES_ENABLE, + 'PERSONAL_NOTIFICATIONS_AUDIO_DEACTIVATED' => + (bool) User::findCurrent()?->getConfiguration()->PERSONAL_NOTIFICATIONS_AUDIO_DEACTIVATED, ]) ?>, } </script> @@ -90,19 +92,28 @@ $lang_attr = str_replace('_', '-', $_SESSION['_language']); <?= Icon::create('zoom-out2')->asImg(24) ?> </button> <? endif; ?> - <?= implode(PageLayout::getMessages()) ?> <?= $content_for_layout ?> </div> + <system-notification-manager + id="system-notifications" + :notifications='<?= htmlReady(json_encode(PageLayout::getMessages())) ?>' + placement="<?= User::findCurrent()?->getConfiguration()->SYSTEM_NOTIFICATIONS_PLACEMENT ?? 'topcenter' ?>"></system-notification-manager> </main> <!-- End main content --> - <a id="scroll-to-top" class="hide"> + <a id="scroll-to-top" class="hide" tabindex="0" title="<?= _('Zurück zum Seitenanfang') ?>"> <?= Icon::create('arr_1up', 'info_alt')->asImg(24, ['class' => '']) ?> </a> - <?= $this->render_partial('footer', ['link_params' => $header_template->link_params]); ?> + <?= $this->render_partial('footer', ['link_params' => $header_template->link_params ?? null]); ?> <?= SkipLinks::getHTML() ?> <section class="sr-only" id="notes_for_screenreader" aria-live="polite"></section> + +<?php +if (Studip\Debug\DebugBar::isActivated()) { + echo app()->get(\DebugBar\DebugBar::class)->getJavascriptRenderer()->render(); +} +?> </body> </html> <?php NotificationCenter::postNotification('PageDidRender', PageLayout::getBodyElementId()); diff --git a/templates/layouts/dialog.php b/templates/layouts/dialog.php index ddf9280..147f69d 100644 --- a/templates/layouts/dialog.php +++ b/templates/layouts/dialog.php @@ -1,2 +1,2 @@ -<?= implode(PageLayout::getMessages()) ?> -<?= $content_for_layout ?>
\ No newline at end of file +<?= implode('', PageLayout::getMessages()) ?> +<?= $content_for_layout ?> diff --git a/templates/login_emailactivation.php b/templates/login_emailactivation.php index 4f75807..cf8221a 100644 --- a/templates/login_emailactivation.php +++ b/templates/login_emailactivation.php @@ -9,7 +9,7 @@ use Studip\Button, Studip\LinkButton; <b><?= _('E-Mail Aktivierung') ?></b> </td></tr> <tr><td style="background-color: #fff; padding: 1.5em;"> -<?= _('Sie haben Ihre E-Mail-Adresse geändert. Um diese frei zu schalten müssen Sie den Ihnen an Ihre neue Adresse zugeschickten Aktivierungs Schlüssel im unten stehenden Eingabefeld eintragen.'); ?> +<?= _('Sie haben Ihre E-Mail-Adresse geändert. Um diese frei zu schalten müssen Sie den Ihnen an Ihre neue Adresse zugeschickten Aktivierungs Schlüssel im folgenden Eingabefeld eintragen.'); ?> <br><form action="activate_email.php" method="post"> <?= CSRFProtection::tokenTag() ?> <input name="key"> @@ -25,7 +25,7 @@ use Studip\Button, Studip\LinkButton; <b><?= _('E-Mail Aktivierung neu senden') ?></b> </td></tr> <tr><td style="background-color: #fff; padding: 1.5em;"> -<?= _('Sollten Sie keine E-Mail erhalten haben, können Sie sich einen neuen Aktivierungsschlüssel zuschicken lassen. Geben Sie dazu Ihre gewünschte E-Mail-Adresse unten an:'); ?> +<?= _('Sollten Sie keine E-Mail erhalten haben, können Sie sich einen neuen Aktivierungsschlüssel zuschicken lassen. Geben Sie dazu Ihre gewünschte E-Mail-Adresse im folgenden Formular an:'); ?> <form action="activate_email.php" method="post"> <?= CSRFProtection::tokenTag() ?> <input type="hidden" name="uid" value="<?= $uid ?>"> diff --git a/templates/loginform.php b/templates/loginform.php index 69fc1f0..da717eb 100644 --- a/templates/loginform.php +++ b/templates/loginform.php @@ -32,20 +32,14 @@ $show_hidden_login = !$show_login && StudipAuthAbstract::isLoginEnabled(); <div id="login_flex"> <div> - <? if ($loginerror): ?> - <!-- failed login code --> - <?= MessageBox::error(_('Bei der Anmeldung trat ein Fehler auf!'), [ - $error_msg, - sprintf( - _('Bitte wenden Sie sich bei Problemen an: <a href="mailto:%1$s">%1$s</a>'), - $GLOBALS['UNI_CONTACT'] - ) - ]) ?> - <? endif ?> - - <?= implode('', PageLayout::getMessages()); ?> <div id="loginbox"> <header> + <system-notification-manager + id="system-notifications" + class="system-notifications-login" + :notifications='<?= htmlReady(json_encode(PageLayout::getMessages())) ?>' + append-all-to="#loginbox"></system-notification-manager> + <h1><?= htmlReady(Config::get()->UNI_NAME_CLEAN) ?></h1> </header> @@ -139,7 +133,6 @@ $show_hidden_login = !$show_login && StudipAuthAbstract::isLoginEnabled(); </div> - </main> <script type="text/javascript" language="javascript"> diff --git a/templates/mail/html.php b/templates/mail/html.php index e737965..1987333 100644 --- a/templates/mail/html.php +++ b/templates/mail/html.php @@ -1,38 +1,129 @@ -<? +<?php # Lifter010: TODO +/** + * @var string $snd_fullname + * @var string $rec_fullname + * @var string $rec_username + * @var string $message + * @var array $attachments + */ ?> <html> -<head> - <?= Assets::stylesheet('studip-base.css') ?> -</head> -<body> - <div style="background-color: white; margin: auto; width: 700px; padding: 4px;"> - <?= Assets::img("locale/$lang/LC_PICTURES/mail_header.png") ?> - <p> - <?= formatReady($message, true, true) ?> - </p> - <? if (isset($attachments) && count($attachments)) : ?> - <hr> - <span class="minor"> - <?=_("Dateianhänge:")?> - <ul> - <? foreach($attachments as $attachment) : ?> - <li> - <a href="<?= $attachment->getDownloadURL() ?>"><?= htmlReady($attachment->name . ' (' . relsize($attachment->file->size, false) . ')') ?></a> - </li> - <? endforeach;?> - </ul> - </span> - <? endif;?> - <hr> - <span class="minor"> - <? if ($snd_fullname) : ?> - <?= sprintf(_('Diese E-Mail ist eine Kopie einer systeminternen Nachricht, die in Stud.IP von %s (<a href="%s">%s</a>) an %s (<a href="%s">%s</a>) versendet wurde.'), htmlReady($snd_fullname), htmlReady($snd_email),htmlReady($snd_email), htmlReady($rec_fullname), htmlReady($rec_email),htmlReady($rec_email)) ?> - <? else : ?> - <?= sprintf(_("Diese E-Mail ist eine Kopie einer systeminternen Nachricht, die in Stud.IP an %s versendet wurde."), htmlReady($rec_fullname)) ?> - <? endif ?> - <br><?= sprintf(_("Sie erreichen Stud.IP unter %s"), "<a href=\"" . $GLOBALS['ABSOLUTE_URI_STUDIP'] . "\">" . $GLOBALS['ABSOLUTE_URI_STUDIP'] . "</a>") ?> - </span> - </div> -</body> + <head> + <style> + html { + background-color: #e7ebf1; + font-family: 'Lato', Helvetica, Arial, sans-serif; + height: 100%; + width: 100%; + } + + a, a:link, a:visited { + color: #28497c; + text-decoration: none; + } + a[href] { + transition: color .3s; + } + a[disabled] { + pointer-events: none; + } + + a:hover, a:active { + color: #d60000; + text-decoration: none; + } + + .studip-mail { + background-color: #ffffff; + border: 1px solid #d0d7e3; + margin: 25px auto; + padding: 10px 25px 25px 25px; + width: 700px; + } + + .studip-mail header { + border-bottom: 1px solid #d0d7e3; + display: block; + text-align: center; + padding-bottom: 15px; + } + + .studip-mail header .studip-mail-header-logo { + margin-left: auto; + margin-right: auto; + width: 100%; + } + + .studip-mail header .studip-mail-sndrec { + margin-left: auto; + margin-right: auto; + margin-top: 0; + width: 100%; + } + + .studip-mail .studip-mail-message { + line-height: 1.33; + padding: 15px 25px; + } + + .studip-mail footer { + border-top: 1px solid #d0d7e3; + text-align: center; + margin-left: auto; + margin-right: auto; + padding-top: 15px; + width: 100%; + } + </style> + </head> + <body> + <article class="studip-mail"> + <header> + <div class="studip-mail-header-logo" > + <img alt="" width="130" height="92" src="cid:studiplogo"> + </div> + <p class="studip-mail-sndrec"> + <?php if ($snd_fullname) : ?> + <?= sprintf(_('%1$s hat Ihnen eine Nachricht in Stud.IP geschickt.'), + htmlReady($snd_fullname), htmlReady($rec_fullname), htmlReady($rec_username)) ?> + <?php else : ?> + <?= sprintf( + _('Stud.IP hat eine automatische Systemnachricht für Sie.'), + htmlReady($rec_fullname), + htmlReady($rec_username) + ) ?> + <?php endif ?> + </p> + </header> + <section class="studip-mail-message"> + <p> + <?= formatReady($message, true, true) ?> + </p> + <?php if (isset($attachments) && count($attachments)) : ?> + <div class="studip-mail-attachments"> + <?= _('Dateianhänge:') ?> + <ul> + <?php foreach($attachments as $attachment) : ?> + <li> + <a href="<?= $attachment->getDownloadURL() ?>"><?= htmlReady($attachment->name . + ' (' . relsize($attachment->file->size, false) . ')') ?></a> + </li> + <?php endforeach ?> + </ul> + </div> + <?php endif ?> + </section> + <footer> + <?= sprintf( + _('Diese E-Mail ist eine Kopie einer systeminternen Nachricht, die in Stud.IP an %1$s (%2$s) versendet wurde.'), + htmlReady($rec_fullname), + htmlReady($rec_username) + ) + ?> + <br><?= sprintf(_('Sie erreichen Stud.IP unter %s'), + '<a href="' . $GLOBALS['ABSOLUTE_URI_STUDIP'] . '">' . $GLOBALS['ABSOLUTE_URI_STUDIP'] . '</a>') ?> + </footer> + </article> + </body> </html> diff --git a/templates/mail/notification_html.php b/templates/mail/notification_html.php index 5060fb7..93bc1a8 100644 --- a/templates/mail/notification_html.php +++ b/templates/mail/notification_html.php @@ -1,50 +1,132 @@ <? # Lifter010: TODO +/** + * @var string $rec_fullname + * @var string $rec_username + * @var array $news + * @var string $sso + */ ?> <html> -<head> - <?= Assets::stylesheet('studip-base.css') ?> -</head> -<body> - <div style="background-color: white; margin: auto; max-width: 700px; padding: 4px;"> - <?= Assets::img("locale/$lang/LC_PICTURES/mail_header_notification.png") ?> - <p> - <?= _("Sie erhalten hiermit in regelmäßigen Abständen Informationen über Neuigkeiten und Änderungen in belegten Veranstaltungen.") ?> - <br><br> - <?= _("Über welche Inhalte und in welchem Format Sie informiert werden wollen, können Sie hier einstellen:") ?> - <br> - <a href="<?= URLHelper::getLink('dispatch.php/settings/notification', ['again' => 'yes', 'sso' => $sso]) ?>"> - <?= URLHelper::getLink('dispatch.php/settings/notification', ['again' => 'yes', 'sso' => $sso]) ?> - </a> - </p> - - <table class="default"> - <? foreach ($news as $sem_titel => $data) : ?> - <tr class="table_header_bold"> - <td colspan="2" style="font-weight: bold;"> - <a href="<?= URLHelper::getLink('seminar_main.php', ['again' => 'yes', 'sso' => $sso, 'auswahl' => $data[0]['range_id']]) ?>"> - <?= htmlReady($sem_titel) ?> - <?= (($semester = get_semester($data[0]['range_id'])) ? ' ('.$semester.')' : '') ?> - </a> - </td> - </tr> - - <? foreach ($data as $module) : ?> - <tr class="<?= TextHelper::cycle('hover_odd', 'hover_even') ?>"> - <td> - <a href="<?= URLHelper::getLink($module['url'], ['sso' => $sso]) ?>"><?= htmlReady($module['text']) ?></a> - </td> - <td> - <a href="<?= URLHelper::getLink($module['url'], ['sso' => $sso]) ?>"><?= $module['icon']->asImg(['title' => $module['text']]) ?></a> - </td> - </tr> - <? endforeach ?> - <? endforeach ?> - </table> - <hr> - <span class="minor"> - <?= _("Diese Nachricht wurde automatisch vom Stud.IP-System generiert. Sie können darauf nicht antworten.") ?> - </span> - </div> -</body> + <head> + <style> + html { + background-color: #e7ebf1; + font-family: 'Lato', Helvetica, Arial, sans-serif; + height: 100%; + width: 100%; + } + + a, a:link, a:visited { + color: #28497c; + text-decoration: none; + } + a[href] { + transition: color .3s; + } + a[disabled] { + pointer-events: none; + } + + a:hover, a:active { + color: #d60000; + text-decoration: none; + } + + .studip-mail { + background-color: #ffffff; + border: 1px solid #d0d7e3; + margin: 25px auto; + padding: 10px 25px 25px 25px; + width: 700px; + } + + .studip-mail header { + border-bottom: 1px solid #d0d7e3; + display: block; + text-align: center; + padding-bottom: 15px; + } + + .studip-mail header .studip-mail-header-logo { + margin-left: auto; + margin-right: auto; + width: 100%; + } + + .studip-mail header .studip-mail-sndrec { + margin-left: auto; + margin-right: auto; + margin-top: 0; + width: 100%; + } + + .studip-mail .studip-mail-message { + line-height: 1.33; + padding: 15px 25px; + } + + .studip-mail footer { + border-top: 1px solid #d0d7e3; + text-align: center; + margin-left: auto; + margin-right: auto; + padding-top: 15px; + width: 100%; + } + </style> + </head> + <body> + <article class="studip-mail"> + <header> + <div class="studip-mail-header-logo" > + <img alt="" width="130" height="92" src="cid:studiplogo"> + </div> + <p class="studip-mail-sndrec"> + <?= sprintf( + _('Stud.IP hat eine automatische Systemnachricht für Sie.'), + htmlReady($rec_fullname), + htmlReady($rec_username) + ) ?> + </p> + <p> + <?= _("Sie erhalten hiermit in regelmäßigen Abständen Informationen über Neuigkeiten und Änderungen in belegten Veranstaltungen.") ?> + <br><br> + <?= _("Über welche Inhalte und in welchem Format Sie informiert werden wollen, können Sie hier einstellen:") ?> + <br> + <a href="<?= URLHelper::getLink('dispatch.php/settings/notification', ['again' => 'yes', 'sso' => $sso]) ?>"> + <?= URLHelper::getLink('dispatch.php/settings/notification', ['again' => 'yes', 'sso' => $sso]) ?> + </a> + </p> + </header> + <section class="studip-mail-message"> + <table class="default"> + <? foreach ($news as $sem_titel => $data) : ?> + <tr class="table_header_bold"> + <td style="font-weight: bold;"> + <a href="<?= URLHelper::getLink('seminar_main.php', ['again' => 'yes', 'sso' => $sso, 'auswahl' => $data[0]['seminar_id']]) ?>"> + <?= htmlReady($sem_titel) ?> + <?= (($semester = Course::find($data[0]['range_id'])->semester_text) ? ' ('.$semester.')' : '') ?> + </a> + </td> + </tr> + <? foreach ($data as $module) : ?> + <tr> + <td> + <a href="<?= URLHelper::getLink($module['url'], ['sso' => $sso]) ?>"><?= htmlReady($module['text']) ?></a> + </td> + </tr> + <? endforeach ?> + <? endforeach ?> + </table> + </section> + <footer> + <?= sprintf( + _('Diese E-Mail wurde von Stud.IP an %1$s (%2$s) versendet.'), + htmlReady($rec_fullname), + htmlReady($rec_username) + ) + ?> + </footer> + </body> </html> diff --git a/templates/mail/notification_text.php b/templates/mail/notification_text.php index bac0d5e..47b8a4a 100644 --- a/templates/mail/notification_text.php +++ b/templates/mail/notification_text.php @@ -14,7 +14,7 @@ <? foreach ($news as $sem_titel => $data) : ?> <?= sprintf(_("In der Veranstaltung \"%s\" gibt es folgende Neuigkeiten:"), $sem_titel) ?> -<?= URLHelper::getURL('seminar_main.php', ['again' => 'yes', 'sso' => $sso, 'auswahl' => $data[0]['range_id']]) ?> +<?= URLHelper::getURL('seminar_main.php', ['again' => 'yes', 'sso' => $sso, 'auswahl' => $data[0]['seminar_id']]) ?> <? foreach ($data as $module) : ?> diff --git a/templates/shared/message_box.php b/templates/shared/message_box.php index 657563b..447763d 100644 --- a/templates/shared/message_box.php +++ b/templates/shared/message_box.php @@ -1,4 +1,4 @@ -<div class="messagebox messagebox_<?= $class ?> <? if (count($details) > 0 && $close_details): ?>details_hidden<? endif; ?>"> +<div role="region" aria-label="<?= $label ?>" aria-describedby="messagebox-<?= $counter ?>" class="messagebox messagebox_<?= $class ?> <? if (count($details) > 0 && $close_details): ?>details_hidden<? endif; ?>"> <div class="messagebox_buttons"> <? if (count($details) > 0 && $close_details) : ?> <a class="details" href="#" title="<?=_('Detailanzeige umschalten')?>"> @@ -6,19 +6,21 @@ </a> <? endif ?> <? if (!$hide_close): ?> - <a class="close" href="#" title="<?= _('Nachrichtenbox schließen') ?>"> + <a class="close" role="button" href="#" title="<?= _('Nachrichtenbox schließen') ?>"> <span><?= _('Nachrichtenbox schließen') ?></span> </a> <? endif; ?> </div> + <div role="status" id="messagebox-<?= $counter ?>"> <?= $message ?> -<? if (count($details) > 0) : ?> - <div class="messagebox_details"> - <ul> - <? foreach ($details as $li) : ?> - <li><?= $li ?></li> - <? endforeach ?> - </ul> + <? if (count($details) > 0) : ?> + <div class="messagebox_details"> + <ul> + <? foreach ($details as $li) : ?> + <li><?= $li ?></li> + <? endforeach ?> + </ul> + </div> + <? endif ?> </div> -<? endif ?> </div> diff --git a/templates/shared/opengraphinfo_wide.php b/templates/shared/opengraphinfo_wide.php index ddcd19c..44ce918 100644 --- a/templates/shared/opengraphinfo_wide.php +++ b/templates/shared/opengraphinfo_wide.php @@ -18,12 +18,12 @@ if (Config::get()->LOAD_EXTERNAL_MEDIA === "proxy" && Seminar_Session::is_curren ?> <div class="opengraph <? if (count($videofiles) > 0) echo 'video'; ?> <? if (count($audiofiles) > 0) echo 'audio'; ?>"> <? if ($og['image'] && count($videofiles) === 0): ?> - <a href="<?= URLHelper::getLink($og['url'], [], false) ?>" class="image" + <a href="<?= URLHelper::getLink($og['url'], [], true) ?>" class="image" target="_blank" rel="noopener noreferrer" style="background-image:url(<?= htmlReady($media_url_func($og['image'])) ?>)"> </a> <? endif; ?> - <a href="<?= URLHelper::getLink($og['url'], [], false) ?>" class="info" + <a href="<?= URLHelper::getLink($og['url'], [], true) ?>" class="info" target="_blank" rel="noopener noreferrer"> <strong><?= htmlReady($og['title']) ?></strong> <? if (!count($videofiles)) : ?> diff --git a/templates/shared/question-box.php b/templates/shared/question-box.php index 40535c5..5bf1dcd 100644 --- a/templates/shared/question-box.php +++ b/templates/shared/question-box.php @@ -1,5 +1,7 @@ <div class="modaloverlay"> - <div class="ui-dialog ui-corner-all ui-widget ui-widget-content ui-front ui-dialog-buttons studip-confirmation"> + <div class="ui-dialog ui-corner-all ui-widget ui-widget-content ui-front ui-dialog-buttons studip-confirmation" + role="alertdialog" aria-labelledBy="studip-confirmation-title-1" aria-describedby="studip-confirmation-desc-1" + modal="true"> <form action="<?= URLHelper::getLink($accept_url) ?>" method="post"> <?= CSRFProtection::tokenTag() ?> <? foreach ($accept_parameters as $key => $value): ?> @@ -7,13 +9,16 @@ <? endforeach; ?> <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"> - <span class="ui-dialog-title"><?= _('Bitte bestätigen Sie die Aktion') ?></span> + <span class="ui-dialog-title" id="studip-confirmation-title-1"> + <?= _('Bitte bestätigen Sie die Aktion') ?> + </span> <a href="<?= URLHelper::getLink($decline_url, $decline_parameters) ?>" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-dialog-titlebar-close"> <span class="ui-button-icon-primary ui-icon ui-icon-closethick"></span> <span class="ui-button-text"><?= _('Schliessen') ?></span> </a> </div> - <div class="content ui-widget-content ui-dialog-content studip-confirmation"> + <div class="content ui-widget-content ui-dialog-content studip-confirmation" + id="studip-confirmation-desc-1" role="heading" aria-level="2"> <?= $question ?> </div> <div class="buttons ui-widget-content ui-dialog-buttonpane"> diff --git a/templates/shared/tooltip.php b/templates/shared/tooltip.php index a97c73f..513700f 100644 --- a/templates/shared/tooltip.php +++ b/templates/shared/tooltip.php @@ -1,5 +1,11 @@ -<span class="tooltip tooltip-icon <? if ($important) echo 'tooltip-important'; ?>" data-tooltip <? if (!$html) printf('title="%s"', htmlReady($text)) ?> tabindex="0"> -<? if ($html): ?> - <span class="tooltip-content"><?= $text ?></span> -<? endif; ?> +<?php +/** + * @var bool $important + * @var bool $html + * @var string $text + */ +?> +<span class="tooltip tooltip-icon <? if ($important) echo 'tooltip-important'; ?>" + tabindex="0" aria-label="<?= $html ? htmlReady(strip_tags($text)) : htmlReady($text) ?>"> + <span class="tooltip-content"><?= $html ? $text : htmlReady($text) ?></span> </span> diff --git a/templates/sidebar/search-widget.php b/templates/sidebar/search-widget.php index 6d870ba..c314673 100644 --- a/templates/sidebar/search-widget.php +++ b/templates/sidebar/search-widget.php @@ -1,6 +1,7 @@ <form action="<?= URLHelper::getLink($url) ?>" method="<?= $method ?>" - <? if (isset($id)) printf('id="%s"', htmlReady($id)); ?> + <? $id = $id ?? 'form-'.md5(uniqid()) ?> + <? printf('id="%s"', htmlReady($id)) ?> <?= $onsubmit ? 'onsubmit="'.htmlReady($onsubmit).'"' : '' ?> class="sidebar-search"> <? foreach ($url_params as $key => $value): ?> @@ -8,9 +9,10 @@ <? endforeach; ?> <ul class="needles"> <? foreach ($needles as $needle): ?> + <? $hash = md5($url . '|' . $needle['name']) ?> <li <? if ($needle['quick_search'] && $needle['quick_search']->hasExtendedLayout()) echo 'class="extendedLayout" id="' . $needle['quick_search']->getId() . '_frame"'; ?>> <div class="input-group files-search"> - <label for="needle-<?= $hash = md5($url . '|' . $needle['name']) ?>" <? if ($needle['placeholder']) echo 'style="display:none;"'; ?>> + <label for="needle-<?= $hash ?>" <? if ($needle['placeholder']) echo 'class="sr-only"'; ?>> <?= htmlReady($needle['label']) ?> </label> <? if ($needle['quick_search']): ?> @@ -22,16 +24,24 @@ <? if ($needle['placeholder']) printf('placeholder="%s"', htmlReady($needle['label'])); ?> <?= arrayToHtmlAttributes($needle['attributes']) ?>> <? endif; ?> - <? if ($reset_link): ?> - <a class="reset-search" href="<?= $reset_link ?>" tabindex="0" role="button" - title="<?= _('Suche zurücksetzen') ?>"> - <?= Icon::create('decline')->asImg(20) ?> - </a> - <? endif; ?> <button type="submit" class="submit-search<?= $reset_link ? ' is-executed' : '' ?>" title="<?= _('Suche ausführen') ?>"> <?= Icon::create('search')->asImg(20) ?> </button> + <? if ($reset_link): ?> + <? if ($onsubmit) : ?> + <?= Icon::create('decline')->asInput([ + 'title' => _('Suche zurücksetzen'), + 'class' => 'reset-search', + 'onclick' => "document.getElementById('needle-".$hash."').value = ''; this.remove();" + ]) ?> + <? else : ?> + <a class="reset-search" href="<?= $reset_link ?>" tabindex="0" role="button" + title="<?= _('Suche zurücksetzen') ?>"> + <?= Icon::create('decline')->asImg(20) ?> + </a> + <? endif ?> + <? endif; ?> </li> <? endforeach; ?> </ul> diff --git a/templates/start/quickselection.php b/templates/start/quickselection.php index e465d8d..bcf3fb3 100644 --- a/templates/start/quickselection.php +++ b/templates/start/quickselection.php @@ -1,28 +1,31 @@ <div id="quickSelectionWrap" style="padding: 1ex;"> <? foreach ($navigation as $nav) : ?> <? if ($nav->isVisible()) : ?> - <div class="mainmenu"> + <ul class="mainmenu list-unstyled"> <? if (is_internal_url($url = $nav->getURL())) : ?> - <a href="<?= URLHelper::getLink($url) ?>"> + <li><a href="<?= URLHelper::getLink($url) ?>"> <? else : ?> - <a href="<?= htmlReady($url) ?>" target="_blank" rel="noopener noreferrer"> + <li><a href="<?= htmlReady($url) ?>" target="_blank" rel="noopener noreferrer"> <? endif ?> - <?= htmlReady($nav->getTitle()) ?></a> - <? $pos = 0 ?> + <?= htmlReady($nav->getTitle()) ?></a></li> + + <li> + <ul class="list-slash-separated-small"> <? foreach ($nav as $subnav) : ?> <? if ($subnav->isVisible()) : ?> - <font size="-1"> - <?= $pos++ ? ' / ' : '<br>' ?> + <li> <? if (is_internal_url($url = $subnav->getURL())) : ?> - <a href="<?= URLHelper::getLink($url) ?>"> - <? else : ?> + <a href="<?= URLHelper::getLink($url) ?>"> + <? else : ?> <a href="<?= htmlReady($url) ?>" target="_blank" rel="noopener noreferrer"> - <? endif ?> - <?= htmlReady($subnav->getTitle()) ?></a> - </font> + <? endif ?> + <?= htmlReady($subnav->getTitle()) ?></a> + </li> <? endif ?> <? endforeach ?> - </div> + </ul> + </li> + </ul> <? endif ?> <? endforeach ?> </div> diff --git a/templates/tabs.php b/templates/tabs.php index 987e0fd..24597cb 100644 --- a/templates/tabs.php +++ b/templates/tabs.php @@ -7,10 +7,10 @@ foreach (Navigation::getItem("/")->getSubNavigation() as $path => $nav) { } ?> <div class="tabs_wrapper"> - <? SkipLinks::addIndex(_('Zweite Navigationsebene'), 'navigation-level-2', 10, false); ?> <ul id="tabs"> <? if (!empty($navigation)): ?> - <? foreach ($navigation as $path => $nav) : ?> + <? SkipLinks::addIndex(_('Zweite Navigationsebene'), 'navigation-level-2', 10, false); ?> + <? foreach ($navigation as $path => $nav) : ?> <? if ($nav->isVisible()) : ?> <li id="nav_<?= $path1 ?? '' ?>_<?= $path ?>"<?= $nav->isActive() ? ' class="current"' : '' ?>> <? if ($nav->isEnabled()): ?> |
