@ -84,6 +84,10 @@ if ($is_allowed_to_edit) {
}
echo '< div class = "actions" > ';
echo Display::url(
Display::return_icon('new_folder.png', get_lang('AddCategory'), array(), ICON_SIZE_MEDIUM),
api_get_self().'?'.api_get_cidreq().'& action=add_lp_category'
);
echo '< a href = "'.api_get_self().'?'.api_get_cidreq().'&action=add_lp" > '.Display::return_icon('new_learnpath.png', get_lang('LearnpathAddLearnpath'), '', ICON_SIZE_MEDIUM).'< / a > '.
str_repeat(' ', 3).
'< a href = "../upload/index.php?'.api_get_cidreq().'&curdirpath=/&tool='.TOOL_LEARNPATH.'" > '.Display::return_icon('import_scorm.png', get_lang('UploadScorm'), '', ICON_SIZE_MEDIUM).'< / a > ';
@ -97,12 +101,79 @@ if ($is_allowed_to_edit) {
$token = Security::get_token();
/* DISPLAY SCORM LIST */
$categories_temp = learnpath::getCategories(api_get_course_int_id());
$categoryTest = new \Chamilo\CourseBundle\Entity\CLpCategory();
$categoryTest->setId(0);
$categoryTest->setName(get_lang('WithOutCategory'));
$categoryTest->setPosition(0);
$categories = array(
$categoryTest
);
if (!empty($categories_temp)) {
$categories = array_merge($categories, $categories_temp);
}
$userId = api_get_user_id();
$userInfo = api_get_user_info();
$list = new LearnpathList($userId);
$lp_showed = false;
$total = count($categories);
$counterCategories = 1;
$test_mode = api_get_setting('server_type');
foreach ($categories as $item) {
$categoryId = $item->getId();
$list = new LearnpathList(
api_get_user_id(),
null,
null,
null,
false,
$categoryId
);
$flat_list = $list->get_flat_list();
// Hiding categories with out LPs (only for student)
if (empty($flat_list) & & !api_is_allowed_to_edit()) {
continue;
}
$edit_link = null;
$delete_link = null;
$moveUpLink = null;
$moveDownLink = null;
if ($item->getId() > 0 & & api_is_allowed_to_edit()) {
$url = 'lp_controller.php?'.api_get_cidreq().'&action=add_lp_category&id='.$item->getId();
$edit_link = Display::url(Display::return_icon('edit.png', get_lang('Edit')), $url);
$delete_url = 'lp_controller.php?'.api_get_cidreq().'&action=delete_lp_category&id='.$item->getId();
$moveUpUrl = 'lp_controller.php?'.api_get_cidreq().'&action=move_up_category&id='.$item->getId();
$moveDownUrl = 'lp_controller.php?'.api_get_cidreq().'&action=move_down_category&id='.$item->getId();
if ($counterCategories == 1) {
$moveUpLink = Display::url(Display::return_icon('up_na.png', get_lang('Move')), '#');
} else {
$moveUpLink = Display::url(Display::return_icon('up.png', get_lang('Move')), $moveUpUrl);
}
if (($total -1) == $counterCategories) {
$moveDownLink = Display::url(Display::return_icon('down_na.png', get_lang('Move')), '#');
} else {
$moveDownLink = Display::url(Display::return_icon('down.png', get_lang('Move')), $moveDownUrl);
}
$delete_link = Display::url(Display::return_icon('delete.png', get_lang('Delete')), $delete_url);
$counterCategories++;
}
echo Display::page_subheader2($item->getName().$edit_link.$moveUpLink.$moveDownLink.$delete_link);
if (!empty($flat_list)) {
echo '< table class = "data_table" > ';
echo '< tr > ';
@ -122,7 +193,6 @@ if (!empty($flat_list)) {
}
echo '< / tr > ';
$test_mode = api_get_setting('server_type');
$max = count($flat_list);
$counter = 0;
$current = 0;
@ -130,7 +200,10 @@ if (!empty($flat_list)) {
foreach ($flat_list as $id => $details) {
// Validation when belongs to a session.
$session_img = api_get_session_image($details['lp_session'], $userInfo['status']);
$session_img = api_get_session_image(
$details['lp_session'],
$userInfo['status']
);
if (!$is_allowed_to_edit & & $details['lp_visibility'] == 0) {
// This is a student and this path is invisible, skip.
@ -138,7 +211,11 @@ if (!empty($flat_list)) {
}
// Check if the learnpath is visible for student.
if (!$is_allowed_to_edit & & !learnpath::is_lp_visible_for_student($id, $userId)) {
if (!$is_allowed_to_edit & & !learnpath::is_lp_visible_for_student(
$id,
$userId
)
) {
continue;
}
@ -161,9 +238,16 @@ if (!empty($flat_list)) {
if ($time_limits) {
// Check if start time
if (!empty($details['publicated_on']) & & $details['publicated_on'] != '0000-00-00 00:00:00' & &
!empty($details['expired_on']) & & $details['expired_on'] != '0000-00-00 00:00:00') {
$start_time = api_strtotime($details['publicated_on'], 'UTC');
$end_time = api_strtotime($details['expired_on'], 'UTC');
!empty($details['expired_on']) & & $details['expired_on'] != '0000-00-00 00:00:00'
) {
$start_time = api_strtotime(
$details['publicated_on'],
'UTC'
);
$end_time = api_strtotime(
$details['expired_on'],
'UTC'
);
$now = time();
$is_actived_time = false;
@ -179,10 +263,16 @@ if (!empty($flat_list)) {
$start_time = $end_time = '';
} else {
if (!empty($details['publicated_on'])) {
$start_time = api_convert_and_format_date($details['publicated_on'], DATE_TIME_FORMAT_LONG);
$start_time = api_convert_and_format_date(
$details['publicated_on'],
DATE_TIME_FORMAT_LONG
);
}
if (!empty($details['expired_on'])) {
$end_time = api_convert_and_format_date($details['expired_on'], DATE_TIME_FORMAT_LONG);
$end_time = api_convert_and_format_date(
$details['expired_on'],
DATE_TIME_FORMAT_LONG
);
}
}
@ -193,23 +283,43 @@ if (!empty($flat_list)) {
$oddclass = 'row_even';
}
$url_start_lp = 'lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$id;
$url_start_lp = 'lp_controller.php?'.api_get_cidreq(
).'&action=view&lp_id='.$id;
$name = Security::remove_XSS($details['lp_name']);
$extra = null;
if ($is_allowed_to_edit) {
$url_start_lp .= '&isStudentView=true';
$studentVisibility = learnpath::is_lp_visible_for_student($id, $userId);
$dsp_desc = '< em > '.$details['lp_maker'].'< / em > '.( $studentVisibility ? '' : ' - ('.get_lang('LPNotVisibleToStudent').')');
$studentVisibility = learnpath::is_lp_visible_for_student(
$id,
$userId
);
$dsp_desc = '< em > '.$details['lp_maker'].'< / em > '.($studentVisibility ? '' : ' - ('.get_lang(
'LPNotVisibleToStudent'
).')');
$extra = '< div class = "lp_content_type_label" > '.$dsp_desc.'< / div > ';
}
$my_title = $name;
$icon_learnpath = Display::return_icon('learnpath.png', get_lang('LPName'), '', ICON_SIZE_SMALL);
$icon_learnpath = Display::return_icon(
'learnpath.png',
get_lang('LPName'),
'',
ICON_SIZE_SMALL
);
if ($details['lp_visibility'] == 0) {
$my_title = Display::tag('font', $name, array('class' => 'invisible'));
$icon_learnpath = Display::return_icon('learnpath_na.png', get_lang('LPName'), '', ICON_SIZE_SMALL);
$my_title = Display::tag(
'font',
$name,
array('class' => 'invisible')
);
$icon_learnpath = Display::return_icon(
'learnpath_na.png',
get_lang('LPName'),
'',
ICON_SIZE_SMALL
);
}
$dsp_line = '< tr align = "center" class = "'.$oddclass.'" > '.
@ -242,7 +352,10 @@ if (!empty($flat_list)) {
$dsp_progress = "";
if (!api_is_invitee()) {
$dsp_progress = '< td > '.learnpath::get_progress_bar($progress, '%').'< / td > ';
$dsp_progress = '< td > '.learnpath::get_progress_bar(
$progress,
'%'
).'< / td > ';
}
}
@ -261,22 +374,49 @@ if (!empty($flat_list)) {
// EDIT LP
if ($current_session == $details['lp_session']) {
$dsp_edit_lp = '< a href = "lp_controller.php?'.api_get_cidreq().'&action=edit&lp_id='.$id.'" > '.
Display::return_icon('settings.png', get_lang('CourseSettings'), '', ICON_SIZE_SMALL).'< / a > ';
$dsp_edit_lp = '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=edit& lp_id='.$id.'">'.
Display::return_icon(
'settings.png',
get_lang('CourseSettings'),
'',
ICON_SIZE_SMALL
).'< / a > ';
} else {
$dsp_edit_lp = Display::return_icon('settings_na.png', get_lang('CourseSettings'), '', ICON_SIZE_SMALL);
$dsp_edit_lp = Display::return_icon(
'settings_na.png',
get_lang('CourseSettings'),
'',
ICON_SIZE_SMALL
);
}
// BUILD
if ($current_session == $details['lp_session']) {
if ($details['lp_type'] == 1 || $details['lp_type'] == 2) {
$dsp_build = '< a href = "lp_controller.php?'.api_get_cidreq().'&action=add_item&type=step&lp_id='.$id.'&isStudentView=false" > '.
Display::return_icon('edit.png', get_lang('LearnpathEditLearnpath'), '', ICON_SIZE_SMALL).'< / a > ';
$dsp_build = '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=add_item& type=step& lp_id='.$id.'& isStudentView=false">'.
Display::return_icon(
'edit.png',
get_lang('LearnpathEditLearnpath'),
'',
ICON_SIZE_SMALL
).'< / a > ';
} else {
$dsp_build = Display::return_icon('edit_na.png', get_lang('LearnpathEditLearnpath'), '', ICON_SIZE_SMALL);
$dsp_build = Display::return_icon(
'edit_na.png',
get_lang('LearnpathEditLearnpath'),
'',
ICON_SIZE_SMALL
);
}
} else {
$dsp_build = Display::return_icon('edit_na.png', get_lang('LearnpathEditLearnpath'), '', ICON_SIZE_SMALL);
$dsp_build = Display::return_icon(
'edit_na.png',
get_lang('LearnpathEditLearnpath'),
'',
ICON_SIZE_SMALL
);
}
/* VISIBILITY COMMAND */
@ -286,21 +426,54 @@ if (!empty($flat_list)) {
See http://support.chamilo.org/projects/chamilo-18/wiki/Tools_and_sessions).
*/
if ($details['lp_visibility'] == 0) {
$dsp_visible = "< a href = \"".api_get_self()."?".api_get_cidreq()."&lp_id=$id&action=toggle_visible&new_status=1\" > ".Display::return_icon('invisible.png', get_lang('Show'), '', ICON_SIZE_SMALL)."< / a > ";
$dsp_visible = "< a href = \"".api_get_self(
)."?".api_get_cidreq(
)."& lp_id=$id& action=toggle_visible& new_status=1\">".Display::return_icon(
'invisible.png',
get_lang('Show'),
'',
ICON_SIZE_SMALL
)."< / a > ";
} else {
$dsp_visible = "< a href = '".api_get_self()."?".api_get_cidreq()."&lp_id=$id&action=toggle_visible&new_status=0' > ".Display::return_icon('visible.png', get_lang('Hide'), '', ICON_SIZE_SMALL)."< / a > ";
$dsp_visible = "< a href = '".api_get_self(
)."?".api_get_cidreq(
)."& lp_id=$id& action=toggle_visible& new_status=0'>".Display::return_icon(
'visible.png',
get_lang('Hide'),
'',
ICON_SIZE_SMALL
)."< / a > ";
}
/* PUBLISH COMMAND */
if ($current_session == $details['lp_session']) {
if ($details['lp_published'] == "i") {
$dsp_publish = "< a href = \"".api_get_self()."?".api_get_cidreq()."&lp_id=$id&action=toggle_publish&new_status=v\" > ".
Display::return_icon('lp_publish_na.png', get_lang('LearnpathPublish'), '', ICON_SIZE_SMALL)."< / a > ";
$dsp_publish = "< a href = \"".api_get_self(
)."?".api_get_cidreq(
)."& lp_id=$id& action=toggle_publish& new_status=v\">".
Display::return_icon(
'lp_publish_na.png',
get_lang('LearnpathPublish'),
'',
ICON_SIZE_SMALL
)."< / a > ";
} else {
$dsp_publish = "< a href = '".api_get_self()."?".api_get_cidreq()."&lp_id=$id&action=toggle_publish&new_status=i' > ".Display::return_icon('lp_publish.png', get_lang('LearnpathDoNotPublish'), '', ICON_SIZE_SMALL)."< / a > ";
$dsp_publish = "< a href = '".api_get_self(
)."?".api_get_cidreq(
)."& lp_id=$id& action=toggle_publish& new_status=i'>".Display::return_icon(
'lp_publish.png',
get_lang('LearnpathDoNotPublish'),
'',
ICON_SIZE_SMALL
)."< / a > ";
}
} else {
$dsp_publish = Display::return_icon('lp_publish_na.png', get_lang('LearnpathDoNotPublish'), '', ICON_SIZE_SMALL);
$dsp_publish = Display::return_icon(
'lp_publish_na.png',
get_lang('LearnpathDoNotPublish'),
'',
ICON_SIZE_SMALL
);
}
/* MULTIPLE ATTEMPTS OR SERIOUS GAME MODE
@ -312,21 +485,44 @@ if (!empty($flat_list)) {
*/
if ($current_session == $details['lp_session']) {
if ($details['seriousgame_mode'] == 1 & & $details['lp_prevent_reinit'] == 1) { //seriousgame mode | next = single
$dsp_reinit = '< a href = "lp_controller.php?'.api_get_cidreq().'&action=switch_attempt_mode&lp_id='.$id.'" > '.
Display::return_icon('reload.png', get_lang('PreventMultipleAttempts'), '', ICON_SIZE_SMALL).
$dsp_reinit = '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=switch_attempt_mode& lp_id='.$id.'">'.
Display::return_icon(
'reload.png',
get_lang('PreventMultipleAttempts'),
'',
ICON_SIZE_SMALL
).
'< / a > ';
}
if ($details['seriousgame_mode'] == 0 & & $details['lp_prevent_reinit'] == 1) { //single mode | next = multiple
$dsp_reinit = '< a href = "lp_controller.php?'.api_get_cidreq().'&action=switch_attempt_mode&lp_id='.$id.'" > '.
Display::return_icon('reload_na.png', get_lang('AllowMultipleAttempts'), '', ICON_SIZE_SMALL).
$dsp_reinit = '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=switch_attempt_mode& lp_id='.$id.'">'.
Display::return_icon(
'reload_na.png',
get_lang('AllowMultipleAttempts'),
'',
ICON_SIZE_SMALL
).
'< / a > ';
}
if ($details['seriousgame_mode'] == 0 & & $details['lp_prevent_reinit'] == 0) { //multiple mode | next = seriousgame
$dsp_reinit = '< a href = "lp_controller.php?'.api_get_cidreq().'&action=switch_attempt_mode&lp_id='.$id.'" > '.Display::return_icon('reload.png', get_lang('AllowMultipleAttempts'), '', ICON_SIZE_SMALL).
$dsp_reinit = '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=switch_attempt_mode& lp_id='.$id.'">'.Display::return_icon(
'reload.png',
get_lang('AllowMultipleAttempts'),
'',
ICON_SIZE_SMALL
).
'< / a > ';
}
} else {
$dsp_reinit = Display::return_icon('reload_na.png', get_lang('AllowMultipleAttempts'), '', ICON_SIZE_SMALL);
$dsp_reinit = Display::return_icon(
'reload_na.png',
get_lang('AllowMultipleAttempts'),
'',
ICON_SIZE_SMALL
);
}
/* SCREEN LP VIEW */
@ -334,54 +530,120 @@ if (!empty($flat_list)) {
switch ($details['lp_view_mode']) {
case 'fullscreen':
$dsp_default_view = '< a href = "lp_controller.php?'.api_get_cidreq().'&action=switch_view_mode&lp_id='.$id.$token_parameter.'" > '.
Display::return_icon('view_fullscreen.png', get_lang('ViewModeFullScreen'), '', ICON_SIZE_SMALL).'< / a > ';
$dsp_default_view = '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=switch_view_mode& lp_id='.$id.$token_parameter.'">'.
Display::return_icon(
'view_fullscreen.png',
get_lang('ViewModeFullScreen'),
'',
ICON_SIZE_SMALL
).'< / a > ';
break;
case 'embedded':
$dsp_default_view = '< a href = "lp_controller.php?'.api_get_cidreq().'&action=switch_view_mode&lp_id='.$id.$token_parameter.'" > '.
Display::return_icon('view_left_right.png', get_lang('ViewModeEmbedded'), '', ICON_SIZE_SMALL).'< / a > ';
$dsp_default_view = '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=switch_view_mode& lp_id='.$id.$token_parameter.'">'.
Display::return_icon(
'view_left_right.png',
get_lang('ViewModeEmbedded'),
'',
ICON_SIZE_SMALL
).'< / a > ';
break;
case 'embedframe':
$dsp_default_view = '< a href = "lp_controller.php?'.api_get_cidreq().'&action=switch_view_mode&lp_id='.$id.$token_parameter.'" > '.
Display::return_icon('view_nofullscreen.png', get_lang('ViewModeEmbedFrame'), '', ICON_SIZE_SMALL).'< / a > ';
$dsp_default_view = '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=switch_view_mode& lp_id='.$id.$token_parameter.'">'.
Display::return_icon(
'view_nofullscreen.png',
get_lang('ViewModeEmbedFrame'),
'',
ICON_SIZE_SMALL
).'< / a > ';
break;
case 'impress':
$dsp_default_view = '< a href = "lp_controller.php?'.api_get_cidreq().'&action=switch_view_mode&lp_id='.$id.$token_parameter.'" > '.
Display::return_icon('window_list_slide.png', get_lang('ViewModeImpress'), '', ICON_SIZE_SMALL).'< / a > ';
$dsp_default_view = '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=switch_view_mode& lp_id='.$id.$token_parameter.'">'.
Display::return_icon(
'window_list_slide.png',
get_lang('ViewModeImpress'),
'',
ICON_SIZE_SMALL
).'< / a > ';
break;
}
} else {
if ($details['lp_view_mode'] == 'fullscreen') {
$dsp_default_view = Display::return_icon('view_fullscreen_na.png', get_lang('ViewModeEmbedded'), '', ICON_SIZE_SMALL);
$dsp_default_view = Display::return_icon(
'view_fullscreen_na.png',
get_lang('ViewModeEmbedded'),
'',
ICON_SIZE_SMALL
);
} else {
$dsp_default_view = Display::return_icon('view_left_right_na.png', get_lang('ViewModeEmbedded'), '', ICON_SIZE_SMALL);
$dsp_default_view = Display::return_icon(
'view_left_right_na.png',
get_lang('ViewModeEmbedded'),
'',
ICON_SIZE_SMALL
);
}
}
/* DEBUG */
if ($test_mode == 'test' or api_is_platform_admin()) {
if ($details['lp_scorm_debug'] == 1) {
$dsp_debug = '< a href = "lp_controller.php?'.api_get_cidreq().'&action=switch_scorm_debug&lp_id='.$id.'" > '.
Display::return_icon('bug.png', get_lang('HideDebug'), '', ICON_SIZE_SMALL).'< / a > ';
$dsp_debug = '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=switch_scorm_debug& lp_id='.$id.'">'.
Display::return_icon(
'bug.png',
get_lang('HideDebug'),
'',
ICON_SIZE_SMALL
).'< / a > ';
} else {
$dsp_debug = '< a href = "lp_controller.php?'.api_get_cidreq().'&action=switch_scorm_debug&lp_id='.$id.'" > '.
Display::return_icon('bug_na.png', get_lang('ShowDebug'), '', ICON_SIZE_SMALL).'< / a > ';
$dsp_debug = '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=switch_scorm_debug& lp_id='.$id.'">'.
Display::return_icon(
'bug_na.png',
get_lang('ShowDebug'),
'',
ICON_SIZE_SMALL
).'< / a > ';
}
}
/* Export */
if ($details['lp_type'] == 1) {
$dsp_disk = Display::url(
Display::return_icon('cd.gif', get_lang('Export'), array(), ICON_SIZE_SMALL),
api_get_self()."?".api_get_cidreq()."& action=export& lp_id=$id"
Display::return_icon(
'cd.gif',
get_lang('Export'),
array(),
ICON_SIZE_SMALL
),
api_get_self()."?".api_get_cidreq(
)."& action=export& lp_id=$id"
);
} elseif ($details['lp_type'] == 2) {
$dsp_disk = Display::url(
Display::return_icon('cd.gif', get_lang('Export'), array(), ICON_SIZE_SMALL),
api_get_self()."?".api_get_cidreq()."& action=export& lp_id=$id& export_name=".api_replace_dangerous_char($name, 'strict').".zip"
Display::return_icon(
'cd.gif',
get_lang('Export'),
array(),
ICON_SIZE_SMALL
),
api_get_self()."?".api_get_cidreq(
)."& action=export& lp_id=$id& export_name=".api_replace_dangerous_char(
$name,
'strict'
).".zip"
);
} else {
$dsp_disk = Display::return_icon('cd_gray.gif', get_lang('Export'), array(), ICON_SIZE_SMALL);
$dsp_disk = Display::return_icon(
'cd_gray.gif',
get_lang('Export'),
array(),
ICON_SIZE_SMALL
);
}
// Copy
@ -399,55 +661,118 @@ if (!empty($flat_list)) {
if (api_get_course_setting('enable_lp_auto_launch') == 1) {
if ($details['autolaunch'] == 1 & & $autolunch_exists == false) {
$autolunch_exists = true;
$lp_auto_lunch_icon = '< a href = "'.api_get_self().'?'.api_get_cidreq().'&action=auto_launch&status=0&lp_id='.$id.'" >
< img src = "../img/launch.png" border = "0" title = "'.get_lang('DisableLPAutoLaunch').'" / > < / a > ';
$lp_auto_lunch_icon = '< a href = "'.api_get_self(
).'?'.api_get_cidreq(
).'& action=auto_launch& status=0& lp_id='.$id.'">
< img src = "../img/launch.png" border = "0" title = "'.get_lang(
'DisableLPAutoLaunch'
).'" />< / a > ';
} else {
$lp_auto_lunch_icon = '< a href = "'.api_get_self().'?'.api_get_cidreq().'&action=auto_launch&status=1&lp_id='.$id.'" >
< img src = "../img/launch_na.png" border = "0" title = "'.get_lang('EnableLPAutoLaunch').'" / > < / a > ';
$lp_auto_lunch_icon = '< a href = "'.api_get_self(
).'?'.api_get_cidreq(
).'& action=auto_launch& status=1& lp_id='.$id.'">
< img src = "../img/launch_na.png" border = "0" title = "'.get_lang(
'EnableLPAutoLaunch'
).'" />< / a > ';
}
}
// Export to PDF
$export_icon = ' < a href = "'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&lp_id='.$id.'" >
'.Display::return_icon('pdf.png', get_lang('ExportToPDFOnlyHTMLAndImages'), '', ICON_SIZE_SMALL).'< / a > ';
$export_icon = ' < a href = "'.api_get_self().'?'.api_get_cidreq(
).'& action=export_to_pdf& lp_id='.$id.'">
'.Display::return_icon(
'pdf.png',
get_lang('ExportToPDFOnlyHTMLAndImages'),
'',
ICON_SIZE_SMALL
).'< / a > ';
/* Delete */
if ($current_session == $details['lp_session']) {
$dsp_delete = "< a href = \"lp_controller.php?".api_get_cidreq()."&action=delete&lp_id=$id\" " .
"onclick=\"javascript: return confirmation('".addslashes($name)."');\">".
Display::return_icon('delete.png', get_lang('LearnpathDeleteLearnpath'), '', ICON_SIZE_SMALL).'< / a > ';
$dsp_delete = "< a href = \"lp_controller.php?".api_get_cidreq(
)."& action=delete& lp_id=$id\" ".
"onclick=\"javascript: return confirmation('".addslashes(
$name
)."');\">".
Display::return_icon(
'delete.png',
get_lang('LearnpathDeleteLearnpath'),
'',
ICON_SIZE_SMALL
).'< / a > ';
} else {
$dsp_delete = Display::return_icon('delete_na.png', get_lang('LearnpathDeleteLearnpath'), '', ICON_SIZE_SMALL);
$dsp_delete = Display::return_icon(
'delete_na.png',
get_lang('LearnpathDeleteLearnpath'),
'',
ICON_SIZE_SMALL
);
}
/* COLUMN ORDER */
// Only active while session mode is not active
if ($current_session == 0) {
if ($details['lp_display_order'] == 1 & & $max != 1) {
$dsp_order .= '< a href = "lp_controller.php?'.api_get_cidreq().'&action=move_lp_down&lp_id='.$id.'" >
'.Display::return_icon('down.png', get_lang('MoveDown'), '', ICON_SIZE_SMALL).'< / a > ';
$dsp_order .= '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=move_lp_down& lp_id='.$id.'">
'.Display::return_icon(
'down.png',
get_lang('MoveDown'),
'',
ICON_SIZE_SMALL
).'< / a > ';
} elseif ($current == $max - 1 & & $max != 1) {
$dsp_order .= '< a href = "lp_controller.php?'.api_get_cidreq().'&action=move_lp_up&lp_id='.$id.'" >
'.Display::return_icon('up.png', get_lang('MoveUp'), '', ICON_SIZE_SMALL).'< / a > ';
$dsp_order .= '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=move_lp_up& lp_id='.$id.'">
'.Display::return_icon(
'up.png',
get_lang('MoveUp'),
'',
ICON_SIZE_SMALL
).'< / a > ';
} elseif ($max == 1) {
$dsp_order = '';
} else {
$dsp_order .= '< a href = "lp_controller.php?'.api_get_cidreq().'&action=move_lp_down&lp_id='.$id.'" > '.
Display::return_icon('down.png', get_lang('MoveDown'), '', ICON_SIZE_SMALL).'< / a > ';
$dsp_order .= '< a href = "lp_controller.php?'.api_get_cidreq().'&action=move_lp_up&lp_id='.$id.'" > '.
Display::return_icon('up.png', get_lang('MoveUp'), '', ICON_SIZE_SMALL).'< / a > ';
$dsp_order .= '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=move_lp_down& lp_id='.$id.'">'.
Display::return_icon(
'down.png',
get_lang('MoveDown'),
'',
ICON_SIZE_SMALL
).'< / a > ';
$dsp_order .= '< a href = "lp_controller.php?'.api_get_cidreq(
).'& action=move_lp_up& lp_id='.$id.'">'.
Display::return_icon(
'up.png',
get_lang('MoveUp'),
'',
ICON_SIZE_SMALL
).'< / a > ';
}
}
if ($is_allowed_to_edit) {
$start_time = Display::tag('td', Display::div($start_time, array('class' => 'small')));
$end_time = Display::tag('td', Display::div($end_time, array('class' => 'small')));
$start_time = Display::tag(
'td',
Display::div($start_time, array('class' => 'small'))
);
$end_time = Display::tag(
'td',
Display::div($end_time, array('class' => 'small'))
);
} else {
$start_time = $end_time = '';
}
} else {
// Student
$export_icon = ' < a href = "'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&lp_id='.$id.'" > '.
Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL).'< / a > ';
$export_icon = ' < a href = "'.api_get_self().'?'.api_get_cidreq(
).'& action=export_to_pdf& lp_id='.$id.'">'.
Display::return_icon(
'pdf.png',
get_lang('ExportToPDF'),
'',
ICON_SIZE_SMALL
).'< / a > ';
}
$hideScormExportLink = api_get_setting('hide_scorm_export_link');
@ -468,23 +793,26 @@ if (!empty($flat_list)) {
echo $dsp_line.$start_time.$end_time.$dsp_progress.$dsp_desc.$dsp_export.$dsp_edit.$dsp_build.$dsp_edit_lp.$dsp_visible.$dsp_publish.$dsp_reinit.
$dsp_default_view.$dsp_debug.$dsp_disk.$copy.$lp_auto_lunch_icon.$export_icon.$dsp_delete.$dsp_order.$dsp_edit_close;
$lp_showed = true;
echo "< / tr > ";
//counter for number of elements treated
$current++;
} // end foreach ($flat_list)
echo "< / table > ";
} else {
if ($is_allowed_to_edit) {
}
}
if ($is_allowed_to_edit & & $lp_showed == false) {
echo '< div id = "no-data-view" > ';
echo '< h3 > '.get_lang('LearningPaths').'< / h3 > ';
echo '< h2 > '.get_lang('LearningPaths').'< / h2 > ';
echo Display::return_icon('scorms.png', '', array(), 64);
echo '< div class = "controls" > ';
echo Display::url(get_lang('LearnpathAddLearnpath'), api_get_self().'?'.api_get_cidreq().'& action=add_lp', array('class' => 'btn btn-primary '));
echo Display::url(get_lang('LearnpathAddLearnpath'), api_get_self().'?'.api_get_cidreq().'& action=add_lp', array('class' => 'btn'));
echo '< / div > ';
echo '< / div > ';
}
}
$course_info = api_get_course_info();
learnpath::generate_learning_path_folder($course_info);