Browse Source

Adding $_configuration['hide_teacher_icons_lp'] see #5593

Julio Montoya 12 years ago
parent
commit
f13358bd20
1 changed files with 13 additions and 28 deletions
  1. 13 28
      main/newscorm/learnpath.class.php

+ 13 - 28
main/newscorm/learnpath.class.php

@@ -2714,48 +2714,33 @@ class learnpath {
      * Uses the table generated by get_toc() and returns an HTML-formatted string ready to display
      * @return	string	HTML TOC ready to display
      */
-    public function get_html_toc($toc_list = null) {
-        $course_id      = api_get_course_int_id();
-        $course_code    = api_get_course_id();
-        //$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
-
-        $charset = api_get_system_encoding();
-        //$display_action_links_with_icons = false;
-
+    public function get_html_toc($toc_list = null) {  
+        global $_configuration;
+        $is_allowed_to_edit = api_is_allowed_to_edit(null, true, false, false);
+        
         if ($this->debug > 0) {
             error_log('New LP - In learnpath::get_html_toc()', 0);
         }
         if (empty($toc_list)) {
             $toc_list = $this->get_toc();
-        }
-        //echo $this->current;
-        //$parent = $this->items[$this->current]->get_parent();
-        //if (empty($parent)) { $parent = $this->ordered_items[$this->items[$this->current]->get_previous_index()]; }
+        }        
         $html = '<div id="scorm_title" class="scorm_title">' . Security::remove_XSS($this->get_name()) . '</div>';
         
-        /*
-        if ($is_allowed_to_edit) {
+        $hide_teacher_icons_lp = isset($_configuration['hide_teacher_icons_lp']) ? $_configuration['hide_teacher_icons_lp'] : false;
+        
+        
+        if ($is_allowed_to_edit && $hide_teacher_icons_lp == false) {
             $gradebook = Security :: remove_XSS($_GET['gradebook']);
             if ($this->get_lp_session_id() == api_get_session_id()) {
-                $html .= '<div id="actions_lp" class="actions_lp">';
-                if ($display_action_links_with_icons) {
-                    $html .= '<div class = "btn-group">';
-                    $html .= "<a href='lp_controller.php?" . api_get_cidreq() . "&amp;action=build&amp;lp_id=" . $this->lp_id . "' target='_parent'>" . Display :: return_icon('build_learnpath.png', get_lang('Build'),'',ICON_SIZE_MEDIUM)."</a>";
-                    //$html .= "<a href='lp_controller.php?" . api_get_cidreq() . "&amp;action=admin_view&amp;lp_id=" . $this->lp_id . "' target='_parent'>" . Display :: return_icon('move_learnpath.png', get_lang('BasicOverview'),'',ICON_SIZE_MEDIUM)."</a>";
-                    //$html .= '<span>' . Display :: return_icon('view_remove_na.png', get_lang('Display'),'',ICON_SIZE_MEDIUM).'</span><br />';
-                    $html .= '<a href="lp_controller.php?' . api_get_cidreq() . '">'. get_lang('ReturnToLPList') . '</a>';
-                    $html .= '</div>';
-                } else {
+                $html .= '<div id="actions_lp" class="actions_lp">';                
                     $html .= '<div class="btn-group">';
                     $html .= "<a class='btn' href='lp_controller.php?" . api_get_cidreq()."&amp;gradebook=$gradebook&amp;action=build&amp;lp_id=" . $this->lp_id . "' target='_parent'>" . get_lang('Overview') . "</a>";
-                    $html .= "<a class='btn' href='lp_controller.php?" . api_get_cidreq()."&amp;action=add_item&amp;type=step&amp;lp_id=" . $this->lp_id . "' target='_parent'>" . get_lang('Edit') . "</a>";
-                    //$html .= '<span><b>' . get_lang('Display') . '</b></span><br />';
+                    $html .= "<a class='btn' href='lp_controller.php?" . api_get_cidreq()."&amp;action=add_item&amp;type=step&amp;lp_id=" . $this->lp_id . "' target='_parent'>" . get_lang('Edit') . "</a>";                    
                     $html .= '<a class="btn" href="lp_controller.php?'.api_get_cidreq()."&amp;gradebook=$gradebook&amp;action=edit&amp;lp_id=" . $this->lp_id.'">'.get_lang('Settings').'</a>';
-                    $html .= '</div>';
-                }
+                    $html .= '</div>';                
                 $html .= '</div>';
             }
-        }*/
+        }
         $html .= '<div id="inner_lp_toc" class="inner_lp_toc">';
         require_once 'resourcelinker.inc.php';