From 0d95625c2ab0eabe98e724ab79be0087093cc35b Mon Sep 17 00:00:00 2001 From: Moritz Strohm Date: Wed, 4 May 2022 14:18:41 +0000 Subject: fix for BIESt #957 Merge request studip/studip!554 --- app/controllers/news.php | 4 +-- app/controllers/plugin_controller.php | 4 +++ app/controllers/studip_controller.php | 4 ++- app/views/calendar/contentbox/display.php | 4 +-- app/views/news/display.php | 1 - lib/bootstrap.php | 6 ++-- lib/calendar/CalendarColumn.class.php | 4 +-- lib/classes/Assets.class.php | 2 +- lib/classes/Avatar.class.php | 2 +- lib/classes/Log.php | 6 ++-- lib/classes/NotificationCenter.class.php | 9 +++-- lib/classes/PageLayout.php | 2 +- lib/classes/RangeConfig.class.php | 4 +-- lib/classes/Request.class.php | 2 +- lib/classes/SemBrowse.class.php | 2 +- lib/classes/SkipLinks.php | 16 +++++++++ lib/classes/Smiley.php | 2 +- lib/classes/StudipPDO.class.php | 2 +- lib/classes/StudipPDOStatement.php | 2 ++ lib/classes/URLHelper.php | 10 ++++-- lib/classes/Widget.php | 2 +- lib/classes/WidgetContainer.php | 16 ++++----- lib/classes/calendar/CalendarScheduleModel.php | 2 +- lib/classes/helpbar/Helpbar.php | 4 +-- lib/classes/sidebar/LinkElement.php | 2 +- lib/classes/sidebar/SidebarWidget.php | 2 +- lib/functions.php | 7 ++-- lib/include/html_end.inc.php | 2 +- lib/migrations/Migrator.php | 12 +++---- lib/models/HelpTour.class.php | 5 ++- lib/models/SimpleORMap.class.php | 40 ++++++++++++---------- lib/models/StudipNews.class.php | 3 +- lib/navigation/BrowseNavigation.php | 1 + lib/navigation/ContentsNavigation.php | 2 +- lib/navigation/Navigation.php | 4 +-- lib/navigation/StartNavigation.php | 4 ++- lib/object.inc.php | 2 +- lib/phplib/Seminar_Auth.class.php | 17 +++++---- lib/phplib/Seminar_Perm.class.php | 38 ++++++++++++-------- lib/phplib/Seminar_Session.class.php | 2 +- lib/phplib/Seminar_User.class.php | 3 +- lib/phplib/page_open.php | 8 ++--- lib/plugins/engine/PluginManager.class.php | 4 +-- lib/seminar_open.php | 6 ++-- .../core/EvaluationsWidget/EvaluationsWidget.php | 2 +- templates/debug/db-log.php | 2 +- templates/footer.php | 4 +-- templates/header-navigation-item.php | 4 ++- templates/header.php | 2 +- templates/index_nobody.php | 8 ++--- templates/layouts/base.php | 12 +++---- templates/sidebar/list-widget.php | 12 ++++--- templates/sidebar/widget-layout.php | 7 ++-- 53 files changed, 194 insertions(+), 135 deletions(-) diff --git a/app/controllers/news.php b/app/controllers/news.php index 6ce922e..4244b88 100644 --- a/app/controllers/news.php +++ b/app/controllers/news.php @@ -114,7 +114,7 @@ class NewsController extends StudipController $news->deleteRange($range); $news->store(); } else { - $this->question = (string) QuestionBox::create( + PageLayout::postQuestion( _('Ankündigung wirklich aus diesem Bereich entfernen?'), URLHelper::getURL('', ['remove_news' => $news_id, 'news_range' => $range, 'confirm' => true]) ); @@ -129,7 +129,7 @@ class NewsController extends StudipController if (Request::get('confirm')) { $news->delete(); } else { - $this->question = (string) QuestionBox::create( + PageLayout::postQuestion( _('Ankündigung wirklich löschen?'), URLHelper::getURL('', ['delete_news' => $news_id, 'confirm' => true]) ); diff --git a/app/controllers/plugin_controller.php b/app/controllers/plugin_controller.php index 7710bff..445f22e 100644 --- a/app/controllers/plugin_controller.php +++ b/app/controllers/plugin_controller.php @@ -14,8 +14,12 @@ class PluginController extends StudipController { parent::__construct($dispatcher); + if (!isset($dispatcher->current_plugin)) { + throw new Exception('Plugin missing for plugin controller!'); + } $this->plugin = $dispatcher->current_plugin; + if ($this->plugin && $this->plugin->hasTranslation()) { // Localization $this->_ = function ($string) { diff --git a/app/controllers/studip_controller.php b/app/controllers/studip_controller.php index fd52034..deeacdb 100644 --- a/app/controllers/studip_controller.php +++ b/app/controllers/studip_controller.php @@ -293,7 +293,9 @@ abstract class StudipController extends Trails_Controller $to = implode('/', $args); //preserve fragment - [$to, $fragment] = explode('#', $to); + $to_parts = explode('#', $to); + $to = $to_parts[0]; + $fragment = $to_parts[1] ?? ''; $url = parent::url_for($to); diff --git a/app/views/calendar/contentbox/display.php b/app/views/calendar/contentbox/display.php index 3992753..6791670 100644 --- a/app/views/calendar/contentbox/display.php +++ b/app/views/calendar/contentbox/display.php @@ -8,7 +8,7 @@