本文整理汇总了PHP中api_get_course_id函数的典型用法代码示例。如果您正苦于以下问题:PHP api_get_course_id函数的具体用法?PHP api_get_course_id怎么用?PHP api_get_course_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了api_get_course_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editAction
/**
* @Route("/edit/{tool}")
* @Method({"GET|POST"})
*
* @param string $tool
* @return Response
*/
public function editAction($tool)
{
$message = null;
// @todo use proper functions not api functions.
$courseId = api_get_course_int_id();
$sessionId = api_get_session_id();
$tool = \Database::escape_string($tool);
$TBL_INTRODUCTION = \Database::get_course_table(TABLE_TOOL_INTRO);
$url = $this->generateUrl('chamilo_course_introduction_introduction_edit', array('tool' => $tool, 'course' => api_get_course_id()));
$form = $this->getFormValidator($url, $tool);
if ($form->validate()) {
$values = $form->exportValues();
$content = $values['content'];
$sql = "REPLACE {$TBL_INTRODUCTION}\n SET c_id = {$courseId},\n id = '{$tool}',\n intro_text='" . \Database::escape_string($content) . "',\n session_id='" . intval($sessionId) . "'";
\Database::query($sql);
$message = \Display::return_message(get_lang('IntroductionTextUpdated'), 'confirmation', false);
} else {
$sql = "SELECT intro_text FROM {$TBL_INTRODUCTION}\n WHERE c_id = {$courseId} AND id='" . $tool . "' AND session_id = '" . intval($sessionId) . "'";
$result = \Database::query($sql);
$content = null;
if (\Database::num_rows($result) > 0) {
$row = \Database::fetch_array($result);
$content = $row['intro_text'];
}
$form->setDefaults(array('content' => $content));
}
/*$this->getTemplate()->assign('content', $form->return_form());
$this->getTemplate()->assign('message', $message);
$response = $this->getTemplate()->renderLayout('layout_1_col.tpl');*/
$response = null;
return $this->render('ChamiloCoreBundle:Legacy:index.html.twig', array('content' => $form->return_form(), 'message' => $message));
}
示例2: get_class_data
/**
* Get the classes to display on the current page.
*/
function get_class_data($from, $number_of_items, $column, $direction)
{
$class_table = Database::get_main_table(TABLE_MAIN_CLASS);
$course_class_table = Database::get_main_table(TABLE_MAIN_COURSE_CLASS);
$class_user_table = Database::get_main_table(TABLE_MAIN_CLASS_USER);
$courseCode = api_get_course_id();
$sql = "SELECT * FROM {$course_class_table} WHERE course_code = '" . $courseCode . "'";
$res = Database::query($sql);
$subscribed_classes = array();
while ($obj = Database::fetch_object($res)) {
$subscribed_classes[] = $obj->class_id;
}
$sql = "SELECT\n c.id AS col0,\n c.name AS col1,\n COUNT(cu.user_id) AS col2,\n c.id AS col3\n FROM {$class_table} c ";
$sql .= " LEFT JOIN {$class_user_table} cu ON cu.class_id = c.id";
$sql .= " WHERE 1 = 1";
if (isset($_GET['keyword'])) {
$keyword = Database::escape_string(trim($_GET['keyword']));
$sql .= " AND (c.name LIKE '%" . $keyword . "%')";
}
if (count($subscribed_classes) > 0) {
$sql .= " AND c.id NOT IN ('" . implode("','", $subscribed_classes) . "')";
}
$sql .= " GROUP BY c.id, c.name ";
$sql .= " ORDER BY col{$column} {$direction} ";
$sql .= " LIMIT {$from},{$number_of_items}";
$res = Database::query($sql);
$classes = array();
while ($class = Database::fetch_row($res)) {
$classes[] = $class;
}
return $classes;
}
示例3: __construct
/**
* Creates the mPDF object
* @param string $pageFormat format A4 A4-L see http://mpdf1.com/manual/index.php?tid=184&searchstring=format
* @param string $orientation orientation "P" = Portrait "L" = Landscape
* @param array $params
* @param Template $template
*/
public function __construct($pageFormat = 'A4', $orientation = 'P', $params = array(), $template = null)
{
$this->template = $template;
/* More info @ http://mpdf1.com/manual/index.php?tid=184&searchstring=mPDF
* mPDF ([ string $mode [, mixed $format [, float $default_font_size [, string $default_font [, float $margin_left , float $margin_right , float $margin_top , float $margin_bottom , float $margin_header , float $margin_footer [, string $orientation ]]]]]])
*/
if (!in_array($orientation, array('P', 'L'))) {
$orientation = 'P';
}
//$this->pdf = $pdf = new mPDF('UTF-8', $pageFormat, '', '', 30, 20, 27, 25, 16, 13, $orientation);
//left, right, top, bottom, margin_header, margin footer
$params['left'] = isset($params['left']) ? $params['left'] : 15;
$params['right'] = isset($params['right']) ? $params['right'] : 15;
$params['top'] = isset($params['top']) ? $params['top'] : 20;
$params['bottom'] = isset($params['bottom']) ? $params['bottom'] : 15;
$this->params['filename'] = isset($params['filename']) ? $params['filename'] : api_get_local_time();
$this->params['pdf_title'] = isset($params['pdf_title']) ? $params['pdf_title'] : get_lang('Untitled');
$this->params['course_info'] = isset($params['course_info']) ? $params['course_info'] : api_get_course_info();
$this->params['session_info'] = isset($params['session_info']) ? $params['session_info'] : api_get_session_info(api_get_session_id());
$this->params['course_code'] = isset($params['course_code']) ? $params['course_code'] : api_get_course_id();
$this->params['add_signatures'] = isset($params['add_signatures']) ? $params['add_signatures'] : false;
$this->params['show_real_course_teachers'] = isset($params['show_real_course_teachers']) ? $params['show_real_course_teachers'] : false;
$this->params['student_info'] = isset($params['student_info']) ? $params['student_info'] : false;
$this->params['show_grade_generated_date'] = isset($params['show_grade_generated_date']) ? $params['show_grade_generated_date'] : false;
$this->params['show_teacher_as_myself'] = isset($params['show_teacher_as_myself']) ? $params['show_teacher_as_myself'] : true;
$this->params['pdf_date'] = isset($params['pdf_date']) ? $params['pdf_date'] : api_format_date(api_get_local_time(), DATE_TIME_FORMAT_LONG);
$this->pdf = new mPDF('UTF-8', $pageFormat, '', '', $params['left'], $params['right'], $params['top'], $params['bottom'], 8, 8, $orientation);
}
示例4: course_params
/**
* Returns the course parameters. If null default to the current user parameters.
*
* @param string $course_code
* @param string|int $session_id
* @param string|int $group_id
* @return type
*/
public static function course_params($course_code = null, $session_id = null, $group_id = null)
{
$course_code = is_null($course_code) ? api_get_course_id() : $course_code;
$session_id = is_null($session_id) ? api_get_session_id() : $session_id;
$session_id = $session_id ? $session_id : '0';
$group_id = is_null($group_id) ? '' : $group_id;
$group_id = $group_id ? $group_id : '0';
return array('cidReq' => $course_code, 'id_session' => $session_id, 'gidReq' => $group_id);
}
示例5: indexAction
/**
* @Route("/courses/{cidReq}/{sessionId}")
* @Method({"GET"})
*
* @param string $cidReq
* @param int $id_session
* @return Response
*/
public function indexAction($cidReq, $id_session = null)
{
$courseCode = api_get_course_id();
$sessionId = api_get_session_id();
$userId = $this->getUser()->getUserId();
$coursesAlreadyVisited = $this->getRequest()->getSession()->get('coursesAlreadyVisited');
$result = $this->autolaunch();
$showAutoLaunchLpWarning = $result['show_autolaunch_lp_warning'];
$showAutoLaunchExerciseWarning = $result['show_autolaunch_exercise_warning'];
if ($showAutoLaunchLpWarning) {
$this->getTemplate()->assign('lp_warning', Display::return_message(get_lang('TheLPAutoLaunchSettingIsONStudentsWillBeRedirectToAnSpecificLP'), 'warning'));
}
if ($showAutoLaunchExerciseWarning) {
$this->getTemplate()->assign('exercise_warning', Display::return_message(get_lang('TheExerciseAutoLaunchSettingIsONStudentsWillBeRedirectToAnSpecificExercise'), 'warning'));
}
if ($this->isCourseTeacher()) {
$editIcons = Display::url(Display::return_icon('edit.png'), $this->generateUrl('course_home.controller:iconListAction', array('course' => api_get_course_id())));
$this->getTemplate()->assign('edit_icons', $editIcons);
}
if (!isset($coursesAlreadyVisited[$courseCode])) {
event_access_course();
$coursesAlreadyVisited[$courseCode] = 1;
$this->getRequest()->getSession()->set('coursesAlreadyVisited', $coursesAlreadyVisited);
}
$this->getRequest()->getSession()->remove('toolgroup');
$this->getRequest()->getSession()->remove('_gid');
$isSpecialCourse = \CourseManager::is_special_course($courseCode);
if ($isSpecialCourse) {
$autoreg = $this->getRequest()->get('autoreg');
if ($autoreg == 1) {
\CourseManager::subscribe_user($userId, $courseCode, STUDENT);
}
}
$script = 'activity.php';
if (api_get_setting('homepage_view') == 'activity' || api_get_setting('homepage_view') == 'activity_big') {
$script = 'activity.php';
} elseif (api_get_setting('homepage_view') == '2column') {
$script = '2column.php';
} elseif (api_get_setting('homepage_view') == '3column') {
$script = '3column.php';
} elseif (api_get_setting('homepage_view') == 'vertical_activity') {
$script = 'vertical_activity.php';
}
$result = (require_once api_get_path(SYS_CODE_PATH) . 'course_home/' . $script);
$toolList = $result['tool_list'];
$this->getTemplate()->assign('icons', $result['content']);
$introduction = Display::return_introduction_section($this->get('url_generator'), TOOL_COURSE_HOMEPAGE, $toolList);
$this->getTemplate()->assign('introduction_text', $introduction);
if (api_get_setting('show_session_data') == 'true' && $sessionId) {
$sessionInfo = \CourseHome::show_session_data($sessionId);
$this->getTemplate()->assign('session_info', $sessionInfo);
}
$response = $this->get('template')->render_template($this->getTemplatePath() . 'index.tpl');
return new Response($response, 200, array());
}
示例6: classicAction
/**
* Handles default Chamilo scripts handled by Display::display_header() and display_footer()
*
* @param \Silex\Application $app
* @param string $file
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response|void
*/
public function classicAction(Application $app, $file)
{
$responseHeaders = array();
/** @var Request $request */
$request = $app['request'];
// get.
$_GET = $request->query->all();
// post.
$_POST = $request->request->all();
// echo $request->getMethod();
//$_REQUEST = $request->request->all();
$mainPath = $app['paths']['sys_root'] . 'main/';
$fileToLoad = $mainPath . $file;
if (is_file($fileToLoad) && \Security::check_abs_path($fileToLoad, $mainPath)) {
// Default values
$_course = api_get_course_info();
$_user = api_get_user_info();
$charset = 'UTF-8';
$debug = $app['debug'];
$text_dir = api_get_text_direction();
$is_platformAdmin = api_is_platform_admin();
$_cid = api_get_course_id();
// Loading file
ob_start();
require_once $mainPath . $file;
$out = ob_get_contents();
ob_end_clean();
// No browser cache when executing an exercise.
if ($file == 'exercice/exercise_submit.php') {
$responseHeaders = array('cache-control' => 'no-store, no-cache, must-revalidate');
}
// Setting page header/footer conditions (important for LPs)
$app['template']->setFooter($app['template.show_footer']);
$app['template']->setHeader($app['template.show_header']);
if (isset($htmlHeadXtra)) {
$app['template']->addJsFiles($htmlHeadXtra);
}
if (isset($interbreadcrumb)) {
$app['template']->setBreadcrumb($interbreadcrumb);
$app['template']->loadBreadcrumbToTemplate();
}
if (isset($tpl)) {
$response = $app['twig']->render($app['default_layout']);
} else {
$app['template']->assign('content', $out);
$response = $app['twig']->render($app['default_layout']);
}
} else {
return $app->abort(404, 'File not found');
}
return new Response($response, 200, $responseHeaders);
}
示例7: save_objectives
/**
* Writes an item's new values into the database and returns the operation result
* @param integer Learnpath ID
* @param integer User ID
* @param integer View ID
* @param integer Item ID
* @param array Objectives array
*/
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = array())
{
global $_configuration;
$debug = 0;
$return = '';
if ($debug > 0) {
error_log('In xajax_save_objectives(' . $lp_id . ',' . $user_id . ',' . $view_id . ',' . $item_id . ',"' . (count($objectives) > 0 ? count($objectives) : '') . '")', 0);
}
//$objResponse = new xajaxResponse();
require_once 'learnpath.class.php';
require_once 'scorm.class.php';
require_once 'aicc.class.php';
require_once 'learnpathItem.class.php';
require_once 'scormItem.class.php';
require_once 'aiccItem.class.php';
$mylp = '';
if (isset($_SESSION['lpobject'])) {
if ($debug > 1) {
error_log('$_SESSION[lpobject] is set', 0);
}
$oLP = unserialize($_SESSION['lpobject']);
if (!is_object($oLP)) {
if ($debug > 2) {
error_log(print_r($oLP, true), 0);
}
if ($debug > 2) {
error_log('Building new lp', 0);
}
unset($oLP);
$code = api_get_course_id();
$mylp = new learnpath($code, $lp_id, $user_id);
} else {
if ($debug > 2) {
error_log('Reusing session lp', 0);
}
$mylp = $oLP;
}
}
$mylpi =& $mylp->items[$item_id];
//error_log(__FILE__.' '.__LINE__.' '.print_r($objectives,true), 0);
if (is_array($objectives) && count($objectives) > 0) {
foreach ($objectives as $index => $objective) {
//error_log(__FILE__.' '.__LINE__.' '.$objectives[$index][0], 0);
$mylpi->add_objective($index, $objectives[$index]);
}
$mylpi->write_objectives_to_db();
}
//return $objResponse;
return $return;
}
示例8: indexAction
/**
* @Route("/", name="course_home")
* @Route("/index.php")
* @Method({"GET"})
*
* @param Request $request
* @return Response
*/
public function indexAction(Request $request)
{
$sessionId = api_get_session_id();
$course = $this->getCourse();
$courseCode = $course->getId();
$result = $this->autoLaunch();
$showAutoLaunchLpWarning = $result['show_autolaunch_lp_warning'];
$showAutoLaunchExerciseWarning = $result['show_autolaunch_exercise_warning'];
if ($showAutoLaunchLpWarning) {
$this->addFlash('warning', $this->trans('TheLPAutoLaunchSettingIsONStudentsWillBeRedirectToAnSpecificLP'));
}
if ($showAutoLaunchExerciseWarning) {
$this->addFlash('warning', $this->trans('TheExerciseAutoLaunchSettingIsONStudentsWillBeRedirectToAnSpecificExercise'));
}
if (true) {
$editIcons = Display::url(Display::return_icon('edit.png'), $this->generateUrl('chamilo_course_home_home_iconlist', array('course' => api_get_course_id())));
}
$isSpecialCourse = \CourseManager::isSpecialCourse($courseCode);
if ($isSpecialCourse) {
$user = $this->getUser();
if (!empty($user)) {
$userId = $this->getUser()->getId();
$autoreg = $request->get('autoreg');
if ($autoreg == 1) {
\CourseManager::subscribe_user($userId, $courseCode, STUDENT);
}
}
}
$homeView = api_get_setting('course.homepage_view');
if ($homeView == 'activity' || $homeView == 'activity_big') {
$result = $this->renderActivityView();
} elseif ($homeView == '2column') {
$result = $this->render2ColumnView();
} elseif ($homeView == '3column') {
$result = $this->render3ColumnView();
} elseif ($homeView == 'vertical_activity') {
$result = $this->renderVerticalActivityView();
}
$toolList = $result['tool_list'];
$introduction = Display::return_introduction_section(TOOL_COURSE_HOMEPAGE, $toolList);
$sessionInfo = null;
if (api_get_setting('session.show_session_data') == 'true' && $sessionId) {
$sessionInfo = CourseHome::show_session_data($sessionId);
}
return $this->render('ChamiloCourseBundle:Home:index.html.twig', array('course' => $course, 'session_info' => $sessionInfo, 'icons' => $result['content'], 'edit_icons' => $editIcons, 'introduction_text' => $introduction, 'exercise_warning' => null, 'lp_warning' => null));
}
示例9: save_objectives
/**
* Writes an item's new values into the database and returns the operation result
* @param integer Learnpath ID
* @param integer User ID
* @param integer View ID
* @param integer Item ID
* @param array Objectives array
*/
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = array())
{
$debug = 0;
$return = '';
if ($debug > 0) {
error_log('In xajax_save_objectives(' . $lp_id . ',' . $user_id . ',' . $view_id . ',' . $item_id . ',"' . (count($objectives) > 0 ? count($objectives) : '') . '")', 0);
}
$mylp = learnpath::getLpFromSession(api_get_course_id(), $lp_id, $user_id);
$mylpi =& $mylp->items[$item_id];
if (is_array($objectives) && count($objectives) > 0) {
foreach ($objectives as $index => $objective) {
$mylpi->add_objective($index, $objectives[$index]);
}
$mylpi->write_objectives_to_db();
}
return $return;
}
示例10: deleteAction
/**
* @Route("/delete/{tool}")
* @Method({"GET"})
*
* @param string $tool
* @return Response
*/
public function deleteAction($tool)
{
$request = $this->getRequest();
$courseId = $request->get('courseId');
$sessionId = $request->get('sessionId');
$criteria = array('sessionId' => $sessionId, 'id' => $tool, 'cId' => $courseId);
$toolIntro = $this->getRepository()->findOneBy($criteria);
if ($toolIntro) {
$this->getManager()->remove($toolIntro);
$this->getManager()->flush();
$this->get('session')->getFlashBag()->add('success', "IntroductionTextDeleted");
}
$url = $this->generateUrl('introduction.controller:editAction', array('tool' => $tool, 'course' => api_get_course_id()));
$form = $this->getForm($url, $tool);
$this->getTemplate()->assign('content', $form->return_form());
$response = $this->getTemplate()->renderLayout('layout_1_col.tpl');
return new Response($response, 200, array());
}
示例11: __construct
/**
* Creates the mPDF object
* @param string format A4 A4-L see http://mpdf1.com/manual/index.php?tid=184&searchstring=format
* @param string orientation "P" = Portrait "L" = Landscape
*/
public function __construct($page_format = 'A4', $orientation = 'P', $params = array())
{
/* More info @ http://mpdf1.com/manual/index.php?tid=184&searchstring=mPDF
* mPDF ([ string $mode [, mixed $format [, float $default_font_size [, string $default_font [, float $margin_left , float $margin_right , float $margin_top , float $margin_bottom , float $margin_header , float $margin_footer [, string $orientation ]]]]]])
*/
if (!in_array($orientation, array('P', 'L'))) {
$orientation = 'P';
}
//$this->pdf = $pdf = new mPDF('UTF-8', $page_format, '', '', 30, 20, 27, 25, 16, 13, $orientation);
//left, right, top, bottom, margin_header, margin footer
$params['left'] = isset($params['left']) ? $params['left'] : 15;
$params['right'] = isset($params['right']) ? $params['right'] : 15;
$params['top'] = isset($params['top']) ? $params['top'] : 20;
$params['bottom'] = isset($params['bottom']) ? $params['bottom'] : 15;
$this->params['filename'] = isset($params['filename']) ? $params['filename'] : api_get_local_time();
$this->params['pdf_title'] = isset($params['pdf_title']) ? $params['pdf_title'] : get_lang('Untitled');
$this->params['course_code'] = isset($params['course_code']) ? $params['course_code'] : api_get_course_id();
$this->params['add_signatures'] = isset($params['add_signatures']) ? $params['add_signatures'] : false;
$this->pdf = new mPDF('UTF-8', $page_format, '', '', $params['left'], $params['right'], $params['top'], $params['bottom'], 8, 8, $orientation);
}
示例12: get_data_to_graph2
/**
* This is a function to show the generated data
* @param bool $displayWarning
* @return array
*/
public function get_data_to_graph2($displayWarning = true)
{
// do some checks on users/items counts, redefine if invalid values
$usertable = array();
foreach ($this->users as $user) {
$usertable[] = $user;
}
// sort users array
usort($usertable, array('FlatViewDataGenerator', 'sort_by_first_name'));
// generate actual data array
$scoredisplay = ScoreDisplay::instance();
$data = array();
$displaytype = SCORE_DIV;
$selected_users = $usertable;
foreach ($selected_users as $user) {
$row = array();
$row[] = $user[0];
// user id
$item_value = 0;
$item_total = 0;
$final_score = 0;
$item_value_total = 0;
$convert_using_the_global_weight = true;
$course_code = api_get_course_id();
$session_id = api_get_session_id();
$allcat = $this->category->get_subcategories(null, $course_code, $session_id, 'ORDER BY id');
if ($parent_id == 0 && !empty($allcat)) {
foreach ($allcat as $sub_cat) {
$score = $sub_cat->calc_score($user[0]);
$real_score = $score;
$main_weight = $this->category->get_weight();
$divide = $score[1] == 0 ? 1 : $score[1];
$sub_cat_percentage = $sum_categories_weight_array[$sub_cat->get_id()];
$item_value = $score[0] / $divide * $main_weight;
$item_total += $sub_cat->get_weight();
$row[] = array($item_value, trim($scoredisplay->display_score($real_score, SCORE_CUSTOM, null, true)));
$item_value_total += $item_value;
$final_score += $score[0];
//$final_score = ($final_score / $item_total) * 100;
}
$total_score = array($final_score, $item_total);
$row[] = array($final_score, trim($scoredisplay->display_score($total_score, SCORE_CUSTOM, null, true)));
} else {
for ($count = 0; $count < count($this->evals_links); $count++) {
$item = $this->evals_links[$count];
$score = $item->calc_score($user[0]);
$divide = $score[1] == 0 ? 1 : $score[1];
$item_value += $score[0] / $divide * $item->get_weight();
$item_total += $item->get_weight();
$score_denom = $score[1] == 0 ? 1 : $score[1];
$score_final = $score[0] / $score_denom * 100;
$row[] = array($score_final, trim($scoredisplay->display_score($score, SCORE_CUSTOM, null, true)));
}
$total_score = array($item_value, $item_total);
$score_final = $item_value / $item_total * 100;
if ($displayWarning) {
Display::display_warning_message(Display::display_warning_message($total_score[1]));
}
$row[] = array($score_final, trim($scoredisplay->display_score($total_score, SCORE_CUSTOM, null, true)));
}
$data[] = $row;
}
return $data;
}
示例13: export_to_pdf
/**
*
*/
public static function export_to_pdf()
{
$data = GlossaryManager::get_glossary_data(0, GlossaryManager::get_number_glossary_terms(api_get_session_id()), 0, 'ASC');
$html = '<html><body>';
$html .= '<h2>' . get_lang('Glossary') . '</h2><hr><br><br>';
foreach ($data as $item) {
$term = $item[0];
$description = $item[1];
$html .= '<h4>' . $term . '</h4><p>' . $description . '<p><hr>';
}
$html .= '</body></html>';
$course_code = api_get_course_id();
$pdf = new PDF();
//$pdf->set_custom_header($title);
/*$css_file = api_get_path(SYS_CODE_PATH).'css/print.css';
if (file_exists($css_file)) {
$css = @file_get_contents($css_file);
} else {
$css = '';
}*/
$pdf->content_to_pdf($html, '', get_lang('Glossary') . '_' . $course_code, $course_code);
}
示例14: api_get_self
lesson_status = 'completed';
}
<?php
}
?>
param = 'id='+lms_item_id+'&origin='+origin+'&score='+score+'&max='+max+'&min='+min+'&lesson_status='+lesson_status+'&time='+session_time+'&suspend_data='+suspend_data;
url="http://<?php
$self = api_get_self();
$url = $_SERVER['HTTP_HOST'] . $self;
$url = substr($url, 0, -14);
// 14 is the length of this file's name (/scorm_api.php).
echo $url;
?>
/lp_controller.php?cidReq=<?php
echo api_get_course_id();
?>
&action=save&lp_id=<?php
echo $oLP->get_id();
?>
&" + param + "";
logit_lms('saving data (status='+lesson_status+')',1);
xajax_save_item(lms_lp_id, lms_user_id, lms_view_id, lms_item_id, score, max, min, lesson_status, session_time, suspend_data, lesson_location);
//xajax_update_pgs();
//xajax_update_toc();
}
function LMSCommit(val) {
logit_scorm('LMSCommit()',0);
commit = true ;
savedata('commit');
示例15: display_document_form
//.........这里部分代码省略.........
$template_css = '<link rel="stylesheet" href="' . api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/document/css/templates.css" type="text/css" />';
}
$js = '';
if (strpos($valcontent, 'javascript/jquery.highlight.js') === false) {
$js .= '<script type="text/javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/jquery-1.4.2.min.js" language="javascript"></script>';
$js .= '<script type="text/javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'jwplayer/jwplayer.js" language="javascript"></script>' . PHP_EOL;
if (api_get_setting('show_glossary_in_documents') != 'none') {
$js .= '<script language="javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/jquery.highlight.js"></script>';
if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
$js .= '<script language="javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'fckeditor/editor/plugins/glossary/fck_glossary_manual.js"></script>';
} else {
$js .= '<script language="javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"></script>';
}
}
}
$valcontent = str_replace('{CSS}', $template_css . $js, $valcontent);
if (strpos($valcontent, '/css/templates.css') === false) {
$valcontent = str_replace('</head>', $template_css . '</head>', $valcontent);
}
if (strpos($valcontent, 'javascript/jquery.highlight.js') === false) {
$valcontent = str_replace('</head>', $js . '</head>', $valcontent);
}
$valcontent = str_replace('{IMG_DIR}', $img_dir, $valcontent);
$valcontent = str_replace('{REL_PATH}', api_get_path(REL_PATH), $valcontent);
$valcontent = str_replace('{COURSE_DIR}', $default_course_dir, $valcontent);
} elseif (isset($_GET['resource']) && $_GET['resource'] == 'mindmap' || $_GET['resource'] == 'video') {
// Load a mindmap or video into a document
$propTable = Database::get_course_table(TABLE_ITEM_PROPERTY);
$curdirpath = '/mindmaps/';
if ($_GET['resource'] == 'video') {
$curdirpath = '/video/';
$curdirpath_flv = '/video/flv/';
}
$my_course = api_get_course_id();
$src_path = api_get_path(WEB_COURSE_PATH) . $my_course . '/document';
$sql = "SELECT path,title FROM {$tbl_doc} doc,{$propTable} prop WHERE doc.id = prop.ref AND prop.tool = '" . TOOL_DOCUMENT . "'\n AND doc.filetype = 'file' AND (doc.path LIKE '" . $curdirpath . "%' OR doc.path LIKE '" . $curdirpath_flv . "%') AND (doc.path NOT LIKE '" . $curdirpath . "%/%' OR doc.path NOT LIKE '" . $curdirpath_flv . "%/%')\n AND prop.visibility = 1 AND doc.id = '" . Database::escape_string(Security::remove_XSS($_GET['tplid'])) . "'";
$rs = Database::query($sql);
$row = Database::fetch_array($rs);
$resource = $src_path . $row['path'];
$valtitle = $row['title'];
if ($valtitle != '') {
$search = array('.png', '.gif', '.jpg', '.mpg', '.flv', '.swf');
// Add other extensions
$replace = array('', '', '', '', '', '');
$valtitle = str_replace($search, $replace, $valtitle);
}
if ($_GET['resource'] == 'mindmap') {
$valcontent = '<table cellspacing="2" cellpadding="10" border="0" style="width: 95%; height: 500px;">
<tbody>
<tr>
<td valign="top"><img border="0" vspace="0" hspace="0" src="' . $resource . '" alt="' . $title . '" title="' . $title . '"/></td>
</tr>
</tbody>
</table>';
} elseif ($_GET['resource'] == 'video') {
$sys_resource = api_get_path(SYS_COURSE_PATH) . $my_course . '/document' . $row['path'];
$resource_info = pathinfo($sys_resource);
//$video_web_path = api_get_path(WEB_LIBRARY_PATH) . 'fckeditor/editor/plugins/flvPlayer/';
$valcontent = '<table cellspacing="2" cellpadding="10" border="0" style="width: 95%; height: 500px;">
<tbody>
<tr>
<td valign="top">
<!-- Video player plugin -->
<div id="player986311-parent" align="left">
<div style="border-style: none; height: 240px; width: 375px; overflow: hidden; background-color: rgb(220, 220, 220);" id="test">
<div style="display: none; visibility: hidden; width: 0px; height: 0px; overflow: hidden;" id="player986311-config">url=' . $resource . ' width=375 height=240 loop=1 play=true downloadable=false fullscreen=true</div>