Browse Source

tpl block notice_block and help_block - refs BT#11338

Alex Aragón 7 years ago
parent
commit
1c1e68bba1
2 changed files with 42 additions and 23 deletions
  1. 2 21
      main/inc/lib/userportal.lib.php
  2. 40 2
      main/template/default/layout/layout_2_col.tpl

+ 2 - 21
main/inc/lib/userportal.lib.php

@@ -328,7 +328,6 @@ class IndexManager
     public function return_notice()
     {
         $user_selected_language = api_get_interface_language();
-        $html = '';
         // Notice
         $home_notice = @(string) file_get_contents($this->home.'home_notice_'.$user_selected_language.'.html');
         if (empty($home_notice)) {
@@ -336,17 +335,9 @@ class IndexManager
         }
         if (!empty($home_notice)) {
             $home_notice = api_to_system_encoding($home_notice, api_detect_encoding(strip_tags($home_notice)));
-            $html = self::show_right_block(
-                get_lang('Notice'),
-                $home_notice,
-                'notice_block',
-                null,
-                'notices',
-                'noticesCollapse'
-            );
         }
 
-        return $html;
+        return $home_notice;
     }
 
     /**
@@ -366,17 +357,7 @@ class IndexManager
         $html = '';
         $home_menu = @(string) file_get_contents($this->home.'home_menu_'.$user_selected_language.'.html');
         if (!empty($home_menu)) {
-            $home_menu_content = '<ul class="nav nav-pills nav-stacked">';
-            $home_menu_content .= api_to_system_encoding($home_menu, api_detect_encoding(strip_tags($home_menu)));
-            $home_menu_content .= '</ul>';
-            $html .= self::show_right_block(
-                get_lang('MenuGeneral'),
-                $home_menu_content,
-                'help_block',
-                null,
-                'helps',
-                'helpsCollapse'
-            );
+            $html = api_to_system_encoding($home_menu, api_detect_encoding(strip_tags($home_menu)));
         }
 
         return $html;

+ 40 - 2
main/template/default/layout/layout_2_col.tpl

@@ -214,8 +214,46 @@
 
                 {{ teacher_block }}
                 {{ certificates_search_block }}
-                {{ notice_block }}
-                {{ help_block }}
+
+                {% if notice_block %}
+                <div class="panel-group" id="notice" role="tablist" aria-multiselectable="true">
+                    <div class="panel panel-default" id="notice_block">
+                        <div class="panel-heading" role="tab">
+                            <h4 class="panel-title">
+                                <a role="button" data-toggle="collapse" data-parent="#notice" href="#noticeCollapse" aria-expanded="true" aria-controls="noticeCollapse">
+                                    {{ 'Notice' | get_lang }}
+                                </a>
+                            </h4>
+                        </div>
+                        <div style="" aria-expanded="true" id="noticeCollapse" class="panel-collapse collapse in" role="tabpanel">
+                            <div class="panel-body">
+                                {{ notice_block }}
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                {% endif %}
+
+                {% if help_block %}
+                <div class="panel-group" id="help" role="tablist" aria-multiselectable="true">
+                    <div class="panel panel-default" id="help_block">
+                        <div class="panel-heading" role="tab">
+                            <h4 class="panel-title">
+                                <a role="button" data-toggle="collapse" data-parent="#help" href="#helpCollapse" aria-expanded="true" aria-controls="helpCollapse">
+                                    {{ 'MenuGeneral' | get_lang }}
+                                </a>
+                            </h4>
+                        </div>
+                        <div style="" aria-expanded="true" id="helpCollapse" class="panel-collapse collapse in" role="tabpanel">
+                            <div class="panel-body">
+                                <ul class="nav nav-pills nav-stacked">
+                                {{ help_block }}
+                                </ul>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                {% endif %}
 
                 <!-- block navigation -->
                 {% if navigation_course_links %}