From 7cebf9ed193a400b6e5f73b9ba0e116f41e86847 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 17 Jul 2015 11:32:50 +0200 Subject: [PATCH] Fix inscription page. --- main/auth/inscription.php | 14 ++++++-------- main/template/default/auth/inscription.tpl | 6 +++++- main/template/default/layout/blank.tpl | 4 +++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/main/auth/inscription.php b/main/auth/inscription.php index bd02b47ce0..6512c9909f 100755 --- a/main/auth/inscription.php +++ b/main/auth/inscription.php @@ -743,13 +743,16 @@ if ($form->validate()) { $tpl->assign('inscription_content', $content); $tpl->assign('text_after_registration', $text_after_registration); + $tpl->assign('hide_header', $hideHeaders); $inscription = $tpl->get_template('auth/inscription.tpl'); $tpl->display($inscription); } } else { // Custom pages if (CustomPages::enabled()) { - CustomPages::display(CustomPages::REGISTRATION, array('form' => $form)); + CustomPages::display( + CustomPages::REGISTRATION, array('form' => $form) + ); } else { if (!api_is_anonymous()) { @@ -775,17 +778,12 @@ if ($form->validate()) { CourseManager::redirectToCourse([]); } - if ($hideHeaders) { - $showHeader = false; - } else { - $showHeader = true; - } - - $tpl = new Template($tool_name, $showHeader, $showHeader); + $tpl = new Template($tool_name); $tpl->assign('inscription_header', Display::page_header($tool_name)); $tpl->assign('inscription_content', $content); $tpl->assign('form', $form->returnForm()); + $tpl->assign('hide_header', $hideHeaders); $inscription = $tpl->get_template('auth/inscription.tpl'); $tpl->display($inscription); diff --git a/main/template/default/auth/inscription.tpl b/main/template/default/auth/inscription.tpl index 9067d1a3c9..78dc6e31ee 100644 --- a/main/template/default/auth/inscription.tpl +++ b/main/template/default/auth/inscription.tpl @@ -1,4 +1,8 @@ -{% extends template ~ "/layout/layout_1_col.tpl" %} +{% + extends hide_header == true + ? template ~ "/layout/blank.tpl" + : template ~ "/layout/layout_1_col.tpl" +%} {% block content %} diff --git a/main/template/default/layout/blank.tpl b/main/template/default/layout/blank.tpl index e02a27c0d8..176c8a0640 100755 --- a/main/template/default/layout/blank.tpl +++ b/main/template/default/layout/blank.tpl @@ -1 +1,3 @@ -{{ content }} \ No newline at end of file +{% block content %} +{{ content }} +{% endblock %}