Fixing curriculum routes.

skala
Julio Montoya 11 years ago
parent 716e26561a
commit 15be76a44b
  1. 7
      main/inc/routes.php
  2. 32
      main/inc/services.php
  3. 2
      src/ChamiloLMS/Controller/Tool/Curriculum/CurriculumController.php

@ -657,10 +657,13 @@ $app->match('/ajax', 'model_ajax.controller:indexAction', 'GET')
->bind('model_ajax');
if ($alreadyInstalled) {
// Takes a some time to load @todo improve this calls
$app->mount('/admin/administrator/roles', new ChamiloLMS\Provider\ReflectionControllerProvider('role.controller'));
$app->mount('/admin/administrator/question_scores', new ChamiloLMS\Provider\ReflectionControllerProvider('question_score.controller'));
$app->mount('/admin/administrator/question_score_names', new ChamiloLMS\Provider\ReflectionControllerProvider('question_score_name.controller'));
$app->mount('/courses/{course}/curriculum/category', new ChamiloLMS\Provider\ReflectionControllerProvider('curriculum_category.controller'));
$app->mount('/courses/{course}/curriculum/item', new ChamiloLMS\Provider\ReflectionControllerProvider('curriculum_item.controller'));
$app->mount('/courses/{course}/curriculum/user', new ChamiloLMS\Provider\ReflectionControllerProvider('curriculum_user.controller'));
$app->mount('/courses/{course}/curriculum', new ChamiloLMS\Provider\ReflectionControllerProvider('curriculum.controller'));
}

@ -138,7 +138,11 @@ $app['security.access_rules'] = array(
array('^/admin/questionmanager', 'ROLE_QUESTION_MANAGER'),
array('^/main/auth/inscription.php', 'IS_AUTHENTICATED_ANONYMOUSLY'),
array('^/main/auth/lostPassword.php', 'IS_AUTHENTICATED_ANONYMOUSLY'),
array('^/main/.*', array('ROLE_STUDENT'))
array('^/main/.*', array('ROLE_STUDENT')),
array('^/courses/.*/curriculum/category', 'ROLE_TEACHER'),
array('^/courses/.*/curriculum/item', 'ROLE_TEACHER'),
array('^/courses/.*/curriculum/user', 'ROLE_STUDENT'),
array('^/courses/.*/curriculum', 'ROLE_STUDENT'),
//array('^.*$', 'ROLE_USER'),
);
@ -640,3 +644,29 @@ $app['model_ajax.controller'] = $app->share(
return new ChamiloLMS\Controller\ModelAjaxController();
}
);
// Curriculum tool
$app['curriculum.controller'] = $app->share(
function () use ($app) {
return new ChamiloLMS\Controller\Tool\Curriculum\CurriculumController($app);
}
);
$app['curriculum_category.controller'] = $app->share(
function () use ($app) {
return new ChamiloLMS\Controller\Tool\Curriculum\CurriculumCategoryController($app);
}
);
$app['curriculum_item.controller'] = $app->share(
function () use ($app) {
return new ChamiloLMS\Controller\Tool\Curriculum\CurriculumItemController($app);
}
);
$app['curriculum_user.controller'] = $app->share(
function () use ($app) {
return new ChamiloLMS\Controller\Tool\Curriculum\CurriculumUserController($app);
}
);

@ -31,7 +31,7 @@ class CurriculumController extends CommonController
return $this->redirect(
$this->generateUrl(
'curriculum_user.controller:indexAction',
array('course' => $course)
array('course' => $this->getCourse())
)
.'?'.$this->getRequest()->getQueryString()
);

Loading…
Cancel
Save