|
@@ -17,7 +17,7 @@ if ($debug > 0) error_log('New LP -+- Entered lp_controller.php -+- (action: '.$
|
|
|
|
|
|
// Language files that needs to be included.
|
|
|
if (isset($_GET['action'])) {
|
|
|
- if ($_GET['action'] == 'export') {
|
|
|
+ if ($_GET['action'] === 'export') {
|
|
|
// Only needed on export.
|
|
|
$language_file[] = 'hotspot';
|
|
|
}
|
|
@@ -226,10 +226,10 @@ if (isset($_SESSION['lpobject'])) {
|
|
|
$oLP = unserialize($_SESSION['lpobject']);
|
|
|
if (isset($oLP) && is_object($oLP)) {
|
|
|
if ($debug > 0) error_log('New LP - oLP is object', 0);
|
|
|
- if ($myrefresh == 1 OR
|
|
|
- empty($oLP->cc) OR
|
|
|
- $oLP->cc != api_get_course_id() OR
|
|
|
- $oLP->lp_view_session_id != $session_id OR
|
|
|
+ if ($myrefresh == 1 ||
|
|
|
+ empty($oLP->cc) ||
|
|
|
+ $oLP->cc != api_get_course_id() ||
|
|
|
+ $oLP->lp_view_session_id != $session_id ||
|
|
|
$oLP->scorm_debug == '1'
|
|
|
) {
|
|
|
if ($debug > 0) error_log('New LP - Course has changed, discard lp object', 0);
|
|
@@ -358,15 +358,14 @@ if (isset($_POST['title'])) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-$redirectTo = null;
|
|
|
+$redirectTo = '';
|
|
|
+if ($debug > 0) error_log('New LP - action "'.$action.'" triggered');
|
|
|
|
|
|
switch ($action) {
|
|
|
case 'add_item':
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - add item 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 item', 0);
|
|
@@ -387,7 +386,7 @@ switch ($action) {
|
|
|
|
|
|
$_SESSION['post_time'] = $_POST['post_time'];
|
|
|
$directoryParentId = isset($_POST['directory_parent_id']) ? $_POST['directory_parent_id'] : 0;
|
|
|
-
|
|
|
+ $courseInfo = api_get_course_info();
|
|
|
if (empty($directoryParentId)) {
|
|
|
$_SESSION['oLP']->generate_lp_folder($courseInfo);
|
|
|
}
|
|
@@ -457,9 +456,6 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
-
|
|
|
- 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);
|
|
@@ -536,7 +532,6 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - add_lp action triggered', 0);
|
|
|
if (isset($_REQUEST['lp_name']) && !empty($_REQUEST['lp_name'])) {
|
|
|
$_REQUEST['lp_name'] = trim($_REQUEST['lp_name']);
|
|
|
$_SESSION['refresh'] = 1;
|
|
@@ -585,7 +580,6 @@ switch ($action) {
|
|
|
$accumulateScormTime = isset($_REQUEST['accumulate_scorm_time']) ? $_REQUEST['accumulate_scorm_time'] : 'true';
|
|
|
$_SESSION['oLP']->setAccumulateScormTime($accumulateScormTime);
|
|
|
|
|
|
- //require 'lp_build.php';
|
|
|
$url = api_get_self().'?action=add_item&type=step&lp_id='.intval($new_lp_id).'&'.api_get_cidreq();
|
|
|
header("Location: $url&isStudentView=false");
|
|
|
exit;
|
|
@@ -599,7 +593,6 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - admin_view action triggered', 0);
|
|
|
if (!$lp_found) {
|
|
|
error_log('New LP - No learnpath given for admin_view', 0);
|
|
|
require 'lp_list.php';
|
|
@@ -613,7 +606,6 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - auto_launch action triggered', 0);
|
|
|
if (!$lp_found) { error_log('New LP - No learnpath given for set_autolaunch', 0); require 'lp_list.php'; }
|
|
|
else {
|
|
|
$_SESSION['oLP']->set_autolaunch($_GET['lp_id'], $_GET['status']);
|
|
@@ -626,10 +618,10 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - build action triggered', 0);
|
|
|
-
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for build', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for build', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
$_SESSION['refresh'] = 1;
|
|
|
//require 'lp_build.php';
|
|
|
$url = api_get_self().'?action=add_item&type=step&lp_id='.intval($_SESSION['oLP']->lp_id).'&'.api_get_cidreq();
|
|
@@ -641,8 +633,6 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - edit item action triggered', 0);
|
|
|
-
|
|
|
if (!$lp_found) {
|
|
|
error_log('New LP - No learnpath given for edit item', 0);
|
|
|
require 'lp_list.php';
|
|
@@ -698,7 +688,6 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - edit item prereq action triggered', 0);
|
|
|
if (!$lp_found) { error_log('New LP - No learnpath given for edit item prereq', 0); require 'lp_list.php'; }
|
|
|
else {
|
|
|
if (isset($_POST['submit_button'])) {
|
|
@@ -728,9 +717,11 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - move item action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for move item', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for move item', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
$_SESSION['refresh'] = 1;
|
|
|
if (isset($_POST['submit_button'])) {
|
|
|
//Updating the lp.modified_on
|
|
@@ -763,7 +754,6 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - view_item action triggered', 0);
|
|
|
if (!$lp_found) {
|
|
|
error_log('New LP - No learnpath given for view item', 0); require 'lp_list.php';
|
|
|
} else {
|
|
@@ -775,7 +765,6 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - upload action triggered', 0);
|
|
|
$cwdir = getcwd();
|
|
|
require 'lp_upload.php';
|
|
|
// Reinit current working directory as many functions in upload change it.
|
|
@@ -792,9 +781,10 @@ switch ($action) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
|
|
|
- if ($debug > 0) error_log('New LP - export action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for copy', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for copy', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
$_SESSION['oLP']->copy();
|
|
|
}
|
|
|
require 'lp_list.php';
|
|
@@ -807,9 +797,6 @@ switch ($action) {
|
|
|
if ($hideScormExportLink === 'true') {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) {
|
|
|
- error_log('New LP - export action triggered', 0);
|
|
|
- }
|
|
|
if (!$lp_found) {
|
|
|
error_log('New LP - No learnpath given for export', 0);
|
|
|
require 'lp_list.php';
|
|
@@ -827,8 +814,9 @@ switch ($action) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
|
|
|
- if ($debug > 0) error_log('New LP - export action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for export_to_pdf', 0); require 'lp_list.php';
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for export_to_pdf', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
} else {
|
|
|
$result = $_SESSION['oLP']->scorm_export_to_pdf($_GET['lp_id']);
|
|
|
if (!$result) {
|
|
@@ -841,11 +829,13 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - delete action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for delete', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for delete', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
$_SESSION['refresh'] = 1;
|
|
|
$_SESSION['oLP']->delete(null, $_GET['lp_id'], 'remove');
|
|
|
+ Display::addFlash(Display::return_message(get_lang('Deleted')));
|
|
|
Session::erase('oLP');
|
|
|
require 'lp_list.php';
|
|
|
}
|
|
@@ -855,9 +845,11 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - visibility action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for visibility', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for visibility', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
learnpath::toggle_visibility($_REQUEST['lp_id'], $_REQUEST['new_status']);
|
|
|
require 'lp_list.php';
|
|
|
}
|
|
@@ -867,9 +859,10 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - publish action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for publish', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for publish', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
learnpath::toggle_publish($_REQUEST['lp_id'], $_REQUEST['new_status']);
|
|
|
require 'lp_list.php';
|
|
|
}
|
|
@@ -879,7 +872,6 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - publish action triggered', 0);
|
|
|
if (!$lp_found) {
|
|
|
error_log('New LP - No learnpath given for publish', 0);
|
|
|
require 'lp_list.php';
|
|
@@ -893,7 +885,6 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - publish action triggered', 0);
|
|
|
if (!$lp_found) {
|
|
|
error_log('New LP - No learnpath given for publish', 0);
|
|
|
require 'lp_list.php';
|
|
@@ -906,9 +897,11 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - edit action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for edit', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for edit', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
$_SESSION['refresh'] = 1;
|
|
|
require 'lp_edit.php';
|
|
|
}
|
|
@@ -917,9 +910,10 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - update_lp action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for edit', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for edit', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
$_SESSION['refresh'] = 1;
|
|
|
$lp_name = Security::remove_XSS($_REQUEST['lp_name']);
|
|
|
$_SESSION['oLP']->set_name($lp_name);
|
|
@@ -936,8 +930,6 @@ switch ($action) {
|
|
|
}
|
|
|
|
|
|
$author_fixed = substr($author, $auth_init, $len);
|
|
|
- //$author_fixed = $author;
|
|
|
-
|
|
|
$_SESSION['oLP']->set_author($author_fixed);
|
|
|
// TODO (as of Chamilo 1.8.8): Check in the future whether this field is needed.
|
|
|
$_SESSION['oLP']->set_encoding($_REQUEST['lp_encoding']);
|
|
@@ -1032,13 +1024,14 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - add sub item action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for add sub item', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for add sub item', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
$_SESSION['refresh'] = 1;
|
|
|
if (!empty($_REQUEST['parent_item_id'])) {
|
|
|
- $_SESSION['from_learnpath']='yes';
|
|
|
- $_SESSION['origintoolurl'] = 'lp_controller.php?action=admin_view&lp_id='.Security::remove_XSS($_REQUEST['lp_id']);
|
|
|
+ $_SESSION['from_learnpath'] = 'yes';
|
|
|
+ $_SESSION['origintoolurl'] = 'lp_controller.php?action=admin_view&lp_id='.intval($_REQUEST['lp_id']);
|
|
|
require 'resourcelinker.php';
|
|
|
} else {
|
|
|
require 'lp_admin_view.php';
|
|
@@ -1050,12 +1043,10 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - delete item action triggered', 0);
|
|
|
if (!$lp_found) {
|
|
|
error_log('New LP - No learnpath given for delete item', 0);
|
|
|
require 'lp_list.php';
|
|
|
} else {
|
|
|
- //$_SESSION['refresh'] = 1;
|
|
|
if (!empty($_REQUEST['id'])) {
|
|
|
$_SESSION['oLP']->delete_item($_REQUEST['id']);
|
|
|
}
|
|
@@ -1069,9 +1060,10 @@ switch ($action) {
|
|
|
if (!$is_allowed_to_edit) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
- if ($debug > 0) error_log('New LP - edit item prereq action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for edit item prereq', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for edit item prereq', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
if (!empty($_REQUEST['id']) && !empty($_REQUEST['submit_item'])) {
|
|
|
$_SESSION['refresh'] = 1;
|
|
|
$_SESSION['oLP']->edit_item_prereq($_REQUEST['id'], $_REQUEST['prereq']);
|
|
@@ -1080,47 +1072,51 @@ switch ($action) {
|
|
|
}
|
|
|
break;
|
|
|
case 'restart':
|
|
|
- if ($debug > 0) error_log('New LP - restart action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for restart', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for restart', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
$_SESSION['oLP']->restart();
|
|
|
require 'lp_view.php';
|
|
|
}
|
|
|
break;
|
|
|
case 'last':
|
|
|
- if ($debug > 0) error_log('New LP - last action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for last', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for last', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
$_SESSION['oLP']->last();
|
|
|
require 'lp_view.php';
|
|
|
}
|
|
|
break;
|
|
|
case 'first':
|
|
|
- if ($debug > 0) error_log('New LP - first action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for first', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for first', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
$_SESSION['oLP']->first();
|
|
|
require 'lp_view.php';
|
|
|
}
|
|
|
break;
|
|
|
case 'next':
|
|
|
- if ($debug > 0) error_log('New LP - next action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for next', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for next', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
$_SESSION['oLP']->next();
|
|
|
require 'lp_view.php';
|
|
|
}
|
|
|
break;
|
|
|
case 'previous':
|
|
|
- if ($debug > 0) error_log('New LP - previous action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for previous', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for previous', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
$_SESSION['oLP']->previous();
|
|
|
require 'lp_view.php';
|
|
|
}
|
|
|
break;
|
|
|
case 'content':
|
|
|
- if ($debug > 0) error_log('New LP - content action triggered', 0);
|
|
|
if ($debug > 0) error_log('New LP - Item id is '.intval($_GET['item_id']), 0);
|
|
|
if (!$lp_found) {
|
|
|
error_log('New LP - No learnpath given for content', 0);
|
|
@@ -1136,8 +1132,6 @@ switch ($action) {
|
|
|
}
|
|
|
break;
|
|
|
case 'view':
|
|
|
- if ($debug > 0)
|
|
|
- error_log('New LP - view action triggered', 0);
|
|
|
if (!$lp_found) {
|
|
|
error_log('New LP - No learnpath given for view', 0);
|
|
|
require 'lp_list.php';
|
|
@@ -1150,17 +1144,19 @@ switch ($action) {
|
|
|
}
|
|
|
break;
|
|
|
case 'save':
|
|
|
- if ($debug > 0) error_log('New LP - save action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for save', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for save', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
$_SESSION['oLP']->save_item();
|
|
|
require 'lp_save.php';
|
|
|
}
|
|
|
break;
|
|
|
case 'stats':
|
|
|
- if ($debug > 0) error_log('New LP - stats action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for stats', 0); require 'lp_list.php'; }
|
|
|
- else {
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for stats', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ } else {
|
|
|
$_SESSION['oLP']->save_current();
|
|
|
$_SESSION['oLP']->save_last();
|
|
|
$output = require 'lp_stats.php';
|
|
@@ -1168,7 +1164,6 @@ switch ($action) {
|
|
|
}
|
|
|
break;
|
|
|
case 'list':
|
|
|
- if ($debug > 0) error_log('New LP - list action triggered', 0);
|
|
|
if ($lp_found) {
|
|
|
$_SESSION['refresh'] = 1;
|
|
|
$_SESSION['oLP']->save_last();
|
|
@@ -1177,7 +1172,6 @@ switch ($action) {
|
|
|
break;
|
|
|
case 'mode':
|
|
|
// Switch between fullscreen and embedded mode.
|
|
|
- if ($debug > 0) error_log('New LP - mode change triggered', 0);
|
|
|
$mode = $_REQUEST['mode'];
|
|
|
if ($mode == 'fullscreen') {
|
|
|
$_SESSION['oLP']->mode = 'fullscreen';
|
|
@@ -1191,8 +1185,11 @@ switch ($action) {
|
|
|
require 'lp_view.php';
|
|
|
break;
|
|
|
case 'switch_view_mode':
|
|
|
- if ($debug > 0) error_log('New LP - switch_view_mode action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for switch', 0); require 'lp_list.php'; }
|
|
|
+
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for switch', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ }
|
|
|
if (Security::check_token('get')) {
|
|
|
$_SESSION['refresh'] = 1;
|
|
|
$_SESSION['oLP']->update_default_view_mode();
|
|
@@ -1200,22 +1197,22 @@ switch ($action) {
|
|
|
require 'lp_list.php';
|
|
|
break;
|
|
|
case 'switch_force_commit':
|
|
|
- if ($debug > 0) error_log('New LP - switch_force_commit action triggered', 0);
|
|
|
- if (!$lp_found) { error_log('New LP - No learnpath given for switch', 0); require 'lp_list.php'; }
|
|
|
+ if (!$lp_found) {
|
|
|
+ error_log('New LP - No learnpath given for switch', 0);
|
|
|
+ require 'lp_list.php';
|
|
|
+ }
|
|
|
$_SESSION['refresh'] = 1;
|
|
|
$_SESSION['oLP']->update_default_scorm_commit();
|
|
|
require 'lp_list.php';
|
|
|
break;
|
|
|
/* Those 2 switches have been replaced by switc_attempt_mode switch
|
|
|
case 'switch_reinit':
|
|
|
- if ($debug > 0) error_log('New LP - switch_reinit action triggered', 0);
|
|
|
if (!$lp_found) { error_log('New LP - No learnpath given for switch', 0); require 'lp_list.php'; }
|
|
|
$_SESSION['refresh'] = 1;
|
|
|
$_SESSION['oLP']->update_reinit();
|
|
|
require 'lp_list.php';
|
|
|
break;
|
|
|
case 'switch_seriousgame_mode':
|
|
|
- if($debug>0) error_log('New LP - switch_seriousgame_mode action triggered',0);
|
|
|
if(!$lp_found){ error_log('New LP - No learnpath given for switch',0); require 'lp_list.php'; }
|
|
|
$_SESSION['refresh'] = 1;
|
|
|
$_SESSION['oLP']->set_seriousgame_mode();
|
|
@@ -1223,25 +1220,21 @@ switch ($action) {
|
|
|
break;
|
|
|
*/
|
|
|
case 'switch_attempt_mode':
|
|
|
- if($debug>0) error_log('New LP - switch_reinit action triggered',0);
|
|
|
if(!$lp_found){ error_log('New LP - No learnpath given for switch',0); require 'lp_list.php'; }
|
|
|
$_SESSION['refresh'] = 1;
|
|
|
$_SESSION['oLP']->switch_attempt_mode();
|
|
|
require 'lp_list.php';
|
|
|
break;
|
|
|
case 'switch_scorm_debug':
|
|
|
- if ($debug > 0) error_log('New LP - switch_scorm_debug action triggered', 0);
|
|
|
if (!$lp_found) { error_log('New LP - No learnpath given for switch', 0); require 'lp_list.php'; }
|
|
|
$_SESSION['refresh'] = 1;
|
|
|
$_SESSION['oLP']->update_scorm_debug();
|
|
|
require 'lp_list.php';
|
|
|
break;
|
|
|
case 'intro_cmdAdd':
|
|
|
- if ($debug > 0) error_log('New LP - intro_cmdAdd action triggered', 0);
|
|
|
// Add introduction section page.
|
|
|
break;
|
|
|
case 'js_api_refresh':
|
|
|
- if ($debug > 0) error_log('New LP - js_api_refresh action triggered', 0);
|
|
|
if (!$lp_found) { error_log('New LP - No learnpath given for js_api_refresh', 0); require 'lp_message.php'; }
|
|
|
if (isset($_REQUEST['item_id'])) {
|
|
|
$htmlHeadXtra[] = $_SESSION['oLP']->get_js_info($_REQUEST['item_id']);
|
|
@@ -1268,8 +1261,6 @@ switch ($action) {
|
|
|
require 'lp_list_search.php';
|
|
|
break;
|
|
|
case 'impress':
|
|
|
- if ($debug > 0)
|
|
|
- error_log('New LP - view action triggered', 0);
|
|
|
if (!$lp_found) {
|
|
|
error_log('New LP - No learnpath given for view', 0);
|
|
|
require 'lp_list.php';
|
|
@@ -1298,10 +1289,6 @@ switch ($action) {
|
|
|
api_not_allowed(true);
|
|
|
}
|
|
|
|
|
|
- if ($debug > 0) {
|
|
|
- error_log('New LP - seriousgame_mode action triggered');
|
|
|
- }
|
|
|
-
|
|
|
if (!$lp_found) {
|
|
|
error_log('New LP - No learnpath given for visibility');
|
|
|
|
|
@@ -1443,7 +1430,6 @@ switch ($action) {
|
|
|
]);
|
|
|
break;
|
|
|
default:
|
|
|
- if ($debug > 0) error_log('New LP - default action triggered', 0);
|
|
|
require 'lp_list.php';
|
|
|
break;
|
|
|
}
|