From 2c6833e41e745371502c57b910f419693c93bd06 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Mon, 29 Jan 2018 09:50:43 +0100 Subject: [PATCH] WIP - Update tpls with new structure #2328 --- main/inc/lib/template.lib.php | 29 +- main/template/default/layout/footer.tpl | 2 + main/template/default/layout/head.tpl | 2 + .../default/layout/layout_1_col.html.twig | 49 ++++ .../default/layout/layout_2_col.html.twig | 266 ++++++++++++++++++ main/template/default/layout/login_form.tpl | 4 +- main/template/default/layout/menu.tpl | 20 +- main/template/default/layout/page.tpl | 4 +- main/template/default/layout/page_body.tpl | 2 + main/template/default/layout/page_footer.tpl | 4 +- main/template/default/layout/page_header.tpl | 2 + 11 files changed, 364 insertions(+), 20 deletions(-) create mode 100644 main/template/default/layout/layout_1_col.html.twig create mode 100644 main/template/default/layout/layout_2_col.html.twig diff --git a/main/inc/lib/template.lib.php b/main/inc/lib/template.lib.php index 479392c3f1..b04b04f771 100755 --- a/main/inc/lib/template.lib.php +++ b/main/inc/lib/template.lib.php @@ -352,8 +352,11 @@ class Template * */ public function display_one_col_template() { - $tpl = $this->get_template('layout/layout_1_col.tpl'); - $this->display($tpl); + $tpl = $this->get_template('layout/layout_1_col.html.twig'); + echo \Chamilo\CoreBundle\Framework\Container::getTemplating()->render($tpl, $this->params); + + /*$tpl = $this->get_template('layout/layout_1_col.tpl'); + $this->display($tpl);*/ } /** @@ -361,8 +364,10 @@ class Template **/ public function display_two_col_template() { - $tpl = $this->get_template('layout/layout_2_col.tpl'); - $this->display($tpl); + $tpl = $this->get_template('layout/layout_2_col.html.twig'); + echo \Chamilo\CoreBundle\Framework\Container::getTemplating()->render($tpl, $this->params); + + //$this->display($tpl); } /** @@ -868,10 +873,9 @@ class Template //$js_file_to_string .= ''."\n"; } - $js_file_to_string .= ''."\n"; $js_file_to_string .= ''."\n"; - $js_file_to_string .= ''."\n"; + $js_file_to_string .= ''."\n"; foreach ($js_files as $file) { //$js_file_to_string .= api_get_js($file); @@ -1063,7 +1067,7 @@ class Template if (api_get_setting('show_link_ticket_notification') == 'true' && $this->user_is_logged_in) { // by default is project_id = 1 $iconTicket = Display::return_icon( - 'bug.png', + 'help.png', get_lang('Ticket'), [], ICON_SIZE_LARGE @@ -1074,7 +1078,7 @@ class Template $courseParams = api_get_cidreq(); } $url = api_get_path(WEB_CODE_PATH).'ticket/tickets.php?project_id=1&'.$courseParams; - $rightFloatMenu .= '
+ $rightFloatMenu .= '
'.$iconTicket.' @@ -1170,6 +1174,15 @@ class Template 'X-Powered-By: '.$_configuration['software_name'].' '.substr($_configuration['system_version'], 0, 1) ); self::addHTTPSecurityHeaders(); + + $responseCode = $this->getResponseCode(); + if (!empty($responseCode)) { + switch ($responseCode) { + case '404': + header("HTTP/1.0 404 Not Found"); + break; + } + } } $socialMeta = ''; diff --git a/main/template/default/layout/footer.tpl b/main/template/default/layout/footer.tpl index d23628397d..64ebb198fb 100755 --- a/main/template/default/layout/footer.tpl +++ b/main/template/default/layout/footer.tpl @@ -1,3 +1,4 @@ +{% autoescape false %}