services.php 21 KB

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