Browse Source

fix toolbar teacher scorm lp_view refs - CT#7870

aragonc 9 years ago
parent
commit
2b4ff11cf9

+ 0 - 7
app/Resources/public/css/base.css

@@ -3372,15 +3372,8 @@ a.forum_group_link {
 
 /* actions */
 .actions_lp {
-    background:#F8F8F8;
-    margin: 0px;
-    padding:9px 0px 9px 0px;
     width:100%;
     text-align: center;
-
-}
-.actions_lp .btn-group {
-    margin-left: 25px;
 }
 .actions_lp img {
     vertical-align:middle;

+ 33 - 20
main/newscorm/learnpath.class.php

@@ -2402,7 +2402,7 @@ class learnpath
     {
         $text = $percentage . $text_add;
         $output = '<div class="progress">
-                        <div id="progress_bar_value" class="progress-bar" role="progressbar" aria-valuenow="' .$percentage. '" aria-valuemin="0" aria-valuemax="100" style="width: '.$text.';">
+                        <div id="progress_bar_value" class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="' .$percentage. '" aria-valuemin="0" aria-valuemax="100" style="width: '.$text.';">
                         '. $text .'
                         </div>
                     </div>';
@@ -3115,25 +3115,9 @@ class learnpath
         }
         //$html = '<div id="scorm_title" class="scorm-heading">'.Security::remove_XSS($this->get_name()) . '</div>';
         $html = '<div class="scorm-body">';
-        $hide_teacher_icons_lp = api_get_configuration_value('hide_teacher_icons_lp');
-
-        if ($is_allowed_to_edit && $hide_teacher_icons_lp == false) {
-            $gradebook = '';
-            if (!empty($_GET['gradebook'])) {
-                $gradebook = Security:: remove_XSS($_GET['gradebook']);
-            }
-            if ($this->get_lp_session_id() == api_get_session_id()) {
-                $html .= '<div id="actions_lp" class="actions_lp">';
-                $html .= '<div class="btn-group">';
-                $html .= "<a class='btn btn-default' href='lp_controller.php?" . api_get_cidreq()."&gradebook=$gradebook&action=build&lp_id=" . $this->lp_id . "' target='_parent'>" . get_lang('Overview') . "</a>";
-                $html .= "<a class='btn btn-default' href='lp_controller.php?" . api_get_cidreq()."&action=add_item&type=step&lp_id=" . $this->lp_id . "' target='_parent'>" . get_lang('Edit') . "</a>";
-                $html .= '<a class="btn btn-default" href="lp_controller.php?'.api_get_cidreq()."&gradebook=$gradebook&action=edit&lp_id=" . $this->lp_id.'">'.get_lang('Settings').'</a>';
-                $html .= '</div>';
-                $html .= '</div>';
-            }
-        }
+        
 
-        $html .= '<div id="inner_lp_toc" class="inner_lp_toc">';
+        $html .= '<div id="inner_lp_toc" class="inner_lp_toc scrollbar-light">';
         require_once 'resourcelinker.inc.php';
 
         // Temporary variables.
@@ -3228,7 +3212,36 @@ class learnpath
         $html .= "</div>";
         return $html;
     }
-
+    
+     /**
+     * Returns an HTML-formatted string ready to display with teacher buttons
+     * in LP view menu
+     * @return	string	HTML TOC ready to display
+     */
+    public function get_teacher_toc_buttons()
+    {   
+        $is_allowed_to_edit = api_is_allowed_to_edit(null, true, false, false);
+        $hide_teacher_icons_lp = api_get_configuration_value('hide_teacher_icons_lp');
+        $html = '';
+        
+        if ($is_allowed_to_edit && $hide_teacher_icons_lp == false) {
+            $gradebook = '';
+            if (!empty($_GET['gradebook'])) {
+                $gradebook = Security:: remove_XSS($_GET['gradebook']);
+            }
+            if ($this->get_lp_session_id() == api_get_session_id()) {
+                $html .= '<div id="actions_lp" class="actions_lp">';
+                $html .= '<div class="btn-group">';
+                $html .= "<a class='btn btn-default' href='lp_controller.php?" . api_get_cidreq()."&gradebook=$gradebook&action=build&lp_id=" . $this->lp_id . "' target='_parent'>" . Display::returnFontAswesomeIcon('street-view') . get_lang('Overview') . "</a>";
+                $html .= "<a class='btn btn-default' href='lp_controller.php?" . api_get_cidreq()."&action=add_item&type=step&lp_id=" . $this->lp_id . "' target='_parent'>" . Display::returnFontAswesomeIcon('pencil') . get_lang('Edit') . "</a>";
+                $html .= '<a class="btn btn-default" href="lp_controller.php?'.api_get_cidreq()."&gradebook=$gradebook&action=edit&lp_id=" . $this->lp_id.'">' . Display::returnFontAswesomeIcon('cog') . get_lang('Settings').'</a>';
+                $html .= '</div>';
+                $html .= '</div>';
+            }
+        }
+        return $html;
+        
+    }
     /**
      * Gets the learnpath maker name - generally the editor's name
      * @return	string	Learnpath maker name

+ 4 - 0
main/newscorm/lp_view.php

@@ -140,6 +140,8 @@ if ($debug) {
 }
 
 $get_toc_list = $_SESSION['oLP']->get_toc();
+$get_teacher_buttons = $_SESSION['oLP']->get_teacher_toc_buttons();
+
 $type_quiz = false;
 foreach ($get_toc_list as $toc) {
     if ($toc['id'] == $lp_item_id && $toc['type'] == 'quiz') {
@@ -483,6 +485,8 @@ $template->assign('progress_bar', $progress_bar);
 $template->assign('show_audio_player', $show_audioplayer);
 $template->assign('media_player', $mediaplayer);
 $template->assign('toc_list', $get_toc_list);
+$template->assign('teacher_toc_buttons', $get_teacher_buttons);
+
 $template->assign('iframe_src', $src);
 $template->assign('navigation_bar_bottom', $navigation_bar_bottom);
 

+ 10 - 6
main/template/default/learnpath/view.tpl

@@ -42,7 +42,7 @@
                         </div>        
                     </div>
                 </div>
-                    
+                {{ teacher_toc_buttons }}    
                 {% else %}
                     <div id="scorm-info" class="panel panel-default">
                         <div class="panel-heading">
@@ -84,6 +84,7 @@
                                     {{ media_player }}
                                 </div>
                             {% endif %}
+                            {{ teacher_toc_buttons }}
                        </div>
                     </div>
                 {% endif %}
@@ -119,6 +120,7 @@
 
 <script>
     // Resize right and left pane to full height (HUB 20-05-2010).
+    
     var updateContentHeight = function () {
         document.body.style.overflow = 'hidden';
         var IE = window.navigator.appName.match(/microsoft/i);
@@ -130,20 +132,22 @@
         var heightScormInfo = $('#scorm-info').height();
 
         var heightTop = heightScormInfo + 100;
-
+        
+        jQuery('.scrollbar-light').scrollbar();
+        
         //heightTop = (heightTop > 300)? heightTop : 300;
 
         var innerHeight = $(window).height();
 
         if (innerHeight <= 640) {
-            $('#inner_lp_toc').css('height', innerHeight - heightTop + "px");
+            $('.scrollbar-light').css('height', innerHeight - heightTop + "px");
             $('#content_id').css('height', innerHeight - heightControl + "px");
         } else {
-            $('#inner_lp_toc').css('height', innerHeight - heightBreadcrumb - heightTop + "px");
+            $('.scrollbar-light').css('height', innerHeight - heightBreadcrumb - heightTop + "px");
             $('#content_id').css('height', innerHeight - heightControl + "px");
         }
-
-        //var innerHeight = (IE) ? document.body.clientHeight : window.innerHeight ;
+        
+              //var innerHeight = (IE) ? document.body.clientHeight : window.innerHeight ;
 
         // Loads the glossary library.
         {% if glossary_extra_tools in glossary_tool_availables %}