Browse Source

Adding section-login in login pages see #8230

Julio Montoya 10 years ago
parent
commit
d64b865638

+ 2 - 1
main/inc/lib/main_api.lib.php

@@ -3127,7 +3127,7 @@ function api_not_allowed($print_headers = false, $message = null)
             $content .= "</div>";
         }
         $content .= '<hr/><p style="text-align:center"><a href="'.$home_url.'">'.get_lang('ReturnToCourseHomepage').'</a></p>';
-
+        $tpl->setLoginBodyClass();
         $tpl->assign('content', $content);
         $tpl->display_one_col_template();
         exit;
@@ -3146,6 +3146,7 @@ function api_not_allowed($print_headers = false, $message = null)
         // or we try to get directly to a private course without being logged
         if (!is_null(api_get_course_int_id())) {
             api_set_firstpage_parameter(api_get_course_id());
+            $tpl->setLoginBodyClass();
             $action = api_get_self().'?'.Security::remove_XSS($_SERVER['QUERY_STRING']);
             $action = str_replace('&amp;', '&', $action);
             $form = new FormValidator('formLogin', 'post', $action, null, array('class'=>'form-stacked'));

+ 9 - 0
main/inc/lib/template.lib.php

@@ -133,6 +133,7 @@ class Template
         $this->assign('style', $this->style);
         $this->assign('css_style', $this->theme);
         $this->assign('template', $this->style);
+        $this->assign('login_class', null);
 
         //Chamilo plugins
         if ($this->show_header) {
@@ -908,4 +909,12 @@ class Template
     {
         echo $this->twig->render($template, $this->params);
     }
+
+    /**
+     * Adds a body class for login pages
+     */
+    public function setLoginBodyClass()
+    {
+        $this->assign('login_class', 'section-login');
+    }
 }

+ 1 - 1
main/template/default/layout/main_header.tpl

@@ -6,7 +6,7 @@
 <head>
 {% include "default/layout/head.tpl" %}
 </head>
-<body dir="{{ text_direction }}" class="{{ section_name }}">
+<body dir="{{ text_direction }}" class="{{ section_name }} {{ login_class }}">
 <noscript>{{ "NoJavascript"|get_lang }}</noscript>
 
 {% if show_header == true %}