window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; "; } if ((!$is_allowed_to_edit) || ($isStudentView)) { error_log('New LP - User not authorized in lp_add_item.php'); header('location:lp_controller.php?action=view&lp_id='.$learnpath_id); exit; } /* SHOWING THE ADMIN TOOLS */ if (isset($_SESSION['gradebook'])) { $gradebook = $_SESSION['gradebook']; } if (!empty($gradebook) && $gradebook == 'view') { $interbreadcrumb[] = array ( 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('ToolGradebook') ); } $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' => $_SESSION['oLP']->get_name()); 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&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep')); break; default: $interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewStep')); break; } if ($action == 'add_item' && $type == 'document' ) { $interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewDocumentCreated')); } // Theme calls. $show_learn_path = true; $lp_item_id = isset($_GET['id']) ? intval($_GET['id']) : null; if (empty($lp_item_id)) { api_not_allowed(); } Display::display_header(null, 'Path'); $suredel = trim(get_lang('AreYouSureToDelete')); /* DISPLAY SECTION */ echo $_SESSION['oLP']->build_action_menu(); echo '
'; echo '
'; echo $_SESSION['oLP']->return_new_tree(null, true); // Show the template list. echo '
'; echo '
'; $form = new FormValidator('add_audio', 'post', api_get_self().'?action=add_audio&id='.$lp_item_id, null, array('enctype' => 'multipart/form-data')); $form->addElement('header', get_lang('UplUpload')); $form->addElement('file', 'file', get_lang('File')); $form->addElement('hidden', 'id', $lp_item_id); $lp_item = new learnpathItem($lp_item_id); if (isset($lp_item->audio) && !empty($lp_item->audio)) { $form->addElement('checkbox', 'delete_file', null, get_lang('RemoveAudio')); $player = ''; $player .= '
'; $form->addElement('label', get_lang('Preview'), $player); } $form->addElement('button', 'submit', get_lang('Edit')); $course_info = api_get_course_info(); $document_tree = DocumentManager::get_document_preview($course_info, null, null, 0, false, '/audio', 'lp_controller.php?action=add_audio&id='.$lp_item_id); $form->display(); echo ''.get_lang('SelectAnAudioFileFromDocuments').''; echo $document_tree; echo '
'; echo '
'; /* FOOTER */ Display::display_footer();