Browse Source

More fixes in the LP UI

Julio Montoya 12 years ago
parent
commit
5ddb6e944f

+ 161 - 6
main/newscorm/learnpath.class.php

@@ -4815,6 +4815,146 @@ class learnpath {
     }
     
     public function return_new_tree($update_audio = 'false') {
+        
+        $ajax_url = api_get_path(WEB_AJAX_PATH).'lp.ajax.php';        
+        echo '
+        <script>
+        var newOrderData= "";
+        function processChildren(parentId) {
+            //Loop through the children of the UL element defined by the parentId
+            var ulParentID= "UL_" + parentId;
+            $("#" + ulParentID).children().each(function () {
+
+                /*Only process elements with an id attribute (in order to skip the blank,
+                    unmovable <li> elements.*/
+
+                if ($(this).attr("id")) {
+                    /*Build a string of data with the childs ID and parent ID, 
+                        using the "|" as a delimiter between the two IDs and the "^" 
+                        as a record delimiter (these delimiters were chosen in case the data
+                        involved includes more common delimiters like commas within the content)
+                    */
+                    newOrderData= newOrderData + $(this).attr("id") + "|" + parentId + "^";
+
+                    //Determine if this child is a containter
+                    if ($(this).is(".container")) {
+                        //Process the child elements of the container
+                        processChildren($(this).attr("id"));
+                    }
+                }				
+            });  //end of children loop		
+        } //end of processChildren function	
+
+        $(function() {
+
+            $(".item_data").live("mouseover", function(event) {        
+                $(".button_actions", this).show();        
+            });
+
+            $(".item_data").live("mouseout", function() {
+                $(".button_actions",this).hide();
+            });
+
+            $(".button_actions").hide();
+
+            $( ".lp_resource" ).sortable({
+                items: ".lp_resource_element ",        
+                handle: ".moved", //only the class "moved"
+                cursor: "move",
+                connectWith: "#lp_item_list",
+                placeholder: "ui-state-highlight", //defines the yellow highlight        
+
+                start: function(event, ui) {        
+                    $(ui.item).css("width", "160px");            
+                    $(ui.item).find(".item_data").attr("style", "");
+
+                },
+                stop: function(event, ui) {        
+                    $(ui.item).css("width", "100%");
+                },
+            });
+
+            $("#lp_item_list").sortable({
+                items: "li",
+                handle: ".moved", //only the class "moved" 
+                cursor: "move",
+                placeholder: "ui-state-highlight", //defines the yellow highlight             
+
+                update: function(event, ui) {
+
+                    //Walk through the direct descendants of the lp_item_list <ul>
+                    $("#lp_item_list").children().each(function () {
+
+                        /*Only process elements with an id attribute (in order to skip the blank,
+                        unmovable <li> elements.*/
+
+                        if ($(this).attr("id")) {
+                                /*Build a string of data with the child s ID and parent ID, 
+                                using the "|" as a delimiter between the two IDs and the "^" 
+                                as a record delimiter (these delimiters were chosen in case the data
+                                involved includes more common delimiters like commas within the content)
+                                */
+                                newOrderData= newOrderData + $(this).attr("id") + "|" + "0" + "^";
+
+                                //Determine if this child is a containter
+                                if ($(this).is(".li_container")) {
+                                    //Process the child elements of the container
+                                    processChildren($(this).attr("id"));
+                                }
+                            }
+                    }); //end of lp_item_list children loop
+
+                    var order = "new_order="+ newOrderData + "&a=update_lp_item_order";
+                    $.post("'.$ajax_url.'", order, function(reponse){
+                        $("#message").html(reponse);
+                    });            
+                },
+                receive: function(event, ui) {
+
+                    var id = $(ui.item).attr("data_id");            
+                    var type = $(ui.item).attr("data_type");
+                    var title = $(ui.item).attr("title");
+
+                    if (ui.item.parent()[0]) {
+                        var parent_id = $(ui.item.parent()[0]).attr("id");
+                        var previous_id = $(ui.item.prev()).attr("id");
+
+                        if (parent_id) {
+                            parent_id = parent_id.split("_")[1];                    
+                            var params = {
+                                    "a": "add_lp_item",
+                                    "id": id,
+                                    "parent_id": parent_id,
+                                    "previous_id": previous_id,
+                                    "type": type,
+                                    "title" : title
+                                };
+                            $.ajax({
+                                type: "GET",
+                                url: "'.$ajax_url.'",
+                                data: params,                        
+                                async: false, 
+                                success: function(data) {
+                                    if (data == -1) {                                
+                                    } else {
+
+                                        $(".normal-message").hide();
+                                        $(ui.item).attr("id", data);
+                                        $(ui.item).addClass("lp_resource_element_new");                                
+                                        $(ui.item).find(".item_data").attr("style", "");
+                                        $(ui.item).addClass("record li_container");
+                                        $(ui.item).removeClass("lp_resource_element");
+                                        $(ui.item).removeClass("doc_resource");                                
+                                    }                            
+                                }
+                            });
+                        }
+                    }//            
+                }//end receive
+            });      
+        });
+        </script>';
+        
         $is_allowed_to_edit = api_is_allowed_to_edit(null,true);
         
         $course_id = api_get_course_int_id();
@@ -4824,7 +4964,7 @@ class learnpath {
                 WHERE c_id = $course_id AND lp_id = ".$this->lp_id;
 
         $result = Database::query($sql);
-        $arrLP = array ();
+        $arrLP = array();
         while ($row = Database :: fetch_array($result)) {
             $row['title'] = Security :: remove_XSS($row['title']);
             $row['description'] = Security :: remove_XSS($row['description']);
@@ -4925,10 +5065,21 @@ class learnpath {
 
                 $delete_icon .= ' <a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;action=delete_item&amp;id=' . $arrLP[$i]['id'] . '&amp;lp_id=' . $this->lp_id . '" onClick="return confirmation(\'' . addslashes($title) . '\');">';
                 $delete_icon .= Display::return_icon('delete.png', get_lang('_delete_learnpath_module'), array(), ICON_SIZE_TINY);
-                $delete_icon .= '</a>';
+                $delete_icon .= '</a>';                
+         
+                $url = api_get_self() . '?cidReq='.Security::remove_XSS($_GET['cidReq']).'&view=build&id='.$arrLP[$i]['id'] .'&lp_id='.$this->lp_id;
+      
+                if ($arrLP[$i]['item_type'] != 'dokeos_chapter' && $arrLP[$i]['item_type'] != 'chapter') {
+                    $prerequisities_icon = Display::url(Display::return_icon('accept.png', get_lang('Prerequisites'), array(), ICON_SIZE_TINY), $url.'&action=edit_item_prereq');
+                }
+                
+                //if ($arrLP[$i]['item_type'] != 'dokeos_chapter' && $arrLP[$i]['item_type'] != 'chapter') {
+                    $moves_icon = Display::url(Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_TINY), $url.'&action=move_item');
+                //}
+                
             }
             if ($update_audio != 'true') {
-            	$row = $move_icon.' '.$icon.Display::span($title_cut).Display::span($audio.$edit_icon.$delete_icon, array('class'=>'button_actions'));
+            	$row = $move_icon.' '.$icon.Display::span($title_cut).Display::span($audio.$edit_icon.$prerequisities_icon.$moves_icon.$delete_icon, array('class'=>'button_actions'));
             } else {
             	$row = Display::span($title.$icon).Display::span($audio, array('class'=>'button_actions'));            	
             }           
@@ -4984,9 +5135,11 @@ class learnpath {
             	}
             }            
         }    
