Fix URL in order to work with old and new chamilo system

pull/2528/head
jmontoyaa 7 years ago
parent ae88a4d5dd
commit 1d715aa781
  1. 1
      assets/js/main.js
  2. 3
      index.php
  3. 1
      main/admin/index.php
  4. 23
      main/inc/global.inc.php
  5. 22
      main/inc/lib/api.lib.php
  6. 21
      main/inc/lib/display.lib.php
  7. 2
      main/inc/lib/sessionmanager.lib.php
  8. 45
      main/inc/lib/template.lib.php
  9. 62
      main/template/default/layout/head.html.twig
  10. 2
      main/template/default/social/inbox.html.twig
  11. 2
      plugin/ext_auth_chamilo_logout_button_behaviour/plugin.php
  12. 34
      public/libs/readmore-js/.bower.json
  13. 12
      public/libs/readmore-js/README.md
  14. 12
      public/libs/readmore-js/bower.json
  15. 10
      public/libs/readmore-js/demo.html
  16. 5
      public/libs/readmore-js/package.json
  17. 28
      public/libs/readmore-js/readmore.js
  18. 2
      public/libs/readmore-js/readmore.min.js
  19. 3
      src/CoreBundle/Controller/IndexController.php
  20. 12
      src/CoreBundle/EventListener/LegacyListener.php
  21. 6
      src/CoreBundle/EventListener/LegacyLoginListener.php
  22. 20
      src/CoreBundle/EventListener/LoginSuccessHandler.php
  23. 46
      src/CoreBundle/Menu/LeftMenuBuilder.php
  24. 12
      src/CoreBundle/Menu/NavBuilder.php
  25. 20
      src/CoreBundle/Resources/config/routing.yml
  26. 10
      src/CoreBundle/Resources/config/services.yml
  27. 6
      src/ThemeBundle/Controller/NavbarController.php
  28. 1
      src/ThemeBundle/Controller/SecurityController.php
  29. 5
      src/ThemeBundle/Controller/SidebarController.php
  30. 1
      src/ThemeBundle/Controller/WidgetController.php
  31. 48
      src/ThemeBundle/Resources/views/Layout/base-layout.html.twig
  32. 2
      src/ThemeBundle/Resources/views/Layout/header.js.twig
  33. 54
      src/ThemeBundle/Resources/views/Layout/layout_one_col.html.twig
  34. 11
      src/ThemeBundle/Resources/views/Navbar/user.html.twig
  35. 673
      yarn.lock

@ -34,7 +34,6 @@ require("fullcalendar");
require("pwstrength-bootstrap");
require ("readmore-js");
require("js-cookie");
require("js-cookie");
require("jquery-ui-timepicker-addon");
//require("bootstrap-daterangepicker");
require("ckeditor");

@ -1,6 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
header('Location: public/index.php');
exit;
use ChamiloSession as Session;
/**

@ -305,6 +305,7 @@ if (file_exists($sessionsBlockExtraFile)) {
if (api_is_platform_admin()) {
$blocks['sessions']['editable'] = true;
}
$sessionPath = api_get_path(WEB_CODE_PATH).'session/';
$search_form = ' <form method="GET" class="form-inline" action="'.$sessionPath.'session_list.php">

@ -45,12 +45,15 @@ try {
}
$env = $_SERVER['APP_ENV'] ?? 'dev';
$env = 'test';
$kernel = new Chamilo\Kernel($env, true);
$request = Sonata\PageBundle\Request\RequestFactory::createFromGlobals(
'host_with_path_by_locale'
);
// This 'load_legacy' variable is needed to know that symfony is loaded using old style legacy mode,
// and not called from a symfony controller from public/
$request->request->set('load_legacy', true);
$request->setBaseUrl($request->getRequestUri());
$response = $kernel->handle($request);
@ -78,24 +81,28 @@ try {
$libraryPath = __DIR__.'/lib/';
$container = $kernel->getContainer();
// Connect Chamilo with the Symfony container
Container::setContainer($container);
Container::setLegacyServices($container);
// Symfony uses request_stack now
$container->get('request_stack')->push($request);
// Connect Chamilo with the Symfony container
// Container::setContainer($container);
// Container::setLegacyServices($container);
// The code below is not needed. The connections is now made in the file:
// src/CoreBundle/EventListener/LegacyListener.php
// This is called when when doing the $kernel->handle
// Fix chamilo URL when used inside a folder: example.com/chamilo
$append = $kernel->getUrlAppend();
$appendValue = '';
if (!empty($append)) {
$appendValue = "/$append/";
}
$router = $container->get('router');
$context = $container->get('router.request_context');
$host = $router->getContext()->getHost();
$context->setBaseUrl($appendValue);
$baseUrl = $router->getContext()->getBaseUrl();
$container->set('router.request_context', $context);
$packages = $container->get('assets.packages');
@ -263,8 +270,6 @@ try {
ini_set('log_errors', '1');
// Load allowed tag definitions for kses and/or HTMLPurifier.
require_once $libraryPath.'formvalidator/Rule/allowed_tags.inc.php';
@ -512,7 +517,6 @@ try {
}
}
// include the local (contextual) parameters of this course or section
require __DIR__.'/local.inc.php';
$_user = api_get_user_info();
@ -586,7 +590,6 @@ try {
$langstats = new langstats();
}
//Default quota for the course documents folder
$default_quota = api_get_setting('default_document_quotum');
//Just in case the setting is not correctly set

@ -720,12 +720,9 @@ function api_get_path($path = '', $configuration = [])
$course_folder = 'courses/';
static $root_web = '';
//var_dump(Container::getRouter()->generate('legacy_index'));exit;
//var_dump(Container::getRouter()->generate('legacy_index'));
$root_sys = Container::getRootDir();
//$root_web = Container::$container->get('templating.helper.assets')->getUrl('legacy_index');
$root_web = '';
// If no $root_web has been set so far *and* no custom config has been passed to the function
@ -769,7 +766,7 @@ function api_get_path($path = '', $configuration = [])
\Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL
);
$root_web = urldecode($root_web);
$root_web = str_replace('/../', '', $root_web);
//$root_web = str_replace('/../', '', $root_web);
}
if (isset($configuration['multiple_access_urls']) &&
@ -1938,8 +1935,8 @@ function api_get_cidreq_params($courseCode, $sessionId = 0, $groupId = 0)
function api_get_cidreq($addSessionId = true, $addGroupId = true, $origin = '')
{
$courseCode = api_get_course_id();
$url = empty($courseCode) ? '' : 'cidReq='.htmlspecialchars($courseCode);
$origin = empty($origin) ? api_get_origin() : Security::remove_XSS($origin);
$url = empty($courseCode) ? '' : 'cidReq='.htmlspecialchars($courseCode, ENT_QUOTES);
$origin = empty($origin) ? api_get_origin() : htmlspecialchars($origin, ENT_QUOTES);
if ($addSessionId) {
if (!empty($url)) {
@ -2750,9 +2747,6 @@ function api_get_setting($variable)
break;
}
// Old code
var_dump($variable);
global $_setting;
if ($variable == 'header_extra_content') {
$filename = api_get_home_path().'header_extra_content.txt';
@ -3667,7 +3661,6 @@ function api_is_anonymous($user_id = null, $db_check = false)
return true;
}
}
return !Container::getAuthorizationChecker()->isGranted('IS_AUTHENTICATED_FULLY');
}
@ -3683,8 +3676,11 @@ function api_not_allowed(
$message = null,
$responseCode = 0
) {
throw new Exception('api_not_allowed');
echo 'api_not_allowed';
return false;
if (api_get_setting('sso_authentication') === 'true') {
global $osso;
if ($osso) {
@ -7525,7 +7521,7 @@ function api_get_locked_settings()
*/
function api_user_is_login($user_id = null)
{
return Session::read('IS_AUTHENTICATED_FULLY', false) === true;
return Container::getAuthorizationChecker()->isGranted('IS_AUTHENTICATED_FULLY');
}
/**
@ -8421,7 +8417,7 @@ function convert_double_quote_to_single($in_text)
*/
function api_get_origin()
{
$origin = isset($_REQUEST['origin']) ? Security::remove_XSS($_REQUEST['origin']) : '';
$origin = isset($_REQUEST['origin']) ? htmlspecialchars($_REQUEST['origin'], ENT_QUOTES) : '';
return $origin;
}

