From d2c5344db1f4f52f82a77e31ea153675ef7eebd9 Mon Sep 17 00:00:00 2001 From: David Siegfried Date: Wed, 12 Aug 2015 16:32:42 +0200 Subject: [PATCH] remove obtrusive dialog --- FavoritecourcesPlugin.class.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/FavoritecourcesPlugin.class.php b/FavoritecourcesPlugin.class.php index e10ad7c..d8234ef 100644 --- a/FavoritecourcesPlugin.class.php +++ b/FavoritecourcesPlugin.class.php @@ -21,12 +21,10 @@ public function __construct() } $this->start_page = UserConfig::get($GLOBALS['user']->id)->FAVORITE_COURSES_START_PAGE; - if ($this->start_page == '') { - $question = createQuestion(_('Wollen Sie die Favoritenliste als Startseite einstellen?'), - array('really' => true), - array('cancel' => true), - PluginEngine::getLink($this, array(), 'show/set_startpage')); - PageLayout::addBodyElements($question); + if ($this->start_page == '' && match_route('dispatch.php/my_courses')) { + $msg = array(sprintf('%s', PluginEngine::getLink($this, array('really' => true), 'show/set_startpage'), _('Ja'))); + $msg[] = sprintf('%s', PluginEngine::getLink($this, array('cancel' => true), 'show/set_startpage'), _('Nein')); + PageLayout::postMessage(MessageBox::info(_('Wollen Sie die Favoritenliste (Reiter "Meiner Favoriten") als Startseite einstellen?'), $msg)); } if (Navigation::hasItem('/browse')) {