diff --git a/main/admin/course_intro_pdf_import.php b/main/admin/course_intro_pdf_import.php index a2df83d2bc..d42dce923a 100755 --- a/main/admin/course_intro_pdf_import.php +++ b/main/admin/course_intro_pdf_import.php @@ -28,7 +28,12 @@ if ($_POST['formSent']) { $ext_import_file = substr($_FILES['import_file']['name'], (strrpos($_FILES['import_file']['name'], '.') + 1)); if (!in_array($ext_import_file, $allowed_file_mimetype)) { - Display::addFlash(Display::return_message(get_lang('YouMustImportAZipFile'), 'error')); + Display::addFlash( + Display::return_message( + get_lang('YouMustImportAZipFile'), + 'error' + ) + ); } else { $errors = import_pdfs($subDir); if (count($errors) == 0) { @@ -46,7 +51,13 @@ if (count($errors) != 0) { $error_message .= ''; Display::addFlash(Display::return_message($error_message, 'normal', false)); } elseif ($_POST['formSent']) { - Display::addFlash(Display::return_message('CourseIntroductionsAllImportesSuccessfully', 'confirmation', false)); + Display::addFlash( + Display::return_message( + get_lang('CourseIntroductionsAllImportesSuccessfully'), + 'confirmation', + false + ) + ); } Display::display_header($tool_name); @@ -110,7 +121,13 @@ function import_pdfs($subDir = '/') if (count($course) > 0) { // Build file info because handle_uploaded_document() needs it (name, type, size, tmp_name) $fileSize = filesize($baseDir.$uploadPath.$file); - $docId = add_document($course, $subDir.'/'.$file, 'file', $fileSize, $parts[1].' '.substr($parts[2], 0, -4)); + $docId = add_document( + $course, + $subDir.'/'.$file, + 'file', + $fileSize, + $parts[1].' '.substr($parts[2], 0, -4) + ); if ($docId > 0) { if (!is_file($baseDir.$uploadPath.$file)) { error_log($baseDir.$uploadPath.$file.' does not exists in '.__FILE__); @@ -122,8 +139,17 @@ function import_pdfs($subDir = '/') error_log('Destination '.api_get_path(SYS_COURSE_PATH).$course['path'].'/document'.$subDir.' is NOT writeable in '.__FILE__); } // Place each file in its folder in each course - rename($baseDir.$uploadPath.$file, api_get_path(SYS_COURSE_PATH).$course['path'].'/document'.$subDir.'/'.$file); - api_item_property_update($course, TOOL_DOCUMENT, $docId, 'DocumentAdded', api_get_user_id()); + rename( + $baseDir.$uploadPath.$file, + api_get_path(SYS_COURSE_PATH).$course['path'].'/document'.$subDir.'/'.$file + ); + api_item_property_update( + $course, + TOOL_DOCUMENT, + $docId, + 'DocumentAdded', + api_get_user_id() + ); // Redo visibility api_set_default_visibility($docId, TOOL_DOCUMENT); $errors[] = array('Line' => 0, 'Code' => $course['code'], 'Title' => $course['title']); diff --git a/main/exercise/exercise_submit.php b/main/exercise/exercise_submit.php index 863ebad9bb..70b48256e4 100755 --- a/main/exercise/exercise_submit.php +++ b/main/exercise/exercise_submit.php @@ -184,7 +184,11 @@ if ($objExercise->expired_time != 0) { } // Generating the time control key for the user -$current_expired_time_key = ExerciseLib::get_time_control_key($objExercise->id, $learnpath_id, $learnpath_item_id); +$current_expired_time_key = ExerciseLib::get_time_control_key( + $objExercise->id, + $learnpath_id, + $learnpath_item_id +); $_SESSION['duration_time'][$current_expired_time_key] = $current_timestamp; @@ -854,14 +858,28 @@ if ($limit_time_exists) { if (!$permission_to_start || $exercise_timeover) { if (!api_is_allowed_to_edit(null, true)) { $message_warning = $permission_to_start ? get_lang('ReachedTimeLimit') : get_lang('ExerciseNoStartedYet'); - echo Display::return_message(sprintf($message_warning, $exercise_title, $objExercise->selectAttempts()), 'warning'); + echo Display::return_message( + sprintf( + $message_warning, + $exercise_title, + $objExercise->selectAttempts() + ), + 'warning' + ); if ($origin != 'learnpath') { Display :: display_footer(); } exit; } else { $message_warning = $permission_to_start ? get_lang('ReachedTimeLimitAdmin') : get_lang('ExerciseNoStartedAdmin'); - echo Display::return_message(sprintf($message_warning, $exercise_title, $objExercise->selectAttempts()), 'warning'); + echo Display::return_message( + sprintf( + $message_warning, + $exercise_title, + $objExercise->selectAttempts() + ), + 'warning' + ); } } } @@ -1220,14 +1238,14 @@ if (!empty($error)) { '; echo '
- - - - - - - - + + + + + + + + '; // Show list of questions @@ -1238,7 +1256,9 @@ if (!empty($error)) { } $remind_list = []; - if (isset($exercise_stat_info['questions_to_check']) && !empty($exercise_stat_info['questions_to_check'])) { + if (isset($exercise_stat_info['questions_to_check']) && + !empty($exercise_stat_info['questions_to_check']) + ) { $remind_list = explode(',', $exercise_stat_info['questions_to_check']); } @@ -1271,7 +1291,10 @@ if (!empty($error)) { if (isset($attempt_list[$questionId])) { $user_choice = $attempt_list[$questionId]; } elseif ($objExercise->saveCorrectAnswers) { - $correctAnswers = $objExercise->getCorrectAnswersInAllAttempts($learnpath_id, $learnpath_item_id); + $correctAnswers = $objExercise->getCorrectAnswersInAllAttempts( + $learnpath_id, + $learnpath_item_id + ); if (isset($correctAnswers[$questionId])) { $user_choice = $correctAnswers[$questionId]; @@ -1281,7 +1304,9 @@ if (!empty($error)) { $remind_highlight = ''; //Hides questions when reviewing a ALL_ON_ONE_PAGE exercise see #4542 no_remind_highlight class hide with jquery - if ($objExercise->type == ALL_ON_ONE_PAGE && isset($_GET['reminder']) && $_GET['reminder'] == 2) { + if ($objExercise->type == ALL_ON_ONE_PAGE && + isset($_GET['reminder']) && $_GET['reminder'] == 2 + ) { $remind_highlight = 'no_remind_highlight'; } @@ -1329,7 +1354,10 @@ if (!empty($error)) { // Button save and continue switch ($objExercise->type) { case ONE_PER_PAGE: - $exercise_actions .= $objExercise->show_button($questionId, $current_question); + $exercise_actions .= $objExercise->show_button( + $questionId, + $current_question + ); break; case ALL_ON_ONE_PAGE : $button = [ @@ -1362,7 +1390,10 @@ if (!empty($error)) { 'for' => 'remind_list['.$questionId.']' ) ); - $exercise_actions .= Display::div($remind_question_div, array('class'=>'exercise_save_now_button')); + $exercise_actions .= Display::div( + $remind_question_div, + array('class' => 'exercise_save_now_button') + ); } echo Display::div($exercise_actions, array('class'=>'form-actions')); echo ''; diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index 863f6dacdd..7f37101c3c 100755 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -10,7 +10,8 @@ class IndexManager const VIEW_BY_SESSION = 1; // An instance of the template engine - //No need to initialize because IndexManager is not static, and the constructor immediately instantiates a Template + // No need to initialize because IndexManager is not static, + // and the constructor immediately instantiates a Template public $tpl; public $name = ''; public $home = ''; @@ -314,7 +315,6 @@ class IndexManager public function return_notice() { $user_selected_language = api_get_interface_language(); - $html = ''; // Notice $home_notice = @(string) file_get_contents($this->home.'home_notice_'.$user_selected_language.'.html'); @@ -1164,7 +1164,7 @@ class IndexManager // Load sessions in category $session_categories = UserManager::get_sessions_by_category($user_id, false); } - + $sessionCount = 0; $courseCount = 0; @@ -1366,7 +1366,7 @@ class IndexManager $coursesWithoutCategoryTemplate = '/user_portal/grid_courses_without_category.tpl'; $coursesWithCategoryTemplate = '/user_portal/grid_courses_with_category.tpl'; } - + if ($specialCourses) { if ($categoryCodeFilter) { $specialCourses = self::filterByCategory( diff --git a/plugin/kannelsms/lang/english.php b/plugin/kannelsms/lang/english.php index acc1a041af..d030d99ebf 100644 --- a/plugin/kannelsms/lang/english.php +++ b/plugin/kannelsms/lang/english.php @@ -1,7 +1,7 @@ get_handler_field_info_by_field_variable('mobile_phone_number'); + $mobilePhoneNumberExtraField = $mobilePhoneNumberExtraField->get_handler_field_info_by_field_variable( + 'mobile_phone_number' + ); $mobilePhoneNumberExtraFieldValue = new ExtraFieldValue('user'); $mobilePhoneNumberExtraFieldValue = $mobilePhoneNumberExtraFieldValue->get_values_by_handler_and_field_id( diff --git a/plugin/kannelsms/lib/kannelsms_plugin.class.php b/plugin/kannelsms/lib/kannelsms_plugin.class.php index 2681075ced..631f5264b1 100644 --- a/plugin/kannelsms/lib/kannelsms_plugin.class.php +++ b/plugin/kannelsms/lib/kannelsms_plugin.class.php @@ -25,7 +25,7 @@ class KannelsmsPlugin extends SmsPlugin /** * Constructor */ - protected function __construct() + public function __construct() { $fields = array( 'tool_enable' => 'boolean',