diff --git a/main/lp/lp_admin_view.php b/main/lp/lp_admin_view.php index fb63fe0134..cc2a252d2f 100755 --- a/main/lp/lp_admin_view.php +++ b/main/lp/lp_admin_view.php @@ -50,9 +50,12 @@ 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", + 'url' => 'lp_controller.php?action=list&'.api_get_cidreq(), + 'name' => get_lang('LearningPaths') +); +$interbreadcrumb[] = array( + 'url' => api_get_self()."?action=build&lp_id=$learnpath_id&".api_get_cidreq(), "name" => stripslashes("{$therow['name']}"), ); $interbreadcrumb[] = array( @@ -72,7 +75,6 @@ $lp_theme_css = $_SESSION['oLP']->get_theme(); // POST action handling (uploading mp3, deleting mp3) if (isset($_POST['save_audio'])) { - //Updating the lp.modified_on $_SESSION['oLP']->set_modified_on(); @@ -93,7 +95,9 @@ if (isset($_POST['save_audio'])) { // Uploading the audio files. foreach ($_FILES as $key => $value) { - if (substr($key, 0, 7) == 'mp3file' && !empty($_FILES[$key]['tmp_name'])) { + if (substr($key, 0, 7) == 'mp3file' && + !empty($_FILES[$key]['tmp_name']) + ) { // The id of the learning path item. $lp_item_id = str_ireplace('mp3file', '', $key); @@ -109,7 +113,6 @@ if (isset($_POST['save_audio'])) { $clean_name = api_replace_dangerous_char($file_name); // No "dangerous" files. $clean_name = disable_dangerous_file($clean_name); - $check_file_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/audio/'.$clean_name; // If the file exists we generate a new name. @@ -145,9 +148,10 @@ if (isset($_POST['save_audio'])) { // Store the mp3 file in the lp_item table. $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM); - $sql_insert_audio = "UPDATE $tbl_lp_item SET audio = '".Database::escape_string($file)."' - WHERE c_id = $course_id AND id = '".Database::escape_string($lp_item_id)."'"; - Database::query($sql_insert_audio); + $sql = "UPDATE $tbl_lp_item + SET audio = '".Database::escape_string($file)."' + WHERE c_id = $course_id AND id = '".Database::escape_string($lp_item_id)."'"; + Database::query($sql); } } //echo Display::return_message(get_lang('ItemUpdated'), 'confirm'); @@ -168,69 +172,65 @@ $(function() { - $("#lp_item_list").sortable({ - items: "li", - handle: ".moved", //only the class "moved" - cursor: "move", - placeholder: "ui-state-highlight" //defines the yellow highlight - }); - - $("#listSubmit").click(function () { - //Disable the submit button to prevent a double-click - $(this).attr("disabled","disabled"); - //Initialize the variable that will contain the data to submit to the form - newOrderData= ""; - //All direct descendants of the lp_item_list will have a parentId of 0 - var parentId= 0; - - //Walk through the direct descendants of the lp_item_list