@ -3,6 +3,10 @@
use Chamilo\CoreBundle\Entity\ExtraField;
use ChamiloSession as Session;
use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser;
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\UserBundle\Entity\User;
use Symfony\Component\HttpFoundation\Response;
/**
* Class Display
@ -61,6 +65,9 @@ class Display
$help = null,
$page_header = null
) {
ob_start();
return true;
$origin = api_get_origin();
$showHeader = true;
if (isset($origin) && $origin == 'learnpath') {
@ -136,7 +143,7 @@ class Display
/**
* Displays the reduced page header (without banner).
*/
public static function set_header()
private static function set_header()
{
global $show_learnpath, $tool_name;
self::$global_template = new Template(
@ -152,7 +159,17 @@ class Display
*/
public static function display_footer()
{
echo self::$global_template->show_footer_template();
$contents = ob_get_contents();
ob_end_clean();
$tpl = '@ChamiloTheme/Layout/layout_one_col.html.twig';
$response = new Response();
$params['content'] = $contents;
global $interbreadcrumb;
$params['legacy_breadcrumb'] = $interbreadcrumb;
$content = Container::getTemplating()->render($tpl, $params);
$response->setContent($content);
$response->send();
exit;
}
/**

@ -4507,7 +4507,7 @@ class SessionManager
{
$session_table = Database::get_main_table(TABLE_MAIN_SESSION);
$access_url_rel_session_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
$sql = "SELECT count(id) FROM $session_table s";
$sql = "SELECT count(s.id) FROM $session_table s";
if (!empty($access_url_id) && $access_url_id == intval($access_url_id)) {
$sql .= ", $access_url_rel_session_table u ".
" WHERE s.id = u.session_id AND u.access_url_id = $access_url_id";

@ -6,7 +6,6 @@ use Chamilo\CoreBundle\Framework\Container;
use Chamilo\UserBundle\Entity\User;
use Symfony\Component\HttpFoundation\Response;
/**
* Class Template.
*
@ -360,7 +359,6 @@ class Template
$this->assign('actions', $actions);
}
/**
* Render the template.
*
@ -369,21 +367,32 @@ class Template
*/
public function display($template, $clearFlashMessages = true)
{
//$this->assign('flash_messages', Display::getFlashToString());
if ($clearFlashMessages) {
//Display::cleanFlashMessages();
}
$template = str_replace('tpl', 'html.twig', $template);
$templateFile = api_get_path(SYS_PATH).'main/template/'.$template;
// Set legacy breadcrumb
global $interbreadcrumb;
$this->params['legacy_breadcrumb'] = $interbreadcrumb;
if (!file_exists($templateFile)) {
$e = new \Gaufrette\Exception\FileNotFound($templateFile);
echo $e->getMessage();
exit;
}
//echo Container::getTemplating()->render($template, $this->params);
$this->returnResponse($this->params, $template);
}
/**
* @param array $params
* @param string $template
*
* @throws \Twig\Error\Error
*/
public function returnResponse($params, $template)
{
$response = new Response();
$content = Container::getTemplating()->render($template, $this->params);
$content = Container::getTemplating()->render($template, $params);
$response->setContent($content);
$response->send();
}
@ -393,12 +402,8 @@ class Template
* */
public function display_one_col_template()
{
$tpl = '@ChamiloTheme/Layout/layout_one_col.html.twig';
$response = new Response();
$content = Container::getTemplating()->render($tpl, $this->params);
$response->setContent($content);
$response->send();
$template = '@ChamiloTheme/Layout/layout_one_col.html.twig';
$this->returnResponse($this->params, $template);
}
/**
@ -406,11 +411,8 @@ class Template
*/
public function display_two_col_template()
{
$tpl = '@ChamiloTheme/Layout/layout_two_col.html.twig';
$response = new Response();
$content = Container::getTemplating()->render($tpl, $this->params);
$response->setContent($content);
$response->send();
$template = '@ChamiloTheme/Layout/layout_two_col.html.twig';
$this->returnResponse($this->params, $template);
}
/**
@ -839,7 +841,7 @@ class Template
'jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon.min.js',
'image-map-resizer/js/imageMapResizer.min.js',
'jquery.scrollbar/jquery.scrollbar.min.js',
'readmore-js/readmore.min.js',
//'readmore-js/readmore.min.js',
'bootstrap-select/dist/js/bootstrap-select.min.js',
$selectLink,
'select2/dist/js/select2.min.js',
@ -960,7 +962,7 @@ class Template
}
}
//var_dump(Container::$container->get('router')->generate('legacy_index'));
//var_dump(Container::$container->get('router')->generate('main', ['name' => '1']));
//var_dump(api_get_path(WEB_PATH));
return $favico;
@ -1057,7 +1059,6 @@ class Template
$this->params[$variable] = $value;
}
/**
* Adds a body class for login pages.
*/

@ -1,62 +0,0 @@
{% autoescape false %}
<meta charset="{{ system_charset }}" />
<link href="https://chamilo.org/chamilo-lms/" rel="help" />
<link href="https://chamilo.org/the-association/" rel="author" />
<link href="https://www.gnu.org/licenses/gpl-3.0.en.html" rel="license" />
<!-- Force latest IE rendering engine or ChromeFrame if installed -->
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<![endif]-->
{{ prefetch }}
{{ favico }}
<link rel="apple-touch-icon" href="{{ _p.web }}apple-touch-icon.png" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="generator" content="{{ _s.software_name }} {{ _s.system_version|slice(0,1) }}" />
{# Use the latest engine in ie8/ie9 or use google chrome engine if available #}
{# Improve usability in portal devices #}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title_string }}</title>
{{ social_meta }}
{{ css_static_file_to_string }}
{#{{ js_file_to_string }}#}
<link rel="stylesheet" href="{{ asset('build/chamilo.css') }}"/>
<link rel="stylesheet" href="{{ asset('build/css/base.css') }}"/>
<link rel="stylesheet" href="{{ asset('build/css/themes/'~ theme ~'/default.css') }}"/>
<link rel="stylesheet" media="print" href="{{ asset('build/css/print.css') }}"/>
<script src="{{ asset('build/chamilo.js') }}"></script>
<script src="{{ asset('libs/ckeditor/ckeditor.js') }}"></script>
<script src="{{ asset('libs/readmore-js/readmore.min.js') }}"></script>
<script src="{{ asset('libs/js-cookie/src/js.cookie.js') }}"></script>
{{ extra_headers }}
<script>
/* Global chat variables */
var ajax_url = '{{ _p.web_ajax }}chat.ajax.php';
var online_button = '{{ online_button }}';
var offline_button = '{{ offline_button }}';
var connect_lang = '{{ "ChatConnected"|get_lang }}';
var disconnect_lang = '{{ "ChatDisconnected"|get_lang }}';
var logOutUrl = '{{ _p.web_ajax }}course.ajax.php?a=course_logout';
$(document).ready(function () {
// Executes course logout when user close the browser tab/window
$(window).on('beforeunload', function () {
// Logout of course just in case
$.ajax({
url: logOutUrl,
success: function (data) {
return 1;
}
});
});
});
</script>
{% include template ~ '/layout/header.js.html.twig' %}
{{ css_custom_file_to_string }}
{{ css_style_print }}
{% endautoescape %}

@ -1,4 +1,4 @@
{% extends template ~ "/layout/layout_1_col.html.twig" %}
{% extends "@ChamiloTheme/Layout/layout_one_col.html.twig" %}
{% block content %}
{% autoescape false %}

@ -20,6 +20,8 @@ $plugin_info['comment'] = "If you use some other authentication than local Chami
$plugin_info['version'] = '1.0';
//the plugin author
$plugin_info['author'] = 'Hubert Borderiou';
return;
//the plugin configuration
$form = new FormValidator('eaclbb_form');
$form->addElement("html", "<div class='normal-message'>Fill the text boxes below to overwrite the default values used in this plugin</div>");

@ -1,34 +0,0 @@
{
"name": "Readmore.js",
"main": "readmore.min.js",
"version": "2.1.0",
"homepage": "http://jedfoster.com/Readmore.js/",
"authors": [
"Jed Foster <jed@jedfoster.com>"
],
"description": "A lightweight jQuery plugin for collapsing and expanding long blocks of text with \"Read more\" and \"Close\" links.",
"keywords": [
"css",
"jquery",
"readmore",
"expand",
"collapse"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"_release": "2.1.0",
"_resolution": {
"type": "version",
"tag": "v2.1.0",
"commit": "f0c27b356dea9b54968bc2734cb9be0695d20c1a"
},
"_source": "https://github.com/jedfoster/Readmore.js.git",
"_target": "2.1.0",
"_originalSource": "readmore-js"
}

@ -21,7 +21,7 @@ Then include it in your HTML:
<script src="/node_modules/readmore-js/readmore.min.js"></script>
```
Or, using Webpack or Browserify
Or, using Webpack or Browserify:
```javascript
require('readmore-js');
@ -55,17 +55,23 @@ $('article').readmore({
* `startOpen: false` do not immediately truncate, start in the fully opened position
* `beforeToggle: function() {}` called after a more or less link is clicked, but *before* the block is collapsed or expanded
* `afterToggle: function() {}` called *after* the block is collapsed or expanded
* `blockProcessed: function() {}` called once per block during initilization after Readmore.js has processed the block.
If the element has a `max-height` CSS property, Readmore.js will use that value rather than the value of the `collapsedHeight` option.
### The callbacks:
The callback functions, `beforeToggle` and `afterToggle`, both receive the same arguments: `trigger`, `element`, and `expanded`.
The `beforeToggle` and `afterToggle` callbacks both receive the same arguments: `trigger`, `element`, and `expanded`.
* `trigger`: the "Read more" or "Close" element that was clicked
* `element`: the block that is being collapsed or expanded
* `expanded`: Boolean; `true` means the block is expanded
The `blockProcessed` callback receives `element` and `collapsable`.
* `element`: the block that has just been processed
* `collapsable`: Boolean; `false` means the block was shorter than the specified minimum `collapsedHeight`--the block will not have a "Read more" link
#### Callback example:
Here's an example of how you could use the `afterToggle` callback to scroll back to the top of a block when the "Close" link is clicked.
@ -172,6 +178,6 @@ $ npm install
Which will install the necessary development dependencies. Then, to build the minified script:
```
$ gulp compress
$ npm run build
```

@ -1,6 +1,6 @@
{
"name": "Readmore.js",
"main": "readmore.min.js",
"name": "readmore-js",
"main": "readmore.js",
"version": "2.1.0",
"homepage": "http://jedfoster.com/Readmore.js/",
"authors": [
@ -20,6 +20,10 @@
"node_modules",
"bower_components",
"test",
"tests"
]
"tests",
"gulpfile.js"
],
"dependencies": {
"jquery": ">=2.1.4"
}
}

@ -77,13 +77,14 @@
<li><code>startOpen: false</code> do not immediately truncate, start in the fully opened position</li>
<li><code>beforeToggle: function() {}</code> called after a more or less link is clicked, but <em>before</em> the block is collapsed or expanded</li>
<li><code>afterToggle: function() {}</code> called <em>after</em> the block is collapsed or expanded</li>
<li><code>blockProcessed: function() {}</code> called once per block during initilization after Readmore.js has processed the block.</li>
</ul>
<p>If the element has a <code>max-height</code> CSS property, Readmore.js will use that value rather than the value of the <code>collapsedHeight</code> option.</p>
<h3 id="thecallbacks">The callbacks:</h3>
<p>The callback functions, <code>beforeToggle</code> and <code>afterToggle</code>, both receive the same arguments: <code>trigger</code>, <code>element</code>, and <code>expanded</code>.</p>
<p>The <code>beforeToggle</code> and <code>afterToggle</code> callbacks both receive the same arguments: <code>trigger</code>, <code>element</code>, and <code>expanded</code>.</p>
<ul>
<li><code>trigger</code>: the &#8220;Read more&#8221; or &#8220;Close&#8221; element that was clicked</li>
@ -91,6 +92,13 @@
<li><code>expanded</code>: Boolean; <code>true</code> means the block is expanded</li>
</ul>
<p>The <code>blockProcessed</code> callback receives <code>element</code> and <code>collapsable</code>.</p>
<ul>
<li><code>element</code>: the block that has just been processed</li>
<li><code>collapsable</code>: Boolean; <code>false</code> means the block was shorter than the specified minimum <code>collapsedHeight</code>—the block will not have a "Read more" link</li>
</ul>
<h4 id="callbackexample">Callback example:</h4>
<p>Here&#8217;s an example of how you could use the <code>afterToggle</code> callback to scroll back to the top of a block when the &#8220;Close&#8221; link is clicked.</p>

@ -4,7 +4,8 @@
"description": "A lightweight jQuery plugin for collapsing and expanding long blocks of text with \"Read more\" and \"Close\" links.",
"main": "readmore.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "./node_modules/gulp/bin/gulp.js compress"
},
"repository": {
"type": "git",
@ -24,7 +25,7 @@
},
"homepage": "https://github.com/jedfoster/Readmore.js",
"dependencies": {
"jquery": "~2.1.4"
"jquery": ">2.1.4"
},
"devDependencies": {
"gulp": "^3.9.0",

@ -37,8 +37,9 @@
startOpen: false,
// callbacks
beforeToggle: function(){},
afterToggle: function(){}
blockProcessed: function() {},
beforeToggle: function() {},
afterToggle: function() {}
},
cssEmbedded = {},
uniqueIdCounter = 0;
@ -187,6 +188,9 @@
if (current.outerHeight(true) <= collapsedHeight + heightMargin) {
// The block is shorter than the limit, so there's no need to truncate it.
if (this.options.blockProcessed && typeof this.options.blockProcessed === 'function') {
this.options.blockProcessed(current, false);
}
return true;
}
else {
@ -206,7 +210,7 @@
};
})(this))
.attr({
'data-readmore-toggle': '',
'data-readmore-toggle': id,
'aria-controls': id
}));
@ -215,6 +219,10 @@
height: collapsedHeight
});
}
if (this.options.blockProcessed && typeof this.options.blockProcessed === 'function') {
this.options.blockProcessed(current, true);
}
}
},
@ -224,11 +232,11 @@
}
if (! trigger) {
trigger = $('[aria-controls="' + _this.element.id + '"]')[0];
trigger = $('[aria-controls="' + this.element.id + '"]')[0];
}
if (! element) {
element = _this.element;
element = this.element;
}
var $element = $(element),
@ -250,14 +258,18 @@
// Fire beforeToggle callback
// Since we determined the new "expanded" state above we're now out of sync
// with our true current state, so we need to flip the value of `expanded`
this.options.beforeToggle(trigger, $element, ! expanded);
if (this.options.beforeToggle && typeof this.options.beforeToggle === 'function') {
this.options.beforeToggle(trigger, $element, ! expanded);
}
$element.css({'height': newHeight});
// Fire afterToggle callback
$element.on('transitionend', (function(_this) {
return function() {
_this.options.afterToggle(trigger, $element, expanded);
if (_this.options.afterToggle && typeof _this.options.afterToggle === 'function') {
_this.options.afterToggle(trigger, $element, expanded);
}
$(this).attr({
'aria-expanded': expanded
@ -272,7 +284,7 @@
};
})(this))
.attr({
'data-readmore-toggle': '',
'data-readmore-toggle': $element.attr('id'),
'aria-controls': $element.attr('id')
}));
},

