Minor - format code.

pull/2487/head
jmontoyaa 8 years ago
parent 03006a6072
commit b47557153f
  1. 74
      main/lp/lp_list.php

@ -87,34 +87,47 @@ if ($is_allowed_to_edit) {
break; break;
} }
} }
$actionLeft = null; $actionLeft = '';
if (!$current_session) { if (!$current_session) {
$actionLeft .= Display::url( $actionLeft .= Display::url(
Display::return_icon('new_folder.png', get_lang('AddCategory'), Display::return_icon(
array(), ICON_SIZE_MEDIUM), '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', Display::return_icon(
get_lang('LearnpathAddLearnpath'), '', ICON_SIZE_MEDIUM), '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'), '', Display::return_icon(
ICON_SIZE_MEDIUM), 'import_scorm.png',
'../upload/index.php?'.api_get_cidreq().'&curdirpath=/&tool=' get_lang('UploadScorm'),
.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', Display::return_icon(
get_lang('PowerPointConvert'), '', ICON_SIZE_MEDIUM), 'import_powerpoint.png',
'../upload/upload_ppt.php?'.api_get_cidreq().'&curdirpath=/&tool=' get_lang('PowerPointConvert'),
.TOOL_LEARNPATH '',
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));
@ -128,7 +141,6 @@ $categoryTest = new CLpCategory();
$categoryTest->setId(0); $categoryTest->setId(0);
$categoryTest->setName(get_lang('WithOutCategory')); $categoryTest->setName(get_lang('WithOutCategory'));
$categoryTest->setPosition(0); $categoryTest->setPosition(0);
$categories = array( $categories = array(
$categoryTest $categoryTest
); );
@ -215,8 +227,7 @@ foreach ($categories as $item) {
); );
// Check if the learnpath is visible for student. // Check if the learnpath is visible for student.
if ( if (!$is_allowed_to_edit && $lpVisibility === false
!$is_allowed_to_edit && $lpVisibility === false
&& ($isBlocked && $showBlockedPrerequisite === false) && ($isBlocked && $showBlockedPrerequisite === false)
) { ) {
continue; continue;
@ -227,9 +238,8 @@ 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 ( if (empty($details['created_on']) &&
empty($details['created_on']) empty($details['modified_on'])
&& empty($details['modified_on'])
) { ) {
$time_limits = false; $time_limits = false;
} }
@ -241,9 +251,8 @@ foreach ($categories as $item) {
if ($time_limits) { if ($time_limits) {
// Check if start time // Check if start time
if ( if (!empty($details['publicated_on']) &&
!empty($details['publicated_on']) !empty($details['expired_on'])
&& !empty($details['expired_on'])
) { ) {
$start_time = api_strtotime( $start_time = api_strtotime(
$details['publicated_on'], $details['publicated_on'],
@ -287,8 +296,7 @@ foreach ($categories as $item) {
$oddclass = 'row_even'; $oddclass = 'row_even';
} }
$url_start_lp = 'lp_controller.php?'.api_get_cidreq() $url_start_lp = 'lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$id;
.'&action=view&lp_id='.$id;
$name = Security::remove_XSS($details['lp_name']); $name = Security::remove_XSS($details['lp_name']);
$extra = null; $extra = null;
@ -324,9 +332,8 @@ foreach ($categories as $item) {
} }
// Students can see the lp but is inactive // Students can see the lp but is inactive
if ( if (!$is_allowed_to_edit && $lpVisibility == false &&
!$is_allowed_to_edit && $lpVisibility == false $showBlockedPrerequisite == true
&& $showBlockedPrerequisite == true
) { ) {
$my_title = Display::tag( $my_title = Display::tag(
'font', 'font',
@ -433,9 +440,8 @@ 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 ( if (!isset($details['subscribe_users']) ||
!isset($details['subscribe_users']) $details['subscribe_users'] != 1
|| $details['subscribe_users'] != 1
) { ) {
if ($details['lp_visibility'] == 0) { if ($details['lp_visibility'] == 0) {
$dsp_visible = Display::url( $dsp_visible = Display::url(
@ -665,7 +671,8 @@ 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', Display::return_icon(
'user.png',
get_lang('SubscribeUsersToLp') get_lang('SubscribeUsersToLp')
), ),
api_get_path(WEB_CODE_PATH) api_get_path(WEB_CODE_PATH)
@ -689,7 +696,8 @@ foreach ($categories as $item) {
); );
} else { } else {
$lp_auto_launch_icon = Display::url( $lp_auto_launch_icon = Display::url(
Display::return_icon('launch_na.png', Display::return_icon(
'launch_na.png',
get_lang('EnableLPAutoLaunch') get_lang('EnableLPAutoLaunch')
), ),
api_get_self().'?'.api_get_cidreq() api_get_self().'?'.api_get_cidreq()

Loading…
Cancel
Save