if ($debug > 0) { error_log('New LP - add audio action triggered', 0); } if (!$lp_found) { //check if the learnpath ID was defined, otherwise send back to list if ($debug > 0) { error_log('New LP - No learnpath given for add audio', 0); } require 'lp_list.php'; } else { $_SESSION['refresh'] = 1; if (isset($_REQUEST['id'])) { $lp_item_obj = new learnpathItem($_REQUEST['id']); //Remove audio if (isset($_POST['delete_file']) && $_POST['delete_file'] == 1) { $lp_item_obj->remove_audio(); } //Upload audio if (isset($_FILES['file']) && !empty($_FILES['file'])) { //Updating the lp.modified_on $_SESSION['oLP']->set_modified_on(); $lp_item_obj->add_audio(); } //Add audio file from documents if (isset($_REQUEST['document_id']) && !empty($_REQUEST['document_id'])) { $_SESSION['oLP']->set_modified_on(); $lp_item_obj->add_audio_from_documents($_REQUEST['document_id']); } // Display. require 'lp_add_audio.php'; } else {