@ -8,4 +8,4 @@
*
* Debounce function from http://davidwalsh.name/javascript-debounce-function
*/
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){"use strict";function e(t,e,i){var a;return function(){var n=this,o=arguments,r=function(){a=null,i||t.apply(n,o)},s=i&&!a;clearTimeout(a),a=setTimeout(r,e),s&&t.apply(n,o)}}function i(t){var e=++h;return String(null==t?"rmjs-":t)+e}function a(t){var e=t.clone().css({height:"auto",width:t.width(),maxHeight:"none",overflow:"hidden"}).insertAfter(t),i=e.outerHeight(),a=parseInt(e.css({maxHeight:""}).css("max-height").replace(/[^-\d\.]/g,""),10),n=t.data("defaultHeight");e.remove();var o=a||t.data("collapsedHeight")||n;t.data({expandedHeight:i,maxHeight:a,collapsedHeight:o}).css({maxHeight:"none"})}function n(t){if(!d[t.selector]){var e=" ";t.embedCSS&&""!==t.blockCSS&&(e+=t.selector+" + [data-readmore-toggle], "+t.selector+"[data-readmore]{"+t.blockCSS+"}"),e+=t.selector+"[data-readmore]{transition: height "+t.speed+"ms;overflow: hidden;}",function(t,e){var i=t.createElement("style");i.type="text/css",i.styleSheet?i.styleSheet.cssText=e:i.appendChild(t.createTextNode(e)),t.getElementsByTagName("head")[0].appendChild(i)}(document,e),d[t.selector]=!0}}function o(e,i){this.element=e,this.options=t.extend({},s,i),n(this.options),this._defaults=s,this._name=r,this.init(),window.addEventListener?(window.addEventListener("load",l),window.addEventListener("resize",l)):(window.attachEvent("load",l),window.attachEvent("resize",l))}var r="readmore",s={speed:100,collapsedHeight:200,heightMargin:16,moreLink:'<a href="#">Read More</a>',lessLink:'<a href="#">Close</a>',embedCSS:!0,blockCSS:"display: block; width: 100%;",startOpen:!1,beforeToggle:function(){},afterToggle:function(){}},d={},h=0,l=e(function(){t("[data-readmore]").each(function(){var e=t(this),i="true"===e.attr("aria-expanded");a(e),e.css({height:e.data(i?"expandedHeight":"collapsedHeight")})})},100);o.prototype={init:function(){var e=t(this.element);e.data({defaultHeight:this.options.collapsedHeight,heightMargin:this.options.heightMargin}),a(e);var n=e.data("collapsedHeight"),o=e.data("heightMargin");if(e.outerHeight(!0)<=n+o)return!0;var r=e.attr("id")||i(),s=this.options.startOpen?this.options.lessLink:this.options.moreLink;e.attr({"data-readmore":"","aria-expanded":this.options.startOpen,id:r}),e.after(t(s).on("click",function(t){return function(i){t.toggle(this,e[0],i)}}(this)).attr({"data-readmore-toggle":"","aria-controls":r})),this.options.startOpen||e.css({height:n})},toggle:function(e,i,a){a&&a.preventDefault(),e||(e=t('[aria-controls="'+_this.element.id+'"]')[0]),i||(i=_this.element);var n=t(i),o="",r="",s=!1,d=n.data("collapsedHeight");n.height()<=d?(o=n.data("expandedHeight")+"px",r="lessLink",s=!0):(o=d,r="moreLink"),this.options.beforeToggle(e,n,!s),n.css({height:o}),n.on("transitionend",function(i){return function(){i.options.afterToggle(e,n,s),t(this).attr({"aria-expanded":s}).off("transitionend")}}(this)),t(e).replaceWith(t(this.options[r]).on("click",function(t){return function(e){t.toggle(this,i,e)}}(this)).attr({"data-readmore-toggle":"","aria-controls":n.attr("id")}))},destroy:function(){t(this.element).each(function(){var e=t(this);e.attr({"data-readmore":null,"aria-expanded":null}).css({maxHeight:"",height:""}).next("[data-readmore-toggle]").remove(),e.removeData()})}},t.fn.readmore=function(e){var i=arguments,a=this.selector;return e=e||{},"object"==typeof e?this.each(function(){if(t.data(this,"plugin_"+r)){var i=t.data(this,"plugin_"+r);i.destroy.apply(i)}e.selector=a,t.data(this,"plugin_"+r,new o(this,e))}):"string"==typeof e&&"_"!==e[0]&&"init"!==e?this.each(function(){var a=t.data(this,"plugin_"+r);a instanceof o&&"function"==typeof a[e]&&a[e].apply(a,Array.prototype.slice.call(i,1))}):void 0}});
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){"use strict";function e(t,e,i){var o;return function(){var n=this,a=arguments,s=function(){o=null,i||t.apply(n,a)},r=i&&!o;clearTimeout(o),o=setTimeout(s,e),r&&t.apply(n,a)}}function i(t){var e=++h;return String(null==t?"rmjs-":t)+e}function o(t){var e=t.clone().css({height:"auto",width:t.width(),maxHeight:"none",overflow:"hidden"}).insertAfter(t),i=e.outerHeight(),o=parseInt(e.css({maxHeight:""}).css("max-height").replace(/[^-\d\.]/g,""),10),n=t.data("defaultHeight");e.remove();var a=o||t.data("collapsedHeight")||n;t.data({expandedHeight:i,maxHeight:o,collapsedHeight:a}).css({maxHeight:"none"})}function n(t){if(!d[t.selector]){var e=" ";t.embedCSS&&""!==t.blockCSS&&(e+=t.selector+" + [data-readmore-toggle], "+t.selector+"[data-readmore]{"+t.blockCSS+"}"),e+=t.selector+"[data-readmore]{transition: height "+t.speed+"ms;overflow: hidden;}",function(t,e){var i=t.createElement("style");i.type="text/css",i.styleSheet?i.styleSheet.cssText=e:i.appendChild(t.createTextNode(e)),t.getElementsByTagName("head")[0].appendChild(i)}(document,e),d[t.selector]=!0}}function a(e,i){this.element=e,this.options=t.extend({},r,i),n(this.options),this._defaults=r,this._name=s,this.init(),window.addEventListener?(window.addEventListener("load",c),window.addEventListener("resize",c)):(window.attachEvent("load",c),window.attachEvent("resize",c))}var s="readmore",r={speed:100,collapsedHeight:200,heightMargin:16,moreLink:'<a href="#">Read More</a>',lessLink:'<a href="#">Close</a>',embedCSS:!0,blockCSS:"display: block; width: 100%;",startOpen:!1,blockProcessed:function(){},beforeToggle:function(){},afterToggle:function(){}},d={},h=0,c=e(function(){t("[data-readmore]").each(function(){var e=t(this),i="true"===e.attr("aria-expanded");o(e),e.css({height:e.data(i?"expandedHeight":"collapsedHeight")})})},100);a.prototype={init:function(){var e=t(this.element);e.data({defaultHeight:this.options.collapsedHeight,heightMargin:this.options.heightMargin}),o(e);var n=e.data("collapsedHeight"),a=e.data("heightMargin");if(e.outerHeight(!0)<=n+a)return this.options.blockProcessed&&"function"==typeof this.options.blockProcessed&&this.options.blockProcessed(e,!1),!0;var s=e.attr("id")||i(),r=this.options.startOpen?this.options.lessLink:this.options.moreLink;e.attr({"data-readmore":"","aria-expanded":this.options.startOpen,id:s}),e.after(t(r).on("click",function(t){return function(i){t.toggle(this,e[0],i)}}(this)).attr({"data-readmore-toggle":s,"aria-controls":s})),this.options.startOpen||e.css({height:n}),this.options.blockProcessed&&"function"==typeof this.options.blockProcessed&&this.options.blockProcessed(e,!0)},toggle:function(e,i,o){o&&o.preventDefault(),e||(e=t('[aria-controls="'+this.element.id+'"]')[0]),i||(i=this.element);var n=t(i),a="",s="",r=!1,d=n.data("collapsedHeight");n.height()<=d?(a=n.data("expandedHeight")+"px",s="lessLink",r=!0):(a=d,s="moreLink"),this.options.beforeToggle&&"function"==typeof this.options.beforeToggle&&this.options.beforeToggle(e,n,!r),n.css({height:a}),n.on("transitionend",function(i){return function(){i.options.afterToggle&&"function"==typeof i.options.afterToggle&&i.options.afterToggle(e,n,r),t(this).attr({"aria-expanded":r}).off("transitionend")}}(this)),t(e).replaceWith(t(this.options[s]).on("click",function(t){return function(e){t.toggle(this,i,e)}}(this)).attr({"data-readmore-toggle":n.attr("id"),"aria-controls":n.attr("id")}))},destroy:function(){t(this.element).each(function(){var e=t(this);e.attr({"data-readmore":null,"aria-expanded":null}).css({maxHeight:"",height:""}).next("[data-readmore-toggle]").remove(),e.removeData()})}},t.fn.readmore=function(e){var i=arguments,o=this.selector;return e=e||{},"object"==typeof e?this.each(function(){if(t.data(this,"plugin_"+s)){var i=t.data(this,"plugin_"+s);i.destroy.apply(i)}e.selector=o,t.data(this,"plugin_"+s,new a(this,e))}):"string"==typeof e&&"_"!==e[0]&&"init"!==e?this.each(function(){var o=t.data(this,"plugin_"+s);o instanceof a&&"function"==typeof o[e]&&o[e].apply(o,Array.prototype.slice.call(i,1))}):void 0}});

