Skip to content

Commit ec03f37

Browse files
committed
Replacing legacy routes in templates #2615
1 parent d41e1e1 commit ec03f37

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+232
-173
lines changed

public/main/template/default/admin/career_dashboard.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<td class="cycles">
5050
<h4 id="session-id-{{ sessionid }}">
5151
<a title="{{ session.data.title }}"
52-
href="{{ _p.web }}main/session/resume_session.php?id_session={{ sessionid }}">
52+
href="{{ url('index') }}main/session/resume_session.php?id_session={{ sessionid }}">
5353
{{ session.data.title }}
5454
</a>
5555
</h4>
@@ -58,7 +58,7 @@
5858
<ul>
5959
{% for course in session.courses %}
6060
<li>
61-
<a href="{{ _p.web }}courses/{{ course.directory }}/index.php?sid={{ sessionid }}"
61+
<a href="{{ url('index') }}courses/{{ course.directory }}/index.php?sid={{ sessionid }}"
6262
title="{{ course.title }}">
6363
{{ course.title }}
6464
</a>

public/main/template/default/admin/resource_sequence.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block content %}
44
{% autoescape false %}
55
<script>
6-
var url = '{{ _p.web_ajax }}sequence.ajax.php';
6+
var url = '{{ url('web_ajax') }}sequence.ajax.php';
77
var parentList = [];
88
var resourceId = 0;
99
var sequenceId = 0;

public/main/template/default/agenda/planification.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends "@ChamiloCore/Layout/layout_one_col.html.twig" %}
22

3-
{% set user_id = student_id == _u.id ? 0 : student_id %}
3+
{% set user_id = student_id == app.user.id ? 0 : student_id %}
44

55
{% block content %}
66
{% autoescape false %}
@@ -38,7 +38,7 @@
3838
{% for session in sessions %}
3939
<tr>
4040
<td class="col-session" title="{{ session.title }}">
41-
<a href="{{ _p.web ~ 'session/' ~ session.id ~ '/about/' }}">
41+
<a href="{{ url('index') ~ 'session/' ~ session.id ~ '/about/' }}">
4242
{{ session.title }}
4343
</a>
4444
</td>