+        if ($update_audio == 'false') {
+            $return = '<div class="lp_tree well">';
+        }
         
-        $return = '<ul id="lp_item_list">';
-        
+        $return .= '<ul id="lp_item_list">';        
         $return .='<h4>'.$this->name.'</h4><br>';
         
         $tree = self::print_recursive($elements, $default_data, $default_content);
@@ -4999,7 +5152,9 @@ class learnpath {
         $return .= '</ul>';
         if ($update_audio == 'true') {
             $return = $return_audio;
-        }        
+        } else {
+            $return .= '</div>';
+        }
         return $return;
     }
     

+ 3 - 143
main/newscorm/lp_add_item.php

@@ -24,147 +24,8 @@ include 'resourcelinker.inc.php';
 
 $language_file = 'learnpath';
 
-$ajax_url = api_get_path(WEB_AJAX_PATH).'lp.ajax.php';
 $htmlHeadXtra[] = '
 <script>
-
-var newOrderData= "";
-
-function processChildren(parentId) {
-    //Loop through the children of the UL element defined by the parentId
-    var ulParentID= "UL_" + parentId;
-    $("#" + ulParentID).children().each(function () {
-
-        /*Only process elements with an id attribute (in order to skip the blank,
-            unmovable <li> elements.*/
-
-        if ($(this).attr("id")) {
-            /*Build a string of data with the childs ID and parent ID, 
-                using the "|" as a delimiter between the two IDs and the "^" 
-                as a record delimiter (these delimiters were chosen in case the data
-                involved includes more common delimiters like commas within the content)
-            */
-            newOrderData= newOrderData + $(this).attr("id") + "|" + parentId + "^";
-
-            //Determine if this child is a containter
-            if ($(this).is(".container")) {
-                //Process the child elements of the container
-                processChildren($(this).attr("id"));
-            }
-        }				
-    });  //end of children loop		
-} //end of processChildren function	
-   
-$(function() {
-
-    $(".item_data").live("mouseover", function(event) {        
-        $(".button_actions", this).show();        
-    });
-
-    $(".item_data").live("mouseout", function() {
-        $(".button_actions",this).hide();
-    });
-
-    $(".button_actions").hide();
-
-    $( ".lp_resource" ).sortable({
-        items: ".lp_resource_element ",        
-        handle: ".moved", //only the class "moved"
-        cursor: "move",
-        connectWith: "#lp_item_list",
-        placeholder: "ui-state-highlight", //defines the yellow highlight        
-            
-        start: function(event, ui) {        
-            $(ui.item).css("width", "160px");            
-            $(ui.item).find(".item_data").attr("style", "");
-            
-        },
-        stop: function(event, ui) {        
-            $(ui.item).css("width", "100%");
-        },
-    });
-    
-    $("#lp_item_list").sortable({
-		items: "li",
-		handle: ".moved", //only the class "moved" 
-		cursor: "move",
-		placeholder: "ui-state-highlight", //defines the yellow highlight             
-    
-        update: function(event, ui) {
-        
-            //Walk through the direct descendants of the lp_item_list <ul>
-            $("#lp_item_list").children().each(function () {
-			
-                /*Only process elements with an id attribute (in order to skip the blank,
-                unmovable <li> elements.*/
-
-                if ($(this).attr("id")) {
-                        /*Build a string of data with the child s ID and parent ID, 
-                        using the "|" as a delimiter between the two IDs and the "^" 
-                        as a record delimiter (these delimiters were chosen in case the data
-                        involved includes more common delimiters like commas within the content)
-                        */
-                        newOrderData= newOrderData + $(this).attr("id") + "|" + "0" + "^";
-
-                        //Determine if this child is a containter
-                        if ($(this).is(".li_container")) {
-                            //Process the child elements of the container
-                            processChildren($(this).attr("id"));
-                        }
-                    }
-            }); //end of lp_item_list children loop
-            
-            var order = "new_order="+ newOrderData + "&a=update_lp_item_order";
-            $.post("'.$ajax_url.'", order, function(reponse){
-                $("#message").html(reponse);
-            });            
-        },
-        receive: function(event, ui) {
-        
-            var id = $(ui.item).attr("data_id");            
-            var type = $(ui.item).attr("data_type");
-            var title = $(ui.item).attr("title");
-
-            if (ui.item.parent()[0]) {
-                var parent_id = $(ui.item.parent()[0]).attr("id");
-                var previous_id = $(ui.item.prev()).attr("id");
-                    
-                if (parent_id) {
-                    parent_id = parent_id.split("_")[1];                    
-                    var params = {
-                            "a": "add_lp_item",
-                            "id": id,
-                            "parent_id": parent_id,
-                            "previous_id": previous_id,
-                            "type": type,
-                            "title" : title
-                        };
-                     $.ajax({
-                        type: "GET",
-                        url: "'.$ajax_url.'",
-                        data: params,                        
-                        async: false, 
-                        success: function(data) {
-                            if (data == -1) {                                
-                            } else {
-                            
-                                $(".normal-message").hide();
-                                $(ui.item).attr("id", data);
-                                $(ui.item).addClass("lp_resource_element_new");                                
-                                $(ui.item).find(".item_data").attr("style", "");
-                                $(ui.item).addClass("record li_container");
-                                $(ui.item).removeClass("lp_resource_element");
-                                $(ui.item).removeClass("doc_resource");                                
-                            }                            
-                        }
-                    });
-                }
-            }//            
-        }//end receive
-	});      
-});
-
-
 var temp    = false;
 var load_default_template = '. ((isset($_POST['submit']) || empty($_SERVER['QUERY_STRING'])) ? 'false' : 'true' ) .';
 
