Browse Source

fix in type vertical and horizontal in toolbars navigation - refs CT#8389

Alex Aragon 8 years ago
parent
commit
972743a031
1 changed files with 58 additions and 58 deletions
  1. 58 58
      main/inc/lib/course_home.lib.php

+ 58 - 58
main/inc/lib/course_home.lib.php

@@ -1177,67 +1177,67 @@ class CourseHome
         $item = null;
         $marginLeft = 160;
         
-            $html = '<div id="toolnav">';
-            $html .= '<ul id="toolnavbox">';
-            $count = 0;
-            foreach ($navigation_items as $key => $navigation_item) {
-                //students can't see the course settings option
-                $count++;
-                if (!api_is_allowed_to_edit() && $key == 'course_settings') {
-                    continue;
-                }
-                $html .= '<li>';
-                $url_item = parse_url($navigation_item['link']);
-                $url_current = parse_url($_SERVER['REQUEST_URI']);
-
-                if (api_get_setting('show_navigation_menu') == 'text') {
-                    $class = 'text';
-                    $marginLeft = 170;
-                    $item = $navigation_item['name'];
-                } else if (api_get_setting('show_navigation_menu') == 'icons') {
-                    $class = 'icons';
-                    $marginLeft = 25;
-                    $item = Display::return_icon(substr($navigation_item['image'],0,-3)."png", $navigation_item['name'], array('class'=>'tool-img'), ICON_SIZE_SMALL);
-                }else{
-                    $class = 'icons-text';
-                    $item = $navigation_item['name'] . Display::return_icon(substr($navigation_item['image'],0,-3)."png", $navigation_item['name'], array('class'=>'tool-img'), ICON_SIZE_SMALL);
-                }
-                
-                if (stristr($url_item['path'], $url_current['path'])) {
-                    if (!isset($_GET['learnpath_id']) || strpos($url_item['query'], 'learnpath_id='.intval($_GET['learnpath_id'])) === 0) {
-                        $idLearn = ' id="here"';
-                    }
-                }
-                
-                if (strpos($navigation_item['link'], 'chat') !== false &&
-                    api_get_course_setting('allow_open_chat_window', $course_id)
-                ) {
-                    $html .= '<a ' . $idLearn . ' class="btn btn-default text-left ' . $class . ' " href="javascript: void(0);" onclick="javascript: window.open(\''.$navigation_item['link'].'\',\'window_chat'.api_get_course_id().'\',config=\'height=\'+600+\', width=\'+825+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="'.$navigation_item['target'].'"';
-                    $html .= ' title="'.$navigation_item['name'].'">';
-                    $html .=  $item;
-                    $html .= '</a>';
-                } else {
-                    $html .= '<a ' . $idLearn . ' class="btn btn-default text-left ' . $class . '" href="'.$navigation_item['link'].'" target="_top" title="'.$navigation_item['name'].'">';
-                    $html .=  $item;
-                    $html .= '</a>';
+        $html = '<div id="toolnav">';
+        $html .= '<ul id="toolnavbox">';
+        $count = 0;
+        foreach ($navigation_items as $key => $navigation_item) {
+            //students can't see the course settings option
+            $count++;
+            if (!api_is_allowed_to_edit() && $key == 'course_settings') {
+                continue;
+            }
+            $html .= '<li>';
+            $url_item = parse_url($navigation_item['link']);
+            $url_current = parse_url($_SERVER['REQUEST_URI']);
+
+            if (api_get_setting('show_navigation_menu') == 'text') {
+                $class = 'text';
+                $marginLeft = 170;
+                $item = $navigation_item['name'];
+            } else if (api_get_setting('show_navigation_menu') == 'icons') {
+                $class = 'icons';
+                $marginLeft = 25;
+                $item = Display::return_icon(substr($navigation_item['image'],0,-3)."png", $navigation_item['name'], array('class'=>'tool-img'), ICON_SIZE_SMALL);
+            } else {
+                $class = 'icons-text';
+                $item = $navigation_item['name'] . Display::return_icon(substr($navigation_item['image'],0,-3)."png", $navigation_item['name'], array('class'=>'tool-img'), ICON_SIZE_SMALL);
+            }
+
+            if (stristr($url_item['path'], $url_current['path'])) {
+                if (!isset($_GET['learnpath_id']) || strpos($url_item['query'], 'learnpath_id='.intval($_GET['learnpath_id'])) === 0) {
+                    $idLearn = ' id="here"';
                 }
+            }
 
-                $html .= '</li>';
+            if (strpos($navigation_item['link'], 'chat') !== false &&
+                api_get_course_setting('allow_open_chat_window', $course_id)
+            ) {
+                $html .= '<a ' . $idLearn . ' class="btn btn-default text-left ' . $class . ' " href="javascript: void(0);" onclick="javascript: window.open(\''.$navigation_item['link'].'\',\'window_chat'.api_get_course_id().'\',config=\'height=\'+600+\', width=\'+825+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="'.$navigation_item['target'].'"';
+                $html .= ' title="'.$navigation_item['name'].'">';
+                $html .=  $item;
+                $html .= '</a>';
+            } else {
+                $html .= '<a ' . $idLearn . ' class="btn btn-default text-left ' . $class . '" href="'.$navigation_item['link'].'" target="_top" title="'.$navigation_item['name'].'">';
+                $html .=  $item;
+                $html .= '</a>';
             }
-            $html .= '</ul>';
-            $html .= '<script>$(function() {
-                    $("#toolnavbox a").stop().animate({"margin-left":"-'.$marginLeft.'px"},1000);
-                    $("#toolnavbox > li").hover(
-                        function () {
-                            $("a",$(this)).stop().animate({"margin-left":"-2px"},200);
-                            $("span",$(this)).css("display","block");
-                        },
-                        function () {
-                            $("a",$(this)).stop().animate({"margin-left":"-'.$marginLeft.'px"},200);
-                            $("span",$(this)).css("display","initial");
-                        }
-                    );
-                });</script>';
+
+            $html .= '</li>';
+        }
+        $html .= '</ul>';
+        $html .= '<script>$(function() {
+                $("#toolnavbox a").stop().animate({"margin-left":"-' . $marginLeft . 'px"},1000);
+                $("#toolnavbox > li").hover(
+                    function () {
+                        $("a",$(this)).stop().animate({"margin-left":"-2px"},200);
+                        $("span",$(this)).css("display","block");
+                    },
+                    function () {
+                        $("a",$(this)).stop().animate({"margin-left":"-' . $marginLeft . 'px"},200);
+                        $("span",$(this)).css("display","initial");
+                    }
+                );
+            });</script>';
         $html .= '</div>';
 
         return $html;