Minor - Format code - refs BT#12756

pull/2487/head
Angel Fernando Quiroz Campos 8 years ago
parent 2b3e79acf3
commit 0728911b9f
  1. 363
      main/lp/lp_list.php

@ -28,7 +28,8 @@ $baseWordDir = $courseDir;
* Display initialisation and security checks * Display initialisation and security checks
*/ */
// Extra javascript functions for in html head: // Extra javascript functions for in html head:
$htmlHeadXtra[] = "<script> $htmlHeadXtra[]
= "<script>
function confirmation(name) { function confirmation(name) {
if (confirm(\" ".trim(get_lang('AreYouSureToDeleteJS'))." \"+name+\"?\")) { if (confirm(\" ".trim(get_lang('AreYouSureToDeleteJS'))." \"+name+\"?\")) {
return true; return true;
@ -55,9 +56,12 @@ $current_session = api_get_session_id();
$introductionSection = Display::return_introduction_section( $introductionSection = Display::return_introduction_section(
TOOL_LEARNPATH, TOOL_LEARNPATH,
array( array(
'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/', 'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH)
'CreateDocumentDir' => '../..'.api_get_path(REL_COURSE_PATH).api_get_course_path().'/document/', .api_get_course_path().'/document/',
'BaseHref' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/', 'CreateDocumentDir' => '../..'.api_get_path(REL_COURSE_PATH)
.api_get_course_path().'/document/',
'BaseHref' => api_get_path(WEB_COURSE_PATH)
.api_get_course_path().'/',
) )
); );
@ -87,24 +91,30 @@ if ($is_allowed_to_edit) {
if (!$current_session) { if (!$current_session) {
$actionLeft .= Display::url( $actionLeft .= Display::url(
Display::return_icon('new_folder.png', get_lang('AddCategory'), array(), ICON_SIZE_MEDIUM), Display::return_icon('new_folder.png', get_lang('AddCategory'),
array(), ICON_SIZE_MEDIUM),
api_get_self().'?'.api_get_cidreq().'&action=add_lp_category' api_get_self().'?'.api_get_cidreq().'&action=add_lp_category'
); );
} }
$actionLeft .= Display::url( $actionLeft .= Display::url(
Display::return_icon('new_learnpath.png', get_lang('LearnpathAddLearnpath'), '', ICON_SIZE_MEDIUM), Display::return_icon('new_learnpath.png',
get_lang('LearnpathAddLearnpath'), '', ICON_SIZE_MEDIUM),
api_get_self().'?'.api_get_cidreq().'&action=add_lp' api_get_self().'?'.api_get_cidreq().'&action=add_lp'
); );
$actionLeft .= Display::url( $actionLeft .= Display::url(
Display::return_icon('import_scorm.png', get_lang('UploadScorm'), '', ICON_SIZE_MEDIUM), Display::return_icon('import_scorm.png', get_lang('UploadScorm'), '',
'../upload/index.php?'.api_get_cidreq().'&curdirpath=/&tool='.TOOL_LEARNPATH ICON_SIZE_MEDIUM),
'../upload/index.php?'.api_get_cidreq().'&curdirpath=/&tool='
.TOOL_LEARNPATH
); );
if (api_get_setting('service_ppt2lp', 'active') === 'true') { if (api_get_setting('service_ppt2lp', 'active') === 'true') {
$actionLeft .= Display::url( $actionLeft .= Display::url(
Display::return_icon('import_powerpoint.png', get_lang('PowerPointConvert'), '', ICON_SIZE_MEDIUM), Display::return_icon('import_powerpoint.png',
'../upload/upload_ppt.php?'.api_get_cidreq().'&curdirpath=/&tool='.TOOL_LEARNPATH get_lang('PowerPointConvert'), '', ICON_SIZE_MEDIUM),
'../upload/upload_ppt.php?'.api_get_cidreq().'&curdirpath=/&tool='
.TOOL_LEARNPATH
); );
} }
$actions = Display::toolbarAction('actions-lp', array($actionLeft)); $actions = Display::toolbarAction('actions-lp', array($actionLeft));
@ -164,7 +174,8 @@ foreach ($categories as $item) {
continue; continue;
} }
$showBlockedPrerequisite = api_get_configuration_value('show_prerequisite_as_blocked'); $showBlockedPrerequisite
= api_get_configuration_value('show_prerequisite_as_blocked');
$listData = []; $listData = [];
if (!empty($flat_list)) { if (!empty($flat_list)) {
@ -195,8 +206,9 @@ foreach ($categories as $item) {
); );
// Check if the learnpath is visible for student. // Check if the learnpath is visible for student.
if (!$is_allowed_to_edit && $lpVisibility === false && if (
($isBlocked && $showBlockedPrerequisite === false) !$is_allowed_to_edit && $lpVisibility === false
&& ($isBlocked && $showBlockedPrerequisite === false)
) { ) {
continue; continue;
} }
@ -206,8 +218,9 @@ foreach ($categories as $item) {
$time_limits = false; $time_limits = false;
// This is an old LP (from a migration 1.8.7) so we do nothing // This is an old LP (from a migration 1.8.7) so we do nothing
if ((empty($details['created_on'])) && if (
(empty($details['modified_on'])) empty($details['created_on'])
&& empty($details['modified_on'])
) { ) {
$time_limits = false; $time_limits = false;
} }
@ -219,7 +232,10 @@ foreach ($categories as $item) {
if ($time_limits) { if ($time_limits) {
// Check if start time // Check if start time
if (!empty($details['publicated_on']) && !empty($details['expired_on'])) { if (
!empty($details['publicated_on'])
&& !empty($details['expired_on'])
) {
$start_time = api_strtotime( $start_time = api_strtotime(
$details['publicated_on'], $details['publicated_on'],
'UTC' 'UTC'
@ -262,22 +278,25 @@ foreach ($categories as $item) {
$oddclass = 'row_even'; $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']); $name = Security::remove_XSS($details['lp_name']);
$extra = null; $extra = null;
if ($is_allowed_to_edit) { if ($is_allowed_to_edit) {
$url_start_lp .= '&isStudentView=true'; $url_start_lp .= '&isStudentView=true';
$dsp_desc = '<em>'.$details['lp_maker'].'</em> '.($lpVisibility ? '' : ' - ('.get_lang('LPNotVisibleToStudent').')'); $dsp_desc = '<em>'.$details['lp_maker'].'</em> '
$extra = '<div class ="lp_content_type_label">'.$dsp_desc.'</div>'; .($lpVisibility
? ''
: ' - ('.get_lang('LPNotVisibleToStudent').')');
$extra = '<div class ="lp_content_type_label">'.$dsp_desc
.'</div>';
} }
$my_title = $name; $my_title = $name;
$icon_learnpath = Display::return_icon( $icon_learnpath = Display::return_icon(
'learnpath.png', 'learnpath.png',
get_lang('LPName'), get_lang('LPName')
'',
ICON_SIZE_SMALL
); );
if ($details['lp_visibility'] == 0) { if ($details['lp_visibility'] == 0) {
@ -288,16 +307,14 @@ foreach ($categories as $item) {
); );
$icon_learnpath = Display::return_icon( $icon_learnpath = Display::return_icon(
'learnpath_na.png', 'learnpath_na.png',
get_lang('LPName'), get_lang('LPName')
'',
ICON_SIZE_SMALL
); );
} }
// Students can see the lp but is inactive // Students can see the lp but is inactive
if (!$is_allowed_to_edit && if (
$lpVisibility == false && !$is_allowed_to_edit && $lpVisibility == false
$showBlockedPrerequisite == true && $showBlockedPrerequisite == true
) { ) {
$my_title = Display::tag( $my_title = Display::tag(
'font', 'font',
@ -306,9 +323,7 @@ foreach ($categories as $item) {
); );
$icon_learnpath = Display::return_icon( $icon_learnpath = Display::return_icon(
'learnpath_na.png', 'learnpath_na.png',
get_lang('LPName'), get_lang('LPName')
'',
ICON_SIZE_SMALL
); );
$url_start_lp = '#'; $url_start_lp = '#';
} }
@ -356,15 +371,17 @@ foreach ($categories as $item) {
// EDIT LP // EDIT LP
if ($current_session == $details['lp_session']) { if ($current_session == $details['lp_session']) {
$dsp_edit_lp = Display::url( $dsp_edit_lp = Display::url(
Display::return_icon('settings.png', get_lang('CourseSettings'), '', ICON_SIZE_SMALL), Display::return_icon(
"lp_controller.php?".api_get_cidreq()."&action=edit&lp_id=$id" 'settings.png',
get_lang('CourseSettings')
),
"lp_controller.php?".api_get_cidreq()
."&action=edit&lp_id=$id"
); );
} else { } else {
$dsp_edit_lp = Display::return_icon( $dsp_edit_lp = Display::return_icon(
'settings_na.png', 'settings_na.png',
get_lang('CourseSettings'), get_lang('CourseSettings')
'',
ICON_SIZE_SMALL
); );
} }
@ -372,28 +389,30 @@ foreach ($categories as $item) {
if ($current_session == $details['lp_session']) { if ($current_session == $details['lp_session']) {
if ($details['lp_type'] == 1 || $details['lp_type'] == 2) { if ($details['lp_type'] == 1 || $details['lp_type'] == 2) {
$dsp_build = Display::url( $dsp_build = Display::url(
Display::return_icon('edit.png', get_lang('LearnpathEditLearnpath'), '', ICON_SIZE_SMALL), Display::return_icon(
'lp_controller.php?'.api_get_cidreq().'&'.http_build_query([ 'edit.png',
get_lang('LearnpathEditLearnpath')
),
'lp_controller.php?'.api_get_cidreq().'&'
.http_build_query(
[
'action' => 'add_item', 'action' => 'add_item',
'type' => 'step', 'type' => 'step',
'lp_id' => $id, 'lp_id' => $id,
'isStudentView' => 'false', 'isStudentView' => 'false',
]) ]
)
); );
} else { } else {
$dsp_build = Display::return_icon( $dsp_build = Display::return_icon(
'edit_na.png', 'edit_na.png',
get_lang('LearnpathEditLearnpath'), get_lang('LearnpathEditLearnpath')
'',
ICON_SIZE_SMALL
); );
} }
} else { } else {
$dsp_build = Display::return_icon( $dsp_build = Display::return_icon(
'edit_na.png', 'edit_na.png',
get_lang('LearnpathEditLearnpath'), get_lang('LearnpathEditLearnpath')
'',
ICON_SIZE_SMALL
); );
} }
@ -402,34 +421,37 @@ foreach ($categories as $item) {
paths inside the session. paths inside the session.
See http://support.chamilo.org/projects/chamilo-18/wiki/Tools_and_sessions). See http://support.chamilo.org/projects/chamilo-18/wiki/Tools_and_sessions).
*/ */
if (!isset($details['subscribe_users']) || $details['subscribe_users'] != 1) { if (
!isset($details['subscribe_users'])
|| $details['subscribe_users'] != 1
) {
if ($details['lp_visibility'] == 0) { if ($details['lp_visibility'] == 0) {
$dsp_visible = Display::url( $dsp_visible = Display::url(
Display::return_icon('invisible.png', get_lang('Show'), '', ICON_SIZE_SMALL), Display::return_icon(
api_get_self().'?'.api_get_cidreq()."&lp_id=$id&action=toggle_visible&new_status=1" 'invisible.png',
get_lang('Show')
),
api_get_self().'?'.api_get_cidreq()
."&lp_id=$id&action=toggle_visible&new_status=1"
); );
} else { } else {
$dsp_visible = Display::url( $dsp_visible = Display::url(
Display::return_icon('visible.png', get_lang('Hide'), '', ICON_SIZE_SMALL), Display::return_icon('visible.png', get_lang('Hide')),
api_get_self().'?'.api_get_cidreq()."&lp_id=$id&action=toggle_visible&new_status=0" api_get_self().'?'.api_get_cidreq()
."&lp_id=$id&action=toggle_visible&new_status=0"
); );
} }
} }
// Tracking command // Tracking command
$trackingActionUrl = 'lp_controller.php?' $trackingActionUrl = 'lp_controller.php?'
. api_get_cidreq().'&' .api_get_cidreq().'&'
. http_build_query([ .http_build_query(['action' => 'report', 'lp_id' => $id]);
'action' => 'report',
'lp_id' => $id,
]);
$trackingAction = Display::url( $trackingAction = Display::url(
Display::return_icon( Display::return_icon(
'test_results.png', 'test_results.png',
get_lang('Results'), get_lang('Results')
array(),
ICON_SIZE_SMALL
), ),
$trackingActionUrl $trackingActionUrl
); );
@ -440,36 +462,25 @@ foreach ($categories as $item) {
$dsp_publish = Display::url( $dsp_publish = Display::url(
Display::return_icon( Display::return_icon(
'lp_publish_na.png', 'lp_publish_na.png',
get_lang('LearnpathPublish'), get_lang('LearnpathPublish')
'',
ICON_SIZE_SMALL
), ),
api_get_self().'?'.api_get_cidreq()."&lp_id=$id&action=toggle_publish&new_status=v" api_get_self().'?'.api_get_cidreq()
."&lp_id=$id&action=toggle_publish&new_status=v"
); );
} else { } 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 = Display::url( $dsp_publish = Display::url(
Display::return_icon( Display::return_icon(
'lp_publish.png', 'lp_publish.png',
get_lang('LearnpathDoNotPublish'), get_lang('LearnpathDoNotPublish')
'',
ICON_SIZE_SMALL
), ),
api_get_self().'?'.api_get_cidreq()."&lp_id=$id&action=toggle_publish&new_status=i" api_get_self().'?'.api_get_cidreq()
."&lp_id=$id&action=toggle_publish&new_status=i"
); );
} }
} else { } else {
$dsp_publish = Display::return_icon( $dsp_publish = Display::return_icon(
'lp_publish_na.png', 'lp_publish_na.png',
get_lang('LearnpathDoNotPublish'), get_lang('LearnpathDoNotPublish')
'',
ICON_SIZE_SMALL
); );
} }
@ -480,48 +491,49 @@ foreach ($categories as $item) {
* It is thus a mix betwenn multiple attempt and mono attempt * It is thus a mix betwenn multiple attempt and mono attempt
*/ */
if ($current_session == $details['lp_session']) { if ($current_session == $details['lp_session']) {
if ($details['seriousgame_mode'] == 1 && $details['lp_prevent_reinit'] == 1) { if ($details['seriousgame_mode'] == 1
&& $details['lp_prevent_reinit'] == 1
) {
// seriousgame mode | next = single // seriousgame mode | next = single
$dsp_reinit = Display::url( $dsp_reinit = Display::url(
Display::return_icon( Display::return_icon(
'reload.png', 'reload.png',
get_lang('PreventMultipleAttempts'), get_lang('PreventMultipleAttempts')
'',
ICON_SIZE_SMALL
), ),
"lp_controller.php?".api_get_cidreq()."&action=switch_attempt_mode&lp_id=$id" "lp_controller.php?".api_get_cidreq()
."&action=switch_attempt_mode&lp_id=$id"
); );
} }
if ($details['seriousgame_mode'] == 0 && $details['lp_prevent_reinit'] == 1) { if ($details['seriousgame_mode'] == 0
&& $details['lp_prevent_reinit'] == 1
) {
// single mode | next = multiple // single mode | next = multiple
$dsp_reinit = Display::url( $dsp_reinit = Display::url(
Display::return_icon( Display::return_icon(
'reload_na.png', 'reload_na.png',
get_lang('AllowMultipleAttempts'), get_lang('AllowMultipleAttempts')
'',
ICON_SIZE_SMALL
), ),
"lp_controller.php?".api_get_cidreq()."&action=switch_attempt_mode&lp_id=$id" "lp_controller.php?".api_get_cidreq()
."&action=switch_attempt_mode&lp_id=$id"
); );
} }
if ($details['seriousgame_mode'] == 0 && $details['lp_prevent_reinit'] == 0) { if ($details['seriousgame_mode'] == 0
&& $details['lp_prevent_reinit'] == 0
) {
// multiple mode | next = seriousgame // multiple mode | next = seriousgame
$dsp_reinit = Display::url( $dsp_reinit = Display::url(
Display::return_icon( Display::return_icon(
'reload.png', 'reload.png',
get_lang('AllowMultipleAttempts'), get_lang('AllowMultipleAttempts')
'',
ICON_SIZE_SMALL
), ),
"lp_controller.php?".api_get_cidreq()."&action=switch_attempt_mode&lp_id=$id" "lp_controller.php?".api_get_cidreq()
."&action=switch_attempt_mode&lp_id=$id"
); );
} }
} else { } else {
$dsp_reinit = Display::return_icon( $dsp_reinit = Display::return_icon(
'reload_na.png', 'reload_na.png',
get_lang('AllowMultipleAttempts'), get_lang('AllowMultipleAttempts')
'',
ICON_SIZE_SMALL
); );
} }
@ -532,48 +544,44 @@ foreach ($categories as $item) {
$dsp_default_view = Display::url( $dsp_default_view = Display::url(
Display::return_icon( Display::return_icon(
'view_fullscreen.png', 'view_fullscreen.png',
get_lang('ViewModeFullScreen'), get_lang('ViewModeFullScreen')
'',
ICON_SIZE_SMALL
), ),
'lp_controller.php?'.api_get_cidreq() 'lp_controller.php?'.api_get_cidreq()
. '&action=switch_view_mode&lp_id='.$id.$token_parameter .'&action=switch_view_mode&lp_id='.$id
.$token_parameter
); );
break; break;
case 'embedded': case 'embedded':
$dsp_default_view = Display::url( $dsp_default_view = Display::url(
Display::return_icon( Display::return_icon(
'view_left_right.png', 'view_left_right.png',
get_lang('ViewModeEmbedded'), get_lang('ViewModeEmbedded')
'',
ICON_SIZE_SMALL
), ),
'lp_controller.php?'.api_get_cidreq() 'lp_controller.php?'.api_get_cidreq()
. '&action=switch_view_mode&lp_id='.$id.$token_parameter .'&action=switch_view_mode&lp_id='.$id
.$token_parameter
); );
break; break;
case 'embedframe': case 'embedframe':
$dsp_default_view = Display::url( $dsp_default_view = Display::url(
Display::return_icon( Display::return_icon(
'view_nofullscreen.png', 'view_nofullscreen.png',
get_lang('ViewModeEmbedFrame'), get_lang('ViewModeEmbedFrame')
'',
ICON_SIZE_SMALL
), ),
'lp_controller.php?'.api_get_cidreq() 'lp_controller.php?'.api_get_cidreq()
. '&action=switch_view_mode&lp_id='.$id.$token_parameter .'&action=switch_view_mode&lp_id='.$id
.$token_parameter
); );
break; break;
case 'impress': case 'impress':
$dsp_default_view = Display::url( $dsp_default_view = Display::url(
Display::return_icon( Display::return_icon(
'window_list_slide.png', 'window_list_slide.png',
get_lang('ViewModeImpress'), get_lang('ViewModeImpress')
'',
ICON_SIZE_SMALL
), ),
'lp_controller.php?'.api_get_cidreq() 'lp_controller.php?'.api_get_cidreq()
. '&action=switch_view_mode&lp_id='.$id.$token_parameter .'&action=switch_view_mode&lp_id='.$id
.$token_parameter
); );
break; break;
} }
@ -581,16 +589,12 @@ foreach ($categories as $item) {
if ($details['lp_view_mode'] == 'fullscreen') { if ($details['lp_view_mode'] == 'fullscreen') {
$dsp_default_view = Display::return_icon( $dsp_default_view = Display::return_icon(
'view_fullscreen_na.png', 'view_fullscreen_na.png',
get_lang('ViewModeEmbedded'), get_lang('ViewModeEmbedded')
'',
ICON_SIZE_SMALL
); );
} else { } else {
$dsp_default_view = Display::return_icon( $dsp_default_view = Display::return_icon(
'view_left_right_na.png', 'view_left_right_na.png',
get_lang('ViewModeEmbedded'), get_lang('ViewModeEmbedded')
'',
ICON_SIZE_SMALL
); );
} }
} }
@ -601,21 +605,19 @@ foreach ($categories as $item) {
$dsp_debug = Display::url( $dsp_debug = Display::url(
Display::return_icon( Display::return_icon(
'bug.png', 'bug.png',
get_lang('HideDebug'), get_lang('HideDebug')
'',
ICON_SIZE_SMALL
), ),
"lp_controller.php?".api_get_cidreq()."&action=switch_scorm_debug&lp_id=$id" "lp_controller.php?".api_get_cidreq()
."&action=switch_scorm_debug&lp_id=$id"
); );
} else { } else {
$dsp_debug = Display::url( $dsp_debug = Display::url(
Display::return_icon( Display::return_icon(
'bug_na.png', 'bug_na.png',
get_lang('ShowDebug'), get_lang('ShowDebug')
'',
ICON_SIZE_SMALL
), ),
"lp_controller.php?".api_get_cidreq()."&action=switch_scorm_debug&lp_id=$id" "lp_controller.php?".api_get_cidreq()
."&action=switch_scorm_debug&lp_id=$id"
); );
} }
} }
@ -623,42 +625,27 @@ foreach ($categories as $item) {
/* Export */ /* Export */
if ($details['lp_type'] == 1) { if ($details['lp_type'] == 1) {
$dsp_disk = Display::url( $dsp_disk = Display::url(
Display::return_icon( Display::return_icon('cd.png', get_lang('Export')),
'cd.png', api_get_self()."?".api_get_cidreq()
get_lang('Export'), ."&action=export&lp_id=$id"
array(),
ICON_SIZE_SMALL
),
api_get_self()."?".api_get_cidreq(
)."&action=export&lp_id=$id"
); );
} elseif ($details['lp_type'] == 2) { } elseif ($details['lp_type'] == 2) {
$dsp_disk = Display::url( $dsp_disk = Display::url(
Display::return_icon( Display::return_icon('cd.png', get_lang('Export')),
'cd.png', api_get_self()."?".api_get_cidreq()
get_lang('Export'), ."&action=export&lp_id=$id&export_name="
array(), .api_replace_dangerous_char($name).".zip"
ICON_SIZE_SMALL
),
api_get_self()."?".api_get_cidreq()."&action=export&lp_id=$id&export_name=".api_replace_dangerous_char($name).".zip"
); );
} else { } else {
$dsp_disk = Display::return_icon( $dsp_disk = Display::return_icon(
'cd_na.png', 'cd_na.png',
get_lang('Export'), get_lang('Export')
array(),
ICON_SIZE_SMALL
); );
} }
// Copy // Copy
$copy = Display::url( $copy = Display::url(
Display::return_icon( Display::return_icon('cd_copy.png', get_lang('Copy')),
'cd_copy.png',
get_lang('Copy'),
array(),
ICON_SIZE_SMALL
),
api_get_self()."?".api_get_cidreq()."&action=copy&lp_id=$id" api_get_self()."?".api_get_cidreq()."&action=copy&lp_id=$id"
); );
@ -666,23 +653,35 @@ foreach ($categories as $item) {
$subscribeUsers = null; $subscribeUsers = null;
if ($details['subscribe_users'] == 1) { if ($details['subscribe_users'] == 1) {
$subscribeUsers = Display::url( $subscribeUsers = Display::url(
Display::return_icon('user.png', get_lang('SubscribeUsersToLp')), Display::return_icon('user.png',
api_get_path(WEB_CODE_PATH)."lp/lp_subscribe_users.php?lp_id=$id&".api_get_cidreq() get_lang('SubscribeUsersToLp')
),
api_get_path(WEB_CODE_PATH)
."lp/lp_subscribe_users.php?lp_id=$id&".api_get_cidreq()
); );
} }
/* Auto launch LP code */ /* Auto launch LP code */
if (api_get_course_setting('enable_lp_auto_launch') == 1) { if (api_get_course_setting('enable_lp_auto_launch') == 1) {
if ($details['autolaunch'] == 1 && $autolaunch_exists == false) { if ($details['autolaunch'] == 1
&& $autolaunch_exists == false
) {
$autolaunch_exists = true; $autolaunch_exists = true;
$lp_auto_launch_icon = Display::url( $lp_auto_launch_icon = Display::url(
Display::return_icon('launch.png', get_lang('DisableLPAutoLaunch')), Display::return_icon(
api_get_self().'?'.api_get_cidreq()."&action=auto_launch&status=0&lp_id=$id" 'launch.png',
get_lang('DisableLPAutoLaunch')
),
api_get_self().'?'.api_get_cidreq()
."&action=auto_launch&status=0&lp_id=$id"
); );
} else { } else {
$lp_auto_launch_icon = Display::url( $lp_auto_launch_icon = Display::url(
Display::return_icon('launch_na.png', get_lang('EnableLPAutoLaunch')), Display::return_icon('launch_na.png',
api_get_self().'?'.api_get_cidreq()."&action=auto_launch&status=1&lp_id=$id" get_lang('EnableLPAutoLaunch')
),
api_get_self().'?'.api_get_cidreq()
."&action=auto_launch&status=1&lp_id=$id"
); );
} }
} }
@ -691,11 +690,10 @@ foreach ($categories as $item) {
$export_icon = Display::url( $export_icon = Display::url(
Display::return_icon( Display::return_icon(
'pdf.png', 'pdf.png',
get_lang('ExportToPDFOnlyHTMLAndImages'), get_lang('ExportToPDFOnlyHTMLAndImages')
'',
ICON_SIZE_SMALL
), ),
api_get_self().'?'.api_get_cidreq()."&action=export_to_pdf&lp_id=$id" api_get_self().'?'.api_get_cidreq()
."&action=export_to_pdf&lp_id=$id"
); );
/* Delete */ /* Delete */
@ -703,19 +701,19 @@ foreach ($categories as $item) {
$dsp_delete = Display::url( $dsp_delete = Display::url(
Display::return_icon( Display::return_icon(
'delete.png', 'delete.png',
get_lang('LearnpathDeleteLearnpath'), get_lang('LearnpathDeleteLearnpath')
'',
ICON_SIZE_SMALL
), ),
'lp_controller.php?'.api_get_cidreq()."&action=delete&lp_id=$id", 'lp_controller.php?'.api_get_cidreq()
['onclick' => "javascript: return confirmation('".addslashes($name)."');"] ."&action=delete&lp_id=$id",
[
'onclick' => "javascript: return confirmation('"
.addslashes($name)."');"
]
); );
} else { } else {
$dsp_delete = Display::return_icon( $dsp_delete = Display::return_icon(
'delete_na.png', 'delete_na.png',
get_lang('LearnpathDeleteLearnpath'), get_lang('LearnpathDeleteLearnpath')
'',
ICON_SIZE_SMALL
); );
} }
@ -724,24 +722,28 @@ foreach ($categories as $item) {
if ($current_session == 0) { if ($current_session == 0) {
if ($details['lp_display_order'] == 1 && $max != 1) { if ($details['lp_display_order'] == 1 && $max != 1) {
$dsp_order .= Display::url( $dsp_order .= Display::url(
Display::return_icon('down.png', get_lang('MoveDown'), '', ICON_SIZE_SMALL), Display::return_icon('down.png', get_lang('MoveDown')),
"lp_controller.php?".api_get_cidreq()."&action=move_lp_down&lp_id=$id&category_id=$categoryId" "lp_controller.php?".api_get_cidreq()
."&action=move_lp_down&lp_id=$id&category_id=$categoryId"
); );
} elseif ($current == $max - 1 && $max != 1) { } elseif ($current == $max - 1 && $max != 1) {
$dsp_order .= Display::url( $dsp_order .= Display::url(
Display::return_icon('up.png', get_lang('MoveUp'), '', ICON_SIZE_SMALL), Display::return_icon('up.png', get_lang('MoveUp')),
"lp_controller.php?".api_get_cidreq()."&action=move_lp_up&lp_id=$id&category_id=$categoryId" "lp_controller.php?".api_get_cidreq()
."&action=move_lp_up&lp_id=$id&category_id=$categoryId"
); );
} elseif ($max == 1) { } elseif ($max == 1) {
$dsp_order = ''; $dsp_order = '';
} else { } else {
$dsp_order .= Display::url( $dsp_order .= Display::url(
Display::return_icon('down.png', get_lang('MoveDown'), '', ICON_SIZE_SMALL), Display::return_icon('down.png', get_lang('MoveDown')),
"lp_controller.php?".api_get_cidreq()."&action=move_lp_down&lp_id=$id&category_id=$categoryId" "lp_controller.php?".api_get_cidreq()
."&action=move_lp_down&lp_id=$id&category_id=$categoryId"
); );
$dsp_order .= Display::url( $dsp_order .= Display::url(
Display::return_icon('up.png', get_lang('MoveUp'), '', ICON_SIZE_SMALL), Display::return_icon('up.png', get_lang('MoveUp')),
"lp_controller.php?".api_get_cidreq()."&action=move_lp_up&lp_id=$id&category_id=$categoryId" "lp_controller.php?".api_get_cidreq()
."&action=move_lp_up&lp_id=$id&category_id=$categoryId"
); );
} }
} }
@ -757,7 +759,8 @@ foreach ($categories as $item) {
if ($details['seriousgame_mode'] == 0) { if ($details['seriousgame_mode'] == 0) {
$actionSeriousGame = Display::toolbarButton( $actionSeriousGame = Display::toolbarButton(
null, null,
api_get_self().'?'.api_get_cidreq()."&lp_id=$id&action=toggle_seriousgame", api_get_self().'?'.api_get_cidreq()
."&lp_id=$id&action=toggle_seriousgame",
'trophy', 'trophy',
'default', 'default',
[ [
@ -768,7 +771,8 @@ foreach ($categories as $item) {
} else { } else {
$actionSeriousGame = Display::toolbarButton( $actionSeriousGame = Display::toolbarButton(
null, null,
api_get_self().'?'.api_get_cidreq()."&lp_id=$id&action=toggle_seriousgame", api_get_self().'?'.api_get_cidreq()
."&lp_id=$id&action=toggle_seriousgame",
'trophy', 'trophy',
'warning', 'warning',
[ [
@ -781,8 +785,9 @@ foreach ($categories as $item) {
} else { } else {
// Student // Student
$export_icon = Display::url( $export_icon = Display::url(
Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL), Display::return_icon('pdf.png', get_lang('ExportToPDF')),
api_get_self().'?'.api_get_cidreq()."&action=export_to_pdf&lp_id=$id" api_get_self().'?'.api_get_cidreq()
."&action=export_to_pdf&lp_id=$id"
); );
} }

Loading…
Cancel
Save