@@ -309,10 +170,11 @@ $interbreadcrumb[] = array('url' => api_get_self()."?action=build&lp_id=$learnpa
 
 switch ($type) {
     case 'chapter':
+        $interbreadcrumb[]= array ('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep'));
         $interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewChapter'));
         break;
     case 'document':
-        $interbreadcrumb[]= array ('url' => 'lp_controller.php?action=add_item&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep'));
+        $interbreadcrumb[]= array ('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep'));
         break;
     default:
         $interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewStep'));
@@ -383,10 +245,8 @@ echo $_SESSION['oLP']->build_action_menu();
 echo '<div class="row-fluid" style="overflow:hidden">';
 echo '<div id="lp_sidebar" class="span4">';
 
-echo '<div class="lp_tree well">';
-// Build the tree with the menu items in it
 echo $_SESSION['oLP']->return_new_tree(); //echo $_SESSION['oLP']->build_tree();
-echo '</div>';    
+
 
 // Show the template list.
 if ($type == 'document' && !isset($_GET['file'])) {    

+ 2 - 0
main/newscorm/lp_admin_view.php

@@ -81,6 +81,8 @@ if (!empty($gradebook) && $gradebook == 'view') {
 
 $interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths'));
 $interbreadcrumb[] = array('url' => api_get_self()."?action=build&lp_id=$learnpath_id", "name" => stripslashes("{$therow['name']}"));
+$interbreadcrumb[] = array('url' => api_get_self()."?action=add_item&type=step&lp_id=$learnpath_id", 'name' => get_lang('NewStep'));
+
 if (isset($_REQUEST['updateaudio'])) {
     $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('UpdateAllAudioFragments'));
 } else {

+ 8 - 32
main/newscorm/lp_controller.php

@@ -337,8 +337,7 @@ switch ($action) {
                 exit;
             }
         }
-    break;
-
+        break;
     case 'build':
         if (!$is_allowed_to_edit) {
             api_not_allowed(true);  
@@ -351,29 +350,6 @@ switch ($action) {
             require 'lp_build.php';
         }
         break;
-
-    case 'delete_item':
-        if (!$is_allowed_to_edit) {
-            api_not_allowed(true);
-        }
-        if ($debug > 0) error_log('New LP - delete item action triggered', 0);
-        if (!$lp_found) { error_log('New LP - No learnpath given for delete item', 0); require 'lp_list.php'; }
-        else {
-            $_SESSION['refresh'] = 1;
-            if (is_numeric($_GET['id'])) {
-                $_SESSION['oLP']->delete_item($_GET['id']);
-                $is_success = true;
-            }
-            require 'lp_add_item.php';
-            /*
-            if (isset($_GET['view']) && $_GET['view'] == 'build') {
-                
-            } else {
-                require 'lp_admin_view.php';
-            }*/
-        }
-        break;
-
     case 'edit_item':
         if (!$is_allowed_to_edit) {
             api_not_allowed(true);
@@ -700,23 +676,23 @@ switch ($action) {
             }
         }
         break;
-
     case 'deleteitem':
-    case 'delete_item':
+    case 'delete_item':        
         if (!$is_allowed_to_edit) {
             api_not_allowed(true);
         }
         if ($debug > 0) error_log('New LP - delete item action triggered', 0);
         if (!$lp_found) { error_log('New LP - No learnpath given for delete item', 0); require 'lp_list.php'; }
-        else {
-            $_SESSION['refresh'] = 1;
+        else {            
+            //$_SESSION['refresh'] = 1;
             if (!empty($_REQUEST['id'])) {
                 $_SESSION['oLP']->delete_item($_REQUEST['id']);
-            }
-            require 'lp_admin_view.php';
+            }            
+            $url = api_get_self().'?action=add_item&type=step&lp_id='.intval($_REQUEST['lp_id']);                        
+            header('Location: '.$url);
+            exit;
         }
         break;
-
     case 'edititemprereq':
     case 'edit_item_prereq':
         if (!$is_allowed_to_edit) {

+ 1 - 0
main/newscorm/lp_edit.php

@@ -30,6 +30,7 @@ if (!empty($gradebook) && $gradebook == 'view') {
 }
 $interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths'));
 $interbreadcrumb[] = array('url' => api_get_self()."?action=build&lp_id=".$_SESSION['oLP']->get_id(), 'name' => $_SESSION['oLP']->get_name());
+//$interbreadcrumb[] = array('url' => api_get_self()."?action=add_item&type=step&lp_id=$learnpath_id", 'name' => get_lang('NewStep'));
 
 $htmlHeadXtra[] = '<script type="text/javascript">        
 function activate_start_date() {

+ 5 - 14
main/newscorm/lp_edit_item.php

@@ -55,8 +55,6 @@ $};'.$_SESSION['oLP']->get_js_dropdown_array().'</script>';
 $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
 
 $tbl_lp = Database::get_course_table(TABLE_LP_MAIN);
-$tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
-$tbl_lp_view = Database::get_course_table(TABLE_LP_VIEW);
 
 $isStudentView  = (int) $_REQUEST['isStudentView'];
 $learnpath_id   = (int) $_REQUEST['lp_id'];
@@ -98,13 +96,13 @@ if (!empty($gradebook) && $gradebook == 'view') {
 }
 $interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths'));
 $interbreadcrumb[] = array('url' => api_get_self()."?action=build&lp_id=$learnpath_id", 'name' => stripslashes("{$therow['name']}"));
-$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit'));
+$interbreadcrumb[] = array('url' => api_get_self()."?action=add_item&type=step&lp_id=$learnpath_id", 'name' => get_lang('NewStep'));
 
 // Theme calls.
 $show_learn_path = true;
 $lp_theme_css = $_SESSION['oLP']->get_theme();
 
-Display::display_header(null,'Path');
+Display::display_header(get_lang('Edit'),'Path');
 $suredel = trim(get_lang('AreYouSureToDelete'));
 
 ?>
@@ -146,21 +144,14 @@ $path_file = Database::result($res_doc, 0, 0);
 $path_parts = pathinfo($path_file);
 
 if (Database::num_rows($res_doc) > 0 && $path_parts['extension'] == 'html') {
-    $count_items = count($_SESSION['oLP']->ordered_items);
-    $style = ($count_items > 12) ? ' style="height:250px;width:230px;overflow-x : auto; overflow : scroll;" ' : ' class="lp_tree" ';
-    echo '<div '.$style.'>';
-    // Build the tree with the menu items in it.
-    echo $_SESSION['oLP']->build_tree();
-    echo '</div>';
+    echo $_SESSION['oLP']->return_new_tree();
+    
     // Show the template list
     echo '<p style="border-bottom:1px solid #999999; margin:0; padding:2px;"></p>';
     echo '<br />';
     echo '<div id="frmModel" style="display:block; height:890px;width:100px; position:relative;"></div>';
 } else {
-    echo '<div class="lp_tree" style="height:90%" >';
-    // Build the tree with the menu items in it.
-    echo $_SESSION['oLP']->build_tree();
-    echo '</div>';
+    echo $_SESSION['oLP']->return_new_tree();    
 }
         
 echo '</div>';

+ 3 - 10
main/newscorm/lp_edit_item_prereq.php

@@ -67,16 +67,15 @@ if (!empty($gradebook) && $gradebook == 'view') {
 
 $interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths'));
 $interbreadcrumb[] = array('url' => api_get_self()."?action=build&lp_id=$learnpath_id", 'name' => stripslashes("{$therow['name']}"));
+$interbreadcrumb[] = array('url' => api_get_self()."?action=add_item&type=step&lp_id=$learnpath_id", 'name' => get_lang('NewStep'));
 
 // Theme calls.
 $show_learn_path = true;
 $lp_theme_css = $_SESSION['oLP']->get_theme();
 
-Display::display_header(null,'Path');
-//api_display_tool_title($therow['name']);
+Display::display_header(get_lang('Prerequisites'),'Path');
 
 $suredel = trim(get_lang('AreYouSureToDelete'));
-//$suredelstep = trim(get_lang('AreYouSureToDeleteSteps'));
 ?>
 <script type='text/javascript'>
 /* <![CDATA[ */
@@ -110,13 +109,7 @@ echo $_SESSION['oLP']->build_action_menu();
 
 echo '<div class="row-fluid">';
 echo '<div class="span3">';
-
-
-echo '<div class="lp_tree">';
-    // Build the tree with the menu items in it.
-    echo $_SESSION['oLP']->build_tree();
-echo '</div>';
-
+    echo $_SESSION['oLP']->return_new_tree();
 echo '</div>';
 echo '<div class="span9">';
 

+ 3 - 6
main/newscorm/lp_move_item.php

@@ -117,12 +117,13 @@ if (!empty($gradebook) && $gradebook == 'view') {
 
 $interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths'));
 $interbreadcrumb[] = array('url' => api_get_self()."?action=build&lp_id=$learnpath_id", 'name' => stripslashes("{$therow['name']}"));
+$interbreadcrumb[] = array('url' => api_get_self()."?action=add_item&type=step&lp_id=$learnpath_id", 'name' => get_lang('NewStep'));
 
 // Theme calls
 $show_learn_path = true;
 $lp_theme_css = $_SESSION['oLP']->get_theme();
 
-Display::display_header(null, 'Path');
+Display::display_header(get_lang('Move'), 'Path');
 //api_display_tool_title($therow['name']);
 
 $suredel = trim(get_lang('AreYouSureToDelete'));
@@ -160,11 +161,7 @@ echo $_SESSION['oLP']->build_action_menu();
 
 echo '<div class="row-fluid">';
 echo '<div class="span3">';
-
-    echo '<div class="lp_tree">';
-        // Build the tree with the menu items in it.
-        echo $_SESSION['oLP']->build_tree();
-    echo '</div>';
+    echo $_SESSION['oLP']->return_new_tree();
 echo '</div>';
 
 echo '<div class="span9">';

+ 3 - 6
main/newscorm/lp_view_item.php

@@ -108,7 +108,7 @@ if (!empty($gradebook) && $gradebook == 'view') {
 
 $interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths'));
 $interbreadcrumb[] = array('url' => api_get_self()."?action=build&lp_id=$learnpath_id", 'name' => $therow['name']);
-$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Item'));
+$interbreadcrumb[] = array('url' => api_get_self()."?action=add_item&type=step&lp_id=$learnpath_id", 'name' => get_lang('NewStep'));
 
 // Theme calls
 $show_learn_path = true;
@@ -116,7 +116,7 @@ if (isset($_SESSION['oLP']) && is_object($_SESSION['oLP'])) {
 	$lp_theme_css = $_SESSION['oLP']->get_theme();
 }
 
-Display::display_header(null,'Path');
+Display::display_header(get_lang('Item'),'Path');
 //api_display_tool_title($therow['name']);
 
 $suredel = trim(get_lang('AreYouSureToDelete'));
@@ -145,10 +145,7 @@ if (is_object($_SESSION['oLP'])) {
 	echo $_SESSION['oLP']->build_action_menu();
     echo '<div class="row-fluid">';
     echo '<div class="span3">';
-        echo '<div class="lp_tree">';
-        // Build the tree with the menu items in it.
-        echo $_SESSION['oLP']->build_tree();
-        echo '</div>';
+    echo $_SESSION['oLP']->return_new_tree();
     echo '</div>';
     echo '<div class="span9">';
         echo $_SESSION['oLP']->display_item((isset($new_item_id)) ? $new_item_id : $_GET['id']);