@ -94,7 +94,8 @@ class IndexController extends BaseController
return $this->render(
'@ChamiloCore/Index/index.html.twig',
[
'content' => '',
'content' =>
api_get_path(WEB_CODE_PATH).'messages/inbox.php',
'announcements_block' => $announcementsBlock,
//'home_page_block' => $pageController->returnHomePage()
]

@ -9,6 +9,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Routing\Route;
/**
* Class LegacyListener
@ -36,6 +37,17 @@ class LegacyListener
/** @var ContainerInterface $container */
$container = $this->container;
if ($request->get('load_legacy') === true) {
/*$container->get('router.default')->getRouteCollection()->remove('legacy_index');
$route = new Route('/aaa/');
$container->get('router')->getRouteCollection()->add('legacy_index', $route);*/
}
$context = $container->get('router.request_context');
$context->setBaseUrl('/');
$container->get('router.default')->setContext($context);
//var_dump($container->get('router.default')->generate('home'));
// Setting container
Container::setContainer($container);
Container::setLegacyServices($container);

@ -16,6 +16,8 @@ use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
/**
* Class LegacyLoginListener.
* File not needed the real listener is LegacyListener
* @deprecated
*
* @package Chamilo\CoreBundle\EventListener
*/
@ -54,11 +56,7 @@ class LegacyLoginListener implements EventSubscriberInterface
if ($token) {
$isGranted = $container->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY');
if ($isGranted) {
$session->set('IS_AUTHENTICATED_FULLY', true);
$session->set('IS_AUTHENTICATED_ANONYMOUSLY', false);
} else {
$session->set('IS_AUTHENTICATED_FULLY', false);
$session->set('IS_AUTHENTICATED_ANONYMOUSLY', true);
if (isset($_SESSION) && isset($_SESSION['_user'])) {
if ($_SESSION['_user']['active'] == 1) {
$username = $_SESSION['_user']['username'];

@ -72,19 +72,21 @@ class LoginSuccessHandler implements AuthenticationSuccessHandlerInterface
/* Possible values: index.php, user_portal.php, main/auth/courses.php */
$pageAfterLogin = api_get_setting('page_after_login');
$url = 'index.php';
$legacyIndex = $this->router->generate('legacy_index', [], UrlGeneratorInterface::ABSOLUTE_URL);
// Default redirect:
$url = $legacyIndex;
if ($this->checker->isGranted('ROLE_STUDENT') && !empty($pageAfterLogin)) {
switch ($pageAfterLogin) {
case 'index.php':
//$url = $this->router->generate('home');
$url = $this->router->generate('home').'/../../index.php';
$url = $legacyIndex;
break;
case 'user_portal.php':
//$url = $this->router->generate('userportal');
$url = $this->router->generate('home').'/../../user_portal.php';
$url = $legacyIndex.'user_portal.php';
break;
case 'main/auth/courses.php':
$url = api_get_path(WEB_PUBLIC_PATH).$pageAfterLogin;
$url = $legacyIndex.'/'.$pageAfterLogin;
break;
}
}
@ -94,12 +96,10 @@ class LoginSuccessHandler implements AuthenticationSuccessHandlerInterface
Session::write('is_platformAdmin', (bool) \UserManager::is_admin($userId));
Session::write('is_allowedCreateCourse', (bool) ($userInfo['status'] == 1));
//$url = $this->router->generate('userportal');
// Redirecting to a course or a session.
if (api_get_setting('course.go_to_course_after_login') == 'true') {
// Get the courses list
$personal_course_list = \UserManager::get_personal_session_course_list($userId);
$my_session_list = [];
$count_of_courses_no_sessions = 0;
$count_of_courses_with_sessions = 0;
@ -136,10 +136,6 @@ class LoginSuccessHandler implements AuthenticationSuccessHandlerInterface
// Redirect the user to where they were before the login process begun.
if (empty($response)) {
$url = $request->headers->get('referer');
/*// if the referer is the login use the home.
if (strpos($url, 'login') !== false) {
$url = $this->router->generate('home');
}*/
$response = new RedirectResponse($url);
}

@ -133,7 +133,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('AddSession'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => ['name' => 'session/session_add.php'],
]
);
@ -161,7 +161,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('Inbox'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'messages/inbox.php',
],
@ -171,7 +171,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('Compose'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'messages/new_message.php',
],
@ -181,7 +181,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('PendingInvitations'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/invitations.php',
],
@ -191,7 +191,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('MyFiles'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/myfiles.php',
],
@ -201,7 +201,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('EditProfile'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'messages/inbox.php',
],
@ -211,7 +211,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('Inbox'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'messages/inbox.php',
],
@ -242,7 +242,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('Home'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/home.php',
],
@ -252,7 +252,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('Messages'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'messages/inbox.php',
],
@ -262,7 +262,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('Invitations'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/invitations.php',
],
@ -272,7 +272,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('ViewMySharedProfile'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/profile.php',
],
@ -282,7 +282,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('Friends'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/friends.php',
],
@ -292,7 +292,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('SocialGroups'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/groups.php',
],
@ -302,7 +302,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('Search'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/search.php',
],
@ -312,7 +312,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('MyFiles'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/myfiles.php',
],
@ -347,7 +347,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('MyCertificates'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => ['name' => 'gradebook/my_certificates.php'],
]
);
@ -360,7 +360,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('Search'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => ['name' => 'gradebook/search.php'],
]
);
@ -370,7 +370,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('MySkills'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => ['name' => 'social/my_skills_report.php'],
]
);
@ -379,7 +379,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('ManageSkills'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => ['name' => 'admin/skills_wheel.php'],
]
);
@ -400,7 +400,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
*/
public function loginMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('main');
$menu = $factory->createItem('legacy_main');
$translator = $this->container->get('translator');
$settingManager = $this->container->get('chamilo.settings.manager');
@ -412,7 +412,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
'FOSUserBundle'
),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => ['name' => 'auth/inscription.php'],
["attributes" => ["id" => 'nav']],
]
@ -428,7 +428,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
),
[
//'route' => 'fos_user_resetting_request',
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => ['name' => 'auth/lostPassword.php'],
["attributes" => ["id" => 'nav']],
]
@ -447,7 +447,7 @@ class LeftMenuBuilder implements ContainerAwareInterface
public function helpMenu(FactoryInterface $factory, array $options)
{
$translator = $this->container->get('translator');
$menu = $factory->createItem('main');
$menu = $factory->createItem('legacy_main');
$menu->addChild(
$translator->trans('Forum'),
[

@ -75,7 +75,7 @@ class NavBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('MyCourses'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => '../user_portal.php',
],
@ -85,7 +85,7 @@ class NavBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('Calendar'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'calendar/agenda_js.php',
],
@ -95,7 +95,7 @@ class NavBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('Reporting'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'mySpace/index.php',
],
@ -105,7 +105,7 @@ class NavBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('Social'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'social/home.php',
],
@ -116,7 +116,7 @@ class NavBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('Dashboard'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'dashboard/index.php',
],
@ -125,7 +125,7 @@ class NavBuilder implements ContainerAwareInterface
$menu->addChild(
$translator->trans('Administration'),
[
'route' => 'main',
'route' => 'legacy_main',
'routeParameters' => [
'name' => 'admin/index.php',
],

@ -1,3 +1,14 @@
# Legacy routes
legacy_index:
path: ../
legacy_main:
path: ../main/{name}
defaults: {_controller: 'ChamiloCoreBundle:Legacy:classic'}
requirements:
name: .+
core_controller:
resource: '@ChamiloCoreBundle/Controller/IndexController.php'
type: annotation
@ -31,15 +42,6 @@ legacy_javascript:
type: annotation
prefix: /js
legacy_index:
path: ../
# Legacy routes
main:
path: ../main/{name}
defaults: {_controller: 'ChamiloCoreBundle:Legacy:classic'}
requirements:
name: .+
legacy_plugin:
path: /plugin/{name}

@ -146,11 +146,11 @@ services:
- {name: kernel.event_listener, event: kernel.request, method: onKernelRequest}
- {name: kernel.event_listener, event: kernel.controller, method: onKernelController, priority: 11}
chamilo_core.listener.legacy_login_listener:
class: Chamilo\CoreBundle\EventListener\LegacyLoginListener
arguments: ["@service_container", '@security.token_storage']
tags:
- {name: kernel.event_listener, event: kernel.request, method: onKernelRequest}
# chamilo_core.listener.legacy_login_listener:
# class: Chamilo\CoreBundle\EventListener\LegacyLoginListener
# arguments: ["@service_container", '@security.token_storage']
# tags:
# - {name: kernel.event_listener, event: kernel.request, method: onKernelRequest}
# Locale listener
chamilo_core.listener.locale:

@ -20,6 +20,7 @@ use Symfony\Component\HttpFoundation\Response;
class NavbarController extends Controller
{
/**
* @deprecated
* @param int $max
*
* @return Response
@ -42,6 +43,7 @@ class NavbarController extends Controller
}
/**
* @deprecated
* @param int $max
*
* @return Response
@ -64,6 +66,7 @@ class NavbarController extends Controller
}
/**
* @deprecated
* @param int $max
*
* @return Response
@ -85,6 +88,7 @@ class NavbarController extends Controller
}
/**
* @deprecated
* @return Response
*/
public function userAction()
@ -103,7 +107,7 @@ class NavbarController extends Controller
}
/**
* @return EventDispatcher
* @return object|\Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher
*/
protected function getDispatcher()
{

@ -9,6 +9,7 @@ use Symfony\Component\Security\Core\SecurityContext;
/**
* Class SecurityController.
*
* @package Chamilo\ThemeBundle\Controller
*/
class SecurityController extends Controller

@ -17,6 +17,9 @@ use Symfony\Component\HttpFoundation\Response;
*/
class SidebarController extends Controller
{
/**
* @return Response
*/
public function userPanelAction()
{
if (!$this->getDispatcher()->hasListeners(ThemeEvents::THEME_SIDEBAR_USER)) {
@ -99,7 +102,7 @@ class SidebarController extends Controller
}
/**
* @return object|\Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher|\Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher
* @return object|\Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher
*/
protected function getDispatcher()
{

@ -7,6 +7,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
/**
* Class WidgetController.
*
* @package Chamilo\ThemeBundle\Controller
*/
class WidgetController extends Controller

@ -63,6 +63,8 @@
<script src="{{ asset('build/chamilo.js') }}"></script>
<script src="{{ asset('libs/ckeditor/ckeditor.js') }}"></script>
<script src="{{ asset('libs/readmore-js/readmore.min.js') }}"></script>
<script src="{{ asset('libs/js-cookie/src/js.cookie.js') }}"></script>
{#<script src="{{ asset('assets/modernizr/modernizr.js') }}"></script>#}
{# Check chamilo_js key in assetic.yml #}
@ -73,7 +75,7 @@
{#<script src="{{ asset('bundles/ivoryckeditor/ckeditor.js') }}" type="text/javascript"></script>#}
<script src="{{ asset('bundles/fosjsrouting/js/router.js') }}"></script>
<script src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData"}) }}"></script>
{#<script src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData"}) }}"></script>#}
{% block chamilo_header_js %}
{% include '@ChamiloTheme/Layout/header.js.twig' %}
@ -89,11 +91,15 @@
{#{% endjavascripts %}#}
{% endblock %}
</head>
<body>
{#{{ url('legacy_index') }}#}
{#<br />#}
{#{{ url('main', { 'name' : 'messages/inbox.php' }) }}#}
{#{{ url('main', {'name': ' '}) }}#}
<noscript>{{ "NoJavascript" | trans }}</noscript>
{#{% if show_header == true %}#}
{% block chamilo_wrap %}
{% autoescape false %}
<div id="page-wrap">
@ -175,7 +181,40 @@
{% if app.user is not null and is_granted('IS_AUTHENTICATED_FULLY') %}
<div class="navbar-custom-menu">
<ul class="nav navbar-nav navbar-right">
{{ render(controller('ChamiloThemeBundle:Navbar:user')) }}
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<img class="img-circle" src="{{ asset(app.user.avatarOrAnonymous(32)) }}"
alt="{{ app.user.completeName }}" />
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li class="user-header">
<div class="text-center">
<img class="img-circle" src="{{ asset(app.user.avatarOrAnonymous(64)) }}" alt="{{ app.user.completeName }}" />
<p class="name">
<a href="{{ url('legacy_main', { 'name' : 'social/home.php' })}}">
{{ app.user.completeName }}
</a>
</p>
<p><i class="fa fa-envelope-o" aria-hidden="true"></i> {{ app.user.email }}</p>
</div>
</li>
<li role="separator" class="divider"></li>
<li class="user-body">
<a title="{{ "Inbox"|trans }}" href="{{ url('legacy_main', { 'name' : 'messages/inbox.php' }) }}">
<em class="fa fa-envelope" aria-hidden="true"></em> {{ "Inbox"|get_lang }}
</a>
<a title="{{ "MyCertificates"|trans }}" href="{{ url('legacy_main', { 'name' : 'gradebook/my_certificates.php' }) }}">
<em class="fa fa-graduation-cap" aria-hidden="true"></em> {{ "MyCertificates"|get_lang }}
</a>
<a id="logout_button" title="{{ "Logout"|trans }}" href="{{ path('legacy_main', { 'name' : '../public/logout'}) }}" >
<em class="fa fa-sign-out"></em> {{ "Logout"|trans }}
</a>
</li>
</ul>
</li>
</ul>
</div>
{% endif %}
@ -250,7 +289,6 @@
</div> {# end top_main_content #}
</div> {# End page-wrap div #}
{% block chamilo_footer %}
{% include '@ChamiloTheme/Layout/footer.html.twig' %}
{% endblock %}

@ -133,7 +133,7 @@ $(document).ready(function() {
// Removes the yellow input in Chrome
if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) {
$(window).load(function(){
$(window).on('load', function() {
$('input:-webkit-autofill').each(function(){
var text = $(this).val();
var name = $(this).attr('name');

@ -2,6 +2,7 @@
{% block page_content %}
{% autoescape false %}
{% if js is defined %}
{% for item in js %}
{{ item }}
@ -13,6 +14,7 @@
{{ plugin_main_top }}
</div>
{% endif %}
{% if plugin_content_top %}
<div id="plugin_content_top" class="col-md-12">
{{ plugin_content_top }}
@ -26,38 +28,38 @@
{% endif %}
<section id="content-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-12">
{% autoescape false %}
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-12">
{% autoescape false %}
{# Breadcrumb #}
{% block chamilo_breadcrumb %}
{% include '@ChamiloCore/breadcrumb.html.twig' %}
{% endblock %}
{# Breadcrumb #}
{% block chamilo_breadcrumb %}
{% include '@ChamiloCore/breadcrumb.html.twig' %}
{% endblock %}
{% if actions != '' %}
<div class="actions">
{{ actions }}
</div>
{% endif %}
{% if actions != '' %}
<div class="actions">
{{ actions }}
</div>
{% endif %}
{% block chamilo_messages %}
{% autoescape false %}
{% include '@ChamiloTheme/FlashMessage/render.html.twig' %}
{% endautoescape %}
{% endblock %}
{% block chamilo_messages %}
{% autoescape false %}
{% include '@ChamiloTheme/FlashMessage/render.html.twig' %}
{% endautoescape %}
{% endblock %}
{# Content #}
{% block content %}
<section id="main_content">
{{ content }}
</section>
{% endblock %}
{% endautoescape %}
{# Content #}
{% block content %}
<section id="main_content">
{{ content }}
</section>
{% endblock %}
{% endautoescape %}
</div>
</div>
</div>
</div>
</section>
{% if plugin_content_bottom %}

@ -12,7 +12,7 @@
<div class="text-center">
<img class="img-circle" src="{{ asset(user.avatarOrAnonymous(64)) }}" alt="{{ user.completeName }}" />
<p class="name">
<a href="{{ url('main', { 'name' : 'social/home.php' })}}">
<a href="{{ url('legacy_main', { 'name' : 'social/home.php' })}}">
{{ user.completeName }}
</a>
</p>
@ -21,13 +21,16 @@
</li>
<li role="separator" class="divider"></li>
<li class="user-body">
<a title="{{ "Inbox"|trans }}" href="{{ url('main', { 'name' : 'messages/inbox.php' }) }}">
{{ url('home') }}
<a title="{{ "Inbox"|trans }}" href="{{ url('legacy_main', { 'name' : 'messages/inbox.php' }) }}">
<em class="fa fa-envelope" aria-hidden="true"></em> {{ "Inbox"|get_lang }}
</a>
<a title="{{ "MyCertificates"|trans }}" href="{{ url('main', { 'name' : 'gradebook/my_certificates.php' }) }}">
<a title="{{ "MyCertificates"|trans }}" href="{{ url('legacy_main', { 'name' : 'gradebook/my_certificates.php' }) }}">
<em class="fa fa-graduation-cap" aria-hidden="true"></em> {{ "MyCertificates"|get_lang }}
</a>
<a id="logout_button" title="{{ "Logout"|trans }}" href="{{ path('logout') }}" >
<a id="logout_button" title="{{ "Logout"|trans }}" href="{{ path('legacy_main', { 'name' : '../public/logout'}) }}" >
<em class="fa fa-sign-out"></em> {{ "Logout"|trans }}
</a>
</li>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save