diff --git a/main/course_progress/thematic_advance.php b/main/course_progress/thematic_advance.php
index 30ea5d3a9c..350625294c 100755
--- a/main/course_progress/thematic_advance.php
+++ b/main/course_progress/thematic_advance.php
@@ -30,10 +30,10 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
$form->addElement('hidden', 'action', $action);
if (!empty($thematic_advance_id)) {
- $form->addElement('hidden', 'thematic_advance_id',$thematic_advance_id);
+ $form->addElement('hidden', 'thematic_advance_id', $thematic_advance_id);
}
if (!empty($thematic_id)) {
- $form->addElement('hidden', 'thematic_id',$thematic_id);
+ $form->addElement('hidden', 'thematic_id', $thematic_id);
}
$radios = array();
@@ -80,14 +80,30 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
}
if (count($attendance_select) > 1) {
- $form->addElement('select', 'attendance_select', get_lang('Attendances'), $attendance_select, array('id' => 'id_attendance_select', 'onchange' => 'datetime_by_attendance(this.value)'));
+ $form->addElement(
+ 'select',
+ 'attendance_select',
+ get_lang('Attendances'),
+ $attendance_select,
+ array('id' => 'id_attendance_select', 'onchange' => 'datetime_by_attendance(this.value)')
+ );
} else {
- $form->addElement('label', get_lang('Attendances'), ''.get_lang('ThereAreNoAttendancesInsideCourse').'');
+ $form->addElement(
+ 'label',
+ get_lang('Attendances'),
+ ''.get_lang('ThereAreNoAttendancesInsideCourse').''
+ );
}
$form->addElement('html', '
');
if (!empty($calendar_select)) {
- $form->addElement('select', 'start_date_by_attendance', get_lang('StartDate'), $calendar_select, array('id'=>'start_date_select_calendar'));
+ $form->addElement(
+ 'select',
+ 'start_date_by_attendance',
+ get_lang('StartDate'),
+ $calendar_select,
+ array('id' => 'start_date_select_calendar')
+ );
}
$form->addElement('html', '
');
$form->addElement('html', '');
diff --git a/main/course_progress/thematic_controller.php b/main/course_progress/thematic_controller.php
index 43525bed29..fdc5da6ead 100755
--- a/main/course_progress/thematic_controller.php
+++ b/main/course_progress/thematic_controller.php
@@ -39,7 +39,7 @@ class ThematicController
$data = array();
$check = Security::check_token('request');
$thematic_id = isset($_REQUEST['thematic_id']) ? intval($_REQUEST['thematic_id']) : null;
- $displayHeader = (!empty($_REQUEST['display']) && $_REQUEST['display'] === 'no_header') ? false : true;
+ $displayHeader = !empty($_REQUEST['display']) && $_REQUEST['display'] === 'no_header' ? false : true;
if ($check) {
switch ($action) {
diff --git a/main/create_course/add_course.php b/main/create_course/add_course.php
index f67fccbba1..520fc31562 100755
--- a/main/create_course/add_course.php
+++ b/main/create_course/add_course.php
@@ -11,7 +11,6 @@
* "Course validation" feature, technical adaptation for Chamilo 1.8.8:
* @author Ivan Tcholakov
*/
-use \ChamiloSession as Session;
// Flag forcing the "current course" reset.
$cidReset = true;
@@ -26,7 +25,7 @@ $this_section = SECTION_COURSES;
// true - the new course is requested only and it is created after approval;
// false - the new course is created immediately, after filling this form.
$course_validation_feature = false;
-if (api_get_setting('course_validation') == 'true' && !api_is_platform_admin()) {
+if (api_get_setting('course_validation') === 'true' && !api_is_platform_admin()) {
$course_validation_feature = true;
}
@@ -49,10 +48,7 @@ $tool_name = $course_validation_feature ? get_lang('CreateCourseRequest') : get_
$tpl = new Template($tool_name);
-if (
- api_get_setting('allow_users_to_create_courses') == 'false' &&
- !api_is_platform_admin()
-) {
+if (api_get_setting('allow_users_to_create_courses') === 'false' && !api_is_platform_admin()) {
api_not_allowed(true);
}
@@ -123,7 +119,6 @@ $form->addRule(
);
// The teacher
-//array(get_lang('Professor'), null), null, array('size' => '60', 'disabled' => 'disabled'));
$titular = & $form->addElement('hidden', 'tutor_name', '');
if ($course_validation_feature) {
@@ -361,7 +356,7 @@ if ($form->validate()) {
false
);
// Display the form.
- $content = $form->return_form();
+ $content = $form->returnForm();
}
}
} else {
@@ -371,7 +366,7 @@ if ($form->validate()) {
false
);
// Display the form.
- $content = $form->return_form();
+ $content = $form->returnForm();
}
} else {
if (!$course_validation_feature) {
diff --git a/main/dropbox/dropbox_class.inc.php b/main/dropbox/dropbox_class.inc.php
index 9c223622f4..d6f8ddf0ff 100755
--- a/main/dropbox/dropbox_class.inc.php
+++ b/main/dropbox/dropbox_class.inc.php
@@ -54,7 +54,8 @@ class Dropbox_Work
public $upload_date;
public $last_upload_date;
public $isOldWork;
- public $feedback_date, $feedback;
+ public $feedback_date;
+ public $feedback;
/**
* Constructor calls private functions to create a new work or retreive an existing work from DB
@@ -126,7 +127,7 @@ class Dropbox_Work
'description' => $this->description,
'author' => $this->author,
'last_upload_date' => $this->last_upload_date,
- 'session_id' => api_get_session_id(),
+ 'session_id' => api_get_session_id()
];
Database::update(
@@ -220,9 +221,10 @@ class Dropbox_Work
// Getting the feedback on the work.
if ($action == 'viewfeedback' AND $this->id == $_GET['id']) {
$feedback2 = array();
- $sql_feedback = "SELECT * FROM ".$dropbox_cnf['tbl_feedback']."
- WHERE c_id = $course_id AND file_id='".$id."' ORDER BY feedback_id ASC";
- $result = Database::query($sql_feedback);
+ $sql = "SELECT * FROM ".$dropbox_cnf['tbl_feedback']."
+ WHERE c_id = $course_id AND file_id='".$id."'
+ ORDER BY feedback_id ASC";
+ $result = Database::query($sql);
while ($row_feedback = Database::fetch_array($result)) {
$row_feedback['feedback'] = Security::remove_XSS($row_feedback['feedback']);
$feedback2[] = $row_feedback;
@@ -381,7 +383,6 @@ class Dropbox_SentWork extends Dropbox_Work
WHERE c_id = $course_id AND file_id = ".intval($id)."";
$result = Database::query($sql);
while ($res = Database::fetch_array($result, 'ASSOC')) {
-
// Check for deleted users
$dest_user_id = $res['dest_user_id'];
$user_info = api_get_user_info($dest_user_id);
@@ -571,7 +572,7 @@ class Dropbox_Person
/**
* Deletes all the received work of this person
*/
- function deleteAllReceivedWork()
+ public function deleteAllReceivedWork()
{
$course_id = api_get_course_int_id();
$dropbox_cnf = getDropboxConf();
@@ -589,7 +590,7 @@ class Dropbox_Person
* Deletes all the received categories and work of this person
* @param integer $id
*/
- function deleteReceivedWorkFolder($id)
+ public function deleteReceivedWorkFolder($id)
{
$dropbox_cnf = getDropboxConf();
$course_id = api_get_course_int_id();
@@ -612,7 +613,7 @@ class Dropbox_Person
*
* @param integer $id
*/
- function deleteReceivedWork($id)
+ public function deleteReceivedWork($id)
{
$course_id = api_get_course_int_id();
$dropbox_cnf = getDropboxConf();
@@ -642,7 +643,7 @@ class Dropbox_Person
/**
* Deletes all the sent dropbox files of this person
*/
- function deleteAllSentWork()
+ public function deleteAllSentWork()
{
$course_id = api_get_course_int_id();
$dropbox_cnf = getDropboxConf();
@@ -661,7 +662,7 @@ class Dropbox_Person
*
* @param unknown_type $id
*/
- function deleteSentWork($id)
+ public function deleteSentWork($id)
{
$course_id = api_get_course_int_id();
$dropbox_cnf = getDropboxConf();
@@ -696,7 +697,7 @@ class Dropbox_Person
* @param string $id
* @param string $text
*/
- function updateFeedback($id, $text)
+ public function updateFeedback($id, $text)
{
$course_id = api_get_course_int_id();
$_course = api_get_course_info();
@@ -760,7 +761,7 @@ class Dropbox_Person
* @param string $type
* @param string $value
*/
- function filter_received_work($type, $value)
+ public function filter_received_work($type, $value)
{
$dropbox_cnf = getDropboxConf();
$new_received_work = array();
diff --git a/main/exercise/exercise.php b/main/exercise/exercise.php
index 7c76278dd5..0dd1689507 100644
--- a/main/exercise/exercise.php
+++ b/main/exercise/exercise.php
@@ -223,7 +223,12 @@ if ($is_allowedToEdit) {
// deletes an exercise
if ($exercise_action_locked == false) {
$objExerciseTmp->delete();
- $link_info = GradebookUtils::is_resource_in_course_gradebook(api_get_course_id(), 1, $exerciseId, api_get_session_id());
+ $link_info = GradebookUtils::isResourceInCourseGradebook(
+ api_get_course_id(),
+ 1,
+ $exerciseId,
+ api_get_session_id()
+ );
if ($link_info !== false) {
GradebookUtils::remove_resource_from_course_gradebook($link_info['id']);
}
diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php
index a1e0094f77..2a0a307eb1 100755
--- a/main/forum/forumfunction.inc.php
+++ b/main/forum/forumfunction.inc.php
@@ -136,7 +136,7 @@ function handle_forum_and_forumcategories($lp_id = null)
for ($i = 0; $i < count($list_threads); $i++) {
deleteForumCategoryThread('thread', $list_threads[$i]['thread_id']);
- $link_info = GradebookUtils::is_resource_in_course_gradebook(
+ $link_info = GradebookUtils::isResourceInCourseGradebook(
api_get_course_id(),
5,
intval($list_threads[$i]['thread_id']),
@@ -2366,7 +2366,7 @@ function updateThread($values)
$sessionId = api_get_session_id();
$courseId = api_get_course_id();
- $linkInfo = GradebookUtils::is_resource_in_course_gradebook(
+ $linkInfo = GradebookUtils::isResourceInCourseGradebook(
$courseId,
LINK_FORUM_THREAD,
$id,
@@ -2636,7 +2636,7 @@ function store_thread($current_forum, $values, $courseInfo = array(), $showMessa
Session::erase('breadcrumbs');
Session::erase('addedresource');
Session::erase('addedresourceid');
-
+
if ($showMessage) {
Display::addFlash(Display::return_message($message, 'success', false));
}
@@ -3520,7 +3520,12 @@ function show_edit_post_form(
$form->addElement('label', ''.get_lang('AlterQualifyThread').'');
$form->addElement('checkbox', 'thread_qualify_gradebook', '', get_lang('QualifyThreadGradebook'), 'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
- $link_info = GradebookUtils::is_resource_in_course_gradebook(api_get_course_id(), 5, $_GET['thread'], api_get_session_id());
+ $link_info = GradebookUtils::isResourceInCourseGradebook(
+ api_get_course_id(),
+ 5,
+ $_GET['thread'],
+ api_get_session_id()
+ );
if (!empty($link_info)) {
$defaults['thread_qualify_gradebook'] = true;
$defaults['category_id'] = $link_info['category_id'];
diff --git a/main/forum/viewforum.php b/main/forum/viewforum.php
index dad2b115ff..bbfa27367a 100755
--- a/main/forum/viewforum.php
+++ b/main/forum/viewforum.php
@@ -193,7 +193,7 @@ if (
$message = deleteForumCategoryThread($_GET['content'], $_GET['id']);
// Delete link
- $link_info = GradebookUtils::is_resource_in_course_gradebook(
+ $link_info = GradebookUtils::isResourceInCourseGradebook(
api_get_course_id(),
5,
intval($_GET['id']),
diff --git a/main/gradebook/certificate_report.php b/main/gradebook/certificate_report.php
index 38930081d9..8098c826bf 100644
--- a/main/gradebook/certificate_report.php
+++ b/main/gradebook/certificate_report.php
@@ -1,12 +1,13 @@
* @package chamilo.gradebook
*/
-use ChamiloSession as Session;
$cidReset = true;
diff --git a/main/gradebook/get_badges.php b/main/gradebook/get_badges.php
index f477cc8908..5b918792ee 100644
--- a/main/gradebook/get_badges.php
+++ b/main/gradebook/get_badges.php
@@ -57,9 +57,11 @@ $tpl = new Template(get_lang('Badges'), false, false);
$tpl->assign(
'content',
- ""
+ ""
);
$tpl->display_one_col_template();
diff --git a/main/gradebook/gradebook.php b/main/gradebook/gradebook.php
index f8919e83df..ed96babf4c 100755
--- a/main/gradebook/gradebook.php
+++ b/main/gradebook/gradebook.php
@@ -1,9 +1,11 @@
+$htmlHeadXtra[] = '';
api_block_anonymous_users();
-$htmlHeadXtra[]= '';
/*
MAIN CODE
*/
-if (isset($_GET['f']) && $_GET['f']=='social') {
+if (isset($_GET['f']) && $_GET['f'] === 'social') {
$this_section = SECTION_SOCIAL;
$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social'));
$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox'));
@@ -66,13 +62,17 @@ if (isset($_GET['f']) && $_GET['f']=='social') {
$actions = '';
if (api_get_setting('extended_profile') == 'true') {
if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
- $actions .= ''.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'';
+ $actions .= ''.
+ Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'';
}
if (api_get_setting('allow_message_tool') == 'true') {
//echo ''.Display::return_icon('inbox.png').' '.get_lang('Messages').'';
- $actions .= ''.Display::return_icon('message_new.png',get_lang('ComposeMessage')).'';
- $actions .= ''.Display::return_icon('inbox.png',get_lang('Inbox')).'';
- $actions .= ''.Display::return_icon('outbox.png',get_lang('Outbox')).'';
+ $actions .= ''.
+ Display::return_icon('message_new.png',get_lang('ComposeMessage')).'';
+ $actions .= ''.
+ Display::return_icon('inbox.png',get_lang('Inbox')).'';
+ $actions .= ''.
+ Display::return_icon('outbox.png',get_lang('Outbox')).'';
}
}
@@ -81,7 +81,7 @@ $info_delete_outbox =array();
$info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',',$_GET['form_delete_outbox']) : '';
$count_delete_outbox = count($info_delete_outbox) - 1;
-if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0])=='delete') {
+if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0]) == 'delete') {
for ($i = 1; $i <= $count_delete_outbox; $i++) {
MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]);
}
diff --git a/main/messages/view_message.php b/main/messages/view_message.php
index f0d19244c7..8c0c5512c9 100755
--- a/main/messages/view_message.php
+++ b/main/messages/view_message.php
@@ -27,11 +27,11 @@ if (isset($_GET['f']) && $_GET['f']=='social') {
if (api_get_setting('extended_profile') == 'true') {
$social_right_content .= '';
- if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
+ if (api_get_setting('allow_social_tool') === 'true' && api_get_setting('allow_message_tool') === 'true') {
$social_right_content .= '
'.
Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'';
}
- if (api_get_setting('allow_message_tool') == 'true') {
+ if (api_get_setting('allow_message_tool') === 'true') {
$social_right_content .= '
'.
Display::return_icon('message_new.png',get_lang('ComposeMessage')).'';
$social_right_content .= '
'.
@@ -56,7 +56,7 @@ if (empty($_GET['id'])) {
$message = '';
// LEFT COLUMN
-if (api_get_setting('allow_social_tool') == 'true') {
+if (api_get_setting('allow_social_tool') === 'true') {
// Block Social Menu
$social_menu_block = SocialManager::show_social_menu($show_menu);
}
@@ -72,7 +72,7 @@ $tpl = new Template(get_lang('View'));
// Block Social Avatar
SocialManager::setSocialUserBlock($tpl, $user_id, $show_menu);
-if (api_get_setting('allow_social_tool') == 'true') {
+if (api_get_setting('allow_social_tool') === 'true') {
$tpl->assign('social_menu_block', $social_menu_block);
$tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('social/inbox.tpl');
diff --git a/main/mySpace/user_edit.php b/main/mySpace/user_edit.php
index e342b89363..7944a89b73 100644
--- a/main/mySpace/user_edit.php
+++ b/main/mySpace/user_edit.php
@@ -2,7 +2,6 @@
/* For licensing terms, see /license.txt */
// including necessary libraries
-$language_file = array('admin', 'registration');
$cidReset = true;
require_once '../inc/global.inc.php';
@@ -181,7 +180,7 @@ if ($form->validate()) {
api_get_setting('administratorTelephone')."\n" .
get_lang('Email') ." : ".api_get_setting('emailAdministrator');
$emailbody = nl2br($emailbody);
-
+
api_mail_html(
api_get_person_name($userInfo['firstname'], $userInfo['lastname'], null, PERSON_NAME_EMAIL_ADDRESS),
$email,
diff --git a/main/notebook/index.php b/main/notebook/index.php
index 229ff75278..c265cca06c 100755
--- a/main/notebook/index.php
+++ b/main/notebook/index.php
@@ -7,7 +7,6 @@
* refactoring and tighter integration
*/
-// Including the global initialization file
require_once '../inc/global.inc.php';
$current_course_tool = TOOL_NOTEBOOK;
@@ -20,12 +19,12 @@ api_protect_course_script(true);
// Additional javascript
$htmlHeadXtra[] = NotebookManager::javascript_notebook();
-$htmlHeadXtra[] = '';
@@ -35,12 +34,14 @@ $tool = TOOL_NOTEBOOK;
// Tracking
Event::event_access_tool(TOOL_NOTEBOOK);
+$action = isset($_GET['action']) ? $_GET['action'] : '';
+
// Tool name
-if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
+if ($action === 'addnote') {
$tool = 'NoteAddNew';
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('ToolNotebook'));
}
-if (isset($_GET['action']) && $_GET['action'] == 'editnote') {
+if ($action === 'editnote') {
$tool = 'ModifyNote';
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('ToolNotebook'));
}
@@ -52,7 +53,7 @@ Display::display_header(get_lang(ucfirst($tool)));
Display::display_introduction_section(TOOL_NOTEBOOK);
// Action handling: Adding a note
-if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
+if ($action === 'addnote') {
if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
api_not_allowed();
}
@@ -103,7 +104,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
$form->setConstants(array('sec_token' => $token));
$form->display();
}
-} elseif (isset($_GET['action']) && $_GET['action'] == 'editnote' && is_numeric($_GET['notebook_id'])) {
+} elseif ($action === 'editnote' && is_numeric($_GET['notebook_id'])) {
// Action handling: Editing a note
if (!empty($_GET['isStudentView'])) {
@@ -112,12 +113,15 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
}
// Initialize the object
- $form = new FormValidator('note', 'post', api_get_self().'?action='.Security::remove_XSS($_GET['action']).'¬ebook_id='.Security::remove_XSS($_GET['notebook_id']));
+ $form = new FormValidator(
+ 'note',
+ 'post',
+ api_get_self().'?action='.Security::remove_XSS($_GET['action']).'¬ebook_id='.intval($_GET['notebook_id'])
+ );
// Setting the form elements
$form->addElement('header', '', get_lang('ModifyNote'));
$form->addElement('hidden', 'notebook_id');
$form->addElement('text', 'note_title', get_lang('NoteTitle'), array('size' => '100'));
- //$form->applyFilter('note_title', 'html_filter');
$form->addElement('html_editor', 'note_comment', get_lang('NoteComment'), null, api_is_allowed_to_edit()
? array('ToolbarSet' => 'Notebook', 'Width' => '100%', 'Height' => '300')
: array('ToolbarSet' => 'NotebookStudent', 'Width' => '100%', 'Height' => '300', 'UserStatus' => 'student')
@@ -154,7 +158,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
$form->setConstants(array('sec_token' => $token));
$form->display();
}
-} elseif (isset($_GET['action']) && $_GET['action'] == 'deletenote' && is_numeric($_GET['notebook_id'])) {
+} elseif ($action === 'deletenote' && is_numeric($_GET['notebook_id'])) {
// Action handling: deleting a note
$res = NotebookManager::delete_note(Security::remove_XSS($_GET['notebook_id']));
@@ -164,28 +168,26 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
NotebookManager::display_notes();
} elseif (
- isset($_GET['action']) && $_GET['action'] == 'changeview' &&
- in_array($_GET['view'], array('creation_date', 'update_date', 'title'))
- ) {
+ $action === 'changeview' && in_array($_GET['view'], array('creation_date', 'update_date', 'title')) ) {
// Action handling: changing the view (sorting order)
switch ($_GET['view']) {
case 'creation_date':
- if (!$_GET['direction'] OR $_GET['direction'] == 'ASC') {
+ if (!$_GET['direction'] || $_GET['direction'] == 'ASC') {
Display::display_confirmation_message(get_lang('NotesSortedByCreationDateAsc'));
} else {
Display::display_confirmation_message(get_lang('NotesSortedByCreationDateDESC'));
}
break;
case 'update_date':
- if (!$_GET['direction'] OR $_GET['direction'] == 'ASC') {
+ if (!$_GET['direction'] || $_GET['direction'] == 'ASC') {
Display::display_confirmation_message(get_lang('NotesSortedByUpdateDateAsc'));
} else {
Display::display_confirmation_message(get_lang('NotesSortedByUpdateDateDESC'));
}
break;
case 'title':
- if (!$_GET['direction'] OR $_GET['direction'] == 'ASC') {
+ if (!$_GET['direction'] || $_GET['direction'] == 'ASC') {
Display::display_confirmation_message(get_lang('NotesSortedByTitleAsc'));
} else {
Display::display_confirmation_message(get_lang('NotesSortedByTitleDESC'));
@@ -198,5 +200,4 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
NotebookManager::display_notes();
}
-// Footer
Display::display_footer();
diff --git a/main/search/search_suggestions.php b/main/search/search_suggestions.php
index 5f382544b4..63c63db01b 100755
--- a/main/search/search_suggestions.php
+++ b/main/search/search_suggestions.php
@@ -10,11 +10,10 @@ require_once dirname(__FILE__) . '/../inc/global.inc.php';
function get_suggestions_from_search_engine($q)
{
-// if (strlen($q)<2) { return null;}
global $charset;
$json = [];
- $table_sfv = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
+ $table_sfv = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
$q = Database::escape_string($q);
$cid = api_get_course_id();
$sql_add = '';
@@ -78,8 +77,8 @@ function get_suggestions_from_search_engine($q)
// will create a copy as Yannick - Car - Speed
// in $output[3]
$c = count($output);
- for ($i=0;$i<$c; $i++) {
- $output[($c+$i)] = $current_field_val;
+ for ($i = 0; $i < $c; $i++) {
+ $output[($c + $i)] = $current_field_val;
}
} else {
//no identical field id, continue as usual
@@ -87,7 +86,7 @@ function get_suggestions_from_search_engine($q)
if ($c == 0) {
$output[] = $row2['value'].' - ';
} else {
- foreach ($output as $i=>$out) {
+ foreach ($output as $i => $out) {
//use the latest combination of fields
$output[$i] .= $row2['value'].' - ';
}
@@ -98,7 +97,7 @@ function get_suggestions_from_search_engine($q)
foreach ($output as $i=>$out) {
if (api_stristr($out,$q) === false) {continue;}
$s = api_convert_encoding(substr($out, 0, -3), 'UTF-8', $charset);
- if (!in_array($s,$more_sugg)) {
+ if (!in_array($s, $more_sugg)) {
$more_sugg[] = $s;
$json[] = [
'id' => $s,
@@ -115,6 +114,8 @@ function get_suggestions_from_search_engine($q)
}
$q = strtolower($_GET["term"]);
-if (!$q) return;
+if (!$q) {
+ return;
+}
//echo $q . "| value\n";
get_suggestions_from_search_engine($q);
diff --git a/main/session/about.php b/main/session/about.php
index 57800f9e3a..27f52d42a1 100644
--- a/main/session/about.php
+++ b/main/session/about.php
@@ -1,14 +1,16 @@
* @package chamilo.session
*/
-use Chamilo\CoreBundle\Entity\ExtraField;
-use Chamilo\CourseBundle\Entity\CCourseDescription;
-use \Chamilo\CoreBundle\Entity\SequenceResource;
$cidReset = true;
@@ -24,18 +26,12 @@ if (!$session) {
api_not_allowed(true);
}
-$sessionCourses = $entityManager->getRepository('ChamiloCoreBundle:Session')
- ->getCoursesOrderedByPosition($session);
-
$courses = [];
-
-$entityManager = Database::getManager();
+$sessionCourses = $entityManager->getRepository('ChamiloCoreBundle:Session')->getCoursesOrderedByPosition($session);
$fieldsRepo = $entityManager->getRepository('ChamiloCoreBundle:ExtraField');
$fieldTagsRepo = $entityManager->getRepository('ChamiloCoreBundle:ExtraFieldRelTag');
$userRepo = $entityManager->getRepository('ChamiloUserBundle:User');
-$sequenceResourceRepo = $entityManager->getRepository(
- 'ChamiloCoreBundle:SequenceResource'
-);
+$sequenceResourceRepo = $entityManager->getRepository('ChamiloCoreBundle:SequenceResource');
$tagField = $fieldsRepo->findOneBy([
'extraFieldType' => ExtraField::COURSE_FIELD_TYPE,
diff --git a/main/session/add_courses_to_session.php b/main/session/add_courses_to_session.php
index 025a962861..57079d83b1 100644
--- a/main/session/add_courses_to_session.php
+++ b/main/session/add_courses_to_session.php
@@ -5,6 +5,7 @@
* @package chamilo.admin
* @todo use formvalidator
*/
+
// resetting the course id.
$cidReset = true;
@@ -206,162 +207,162 @@ if (!api_is_platform_admin() && api_is_teacher()) {
unset($Courses);
?>
-