services.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * This file includes all the services that are loaded via the ServiceProviderInterface
  5. *
  6. * @package chamilo.services
  7. */
  8. // Monolog.
  9. use Doctrine\Common\Persistence\AbstractManagerRegistry;
  10. use FranMoreno\Silex\Provider\PagerfantaServiceProvider;
  11. use Silex\Application;
  12. use Silex\ServiceProviderInterface;
  13. use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
  14. // Monolog.
  15. if (is_writable($app['sys_temp_path'])) {
  16. /**
  17. * Adding Monolog service provider.
  18. * Examples:
  19. * $app['monolog']->addDebug('Testing the Monolog logging.');
  20. * $app['monolog']->addInfo('Testing the Monolog logging.');
  21. * $app['monolog']->addError('Testing the Monolog logging.');
  22. */
  23. if ($app['debug']) {
  24. $app->register(
  25. new Silex\Provider\MonologServiceProvider(),
  26. array(
  27. 'monolog.logfile' => $app['chamilo.log'],
  28. 'monolog.name' => 'chamilo',
  29. )
  30. );
  31. }
  32. }
  33. //Setting HttpCacheService provider in order to use do: $app['http_cache']->run();
  34. /*
  35. $app->register(new Silex\Provider\HttpCacheServiceProvider(), array(
  36. 'http_cache.cache_dir' => $app['http_cache.cache_dir'].'/',
  37. ));*/
  38. // http://symfony.com/doc/master/reference/configuration/security.html
  39. $app->register(new Silex\Provider\SecurityServiceProvider(), array(
  40. 'security.firewalls' => array(
  41. 'login' => array(
  42. 'pattern' => '^/login$',
  43. 'anonymous' => true
  44. ),
  45. 'admin' => array(
  46. //'http' => true,
  47. 'pattern' => '^/.*$',
  48. 'form' => array(
  49. 'login_path' => '/login',
  50. 'check_path' => '/admin/login_check',
  51. 'default_target_path' => '/userportal',
  52. 'username_parameter' => 'username',
  53. 'password_parameter' => 'password',
  54. ),
  55. 'logout' => array(
  56. 'logout_path' => '/admin/logout',
  57. 'target' => '/'
  58. ),
  59. 'users' => $app->share(function() use ($app) {
  60. return $app['orm.em']->getRepository('Entity\User');
  61. }),
  62. 'anonymous' => true
  63. ),/*
  64. 'classic' => array(
  65. 'pattern' => '^/.*$'
  66. )*/
  67. )
  68. ));
  69. // Registering Password encoder.
  70. $app['security.encoder.digest'] = $app->share(function($app) {
  71. // use the sha1 algorithm
  72. // don't base64 encode the password
  73. // use only 1 iteration
  74. return new MessageDigestPasswordEncoder($app['configuration']['password_encryption'], false, 1);
  75. });
  76. // What to do when login success?
  77. $app['security.authentication.success_handler.admin'] = $app->share(function($app) {
  78. return new ChamiloLMS\Component\Auth\LoginSuccessHandler($app['url_generator'], $app['security']);
  79. });
  80. // What to do when logout?
  81. $app['security.authentication.logout_handler.admin'] = $app->share(function($app) {
  82. return new ChamiloLMS\Component\Auth\LogoutSuccessHandler($app['url_generator'], $app['security']);
  83. });
  84. // Role hierarchy
  85. $app['security.role_hierarchy'] = array(
  86. 'ROLE_ADMIN' => array('ROLE_QUESTION_MANAGER', 'ROLE_TEACHER', 'ROLE_ALLOWED_TO_SWITCH'),
  87. 'ROLE_TEACHER' => array('ROLE_STUDENT'),
  88. 'ROLE_RRHH' => array('ROLE_TEACHER'),
  89. 'ROLE_QUESTION_MANAGER' => array('ROLE_QUESTION_MANAGER'),
  90. 'ROLE_SESSION_MANAGER' => array('ROLE_SESSION_MANAGER'),
  91. 'ROLE_STUDENT' => array('ROLE_STUDENT'),
  92. 'ROLE_ANONYMOUS' => array('ROLE_ANONYMOUS'),
  93. 'ROLE_JURY_PRESIDENT' => array('ROLE_JURY_PRESIDENT', 'ROLE_JURY_MEMBER', 'ROLE_JURY_SUBSTITUTE'),
  94. 'ROLE_JURY_SUBSTITUTE' => array('ROLE_JURY_SUBSTITUTE', 'ROLE_JURY_MEMBER'),
  95. 'ROLE_JURY_MEMBER' => array('ROLE_JURY_MEMBER')
  96. );
  97. // Role rules
  98. $app['security.access_rules'] = array(
  99. //array('^/admin', 'ROLE_ADMIN', 'https'),
  100. array('^/admin/administrator', 'ROLE_ADMIN'),
  101. array('^/main/admin/.*', 'ROLE_ADMIN'),
  102. array('^/admin/questionmanager', 'ROLE_QUESTION_MANAGER'),
  103. array('^/main/.*', array('ROLE_STUDENT')),
  104. array('^/admin/director', 'ROLE_DIRECTOR'),
  105. array('^/tool/.*', array('ROLE_ADMIN','ROLE_TEACHER')),
  106. array('^/admin/jury_president', 'ROLE_JURY_PRESIDENT'),
  107. array('^/admin/jury_member', 'ROLE_JURY_MEMBER') //? jury subsitute??
  108. //array('^.*$', 'ROLE_USER'),
  109. );
  110. /**
  111. $app['security.access_manager'] = $app->share(function($app) {
  112. return new AccessDecisionManager($app['security.voters'], 'unanimous');
  113. });*/
  114. // Setting Controllers as services provider.
  115. $app->register(new Silex\Provider\ServiceControllerServiceProvider());
  116. // Validator provider.
  117. $app->register(new Silex\Provider\ValidatorServiceProvider());
  118. // Implements Symfony2 translator.
  119. $app->register(new Silex\Provider\TranslationServiceProvider(), array(
  120. 'locale' => 'en',
  121. 'locale_fallback' => 'en'
  122. ));
  123. // Form provider
  124. $app->register(new Silex\Provider\FormServiceProvider());
  125. // URL generator provider
  126. $app->register(new Silex\Provider\UrlGeneratorServiceProvider());
  127. // Needed to use the "entity" option in symfony forms
  128. class ManagerRegistry extends AbstractManagerRegistry
  129. {
  130. protected $container;
  131. protected function getService($name)
  132. {
  133. return $this->container[$name];
  134. }
  135. protected function resetService($name)
  136. {
  137. unset($this->container[$name]);
  138. }
  139. public function getAliasNamespace($alias)
  140. {
  141. throw new \BadMethodCallException('Namespace aliases not supported.');
  142. }
  143. public function setContainer(Application $container)
  144. {
  145. $this->container = $container;
  146. }
  147. }
  148. $app['form.extensions'] = $app->share($app->extend('form.extensions', function ($extensions, $app) {
  149. $managerRegistry = new ManagerRegistry(null, array('db'), array('orm.em'), null, null, $app['orm.proxies_namespace']);
  150. $managerRegistry->setContainer($app);
  151. $extensions[] = new \Symfony\Bridge\Doctrine\Form\DoctrineOrmExtension($managerRegistry);
  152. return $extensions;
  153. }));
  154. // Setting Doctrine service provider (DBAL)
  155. if (isset($app['configuration']['main_database'])) {
  156. /* The database connection can be overwritten if you set $_configuration['db.options']
  157. in configuration.php like this : */
  158. $defaultDatabaseOptions = array(
  159. 'db_read' => array(
  160. 'driver' => 'pdo_mysql',
  161. 'host' => $app['configuration']['db_host'],
  162. 'dbname' => $app['configuration']['main_database'],
  163. 'user' => $app['configuration']['db_user'],
  164. 'password' => $app['configuration']['db_password'],
  165. 'charset' => 'utf8',
  166. //'priority' => '1'
  167. ),
  168. 'db_write' => array(
  169. 'driver' => 'pdo_mysql',
  170. 'host' => $app['configuration']['db_host'],
  171. 'dbname' => $app['configuration']['main_database'],
  172. 'user' => $app['configuration']['db_user'],
  173. 'password' => $app['configuration']['db_password'],
  174. 'charset' => 'utf8',
  175. //'priority' => '2'
  176. ),
  177. );
  178. // Could be set in the $_configuration array
  179. if (isset($app['configuration']['db.options'])) {
  180. $defaultDatabaseOptions = $app['configuration']['db.options'];
  181. }
  182. $app->register(
  183. new Silex\Provider\DoctrineServiceProvider(),
  184. array(
  185. 'dbs.options' => $defaultDatabaseOptions
  186. )
  187. );
  188. $mappings = array(
  189. array(
  190. /* If true, only simple notations like @Entity will work.
  191. If false, more advanced notations and aliasing via use will work.
  192. (Example: use Doctrine\ORM\Mapping AS ORM, @ORM\Entity)*/
  193. 'use_simple_annotation_reader' => false,
  194. 'type' => 'annotation',
  195. 'namespace' => 'Entity',
  196. 'path' => api_get_path(INCLUDE_PATH).'Entity',
  197. // 'orm.default_cache' =>
  198. ),
  199. array(
  200. 'use_simple_annotation_reader' => false,
  201. 'type' => 'annotation',
  202. 'namespace' => 'Gedmo',
  203. 'path' => api_get_path(SYS_PATH).'vendors/gedmo/doctrine-extensions/lib/Gedmo',
  204. )
  205. );
  206. // Setting Doctrine ORM.
  207. $app->register(
  208. new Dflydev\Silex\Provider\DoctrineOrm\DoctrineOrmServiceProvider,
  209. array(
  210. // Doctrine2 ORM cache
  211. /*'orm.default_cache' => 'apc', // array, apc, xcache, memcache, memcached
  212. 'metadata_cache' => 'apc',
  213. 'result_cache' => 'apc',*/
  214. // Proxies
  215. 'orm.auto_generate_proxies' => true,
  216. 'orm.proxies_dir' => $app['db.orm.proxies_dir'],
  217. 'orm.proxies_namespace' => 'Doctrine\ORM\Proxy\Proxy',
  218. 'orm.ems.default' => 'db_read',
  219. 'orm.ems.options' => array(
  220. 'db_read' => array(
  221. 'connection' => 'db_read',
  222. 'mappings' => $mappings,
  223. ),
  224. 'db_write' => array(
  225. 'connection' => 'db_write',
  226. 'mappings' => $mappings,
  227. ),
  228. ),
  229. )
  230. );
  231. }
  232. // Setting Twig as a service provider.
  233. $app->register(
  234. new Silex\Provider\TwigServiceProvider(),
  235. array(
  236. 'twig.path' => array(
  237. api_get_path(SYS_CODE_PATH).'template', //template folder
  238. api_get_path(SYS_PLUGIN_PATH) //plugin folder
  239. ),
  240. // twitter bootstrap form twig templates
  241. 'twig.form.templates' => array('form_div_layout.html.twig', 'default/form/form_custom_template.tpl'),
  242. 'twig.options' => array(
  243. 'debug' => $app['debug'],
  244. 'charset' => 'utf-8',
  245. 'strict_variables' => false,
  246. 'autoescape' => false,
  247. 'cache' => $app['debug'] ? false : $app['twig.cache.path'],
  248. 'optimizations' => -1, // turn on optimizations with -1
  249. )
  250. )
  251. );
  252. // Setting Twig options
  253. $app['twig'] = $app->share(
  254. $app->extend('twig', function ($twig) {
  255. $twig->addFilter('get_lang', new Twig_Filter_Function('get_lang'));
  256. $twig->addFilter('get_path', new Twig_Filter_Function('api_get_path'));
  257. $twig->addFilter('get_setting', new Twig_Filter_Function('api_get_setting'));
  258. $twig->addFilter('var_dump', new Twig_Filter_Function('var_dump'));
  259. $twig->addFilter('return_message', new Twig_Filter_Function('Display::return_message_and_translate'));
  260. $twig->addFilter('display_page_header', new Twig_Filter_Function('Display::page_header_and_translate'));
  261. $twig->addFilter(
  262. 'display_page_subheader',
  263. new Twig_Filter_Function('Display::page_subheader_and_translate')
  264. );
  265. $twig->addFilter('icon', new Twig_Filter_Function('Template::get_icon_path'));
  266. $twig->addFilter('format_date', new Twig_Filter_Function('Template::format_date'));
  267. return $twig;
  268. })
  269. );
  270. // Developer tools.
  271. if (is_writable($app['sys_temp_path'])) {
  272. if ($app['show_profiler']) {
  273. // Adding Symfony2 web profiler (memory, time, logs, etc)
  274. $app->register(
  275. $p = new Silex\Provider\WebProfilerServiceProvider(),
  276. array(
  277. 'profiler.cache_dir' => $app['profiler.cache_dir'],
  278. )
  279. );
  280. $app->mount('/_profiler', $p);
  281. // PHP errors for cool kids
  282. //$app->register(new Whoops\Provider\Silex\WhoopsServiceProvider);
  283. }
  284. }
  285. // Pagerfanta settings (Pagination using Doctrine2, arrays, etc)
  286. $app->register(new PagerfantaServiceProvider());
  287. // Custom route params see https://github.com/franmomu/silex-pagerfanta-provider/pull/2
  288. //$app['pagerfanta.view.router.name']
  289. //$app['pagerfanta.view.router.params']
  290. $app['pagerfanta.view.options'] = array(
  291. 'routeName' => null,
  292. 'routeParams' => array(),
  293. 'pageParameter' => '[page]',
  294. 'proximity' => 3,
  295. 'next_message' => '&raquo;',
  296. 'prev_message' => '&laquo;',
  297. 'default_view' => 'twitter_bootstrap' // the pagination style
  298. );
  299. // Registering Menu service provider (too gently creating menus with the URLgenerator provider)
  300. $app->register(new \Knp\Menu\Silex\KnpMenuServiceProvider());
  301. // @todo use a app['image_processor'] setting
  302. define('IMAGE_PROCESSOR', 'gd'); // imagick or gd strings
  303. // Setting the Imagine service provider to deal with image transformations used in social group.
  304. $app->register(new Grom\Silex\ImagineServiceProvider(), array(
  305. 'imagine.factory' => 'Gd'
  306. ));
  307. // Prompts Doctrine SQL queries using Monolog.
  308. $app['dbal_logger'] = $app->share(function() {
  309. //return new Doctrine\DBAL\Logging\DebugStack();
  310. });
  311. if ($app['debug']) {
  312. /*$logger = $app['dbal_logger'];
  313. $app['db.config']->setSQLLogger($logger);
  314. $app->after(function() use ($app, $logger) {
  315. // Log all queries as DEBUG.
  316. foreach ($logger->queries as $query) {
  317. $app['monolog']->debug(
  318. $query['sql'],
  319. array(
  320. 'params' => $query['params'],
  321. 'types' => $query['types'],
  322. 'executionMS' => $query['executionMS']
  323. )
  324. );
  325. }
  326. });*/
  327. }
  328. // Email service provider.
  329. $app->register(new Silex\Provider\SwiftmailerServiceProvider(), array(
  330. 'swiftmailer.options' => array(
  331. 'host' => isset($platform_email['SMTP_HOST']) ? $platform_email['SMTP_HOST'] : null,
  332. 'port' => isset($platform_email['SMTP_PORT']) ? $platform_email['SMTP_PORT'] : null,
  333. 'username' => isset($platform_email['SMTP_USER']) ? $platform_email['SMTP_USER'] : null,
  334. 'password' => isset($platform_email['SMTP_PASS']) ? $platform_email['SMTP_PASS'] : null,
  335. 'encryption' => null,
  336. 'auth_mode' => null
  337. )
  338. ));
  339. // Mailer
  340. $app['mailer'] = $app->share(function ($app) {
  341. return new \Swift_Mailer($app['swiftmailer.transport']);
  342. });
  343. // Assetic service provider.
  344. if ($app['assetic.enabled']) {
  345. $app->register(new SilexAssetic\AsseticServiceProvider(), array(
  346. 'assetic.options' => array(
  347. 'debug' => $app['debug'],
  348. 'auto_dump_assets' => $app['assetic.auto_dump_assets'],
  349. )
  350. ));
  351. // Less filter
  352. $app['assetic.filter_manager'] = $app->share(
  353. $app->extend('assetic.filter_manager', function($fm, $app) {
  354. $fm->set('lessphp', new Assetic\Filter\LessphpFilter());
  355. return $fm;
  356. })
  357. );
  358. $app['assetic.asset_manager'] = $app->share(
  359. $app->extend('assetic.asset_manager', function($am, $app) {
  360. $am->set('styles', new Assetic\Asset\AssetCache(
  361. new Assetic\Asset\GlobAsset(
  362. $app['assetic.input.path_to_css'],
  363. array($app['assetic.filter_manager']->get('lessphp'))
  364. ),
  365. new Assetic\Cache\FilesystemCache($app['assetic.path_to_cache'])
  366. ));
  367. $am->get('styles')->setTargetPath($app['assetic.output.path_to_css']);
  368. $am->set('scripts', new Assetic\Asset\AssetCache(
  369. new Assetic\Asset\GlobAsset($app['assetic.input.path_to_js']),
  370. new Assetic\Cache\FilesystemCache($app['assetic.path_to_cache'])
  371. ));
  372. $am->get('scripts')->setTargetPath($app['assetic.output.path_to_js']);
  373. return $am;
  374. })
  375. );
  376. }
  377. // Gaufrette service provider (to manage files/dirs) (not used yet)
  378. /*
  379. use Bt51\Silex\Provider\GaufretteServiceProvider\GaufretteServiceProvider;
  380. $app->register(new GaufretteServiceProvider(), array(
  381. 'gaufrette.adapter.class' => 'Local',
  382. 'gaufrette.options' => array(api_get_path(SYS_DATA_PATH))
  383. ));
  384. */
  385. // Use Symfony2 filesystem instead of custom scripts
  386. $app->register(new Neutron\Silex\Provider\FilesystemServiceProvider());
  387. /** Chamilo service provider. */
  388. class ChamiloServiceProvider implements ServiceProviderInterface
  389. {
  390. public function register(Application $app)
  391. {
  392. // Template class
  393. $app['template'] = $app->share(function () use ($app) {
  394. $template = new Template($app);
  395. return $template;
  396. });
  397. $app['paths'] = $app->share(function () use ($app) {
  398. return array(
  399. //'root_web' => $app['root_web'],
  400. 'root_sys' => $app['root_sys'],
  401. 'sys_root' => $app['root_sys'], // just an alias
  402. 'sys_data_path' => $app['sys_data_path'],
  403. 'sys_config_path' => $app['sys_config_path'],
  404. 'sys_temp_path' => $app['sys_temp_path'],
  405. 'sys_log_path' => $app['sys_log_path']
  406. );
  407. });
  408. // Chamilo data filesystem.
  409. $app['chamilo.filesystem'] = $app->share(function () use ($app) {
  410. $filesystem = new ChamiloLMS\Component\DataFilesystem\DataFilesystem($app['paths'], $app['filesystem']);
  411. return $filesystem;
  412. });
  413. // Page controller class.
  414. $app['page_controller'] = $app->share(function () use ($app) {
  415. $pageController = new PageController($app);
  416. return $pageController;
  417. });
  418. // Mail template generator.
  419. $app['mail_generator'] = $app->share(function () use ($app) {
  420. $mailGenerator = new ChamiloLMS\Component\Mail\MailGenerator($app['twig'], $app['mailer']);
  421. return $mailGenerator;
  422. });
  423. // Database.
  424. $app['database'] = $app->share(function () use ($app) {
  425. $db = new Database($app['db'], $app['dbs']);
  426. return $db;
  427. });
  428. }
  429. public function boot(Application $app)
  430. {
  431. }
  432. }
  433. // Registering Chamilo service provider.
  434. $app->register(new ChamiloServiceProvider(), array());
  435. // Controller as services definitions.
  436. $app['pages.controller'] = $app->share(
  437. function () use ($app) {
  438. return new PagesController($app['pages.repository']);
  439. }
  440. );
  441. $app['index.controller'] = $app->share(
  442. function () use ($app) {
  443. $controller = new ChamiloLMS\Controller\IndexController($app);
  444. return $controller;
  445. }
  446. );
  447. $app['legacy.controller'] = $app->share(
  448. function () use ($app) {
  449. return new ChamiloLMS\Controller\LegacyController($app);
  450. }
  451. );
  452. $app['userPortal.controller'] = $app->share(
  453. function () use ($app) {
  454. return new ChamiloLMS\Controller\UserPortalController($app);
  455. }
  456. );
  457. $app['learnpath.controller'] = $app->share(
  458. function () use ($app) {
  459. return new ChamiloLMS\Controller\LearnpathController();
  460. }
  461. );
  462. $app['course_home.controller'] = $app->share(
  463. function () use ($app) {
  464. return new ChamiloLMS\Controller\CourseHomeController();
  465. }
  466. );
  467. $app['course_home.controller'] = $app->share(
  468. function () use ($app) {
  469. return new ChamiloLMS\Controller\CourseHomeController();
  470. }
  471. );
  472. $app['introduction_tool.controller'] = $app->share(
  473. function () use ($app) {
  474. return new ChamiloLMS\Controller\IntroductionToolController();
  475. }
  476. );
  477. $app['certificate.controller'] = $app->share(
  478. function () use ($app) {
  479. return new ChamiloLMS\Controller\CertificateController();
  480. }
  481. );
  482. $app['user.controller'] = $app->share(
  483. function () use ($app) {
  484. return new ChamiloLMS\Controller\UserController();
  485. }
  486. );
  487. $app['news.controller'] = $app->share(
  488. function () use ($app) {
  489. return new ChamiloLMS\Controller\NewsController();
  490. }
  491. );
  492. $app['editor.controller'] = $app->share(
  493. function () use ($app) {
  494. return new ChamiloLMS\Controller\EditorController();
  495. }
  496. );
  497. $app['question_manager.controller'] = $app->share(
  498. function () use ($app) {
  499. return new ChamiloLMS\Controller\Admin\QuestionManager\QuestionManagerController();
  500. }
  501. );
  502. $app['exercise_manager.controller'] = $app->share(
  503. function () use ($app) {
  504. return new ChamiloLMS\Controller\ExerciseController($app);
  505. }
  506. );
  507. $app['admin.controller'] = $app->share(
  508. function () use ($app) {
  509. return new ChamiloLMS\Controller\Admin\AdministratorController($app);
  510. }
  511. );
  512. $app['role.controller'] = $app->share(
  513. function () use ($app) {
  514. return new ChamiloLMS\Controller\Admin\Administrator\RoleController($app);
  515. }
  516. );
  517. $app['question_score.controller'] = $app->share(
  518. function () use ($app) {
  519. return new ChamiloLMS\Controller\Admin\Administrator\QuestionScoreController($app);
  520. }
  521. );
  522. $app['question_score_name.controller'] = $app->share(
  523. function () use ($app) {
  524. return new ChamiloLMS\Controller\Admin\Administrator\QuestionScoreNameController($app);
  525. }
  526. );
  527. $app['model_ajax.controller'] = $app->share(
  528. function () use ($app) {
  529. return new ChamiloLMS\Controller\ModelAjaxController();
  530. }
  531. );
  532. // Ministerio
  533. $app['branch.controller'] = $app->share(
  534. function () use ($app) {
  535. return new ChamiloLMS\Controller\Admin\Administrator\BranchController($app);
  536. }
  537. );
  538. $app['branch_director.controller'] = $app->share(
  539. function () use ($app) {
  540. return new ChamiloLMS\Controller\Admin\Director\BranchDirectorController($app);
  541. }
  542. );
  543. $app['jury.controller'] = $app->share(
  544. function () use ($app) {
  545. return new ChamiloLMS\Controller\Admin\Administrator\JuryController($app);
  546. }
  547. );
  548. $app['jury_president.controller'] = $app->share(
  549. function () use ($app) {
  550. return new ChamiloLMS\Controller\Admin\JuryPresident\JuryPresidentController($app);
  551. }
  552. );
  553. $app['jury_member.controller'] = $app->share(
  554. function () use ($app) {
  555. return new ChamiloLMS\Controller\Admin\JuryMember\JuryMemberController($app);
  556. }
  557. );
  558. $app['curriculum_category.controller'] = $app->share(
  559. function () use ($app) {
  560. return new ChamiloLMS\Controller\Tool\Curriculum\CurriculumCategoryController($app);
  561. }
  562. );
  563. $app['curriculum_item.controller'] = $app->share(
  564. function () use ($app) {
  565. return new ChamiloLMS\Controller\Tool\Curriculum\CurriculumItemController($app);
  566. }
  567. );
  568. $app['curriculum_user.controller'] = $app->share(
  569. function () use ($app) {
  570. return new ChamiloLMS\Controller\Tool\Curriculum\CurriculumUserController($app);
  571. }
  572. );