예제 #1
0
    api_not_allowed();
}
Display::display_header(null, 'Path');
$suredel = trim(get_lang('AreYouSureToDelete'));
/* DISPLAY SECTION */
echo $_SESSION['oLP']->build_action_menu();
echo '<div class="row" style="overflow:hidden">';
echo '<div id="lp_sidebar" class="col-md-4">';
echo $_SESSION['oLP']->return_new_tree(null, true);
// Show the template list.
echo '</div>';
echo '<div id="doc_form" class="col-md-8">';
$lp_item = new learnpathItem($lp_item_id);
$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('html', $lp_item->get_title());
$form->addElement('file', 'file', get_lang('AudioFile'), 'style="width: 250px"');
$form->addElement('hidden', 'id', $lp_item_id);
if (isset($lp_item->audio) && !empty($lp_item->audio)) {
    $form->addElement('checkbox', 'delete_file', null, get_lang('RemoveAudio'));
    $player = '<script type="text/javascript" src="../inc/lib/mediaplayer/swfobject.js"></script>';
    $player .= '<div id="preview"></div><script type="text/javascript">
                    var s1 = new SWFObject("../inc/lib/mediaplayer/player.swf","ply","250","20","9","#FFFFFF");
                    s1.addParam("allowscriptaccess","always");
                    s1.addParam("flashvars","file=../../courses/' . $_course['path'] . '/document/audio/' . $lp_item->audio . '");
                    s1.write("preview");
                </script>';
    $form->addElement('label', get_lang('Preview'), $player);
}
$form->addElement('button', 'submit', get_lang('Edit'));
$course_info = api_get_course_info();
예제 #2
0
        $urlFile = api_get_path(WEB_COURSE_PATH) . $courseInfo['path'] . '/document' . $lpPathInfo['dir'] . $lp_item->audio . '?' . api_get_cidreq();
    }
}
$page = $_SESSION['oLP']->build_action_menu(true);
$page .= '<div class="row" style="overflow:hidden">';
$page .= '<div id="lp_sidebar" class="col-md-4">';
$page .= $_SESSION['oLP']->return_new_tree(null, true);
// Show the template list.
$page .= '</div>';
$recordVoiceForm = Display::page_subheader(get_lang('RecordYourVoice'));
$page .= '<div id="doc_form" class="col-md-8">';
$tpl = new Template(null);
$tpl->assign('unique_file_id', api_get_unique_id());
$tpl->assign('course_code', api_get_course_id());
$tpl->assign('php_session_id', session_id());
$tpl->assign('filename', $lp_item->get_title() . '_nano.wav');
$tpl->assign('enable_nanogong', api_get_setting('enable_nanogong') == 'true' ? 1 : 0);
$tpl->assign('enable_wami', api_get_setting('enable_wami_record') == 'true' ? 1 : 0);
$tpl->assign('cur_dir_path', '/audio');
$tpl->assign('lp_item_id', $lp_item_id);
$tpl->assign('lp_dir', api_remove_trailing_slash($lpPathInfo['dir']));
$recordVoiceForm .= $tpl->fetch('default/learnpath/record_voice.tpl');
$form->addElement('header', get_lang('Or'));
$form->addElement('header', get_lang('AudioFile'));
$form->addElement('html', sprintf(get_lang('AudioFileForItemX'), $lp_item->get_title()));
if (!empty($file)) {
    $audioPlayer = '<div id="preview">' . Display::getMediaPlayer($file, array('url' => $urlFile)) . "</div>";
    $form->addElement('label', get_lang('Listen'), $audioPlayer);
    $url = api_get_path(WEB_CODE_PATH) . 'newscorm/lp_controller.php?lp_id=' . $_SESSION['oLP']->get_id() . '&action=add_audio&id=' . $lp_item_id . '&delete_file=1&' . api_get_cidreq();
    $form->addElement('label', null, Display::url(get_lang('RemoveAudio'), $url, array('class' => 'btn btn-danger')));
} else {
예제 #3
0
        $file = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document' . $lpPathInfo['dir'] . $lp_item->audio;
        $urlFile = api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/document' . $lpPathInfo['dir'] . $lp_item->audio;
    }
}
$page = $_SESSION['oLP']->build_action_menu(true);
$page .= '<div class="row" style="overflow:hidden">';
$page .= '<div id="lp_sidebar" class="col-md-4">';
$page .= $_SESSION['oLP']->return_new_tree(null, true);
// Show the template list.
$page .= '</div>';
$page .= '<div id="doc_form" class="col-md-8">';
$form->addElement('header', get_lang('RecordYourVoice'));
$tpl->assign('unique_file_id', api_get_unique_id());
$tpl->assign('course_code', api_get_course_id());
$tpl->assign('php_session_id', session_id());
$tpl->assign('filename', $lp_item->get_title() . '_nano.wav');
$tpl->assign('enable_nanogong', api_get_setting('enable_nanogong') == 'true' ? 1 : 0);
$tpl->assign('enable_wami', api_get_setting('enable_wami_record') == 'true' ? 1 : 0);
//$tpl->assign('cur_dir_path', api_remove_trailing_slash($lpPathInfo['dir']));
$tpl->assign('cur_dir_path', '/audio');
$tpl->assign('lp_item_id', $lp_item_id);
$tpl->assign('lp_dir', api_remove_trailing_slash($lpPathInfo['dir']));
$voiceContent = $tpl->fetch('default/learnpath/record_voice.tpl');
$form->addElement('html', $voiceContent);
$form->addElement('header', get_lang('UplUpload'));
$form->addElement('html', $lp_item->get_title());
$form->addElement('file', 'file', get_lang('AudioFile'), 'style="width: 250px"');
if (!empty($file)) {
    $url = api_get_path(WEB_CODE_PATH) . 'newscorm/lp_controller.php?lp_id=' . $_SESSION['oLP']->get_id() . '&action=add_audio&id=' . $lp_item_id . '&delete_file=1&' . api_get_cidreq();
    $form->addElement('label', null, Display::url(get_lang('RemoveAudio'), $url, array('class' => 'btn btn-danger')));
}