public/main/template/default/auth/session_catalog.html.twig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@
5252
{{ item.category }}
5353
</div>
5454
{% endif %}
55-
<a href="{{ _p.web ~ 'session/' ~ item.id ~ '/about/' }}" title="{{ item.title }}">
55+
<a href="{{ url('index') ~ 'session/' ~ item.id ~ '/about/' }}" title="{{ item.title }}">
5656
<img class="img-fluid" src="{{ item.image ? _p.web_upload ~ item.image : 'session_default.png'|icon() }}">
5757
</a>
5858
{% endset %}
5959
{% set content %}
6060
<div class="card-title">
6161
<h5 class="title">
62-
<a href="{{ _p.web ~ 'session/' ~ item.id ~ '/about/' }}" title="{{ item.title }}">
62+
<a href="{{ url('index') ~ 'session/' ~ item.id ~ '/about/' }}" title="{{ item.title }}">
6363
{{ item.title }}
6464
</a>
6565
</h5>
@@ -100,7 +100,7 @@
100100
{{ item.price }}
101101
</div>
102102
{% endif %}
103-
{% if _u.logged %}
103+
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
104104
<div class="col-sm-8">
105105
<div class="btn-group btn-group-sm" role="group">
106106
{% if not item.sequences is empty %}
@@ -116,7 +116,7 @@
116116
</div>
117117
</div>
118118
{% endif %}
119-
{% if _u.logged %}
119+
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
120120
<script>
121121
$('#session-{{ item.id }}-sequences').popover({
122122
placement: 'bottom',
@@ -133,7 +133,7 @@
133133
134134
{% for requirement in sequence.requirements %}
135135
content += '<li>';
136-
content += '<a href="{{ _p.web ~ 'session/' ~ requirement.id ~ '/about/' }}">{{ requirement.title }}</a>';
136+
content += '<a href="{{ url('index') ~ 'session/' ~ requirement.id ~ '/about/' }}">{{ requirement.title }}</a>';
137137
content += '</li>';
138138
{% endfor %}
139139
@@ -146,7 +146,7 @@
146146
147147
{% for dependency in sequence.dependencies %}
148148
content += '<li>';
149-
content += '<a href="{{ _p.web ~ 'session/' ~ dependency.id ~ '/about/' }}">{{ dependency.title }}</a>';
149+
content += '<a href="{{ url('index') ~ 'session/' ~ dependency.id ~ '/about/' }}">{{ dependency.title }}</a>';
150150
content += '</li>';
151151
{% endfor %}
152152

public/main/template/default/blog/post.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
</li>
8383
<li class="autor">
8484
<i class="fa fa-user" aria-hidden="true"></i>
85-
<a href="{{ _p.web }}main/social/profile.php?u={{ post.id_author }}">{{ post.author }}</a>
85+
<a href="{{ url('index') }}main/social/profile.php?u={{ post.id_author }}">{{ post.author }}</a>
8686
</li>
8787
<li class="score">
8888
<i class="fa fa-star" aria-hidden="true"></i> {{ post.score_ranking }}

public/main/template/default/exercise/partials/result_exercise.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
{% endif %}
8686
</div>
8787
{% if 'exercise.quiz_confirm_saved_answers'|api_get_setting == 'true' %}
88-
{% set enable_form = data.track_confirmation.updatedAt is empty and data.track_confirmation.userId == _u.id %}
88+
{% set enable_form = data.track_confirmation.updatedAt is empty and data.track_confirmation.userId == app.user.id %}
8989
<form id="quiz_confirm_saved_answers_form" class="space-y-4 mt-4">
9090
<label class="flex items-start space-x-2">
9191
<input type="checkbox"
@@ -119,7 +119,7 @@
119119
</div>
120120

121121
{% if 'exercise.quiz_confirm_saved_answers'|api_get_setting == 'true' %}
122-
{% set enable_form = data.track_confirmation.updatedAt is empty and data.track_confirmation.userId == _u.id %}
122+
{% set enable_form = data.track_confirmation.updatedAt is empty and data.track_confirmation.userId == app.user.id %}
123123
{% if enable_form %}
124124
<script>
125125
$(function () {
@@ -144,7 +144,7 @@
144144
checkbox.prop('disabled', true);
145145
146146
$.post(
147-
'{{ _p.web_ajax }}exercise.ajax.php?a=quiz_confirm_saved_answers',
147+
'{{ url('web_ajax') }}exercise.ajax.php?a=quiz_confirm_saved_answers',
148148
xhrData
149149
).done(function () {
150150
button.parents('.form-group').remove();

public/main/template/default/glossary/glossary_auto.js.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ $(function() {
44
$(window).on("load", function (e) {
55
{% endif %}
66
var my_text = $(".glossary-content").html();
7-
var ajaxRequestUrl = "{{ _p.web }}main/glossary/glossary_ajax_request.php?{{ _p.web_cid_query }}";
8-
var imageSource = "{{ _p.web }}main/inc/lib/javascript/indicator.gif";
7+
var ajaxRequestUrl = "{{ url('index') }}main/glossary/glossary_ajax_request.php?{{ _p.web_cid_query }}";
8+
var imageSource = "{{ url('index') }}main/inc/lib/javascript/indicator.gif";
99
var indicatorImage ='<img src="' + imageSource + '" />';
1010

1111
$.ajax({

public/main/template/default/glossary/glossary_manual.js.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var ajaxRequestUrl = "{{ _p.web }}main/glossary/glossary_ajax_request.php?{{ _p.web_cid_query }}";
1+
var ajaxRequestUrl = "{{ url('index') }}main/glossary/glossary_ajax_request.php?{{ _p.web_cid_query }}";
22
var imageSource = "{{ _p.web_main }}" + "inc/lib/javascript/indicator.gif";
33
var indicatorImage ='<img src="' + imageSource + '" />';
44

public/main/template/default/gradebook/certificate_report.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ $(function () {
7878
<td>
7979
{% for certificate in student.certificates %}
8080
{% set hash = certificate.path_certificate|split('.')|first %}
81-
<a href="{{ _p.web }}certificates/{{ hash }}.html" class="btn btn--plain">
81+
<a href="{{ url('index') }}certificates/{{ hash }}.html" class="btn btn--plain">
8282
<em class="fa fa-floppy-o"></em> {{ 'Certificate' | get_lang }}
8383
</a>
8484
{% endfor %}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p>{{ 'Dear'|get_lang }} {{ complete_name }},</p>
22
<p>{{ 'You are registered to session: %s.'|get_lang|format(session_name) }}</p>
3-
<p>{{ 'The address of'|get_lang }} {{ _s.site_name }} {{ 'is'|get_lang }} : {{ _p.web }}</p>
3+
<p>{{ 'The address of'|get_lang }} {{ _s.site_name }} {{ 'is'|get_lang }} : {{ url('index') }}</p>
44
<p>{{ 'In case of trouble, contact us.'|get_lang }}</p>
55
<p>{{ 'Sincerely'|get_lang }}</p>

0 commit comments

Comments
 (0)