Skip to content
Snippets Groups Projects
Commit 040d121f authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fix link parameters for modules, fixes #4707

Closes #4707

Merge request studip/studip!3501
parent 339b5ec4
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,7 @@ class CoreOverview extends CorePlugin implements StudipModule
$nav = new Navigation(_('Ankündigungen'), '');
if ($result['neue']) {
$nav->setURL('?new_news=true');
$nav->setImage(Icon::create('news', Icon::ROLE_ATTENTION), [
$nav->setImage(Icon::create('news', Icon::ROLE_ATTENTION, [
'title' => sprintf(
ngettext(
'%1$d Ankündigung, %2$d neue',
......@@ -53,10 +53,10 @@ class CoreOverview extends CorePlugin implements StudipModule
$result['count'],
$result['neue']
)
]);
]));
$nav->setBadgeNumber($result['neue']);
} elseif ($result['count']) {
$nav->setImage(Icon::create('news', Icon::ROLE_CLICKABLE), [
$nav->setImage(Icon::create('news', Icon::ROLE_CLICKABLE, [
'title' => sprintf(
ngettext(
'%d Ankündigung',
......@@ -65,7 +65,7 @@ class CoreOverview extends CorePlugin implements StudipModule
),
$result['count']
)
]);
]));
}
return $nav;
}
......
......@@ -93,7 +93,7 @@ class CoreParticipants extends CorePlugin implements StudipModule
$result = $statement->fetch(PDO::FETCH_ASSOC);
if ($result['neue']) {
$navigation->setImage(Icon::create('persons', Icon::ROLE_ATTENTION), [
$navigation->setImage(Icon::create('persons', Icon::ROLE_ATTENTION, [
'title' => sprintf(
ngettext(
'%1$d Teilnehmende/r, %2$d neue/r',
......@@ -103,7 +103,7 @@ class CoreParticipants extends CorePlugin implements StudipModule
$result['count'],
$result['neue']
)
]);
]));
$navigation->setBadgeNumber($result['neue']);
} elseif ($result['count']) {
$navigation->setLinkAttributes([
......
......@@ -38,7 +38,7 @@ class CoreSchedule extends CorePlugin implements StudipModule
$nav = new Navigation(_('Ablaufplan'), 'dispatch.php/course/dates');
if ($result['neue']) {
$nav->setImage(Icon::create('schedule', Icon::ROLE_ATTENTION), [
$nav->setImage(Icon::create('schedule', Icon::ROLE_ATTENTION, [
'title' => sprintf(
ngettext(
'%1$d Termin, %2$d neuer',
......@@ -48,10 +48,10 @@ class CoreSchedule extends CorePlugin implements StudipModule
$result['count'],
$result['neue']
)
]);
]));
$nav->setBadgeNumber($result['neue']);
} else {
$nav->setImage(Icon::create('schedule', Icon::ROLE_CLICKABLE), [
$nav->setImage(Icon::create('schedule', Icon::ROLE_CLICKABLE, [
'title' => sprintf(
ngettext(
'%d Termin',
......@@ -60,7 +60,7 @@ class CoreSchedule extends CorePlugin implements StudipModule
),
$result['count']
)
]);
]));
}
return $nav;
}
......
......@@ -18,7 +18,7 @@ class CoreStudygroupAdmin extends CorePlugin implements StudipModule
public function getIconNavigation($course_id, $last_visit, $user_id)
{
$navigation = new Navigation(_('Verwaltung'), "dispatch.php/course/studygroup/edit/?cid={$course_id}");
$navigation->setImage(Icon::create('admin', Icon::ROLE_CLICKABLE), ['title' => _('Verwaltung')]);
$navigation->setImage(Icon::create('admin', Icon::ROLE_CLICKABLE, ['title' => _('Verwaltung')]));
return $navigation;
}
......
......@@ -109,9 +109,9 @@ class CoursewareModule extends CorePlugin implements SystemPlugin, StudipModule
$new = $statement->fetchColumn();
$nav = new Navigation(_('Courseware'), 'dispatch.php/course/courseware');
$nav->setImage(Icon::create('courseware', Icon::ROLE_CLICKABLE), [
$nav->setImage(Icon::create('courseware', Icon::ROLE_CLICKABLE, [
'title' => _('Courseware'),
]);
]));
if ($new > 0) {
if ($new === 1) {
......@@ -120,9 +120,9 @@ class CoursewareModule extends CorePlugin implements SystemPlugin, StudipModule
} else {
$text = _('neue Seiten');
}
$nav->setImage(Icon::create('courseware', Icon::ROLE_ATTENTION), [
$nav->setImage(Icon::create('courseware', Icon::ROLE_ATTENTION, [
'title' => $new . ' ' . $text,
]);
]));
$nav->setBadgeNumber("$new");
}
......
......@@ -69,7 +69,7 @@ class GradebookModule extends CorePlugin implements SystemPlugin, StudipModule
: Icon::create('assessment', Icon::ROLE_CLICKABLE);
$navigation = new Navigation($title, 'dispatch.php/course/gradebook/overview');
$navigation->setImage($icon, ['title' => $title]);
$navigation->setImage($icon->copyWithAttributes(['title' => $title]));
return $navigation;
}
......
......@@ -70,7 +70,7 @@ class IliasInterfaceModule extends CorePlugin implements StudipModule, SystemPlu
$title = CourseConfig::get($course_id)->getValue('ILIAS_INTERFACE_MODULETITLE');
$nav = new Navigation($title, 'dispatch.php/course/ilias_interface/index');
if ($result['neue']) {
$nav->setImage(Icon::create('learnmodule', Icon::ROLE_ATTENTION), [
$nav->setImage(Icon::create('learnmodule', Icon::ROLE_ATTENTION, [
'title' => sprintf(
ngettext(
'%1$d Lernobjekt, %2$d neues',
......@@ -80,9 +80,9 @@ class IliasInterfaceModule extends CorePlugin implements StudipModule, SystemPlu
$result['count_modules'],
$result['neue']
)
]);
]));
} elseif ($result['count_modules']) {
$nav->setImage(Icon::create('learnmodule', Icon::ROLE_CLICKABLE), [
$nav->setImage(Icon::create('learnmodule', Icon::ROLE_CLICKABLE, [
'title' => sprintf(
ngettext(
'%d Lernobjekt',
......@@ -91,9 +91,9 @@ class IliasInterfaceModule extends CorePlugin implements StudipModule, SystemPlu
),
$result['count_modules']
)
]);
]));
} elseif ($result['count_courses']) {
$nav->setImage(Icon::create('learnmodule', Icon::ROLE_CLICKABLE), [
$nav->setImage(Icon::create('learnmodule', Icon::ROLE_CLICKABLE, [
'title' => sprintf(
ngettext(
'%d ILIAS-Kurs',
......@@ -102,7 +102,7 @@ class IliasInterfaceModule extends CorePlugin implements StudipModule, SystemPlu
),
$result['count_courses']
)
]);
]));
}
return $nav;
}
......
......@@ -49,7 +49,7 @@ class LtiToolModule extends CorePlugin implements StudipModule, SystemPlugin, Pr
: Icon::create('link-extern', Icon::ROLE_CLICKABLE);
$navigation = new Navigation($title, 'dispatch.php/course/lti');
$navigation->setImage($icon, ['title' => $title]);
$navigation->setImage($icon->copyWithAttributes(['title' => $title]));
return $navigation;
}
......
......@@ -32,7 +32,8 @@ class NewsWidget extends CorePlugin implements PortalPlugin
$icons = [];
if (StudipNews::CountUnread() > 0) {
$navigation = new Navigation('', 'dispatch.php/news/visit_all');
$navigation->setImage(Icon::create('refresh', Icon::ROLE_CLICKABLE, ['title' => _('Alle als gelesen markieren'), 'size' => 20]), ['class' => 'visit-all']);
$navigation->setImage(Icon::create('refresh', Icon::ROLE_CLICKABLE, ['title' => _('Alle als gelesen markieren'), 'size' => 20]));
$navigation->setLinkAttributes(['class' => 'visit-all']);
$icons[] = $navigation;
}
......@@ -46,7 +47,9 @@ class NewsWidget extends CorePlugin implements PortalPlugin
if ($GLOBALS['perm']->have_perm('root')) {
$navigation = new Navigation('', 'dispatch.php/news/edit_news/new/studip');
$navigation->setImage(Icon::create('add', Icon::ROLE_CLICKABLE, ['title' => _('Ankündigungen bearbeiten'), 'size' => 20]), ['data-dialog' => '1']);
$navigation->setImage(Icon::create('add', Icon::ROLE_CLICKABLE, ['title' => _('Ankündigungen bearbeiten'), 'size' => 20]));
$navigation->setLinkAttributes(['data-dialog' => '']);
$icons[] = $navigation;
if (Config::get()->NEWS_RSS_EXPORT_ENABLE) {
$navigation = new Navigation('', 'dispatch.php/news/rss_config/studip');
......@@ -56,8 +59,8 @@ class NewsWidget extends CorePlugin implements PortalPlugin
Icon::ROLE_CLICKABLE,
['title' => _('RSS-Feed konfigurieren')]
),
['data-dialog' => 'size=auto']
);
$navigation->setLinkAttributes(['data-dialog' => 'size=auto']);
$icons[] = $navigation;
}
}
......
......@@ -31,7 +31,8 @@ class QuickSelection extends CorePlugin implements PortalPlugin
$template->navigation = $this->getFilteredNavigation($names);
$navigation = new Navigation('', 'dispatch.php/quickselection/configuration');
$navigation->setImage(Icon::create('edit', 'clickable', ["title" => _('Konfigurieren'), 'size' => 20]), ['data-dialog'=>'size=auto']);
$navigation->setImage(Icon::create('edit', Icon::ROLE_CLICKABLE, ["title" => _('Konfigurieren'), 'size' => 20]));
$navigation->setLinkAttributes(['data-dialog' => 'size=auto']);
$template->icons = [$navigation];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment