add submenu - refs #2681

pull/2818/head
Alex Aragón 6 years ago
parent 5a1055757c
commit 5964d493cc
  1. 4
      assets/js/app.js
  2. 68
      src/CoreBundle/Menu/NavBuilder.php

@ -26,10 +26,12 @@ var connect_lang = 'ChatConnected';
var disconnect_lang = 'ChatDisconnected';
$( document ).ready(function() {
//$("#menu_courses").prop("onClick", "javascript:return(false);");
$("#menu_courses").click(function(){
return false;
});
$("#menu_social").click(function(){
return false;
});
});
$(function() {
var isInCourse = $("body").data("in-course");

@ -121,6 +121,17 @@ class NavBuilder implements ContainerAwareInterface
}
}
$menu['courses']->addChild(
$translator->trans('Course history'),
[
'route' => 'userportal',
'routeParameters' => [
'type' => 'sessions',
'filter' => 'history',
],
]
);
if (api_is_allowed_to_create_course()) {
$lang = $translator->trans('Create course');
if ($settingsManager->getSetting('course.course_validation') == 'true') {
@ -139,16 +150,6 @@ class NavBuilder implements ContainerAwareInterface
);
}
$menu['courses']->addChild(
$translator->trans('Course history'),
[
'route' => 'userportal',
'routeParameters' => [
'type' => 'sessions',
'filter' => 'history',
],
]
);
if ($checker->isGranted('ROLE_ADMIN')) {
$menu['courses']->addChild(
@ -197,8 +198,51 @@ class NavBuilder implements ContainerAwareInterface
]
);
$menu['social']->addChild(
$translator->trans('My profile'),
[
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/home.php',
],
]
);
$menu['social']->addChild(
$translator->trans('My shared profile'),
[
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/profile.php',
],
]
);
$menu['social']->addChild(
$translator->trans('Friends'),
[
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/friends.php',
],
]
);
$menu['social']->addChild(
$translator->trans('Social Groups'),
[
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/groups.php',
],
]
);
$menu['social']->addChild(
$translator->trans('My Files'),
[
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/myfiles.php',
],
]
);
}
if ($checker->isGranted('ROLE_ADMIN')) {

Loading…
Cancel
Save