';
diff --git a/main/lp/lp_content.php b/main/lp/lp_content.php
index 1e9e774c82..d6b8ed228f 100755
--- a/main/lp/lp_content.php
+++ b/main/lp/lp_content.php
@@ -33,7 +33,6 @@ if ($debug > 0) {
}
$list = $_SESSION['oLP']->get_toc();
-
$dir = false;
foreach ($list as $toc) {
diff --git a/main/lp/lp_edit.php b/main/lp/lp_edit.php
index 3dac381ebe..3e8de19555 100755
--- a/main/lp/lp_edit.php
+++ b/main/lp/lp_edit.php
@@ -25,7 +25,10 @@ if (!empty($gradebook) && $gradebook == 'view') {
'name' => get_lang('ToolGradebook')
);
}
-$interbreadcrumb[] = array('url' => 'lp_controller.php?action=list&'.api_get_cidreq(), 'name' => get_lang('LearningPaths'));
+$interbreadcrumb[] = array(
+ 'url' => 'lp_controller.php?action=list&'.api_get_cidreq(),
+ 'name' => get_lang('LearningPaths')
+);
$interbreadcrumb[] = array(
'url' => api_get_self()."?action=build&lp_id=".$_SESSION['oLP']->get_id().'&'.api_get_cidreq(),
'name' => $_SESSION['oLP']->get_name()
@@ -51,9 +54,12 @@ function activate_end_date() {
';
$gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null;
-
$defaults = array();
-$form = new FormValidator('form1', 'post', 'lp_controller.php?'.api_get_cidreq());
+$form = new FormValidator(
+ 'form1',
+ 'post',
+ 'lp_controller.php?'.api_get_cidreq()
+);
// Form title
$form->addElement('header', get_lang('EditLPSettings'));
@@ -176,8 +182,8 @@ $form->addElement(
);
$display_date = 'none';
if (!empty($expired_on)) {
- $display_date = 'block';
- $defaults['activate_end_date_check'] = 1;
+ $display_date = 'block';
+ $defaults['activate_end_date_check'] = 1;
}
$form->addElement('html', '');
diff --git a/main/lp/lp_edit_item.php b/main/lp/lp_edit_item.php
index 38b2e718b5..c5f58c4b75 100755
--- a/main/lp/lp_edit_item.php
+++ b/main/lp/lp_edit_item.php
@@ -13,7 +13,6 @@
*/
$this_section = SECTION_COURSES;
-
api_protect_course_script();
/* Header and action code */
diff --git a/main/lp/lp_edit_item_prereq.php b/main/lp/lp_edit_item_prereq.php
index 84475b65c8..1348880b76 100755
--- a/main/lp/lp_edit_item_prereq.php
+++ b/main/lp/lp_edit_item_prereq.php
@@ -60,7 +60,6 @@ $interbreadcrumb[] = array(
'name' => get_lang('NewStep'),
);
-
Display::display_header(get_lang('LearnpathPrerequisites'), 'Path');
$suredel = trim(get_lang('AreYouSureToDeleteJS'));
diff --git a/main/lp/lp_final_item.php b/main/lp/lp_final_item.php
index 46f173b98e..9b8a836eb7 100644
--- a/main/lp/lp_final_item.php
+++ b/main/lp/lp_final_item.php
@@ -74,8 +74,7 @@ $currentItem = $lp->items[$currentItemId];
$currentItemStatus = $currentItem->get_status();
$accessGranted = false;
-if (
- ($count - $completed == 0) ||
+if (($count - $completed == 0) ||
($count - $completed == 1 && ($currentItemStatus == 'incomplete') || ($currentItemStatus == 'not attempted'))
) {
if ($lp->prerequisites_match($currentItemId)) {
@@ -95,10 +94,17 @@ if ($accessGranted == false) {
echo Display::return_message(get_lang('LearnpathPrereqNotCompleted'), 'warning');
$finalItemTemplate = '';
} else {
- $catLoad = Category::load(null, null, $courseCode, null, null, $sessionId, 'ORDER By id');
+ $catLoad = Category::load(
+ null,
+ null,
+ $courseCode,
+ null,
+ null,
+ $sessionId,
+ 'ORDER By id'
+ );
// If not gradebook has been defined
if (empty($catLoad)) {
-
$finalItemTemplate = generateLPFinalItemTemplate(
$id,
$courseCode,
@@ -110,7 +116,14 @@ if ($accessGranted == false) {
} else {
// A gradebook was found, proceed...
$categoryId = $catLoad[0]->get_id();
- $link = LinkFactory::load(null, null, $lpId, null, $courseCode, $categoryId);
+ $link = LinkFactory::load(
+ null,
+ null,
+ $lpId,
+ null,
+ $courseCode,
+ $categoryId
+ );
if ($link) {
$cat = new Category();
@@ -119,26 +132,53 @@ if ($accessGranted == false) {
if ($show_message == '') {
if (!api_is_allowed_to_edit() && !api_is_excluded_user_type()) {
- $certificate = Category::generateUserCertificate($categoryId, $userId);
+ $certificate = Category::generateUserCertificate(
+ $categoryId,
+ $userId
+ );
if (!empty($certificate['pdf_url']) || !empty($certificate['badge_link'])) {
if (is_array($certificate) && isset($certificate['pdf_url'])) {
- $downloadCertificateLink = generateLPFinalItemTemplateCertificateLinks($certificate);
+ $downloadCertificateLink = generateLPFinalItemTemplateCertificateLinks(
+ $certificate
+ );
}
- if (is_array($certificate) && isset($certificate['badge_link'])) {
+ if (is_array($certificate) &&
+ isset($certificate['badge_link'])
+ ) {
$courseId = api_get_course_int_id();
- $badgeLink = generateLPFinalItemTemplateBadgeLinks($userId, $courseId, $sessionId);
+ $badgeLink = generateLPFinalItemTemplateBadgeLinks(
+ $userId,
+ $courseId,
+ $sessionId
+ );
}
}
- $currentScore = Category::getCurrentScore($userId, $categoryId, $courseCode, $sessionId, true);
- Category::registerCurrentScore($currentScore, $userId, $categoryId);
+ $currentScore = Category::getCurrentScore(
+ $userId,
+ $categoryId,
+ $courseCode,
+ $sessionId,
+ true
+ );
+ Category::registerCurrentScore(
+ $currentScore,
+ $userId,
+ $categoryId
+ );
}
}
}
- $finalItemTemplate = generateLPFinalItemTemplate($id, $courseCode, $sessionId, $downloadCertificateLink, $badgeLink);
+ $finalItemTemplate = generateLPFinalItemTemplate(
+ $id,
+ $courseCode,
+ $sessionId,
+ $downloadCertificateLink,
+ $badgeLink
+ );
if (!$finalItemTemplate) {
echo Display::return_message(get_lang('FileNotFound'), 'warning');
@@ -162,8 +202,13 @@ $tpl->display_blank_template();
* @param string $badgeLink
* @return mixed|string
*/
-function generateLPFinalItemTemplate($lpItemId, $courseCode, $sessionId = 0, $downloadCertificateLink = '', $badgeLink = '')
-{
+function generateLPFinalItemTemplate(
+ $lpItemId,
+ $courseCode,
+ $sessionId = 0,
+ $downloadCertificateLink = '',
+ $badgeLink = ''
+) {
$documentInfo = DocumentManager::get_document_data_by_id(
$lpItemId,
$courseCode,
diff --git a/main/lp/lp_impress.php b/main/lp/lp_impress.php
index 55c97caffc..f96bb198aa 100755
--- a/main/lp/lp_impress.php
+++ b/main/lp/lp_impress.php
@@ -47,10 +47,9 @@ $debug = 0;
if ($debug) { error_log('------ Entering lp_impress.php -------'); }
-$course_code = api_get_course_id();
-$course_id = api_get_course_int_id();
+$course_code = api_get_course_id();
+$course_id = api_get_course_int_id();
$htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/impress/impress-demo.css');
-
$list = $_SESSION['oLP']->get_toc();
$is_allowed_to_edit = api_is_allowed_to_edit(null, true, false, false);
diff --git a/main/lp/lp_move_item.php b/main/lp/lp_move_item.php
index 1233190810..dc41e9a025 100755
--- a/main/lp/lp_move_item.php
+++ b/main/lp/lp_move_item.php
@@ -112,7 +112,7 @@ Display::display_header(get_lang('Move'), 'Path');
$suredel = trim(get_lang('AreYouSureToDeleteJS'));
?>
-