Minor - format code

pull/2487/head
jmontoyaa 7 years ago
parent fd6f9c12a0
commit ce3526e064
  1. 2
      main/lp/learnpath.class.php
  2. 13
      main/lp/learnpathList.class.php
  3. 31
      main/lp/lp_list.php
  4. 4
      main/wiki/wiki.inc.php
  5. 2
      src/Chamilo/CourseBundle/Entity/CLpCategory.php

@ -4589,7 +4589,7 @@ class learnpath
// Subscribed groups to a LP
$subscribedGroupsInLp = $itemRepo->getGroupsSubscribedToItem(
'learnpath_category',
TOOL_LEARNPATH_CATEGORY,
$category->getId(),
$course,
$session

@ -39,25 +39,24 @@ class LearnpathList
public function __construct(
$user_id,
$course_code = '',
$session_id = null,
$session_id = 0,
$order_by = null,
$check_publication_dates = false,
$categoryId = null,
$ignoreCategoryFilter = false
) {
$course_info = api_get_course_info($course_code);
$tbl_tool = Database::get_course_table(TABLE_TOOL_LIST);
$this->course_code = $course_code;
$this->user_id = $user_id;
if (empty($course_info['real_id'])) {
return false;
}
$this->course_code = $course_info['code'];
$this->user_id = $user_id;
$course_id = $course_info['real_id'];
// Condition for the session.
if (isset($session_id)) {
if (!empty($session_id)) {
$session_id = intval($session_id);
} else {
$session_id = api_get_session_id();
@ -70,6 +69,8 @@ class LearnpathList
'lp.sessionId'
);
$tbl_tool = Database::get_course_table(TABLE_TOOL_LIST);
$order = "ORDER BY lp.displayOrder ASC, lp.name ASC";
if (isset($order_by)) {
$order = Database::parse_conditions(array('order' => $order_by));

@ -50,7 +50,7 @@ if (api_get_setting('search_enabled') === 'true') {
require api_get_path(LIBRARY_PATH).'search/search_widget.php';
search_widget_prepare($htmlHeadXtra);
}
$current_session = api_get_session_id();
$sessionId = api_get_session_id();
$subscriptionSettings = learnpath::getSubscriptionSettings();
@ -90,7 +90,7 @@ if ($is_allowed_to_edit) {
}
}
$actionLeft = '';
if (!$current_session) {
if (!$sessionId) {
$actionLeft .= Display::url(
Display::return_icon(
'new_folder.png',
@ -154,7 +154,7 @@ if (!empty($categoriesTempList)) {
$userId = api_get_user_id();
$userInfo = api_get_user_info();
$lpIsShown = false;
$filteredCategoryId = $action === 'view_category' && !empty($_GET['id']) ? intval($_GET['id']) : 0;
$filteredCategoryId = ($action === 'view_category' && !empty($_GET['id'])) ? intval($_GET['id']) : 0;
if ($filteredCategoryId) {
/** @var CLpCategory $category */
@ -169,7 +169,7 @@ if ($filteredCategoryId) {
}
$test_mode = api_get_setting('server_type');
$user = UserManager::getRepository()->find($userId);
$user = api_get_user_entity($userId);
$data = [];
/** @var CLpCategory $item */
@ -182,8 +182,8 @@ foreach ($categories as $item) {
$list = new LearnpathList(
api_get_user_id(),
null,
null,
api_get_course_id(),
api_get_session_id(),
null,
false,
$categoryId
@ -196,8 +196,7 @@ foreach ($categories as $item) {
continue;
}
$showBlockedPrerequisite
= api_get_configuration_value('show_prerequisite_as_blocked');
$showBlockedPrerequisite = api_get_configuration_value('show_prerequisite_as_blocked');
$listData = [];
if (!empty($flat_list)) {
@ -389,7 +388,7 @@ foreach ($categories as $item) {
if ($is_allowed_to_edit) {
// EDIT LP
if ($current_session == $details['lp_session']) {
if ($sessionId == $details['lp_session']) {
$dsp_edit_lp = Display::url(
Display::return_icon(
'settings.png',
@ -406,7 +405,7 @@ foreach ($categories as $item) {
}
// BUILD
if ($current_session == $details['lp_session']) {
if ($sessionId == $details['lp_session']) {
if ($details['lp_type'] == 1 || $details['lp_type'] == 2) {
$dsp_build = Display::url(
Display::return_icon(
@ -476,7 +475,7 @@ foreach ($categories as $item) {
);
/* PUBLISH COMMAND */
if ($current_session == $details['lp_session']) {
if ($sessionId == $details['lp_session']) {
if ($details['lp_published'] == "i") {
$dsp_publish = Display::url(
Display::return_icon(
@ -509,7 +508,7 @@ foreach ($categories as $item) {
* When lp status is completed, user can still modify the attempt (adds/time change score, and browse it)
* It is thus a mix betwenn multiple attempt and mono attempt
*/
if ($current_session == $details['lp_session']) {
if ($sessionId == $details['lp_session']) {
if ($details['seriousgame_mode'] == 1
&& $details['lp_prevent_reinit'] == 1
) {
@ -557,7 +556,7 @@ foreach ($categories as $item) {
}
/* SCREEN LP VIEW */
if ($current_session == $details['lp_session']) {
if ($sessionId == $details['lp_session']) {
switch ($details['lp_view_mode']) {
case 'fullscreen':
$dsp_default_view = Display::url(
@ -719,7 +718,7 @@ foreach ($categories as $item) {
);
/* Delete */
if ($current_session == $details['lp_session']) {
if ($sessionId == $details['lp_session']) {
$dsp_delete = Display::url(
Display::return_icon(
'delete.png',
@ -741,7 +740,7 @@ foreach ($categories as $item) {
/* COLUMN ORDER */
// Only active while session mode is not active
if ($current_session == 0) {
if ($sessionId == 0) {
if ($details['lp_display_order'] == 1 && $max != 1) {
$dsp_order .= Display::url(
Display::return_icon('down.png', get_lang('MoveDown')),
@ -868,7 +867,7 @@ foreach ($categories as $item) {
$courseInfo,
TOOL_LEARNPATH_CATEGORY,
$item->getId(),
$current_session
$sessionId
),
'category_is_published' => learnpath::categoryIsPublished(
$item,

@ -2485,9 +2485,7 @@ class Wiki
mpdf-->'.$content_pdf;
$css_file = api_get_path(SYS_CSS_PATH).'themes/'.api_get_setting(
'stylesheets'
).'/print.css';
$css_file = api_get_path(SYS_CSS_PATH).'themes/'.api_get_setting('stylesheets').'/print.css';
if (file_exists($css_file)) {
$css = @file_get_contents($css_file);
} else {

@ -3,6 +3,7 @@
namespace Chamilo\CourseBundle\Entity;
use Chamilo\UserBundle\Entity\User;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Mapping as ORM;
@ -213,7 +214,6 @@ class CLpCategory
$categoryUser->setUser($user);
return $this->hasUser($categoryUser);
}
return false;

Loading…
Cancel
Save