Fix twig URL, use course_url_params to get cid/sid/gid params in twig

pull/3064/head
Julio 5 years ago
parent 8bf44dbbbc
commit 76b5db7cad
  1. 2
      public/main/template/default/course_progress/progress.html.twig
  2. 6
      src/CourseBundle/EventListener/CourseListener.php
  3. 4
      src/ThemeBundle/Resources/views/Editor/config_js.html.twig

@ -130,7 +130,7 @@
<h2>{{ "Educational programming"|trans }}</h2>
<img src="{{ "course_progress.png"|icon(64) }}" width="64" height="64">
<div class="controls">
<a href="{{ _p.web_self }}?{{ _p.web_cid_query ~ "&action=thematic_add" ~ token }}" class="btn btn-outline-primary">
<a href="{{ url('legacy_main', {name : 'course_progress/index.php'}) }}?{{ course_url_params ~ "&action=thematic_add" ~ token }}" class="btn btn-outline-primary">
{{ "Add thematic"|trans }}
</a>
</div>

@ -160,7 +160,9 @@ class CourseListener
$sessionHandler->set('origin', $origin);
}
$sessionHandler->set('cid_req_url', $this->generateCourseUrl($course, $sessionId, $groupId, $origin));
$courseParams = $this->generateCourseUrl($course, $sessionId, $groupId, $origin);
$sessionHandler->set('course_url_params', $courseParams);
$container->get('twig')->addGlobal('course_url_params', $courseParams);
/*if (!$alreadyVisited ||
isset($alreadyVisited) && $alreadyVisited != $courseCode
@ -293,7 +295,7 @@ class CourseListener
$sessionHandler->remove('_locale_course');
$sessionHandler->remove('courseObj');
$sessionHandler->remove('sessionObj');
$sessionHandler->remove('cid_req_url');
$sessionHandler->remove('course_url_params');
$sessionHandler->remove('origin');
// Remove user temp roles

@ -104,8 +104,8 @@ CKEDITOR.editorConfig = function (config) {
{% endif %}
// File manager (elFinder)
config.filebrowserBrowseUrl = '{{ url('editor_filemanager') }}?{{ app.session.get('cid_req_url') }}';
config.videobrowserBrowseUrl = '{{ url('editor_filemanager') }}?{{ app.session.get('cid_req_url') }}';
config.filebrowserBrowseUrl = '{{ url('editor_filemanager') }}?{{ app.session.get('course_url_params') }}';
config.videobrowserBrowseUrl = '{{ url('editor_filemanager') }}?{{ app.session.get('course_url_params') }}';
// Allows to use "class" attribute inside divs and spans.
config.allowedContent = true;

Loading…
Cancel
Save