Minor - adding validations.

1.10.x
Julio Montoya 11 years ago
parent f847f542c5
commit 9059da3b8e
  1. 36
      main/template/default/layout/breadcrumb.tpl
  2. 5
      src/ChamiloLMS/Controller/UserPortalController.php

@ -10,22 +10,24 @@
});
});
</script>
<ul class="breadcrumb">
{{ breadcrumb }}
{% if ("student_view_enabled" | get_setting) == 'true' %}
{% if is_granted('ROLE_TEACHER') %}
<div id="view_as_link" class="pull-right">
{% if app.session.get('studentview') == 'studentview' %}
<a class="btn btn-success btn-xs toggle_student_view" target="_self">
{{ 'StudentView' | trans }}
</a>
{% else %}
<a class="btn btn-default btn-xs toggle_student_view"target="_self">
{{ 'CourseManagerview' | trans }}
</a>
{% endif %}
</div>
{% if breadcrumb %}
<ul class="breadcrumb">
{{ breadcrumb }}
{% if ("student_view_enabled" | get_setting) == 'true' %}
{% if is_granted('ROLE_TEACHER') and app.session.get('_cid') %}
<div id="view_as_link" class="pull-right">
{% if app.session.get('studentview') == 'studentview' %}
<a class="btn btn-success btn-xs toggle_student_view" target="_self">
{{ 'StudentView' | trans }}
</a>
{% else %}
<a class="btn btn-default btn-xs toggle_student_view"target="_self">
{{ 'CourseManagerview' | trans }}
</a>
{% endif %}
</div>
{% endif %}
{% endif %}
{% endif %}
</ul>
</ul>
{% endif %}

@ -3,7 +3,6 @@
namespace ChamiloLMS\Controller;
use Composer\Repository\Pear\BaseChannelReader;
use Silex\Application;
use \ChamiloSession as Session;
use Symfony\Component\HttpFoundation\Response;
@ -99,8 +98,8 @@ class UserPortalController extends CommonController
*/
public function toggleStudentViewAction(Application $app)
{
if (!api_is_allowed_to_edit()) {
return null;
if (!api_is_allowed_to_edit(false, false, false, false)) {
return '';
}
/** @var Request $request */

Loading…
Cancel
Save