Explorar o código

Applied fixes from FlintCI

Julio Montoya %!s(int64=7) %!d(string=hai) anos
pai
achega
ecdc2037e2
Modificáronse 100 ficheiros con 748 adicións e 616 borrados
  1. 3 3
      certificates/index.php
  2. 3 4
      cli-config.php
  3. 5 5
      custompages/first_login-dist.php
  4. 3 2
      custompages/index-logged-dist.php
  5. 10 10
      custompages/index-unlogged-dist.php
  6. 6 4
      custompages/language.inc.php
  7. 3 2
      custompages/language.php
  8. 6 6
      custompages/loggedout-dist.php
  9. 3 3
      custompages/lostpassword-dist.php
  10. 7 7
      custompages/registration-dist.php
  11. 4 3
      custompages/registration-feedback-dist.php
  12. 1 0
      index.php
  13. 4 2
      main/admin/access_url_add_courses_to_url.php
  14. 3 1
      main/admin/access_url_add_usergroup_to_url.php
  15. 6 4
      main/admin/access_url_add_users_to_url.php
  16. 2 2
      main/admin/access_url_check_user_session.php
  17. 1 0
      main/admin/access_url_edit.php
  18. 5 4
      main/admin/access_url_edit_course_category_to_url.php
  19. 6 5
      main/admin/access_url_edit_courses_to_url.php
  20. 9 8
      main/admin/access_url_edit_usergroup_to_url.php
  21. 7 6
      main/admin/access_url_edit_users_to_url.php
  22. 4 3
      main/admin/access_urls.php
  23. 7 6
      main/admin/add_courses_to_usergroup.php
  24. 3 3
      main/admin/add_drh_to_user.php
  25. 7 9
      main/admin/add_sessions_to_promotion.php
  26. 13 14
      main/admin/add_sessions_to_usergroup.php
  27. 21 21
      main/admin/add_users_to_usergroup.php
  28. 4 4
      main/admin/career_dashboard.php
  29. 0 2
      main/admin/careers.php
  30. 6 5
      main/admin/cli.php
  31. 4 3
      main/admin/configure_extensions.php
  32. 7 8
      main/admin/configure_homepage.php
  33. 3 3
      main/admin/configure_inscription.php
  34. 5 5
      main/admin/configure_plugin.php
  35. 6 7
      main/admin/course_add.php
  36. 4 5
      main/admin/course_edit.php
  37. 3 3
      main/admin/course_export.php
  38. 10 3
      main/admin/course_import.php
  39. 9 6
      main/admin/course_information.php
  40. 7 3
      main/admin/course_intro_pdf_import.php
  41. 29 21
      main/admin/course_list.php
  42. 4 4
      main/admin/course_request_accepted.php
  43. 2 1
      main/admin/course_request_edit.php
  44. 4 4
      main/admin/course_request_rejected.php
  45. 7 7
      main/admin/course_request_review.php
  46. 10 6
      main/admin/course_user_import.php
  47. 10 6
      main/admin/course_user_import_by_email.php
  48. 7 5
      main/admin/dashboard_add_courses_to_user.php
  49. 5 4
      main/admin/dashboard_add_sessions_to_user.php
  50. 7 6
      main/admin/dashboard_add_users_to_user.php
  51. 3 2
      main/admin/email_tester.php
  52. 3 1
      main/admin/event_controller.php
  53. 19 16
      main/admin/event_type.php
  54. 0 1
      main/admin/export_certificates.php
  55. 4 5
      main/admin/extra_field_options.php
  56. 10 11
      main/admin/extra_field_workflow.php
  57. 12 13
      main/admin/extra_fields.php
  58. 1 1
      main/admin/filler.php
  59. 7 8
      main/admin/grade_models.php
  60. 1 3
      main/admin/gradebook_dependency.php
  61. 5 6
      main/admin/gradebook_list.php
  62. 33 32
      main/admin/index.php
  63. 16 14
      main/admin/languages.php
  64. 3 2
      main/admin/ldap_form_add_users_group.php
  65. 4 3
      main/admin/ldap_import_students.php
  66. 6 6
      main/admin/ldap_import_students_to_session.php
  67. 2 2
      main/admin/ldap_users_list.php
  68. 4 4
      main/admin/ldap_users_synchro.php
  69. 3 2
      main/admin/legal_add.php
  70. 2 2
      main/admin/legal_list.php
  71. 4 5
      main/admin/promotions.php
  72. 1 1
      main/admin/resource_sequence.php
  73. 117 66
      main/admin/settings.lib.php
  74. 4 3
      main/admin/settings.php
  75. 0 1
      main/admin/skill.php
  76. 5 3
      main/admin/skill_badge.php
  77. 7 8
      main/admin/skill_badge_create.php
  78. 7 5
      main/admin/skill_badge_list.php
  79. 5 4
      main/admin/skill_create.php
  80. 5 4
      main/admin/skill_edit.php
  81. 1 2
      main/admin/skill_level.php
  82. 3 2
      main/admin/skill_list.php
  83. 3 5
      main/admin/skill_profile.php
  84. 4 4
      main/admin/skill_translate.php
  85. 6 7
      main/admin/skills_gradebook.php
  86. 17 10
      main/admin/skills_import.php
  87. 1 2
      main/admin/skills_profile.php
  88. 4 2
      main/admin/special_exports.php
  89. 3 2
      main/admin/specific_fields.php
  90. 3 2
      main/admin/specific_fields_add.php
  91. 2 3
      main/admin/statistics.php
  92. 4 3
      main/admin/statistics/index.php
  93. 18 15
      main/admin/sub_language.php
  94. 32 18
      main/admin/sub_language_add.php
  95. 3 2
      main/admin/sub_language_ajax.inc.php
  96. 12 13
      main/admin/subscribe_user2course.php
  97. 1 1
      main/admin/system_announcements.php
  98. 1 0
      main/admin/system_status.php
  99. 27 26
      main/admin/teacher_time_report.php
  100. 5 5
      main/admin/teachers_time_by_session_report.php

+ 3 - 3
certificates/index.php

@@ -1,10 +1,10 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Show specified user certificate
+ * Show specified user certificate.
+ *
  * @package chamilo.certificate
  */
-
 require_once '../main/inc/global.inc.php';
 
 $action = isset($_GET['action']) ? $_GET['action'] : null;
@@ -29,7 +29,7 @@ switch ($action) {
                 'top' => 0,
                 'right' => 0,
                 'bottom' => 0,
-                'left' => 0
+                'left' => 0,
             ];
 
             $orientation = api_get_configuration_value('certificate_pdf_orientation');

+ 3 - 4
cli-config.php

@@ -3,15 +3,14 @@
 
 /**
  * Script needed to execute bin/doctrine.php in the command line
- * in order to:
+ * in order to:.
  *
  * - Generate migrations
  * - Create schema
  * - Update schema
  * - Validate schema
  * - Etc
- **/
-
+ */
 use Doctrine\ORM\Tools\Console\ConsoleRunner;
 
 require_once __DIR__.'/vendor/autoload.php';
@@ -31,7 +30,7 @@ $dbParams = [
     'host' => $_configuration['db_host'],
     'user' => $_configuration['db_user'],
     'password' => $_configuration['db_password'],
-    'dbname' => $_configuration['main_database']
+    'dbname' => $_configuration['main_database'],
 ];
 
 $database->connect($dbParams, realpath(__DIR__).'/', realpath(__DIR__).'/');

+ 5 - 5
custompages/first_login-dist.php

@@ -1,15 +1,15 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Quick page to react to first login cases
+ * Quick page to react to first login cases.
+ *
  * @package chamilo.custompages
  */
-
 require_once api_get_path(SYS_PATH).'main/inc/global.inc.php';
 require_once __DIR__.'/language.php';
 
 /**
- * Security checks
+ * Security checks.
  */
 if (!isset($_SESSION['conditional_login']['uid'])) {
     die("Not Authorised");
@@ -60,7 +60,7 @@ if ($_GET['invalid'] == 2) {
 }
 $www = api_get_path('WEB_PATH');
 /**
- * HTML output
+ * HTML output.
  */
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -68,7 +68,7 @@ $www = api_get_path('WEB_PATH');
 <head>
     <title>Custompage - login</title>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <script type="text/javascript" src="<?php echo $www ?>web/assets/jquery/dist/jquery.min.js"></script>
+    <script type="text/javascript" src="<?php echo $www; ?>web/assets/jquery/dist/jquery.min.js"></script>
     <script type="text/javascript">
         $(document).ready(function() {
             if (top.location != location)

+ 3 - 2
custompages/index-logged-dist.php

@@ -1,14 +1,15 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Redirect to normal Chamilo
+ * Redirect to normal Chamilo.
+ *
  * @package chamilo.custompages
  */
 require_once api_get_path(SYS_PATH).'main/inc/global.inc.php';
 
 $www = api_get_path('WEB_PATH');
 /**
- * Redirect
+ * Redirect.
  */
 header("Location: $www/user_portal.php");
 exit;

+ 10 - 10
custompages/index-unlogged-dist.php

@@ -1,15 +1,15 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Redirect script
+ * Redirect script.
+ *
  * @package chamilo.custompages
  */
-
 require_once api_get_path(SYS_PATH).'main/inc/global.inc.php';
 require_once __DIR__.'/language.php';
 
 /**
- * Homemade micro-controller
+ * Homemade micro-controller.
  */
 if (isset($_GET['loginFailed'])) {
     if (isset($_GET['error'])) {
@@ -37,14 +37,14 @@ if (isset($_GET['loginFailed'])) {
 $rootWeb = api_get_path('WEB_PATH');
 
 /**
- * HTML output
+ * HTML output.
  */
 ?>
 <html>
 <head>
 	<title>Custompage - login</title>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <script type="text/javascript" src="<?php echo $rootWeb ?>web/assets/jquery/dist/jquery.min.js"></script>
+    <script type="text/javascript" src="<?php echo $rootWeb; ?>web/assets/jquery/dist/jquery.min.js"></script>
 	<script type="text/javascript">
 		$(document).ready(function() {
 			if (top.location != location) {
@@ -62,11 +62,11 @@ $rootWeb = api_get_path('WEB_PATH');
 </head>
 <body>
 	<div id="backgroundimage">
-		<img src="<?php echo api_get_path(WEB_PATH)?>/custompages/images/page-background.png" class="backgroundimage" />
+		<img src="<?php echo api_get_path(WEB_PATH); ?>/custompages/images/page-background.png" class="backgroundimage" />
 	</div>
 	<div id="wrapper">
 		<div id="header">
-			<img src="<?php echo api_get_path(WEB_PATH)?>/custompages/images/header.png" alt="Logo" />
+			<img src="<?php echo api_get_path(WEB_PATH); ?>/custompages/images/header.png" alt="Logo" />
 		</div> <!-- #header -->
 		<div id="login-form-box" class="form-box">
             <div id="login-form-info" class="form-info">
@@ -79,7 +79,7 @@ $rootWeb = api_get_path('WEB_PATH');
                 echo '<div id="login-form-info" class="form-error">'.$error_message.'</div>';
             }
             ?>
-            <form id="login-form" class="form" action="<?php echo api_get_path(WEB_PATH)?>index.php" method="post">
+            <form id="login-form" class="form" action="<?php echo api_get_path(WEB_PATH); ?>index.php" method="post">
                 <div>
                     <label for="login">*<?php echo custompages_get_lang('User'); ?></label>
                     <input name="login" type="text" /><br />
@@ -95,13 +95,13 @@ $rootWeb = api_get_path('WEB_PATH');
                 <?php if (api_get_setting('allow_registration') === 'true') {
                 ?>
                 <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/inscription.php?language=<?php echo api_get_interface_language(); ?>">
-                    <?php echo custompages_get_lang('Registration')?>
+                    <?php echo custompages_get_lang('Registration'); ?>
                 </a><br />
                 <?php
             } ?>
 
                 <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/lostPassword.php?language=<?php echo api_get_interface_language(); ?>">
-                    <?php echo custompages_get_lang('LostPassword')?>
+                    <?php echo custompages_get_lang('LostPassword'); ?>
                 </a>
 			</div>
 		</div> <!-- #form -->

+ 6 - 4
custompages/language.inc.php

@@ -6,13 +6,15 @@
  * to the best pick according to the visitor's browser's options.
  * 2011, Jean-Karim Bockstael, CBlue <jeankarim@cblue.be>
  * This requires the Chamilo system to be initialized
- * (note that it's easier to do the following include in the parent page)
+ * (note that it's easier to do the following include in the parent page).
+ *
  * @package chamilo.custompages
  */
 /**
- * Returns the best match between available languages and visitor preferences
+ * Returns the best match between available languages and visitor preferences.
+ *
  * @return string the best match as 2-chars code, null when none match
-*/
+ */
 function get_preferred_language($available_langs)
 {
     // Parsing the Accept-languages HTTP header
@@ -43,7 +45,7 @@ function get_preferred_language($available_langs)
 }
 
 /**
- * Get a language variable in a specific language
+ * Get a language variable in a specific language.
  */
 function custompages_get_lang($variable)
 {

+ 3 - 2
custompages/language.php

@@ -2,7 +2,8 @@
 /* For licensing terms, see /license.txt */
 /**
  * Definition of language-related functions for cases where th user isn't
- * logged in yet
+ * logged in yet.
+ *
  * @package chamilo.custompages
  */
 // Get helper functions
@@ -19,7 +20,7 @@ $chamilo_langs = [
     'de' => 'german',
     'es' => 'spanish',
     'gl' => 'galician',
-    'eu' => 'basque'
+    'eu' => 'basque',
 ];
 $lang_match = $chamilo_langs[get_preferred_language($available_langs)];
 // recover previous value ...

+ 6 - 6
custompages/loggedout-dist.php

@@ -2,9 +2,9 @@
 /* For licensing terms, see /license.txt */
 /**
  * Displayed after the user has been logged out.
+ *
  * @package chamilo.custompages
  */
-
 $called_direcly = !function_exists('api_get_path');
 if ($called_direcly) {
     return '';
@@ -15,7 +15,7 @@ require_once __DIR__.'/language.php';
 $www = api_get_path('WEB_PATH');
 
 /**
- * HTML output
+ * HTML output.
  */
 ?>
 <!DOCTYPE html>
@@ -23,7 +23,7 @@ $www = api_get_path('WEB_PATH');
     <head>
         <title>Custompage - logged out</title>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-        <script type="text/javascript" src="<?php echo $www ?>web/assets/jquery/dist/jquery.min.js"></script>
+        <script type="text/javascript" src="<?php echo $www; ?>web/assets/jquery/dist/jquery.min.js"></script>
         <script type="text/javascript">
             $(document).ready(function() {
                 if (top.location != location)
@@ -33,11 +33,11 @@ $www = api_get_path('WEB_PATH');
     </head>
     <body>
         <div id="backgroundimage">
-            <img src="<?php echo $www ?>/custompages/images/page-background.png" class="backgroundimage" alt="background"/>
+            <img src="<?php echo $www; ?>/custompages/images/page-background.png" class="backgroundimage" alt="background"/>
         </div>
         <div id="wrapper">
             <div id="header">
-                <img src="<?php echo $www ?>/custompages/images/header.png" alt="Logo" />
+                <img src="<?php echo $www; ?>/custompages/images/header.png" alt="Logo" />
             </div>
 
             <div id="login-form-box" class="form-box">
@@ -47,7 +47,7 @@ $www = api_get_path('WEB_PATH');
             </div>
             <a href="<?php echo $www.'user_portal.php'; ?>">Go to your portal</a>
             <div id="footer">
-                <img src="<?php echo $www ?>/custompages/images/footer.png" alt="footer"/>
+                <img src="<?php echo $www; ?>/custompages/images/footer.png" alt="footer"/>
             </div>
         </div>
     </body>

+ 3 - 3
custompages/lostpassword-dist.php

@@ -2,9 +2,9 @@
 /* For licensing terms, see /license.txt */
 /**
  * Quick form to ask for password reminder.
+ *
  * @package chamilo.custompages
  */
-
 require_once api_get_path(SYS_PATH).'main/inc/global.inc.php';
 require_once __DIR__.'/language.php';
 
@@ -14,7 +14,7 @@ $rootWeb = api_get_path('WEB_PATH');
 <head>
 	<title><?php echo custompages_get_lang('LostPassword'); ?></title>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-	<script type="text/javascript" src="<?php echo $rootWeb ?>web/assets/jquery/dist/jquery.min.js"></script>
+	<script type="text/javascript" src="<?php echo $rootWeb; ?>web/assets/jquery/dist/jquery.min.js"></script>
 
 	<script type="text/javascript">
 		$(document).ready(function() {
@@ -41,7 +41,7 @@ $rootWeb = api_get_path('WEB_PATH');
                 echo '<div id="registration-form-error" class="form-error"><ul>'.$content['info'].'</ul></div>';
             }
 
-            echo isset($content['form']) ? $content['form'] : ''
+            echo isset($content['form']) ? $content['form'] : '';
             ?>
 		</div> <!-- #form -->
 		<div id="footer">

+ 7 - 7
custompages/registration-dist.php

@@ -4,14 +4,14 @@
  * This script allows for specific registration rules (see CustomPages feature of Chamilo)
  * Please contact CBlue regarding any licences issues.
  * Author: noel@cblue.be
- * Copyright: CBlue SPRL, 20XX (GNU/GPLv3)
+ * Copyright: CBlue SPRL, 20XX (GNU/GPLv3).
+ *
  * @package chamilo.custompages
- **/
-
+ */
 require_once api_get_path(SYS_PATH).'main/inc/global.inc.php';
 require_once __DIR__.'/language.php';
 /**
- * Removes some unwanted elementend of the form object
+ * Removes some unwanted elementend of the form object.
  */
 $content['form']->removeElement('extra_mail_notify_invitation');
 $content['form']->removeElement('extra_mail_notify_message');
@@ -27,7 +27,7 @@ $rootWeb = api_get_path('WEB_PATH');
 
 // Deprecated since 2015-03-26
 /**
- * Code to change the way QuickForm render html
+ * Code to change the way QuickForm render html.
  */
 /*
 $renderer = & $content['form']->defaultRenderer();
@@ -84,7 +84,7 @@ EOT;
     <title><?php echo custompages_get_lang('Registration'); ?></title>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <script type="text/javascript" src="<?php echo $rootWeb ?>web/assets/jquery/dist/jquery.min.js"></script>
+    <script type="text/javascript" src="<?php echo $rootWeb; ?>web/assets/jquery/dist/jquery.min.js"></script>
 </head>
 <body>
 <img id="backgroundimage" src="/custompages/images/page-background.png"">
@@ -106,7 +106,7 @@ EOT;
                             ?>
                         </div>
                         <div id="links">
-                            <!--<a href="mailto: support@cblue.be"><?php echo custompages_get_lang('NeedContactAdmin')?></a><br />-->
+                            <!--<a href="mailto: support@cblue.be"><?php echo custompages_get_lang('NeedContactAdmin'); ?></a><br />-->
                         </div>
                     </div>
                     <div id="footer">

+ 4 - 3
custompages/registration-feedback-dist.php

@@ -1,11 +1,12 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Quick display for user registration
+ * Quick display for user registration.
+ *
  * @package chamilo.custompages
  */
 /**
- * HTML output
+ * HTML output.
  */
 require_once api_get_path(SYS_PATH).'main/inc/global.inc.php';
 require_once __DIR__.'/language.php';
@@ -18,7 +19,7 @@ $rootWeb = api_get_path('WEB_PATH');
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <script type="text/javascript" src="<?php echo $rootWeb ?>web/assets/jquery/dist/jquery.min.js"></script>
+    <script type="text/javascript" src="<?php echo $rootWeb; ?>web/assets/jquery/dist/jquery.min.js"></script>
 </head>
 <body>
 <img src="/custompages/images/page-background.png" class="backgroundimage" />

+ 1 - 0
index.php

@@ -35,6 +35,7 @@ if (!empty($_GET['logout'])) {
 /**
  * Registers in the track_e_default table (view in important activities in admin
  * interface) a possible attempted break in, sending auth data through get.
+ *
  * @todo This piece of code should probably move to local.inc.php where the
  * actual login / logout procedure is handled.
  * The real use of this code block should be seriously considered as well.

+ 4 - 2
main/admin/access_url_add_courses_to_url.php

@@ -3,10 +3,12 @@
 /**
  * This script allows platform admins to add users to urls.
  * It displays a list of users and a list of courses;
- * you can select multiple users and courses and then click on
+ * you can select multiple users and courses and then click on.
+ *
  * @package chamilo.admin
+ *
  * @author Julio Montoya <gugli100@gmail.com>
-*/
+ */
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 

+ 3 - 1
main/admin/access_url_add_usergroup_to_url.php

@@ -3,8 +3,10 @@
 /**
  *  This script allows platform admins to add users to urls.
  *  It displays a list of users and a list of courses;
- *  you can select multiple users and courses and then click on
+ *  you can select multiple users and courses and then click on.
+ *
  *  @package chamilo.admin
+ *
  *  @author Julio Montoya <gugli100@gmail.com>
  */
 $cidReset = true;

+ 6 - 4
main/admin/access_url_add_users_to_url.php

@@ -3,8 +3,10 @@
 /**
  * This script allows platform admins to add users to urls.
  *    It displays a list of users and a list of courses;
- *    you can select multiple users and courses and then click on
+ *    you can select multiple users and courses and then click on.
+ *
  * @package chamilo.admin
+ *
  * @author Julio Montoya <gugli100@gmail.com>
  */
 $cidReset = true;
@@ -84,9 +86,9 @@ $target_name = api_sort_by_first_name() ? 'firstname' : 'lastname';
 $target_name = 'lastname';
 $sql = "SELECT user_id,lastname,firstname,username FROM $tbl_user
 	    WHERE ".$target_name." LIKE '".$first_letter_user_lower."%' OR ".$target_name." LIKE '".$first_letter_user_lower."%'
-		ORDER BY ". (count($users) > 0 ? "(user_id IN(".implode(',', $users).")) DESC," : "")." ".$target_name;
-$result     = Database::query($sql);
-$db_users   = Database::store_result($result);
+		ORDER BY ".(count($users) > 0 ? "(user_id IN(".implode(',', $users).")) DESC," : "")." ".$target_name;
+$result = Database::query($sql);
+$db_users = Database::store_result($result);
 unset($result);
 
 $sql = "SELECT id, url FROM $tbl_access_url  WHERE active=1 ORDER BY url";

+ 2 - 2
main/admin/access_url_check_user_session.php

@@ -2,9 +2,9 @@
 /* For licensing terms, see /license.txt */
 /**
  * @author Bart Mollet, Julio Montoya lot of fixes
+ *
  * @package chamilo.admin
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
@@ -78,7 +78,7 @@ foreach ($session_list as $session_item) {
             $order_clause";
 
     $result = Database::query($sql);
-    $users  = Database::store_result($result);
+    $users = Database::store_result($result);
 
     if (!empty($users)) {
         $html .= '<table class="data_table"><tr><th>'.get_lang('User').'<th>'.get_lang('Actions').'</th></tr>';

+ 1 - 0
main/admin/access_url_edit.php

@@ -2,6 +2,7 @@
 /* For licensing terms, see /license.txt */
 /**
  * @package chamilo.admin
+ *
  * @author Julio Montoya <gugli100@gmail.com>
  */
 $cidReset = true;

+ 5 - 4
main/admin/access_url_edit_course_category_to_url.php

@@ -3,6 +3,7 @@
 
 /**
  * @package chamilo.admin
+ *
  * @author Julio Montoya <gugli100@gmail.com>
  */
 
@@ -131,7 +132,7 @@ if ($add_type == 'multiple') {
 $url_list = UrlManager::get_url_data();
 ?>
 <div style="text-align: left;">
-	<?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?>
+	<?php echo $link_add_type_unique; ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple; ?>
 </div>
 <br /><br />
 <form
@@ -144,7 +145,7 @@ $url_list = UrlManager::get_url_data();
 >
 <?php echo get_lang('SelectUrl').' : '; ?>
 <select name="access_url_id" onchange="javascript:send();">
-<option value="0">-- <?php echo get_lang('SelectUrl')?> -- </option>
+<option value="0">-- <?php echo get_lang('SelectUrl'); ?> -- </option>
 	<?php
     $url_selected = '';
     foreach ($url_list as $url_obj) {
@@ -166,11 +167,11 @@ $url_list = UrlManager::get_url_data();
 </select>
 <br /><br />
 <input type="hidden" name="form_sent" value="1" />
-<input type="hidden" name="add_type" value = "<?php echo $add_type ?>" />
+<input type="hidden" name="add_type" value = "<?php echo $add_type; ?>" />
 <table border="0" cellpadding="5" cellspacing="0" width="100%">
 <!-- Users -->
 <tr>
-  <td align="center"><b><?php echo get_lang('CourseCategoryInPlatform') ?> :</b>
+  <td align="center"><b><?php echo get_lang('CourseCategoryInPlatform'); ?> :</b>
   </td>
   <td></td>
   <td align="center"><b><?php printf(get_lang('CourseCategoryListInX'), $url_selected); ?></b></td>

+ 6 - 5
main/admin/access_url_edit_courses_to_url.php

@@ -3,6 +3,7 @@
 
 /**
  * @package chamilo.admin
+ *
  * @author Julio Montoya <gugli100@gmail.com>
  */
 // resetting the course id
@@ -45,7 +46,7 @@ if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id'] != '') {
     $access_url_id = Security::remove_XSS($_REQUEST['access_url_id']);
 }
 
-$xajax -> processRequests();
+$xajax->processRequests();
 $htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
 $htmlHeadXtra[] = '<script>
 function add_user_to_url(code, content) {
@@ -154,7 +155,7 @@ if ($add_type == 'multiple') {
 $url_list = UrlManager::get_url_data();
 ?>
 <div style="text-align: left;">
-    <?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?>
+    <?php echo $link_add_type_unique; ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple; ?>
 </div>
 <br /><br />
 <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if ($ajax_search) {
@@ -162,7 +163,7 @@ $url_list = UrlManager::get_url_data();
 }?> >
     <?php echo get_lang('SelectUrl').' : '; ?>
     <select name="access_url_id" onchange="javascript:send();">
-        <option value="0">-- <?php echo get_lang('SelectUrl')?> -- </option>
+        <option value="0">-- <?php echo get_lang('SelectUrl'); ?> -- </option>
         <?php
         $url_selected = '';
         foreach ($url_list as $url_obj) {
@@ -183,11 +184,11 @@ $url_list = UrlManager::get_url_data();
     </select>
     <br /><br />
     <input type="hidden" name="form_sent" value="1" />
-    <input type="hidden" name="add_type" value = "<?php echo $add_type ?>" />
+    <input type="hidden" name="add_type" value = "<?php echo $add_type; ?>" />
     <table border="0" cellpadding="5" cellspacing="0" width="100%">
         <!-- Users -->
         <tr>
-            <td align="center"><b><?php echo get_lang('CourseListInPlatform') ?> :</b>
+            <td align="center"><b><?php echo get_lang('CourseListInPlatform'); ?> :</b>
             </td>
             <td></td>
             <td align="center"><b><?php echo get_lang('CourseListIn').' '.$url_selected; ?></b></td>

+ 9 - 8
main/admin/access_url_edit_usergroup_to_url.php

@@ -2,6 +2,7 @@
 /* For licensing terms, see /license.txt */
 /**
  * @package chamilo.admin
+ *
  * @author Julio Montoya <gugli100@gmail.com>
  */
 // resetting the course id
@@ -54,7 +55,7 @@ function add_user_to_url(code, content) {
 function send() {
 	if (document.formulaire.access_url_id.value!=0) {
 		document.formulaire.form_sent.value=0;
-		document.formulaire.add_type.value=\'' . $add_type.'\';
+		document.formulaire.add_type.value=\''.$add_type.'\';
 		document.formulaire.submit();
 	}
 }
@@ -140,7 +141,7 @@ if ($add_type == 'multiple') {
                 get_lang('SessionAddTypeUnique'),
                 api_get_self().'?'.http_build_query([
                     'add_type' => 'unique',
-                    'access_url_id' => $access_url_id
+                    'access_url_id' => $access_url_id,
                 ]),
                 'file-o',
                 'default',
@@ -150,7 +151,7 @@ if ($add_type == 'multiple') {
                 get_lang('SessionAddTypeMultiple'),
                 api_get_self().'?'.http_build_query([
                     'add_type' => 'multiple',
-                    'access_url_id' => $access_url_id
+                    'access_url_id' => $access_url_id,
                 ]),
                 'files-o',
                 'default',
@@ -172,11 +173,11 @@ $url_list = UrlManager::get_url_data();
     >
         <div class="row">
             <div class="col-xs-2">
-                <label for="access_url_id"><?php echo get_lang('SelectUrl') ?></label>
+                <label for="access_url_id"><?php echo get_lang('SelectUrl'); ?></label>
             </div>
             <div class="col-xs-5">
                 <select name="access_url_id" id="access_url_id" onchange="javascript:send();" class="form-control">
-                    <option value="0">-- <?php echo get_lang('SelectUrl') ?> --</option>
+                    <option value="0">-- <?php echo get_lang('SelectUrl'); ?> --</option>
                     <?php
                     $url_selected = '';
                     foreach ($url_list as $url_obj) {
@@ -200,7 +201,7 @@ $url_list = UrlManager::get_url_data();
             </div>
         </div>
         <input type="hidden" name="form_sent" value="1"/>
-        <input type="hidden" name="add_type" value="<?php echo $add_type ?>"/>
+        <input type="hidden" name="add_type" value="<?php echo $add_type; ?>"/>
         <?php
         if (!empty($errorMsg)) {
             echo Display::return_message($errorMsg, 'normal'); //main API
@@ -208,7 +209,7 @@ $url_list = UrlManager::get_url_data();
         ?>
         <div class="row">
             <div class="col-sm-5">
-                <label for="<?php echo $ajax_search ? 'course_to_add' : 'origin_users' ?>"><?php echo get_lang('UserGroupListInPlatform') ?></label>
+                <label for="<?php echo $ajax_search ? 'course_to_add' : 'origin_users'; ?>"><?php echo get_lang('UserGroupListInPlatform'); ?></label>
                 <div id="content_source">
                     <?php if ($ajax_search) {
             ?>
@@ -269,7 +270,7 @@ $url_list = UrlManager::get_url_data();
             <div class="col-xs-12 text-center">
                 <button class="save btn btn-primary" onclick="valide()">
                     <span class="fa fa-save fa-fw" aria-hidden="true"></span>
-                    <?php echo isset($_GET['add']) ? get_lang('AddUserGroupToURL') : get_lang('EditUserGroupToURL') ?>
+                    <?php echo isset($_GET['add']) ? get_lang('AddUserGroupToURL') : get_lang('EditUserGroupToURL'); ?>
                 </button>
             </div>
         </div>

+ 7 - 6
main/admin/access_url_edit_users_to_url.php

@@ -2,6 +2,7 @@
 /* For licensing terms, see /license.txt */
 /**
  * @package chamilo.admin
+ *
  * @author Julio Montoya <gugli100@gmail.com>
  */
 // resetting the course id
@@ -57,7 +58,7 @@ function add_user_to_url(code, content) {
 function send() {
 	if (document.formulaire.access_url_id.value!=0) {
 		document.formulaire.form_sent.value=0;
-		document.formulaire.add_type.value=\'' . $add_type.'\';
+		document.formulaire.add_type.value=\''.$add_type.'\';
 		document.formulaire.submit();
 	}
 }
@@ -119,7 +120,7 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) {
                 foreach ($result['users_deleted'] as $user) {
                     $user_info = api_get_user_info($user);
                     if (!empty($user_info)) {
-                        $user_deleted_list [] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname']);
+                        $user_deleted_list[] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname']);
                         $i++;
                     }
                 }
@@ -188,7 +189,7 @@ $url_list = UrlManager::get_url_data();
 ?>
 
 <div style="text-align: left;">
-<?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?>
+<?php echo $link_add_type_unique; ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple; ?>
 </div>
 <br /><br />
 <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if ($ajax_search) {
@@ -196,7 +197,7 @@ $url_list = UrlManager::get_url_data();
 } ?> >
     <?php echo get_lang('SelectUrl').' : '; ?>
 <select name="access_url_id" onchange="javascript:send();">
-<option value="0"> <?php echo get_lang('SelectUrl') ?></option>
+<option value="0"> <?php echo get_lang('SelectUrl'); ?></option>
         <?php
         $url_selected = '';
         foreach ($url_list as $url_obj) {
@@ -217,7 +218,7 @@ $url_list = UrlManager::get_url_data();
 </select>
 <br /><br />
 <input type="hidden" name="form_sent" value="1" />
-<input type="hidden" name="add_type" value = "<?php echo $add_type ?>" />
+<input type="hidden" name="add_type" value = "<?php echo $add_type; ?>" />
 
 <?php
 if (!empty($errorMsg)) {
@@ -237,7 +238,7 @@ if (!empty($errorMsg)) {
     </td>
 </tr>
 <tr>
-  <td align="center"><b><?php echo get_lang('UserListInPlatform') ?> : <?php echo count($nosessionUsersList); ?></b>
+  <td align="center"><b><?php echo get_lang('UserListInPlatform'); ?> : <?php echo count($nosessionUsersList); ?></b>
   </td>
   <td></td>
   <td align="center"><b><?php echo get_lang('UserListIn').' '.$url_selected; ?> : <?php echo count($sessionUsersList); ?></b></td>

+ 4 - 3
main/admin/access_urls.php

@@ -1,12 +1,13 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Frontend script for multiple access urls
+ * Frontend script for multiple access urls.
+ *
  * @package chamilo.admin
+ *
  * @author Julio Montoya <gugli100@gmail.com>
  * @author Yannick Warnier <yannick.warnier@beeznest.com>
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 $this_section = SECTION_PLATFORM_ADMIN;
@@ -142,7 +143,7 @@ $sortable_data = UrlManager::get_url_data();
 $urls = [];
 foreach ($sortable_data as $row) {
     //title
-    $url = Display::url($row['url'], $row['url'], ['target'=>'_blank']);
+    $url = Display::url($row['url'], $row['url'], ['target' => '_blank']);
     $description = $row['description'];
 
     //Status

+ 7 - 6
main/admin/add_courses_to_usergroup.php

@@ -1,8 +1,8 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
-*   @package chamilo.admin
-*/
+ *   @package chamilo.admin
+ */
 
 // Resetting the course id.
 $cidReset = true;
@@ -68,12 +68,12 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) {
 // Filters
 $filters = [
     ['type' => 'text', 'name' => 'code', 'label' => get_lang('CourseCode')],
-    ['type' => 'text', 'name' => 'title', 'label' => get_lang('Title')]
+    ['type' => 'text', 'name' => 'title', 'label' => get_lang('Title')],
 ];
 
 $searchForm = new FormValidator('search', 'get', api_get_self().'?id='.$id);
 $searchForm->addHeader(get_lang('AdvancedSearch'));
-$renderer = & $searchForm->defaultRenderer();
+$renderer = &$searchForm->defaultRenderer();
 $searchForm->addElement('hidden', 'id', $id);
 foreach ($filters as $param) {
     $searchForm->addElement($param['type'], $param['name'], $param['label']);
@@ -157,6 +157,7 @@ function search($needle, $type)
             $xajax_response->addAssign('ajax_list_multiple', 'innerHTML', api_utf8_encode($return));
         }
     }
+
     return $xajax_response;
 }
 
@@ -199,10 +200,10 @@ if (!empty($errorMsg)) {
 
 <table border="0" cellpadding="5" cellspacing="0" width="100%">
 <tr>
-  <td align="center"><b><?php echo get_lang('CoursesInPlatform') ?> :</b>
+  <td align="center"><b><?php echo get_lang('CoursesInPlatform'); ?> :</b>
   </td>
   <td></td>
-  <td align="center"><b><?php echo get_lang('CoursesInGroup') ?> :</b></td>
+  <td align="center"><b><?php echo get_lang('CoursesInGroup'); ?> :</b></td>
 </tr>
 
 <?php if ($add_type == 'multiple') {

+ 3 - 3
main/admin/add_drh_to_user.php

@@ -1,8 +1,8 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-use Chamilo\UserBundle\Entity\User as UserEntity;
 use Chamilo\CoreBundle\Entity\UserRelUser;
+use Chamilo\UserBundle\Entity\User as UserEntity;
 
 $cidReset = true;
 
@@ -50,14 +50,14 @@ $form->addSelectAjax(
 $form->addButtonSave(get_lang('Send'));
 $form->setDefaults([
     'u' => $user,
-    'hrm' => array_keys($hrmOptions)
+    'hrm' => array_keys($hrmOptions),
 ]);
 
 if ($form->validate()) {
     /** @var UserRelUser $subscribedUser */
     foreach ($subscribedUsers as $subscribedUser) {
         $em->remove($subscribedUser);
-    };
+    }
 
     $em->flush();
 

+ 7 - 9
main/admin/add_sessions_to_promotion.php

@@ -1,8 +1,8 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
-*   @package chamilo.admin
-*/
+ *   @package chamilo.admin
+ */
 // resetting the course id
 $cidReset = true;
 
@@ -64,7 +64,6 @@ function validate_filter() {
 }
 </script>';
 
-
 $form_sent = 0;
 $errorMsg = '';
 $users = $sessions = [];
@@ -130,7 +129,6 @@ echo '</div>';
 }?>>
 <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>';
 
-
 if ($add_type == 'multiple') {
     $extraField = new \ExtraField('session');
     $extra_field_list = $extraField->get_all_extra_field_by_type(ExtraField::FIELD_TYPE_SELECT);
@@ -168,10 +166,10 @@ if (!empty($errorMsg)) {
 
 <table border="0" cellpadding="5" cellspacing="0" width="100%">
 <tr>
-  <td align="center"><b><?php echo get_lang('SessionsInPlatform') ?> :</b>
+  <td align="center"><b><?php echo get_lang('SessionsInPlatform'); ?> :</b>
   </td>
   <td></td>
-  <td align="center"><b><?php echo get_lang('SessionsInPromotion') ?> :</b></td>
+  <td align="center"><b><?php echo get_lang('SessionsInPromotion'); ?> :</b></td>
 </tr>
 
 <?php if ($add_type == 'multiple') {
@@ -201,7 +199,7 @@ if (!empty($errorMsg)) {
       } else {
           ?>
       <div id="ajax_list_multiple">
-        <?php echo Display::select('session_not_in_promotion_name', $session_not_in_promotion, '', ['style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'session_not_in_promotion', 'size'=>'15px'], false); ?>
+        <?php echo Display::select('session_not_in_promotion_name', $session_not_in_promotion, '', ['style' => 'width:360px', 'multiple' => 'multiple', 'id' => 'session_not_in_promotion', 'size' => '15px'], false); ?>
       </div>
     <?php
       }
@@ -236,7 +234,7 @@ if (!empty($errorMsg)) {
         'session_in_promotion_name[]',
         $session_in_promotion,
         '',
-        ['style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'session_in_promotion', 'size'=>'15px'],
+        ['style' => 'width:360px', 'multiple' => 'multiple', 'id' => 'session_in_promotion', 'size' => '15px'],
         false
     );
     unset($sessionUsersList);
@@ -346,7 +344,7 @@ function search_sessions($needle, $type)
             }
         }
         $return .= '</select>';
-        $xajax_response -> addAssign('ajax_list_multiple', 'innerHTML', api_utf8_encode($return));
+        $xajax_response->addAssign('ajax_list_multiple', 'innerHTML', api_utf8_encode($return));
     }
 
     return $xajax_response;

+ 13 - 14
main/admin/add_sessions_to_usergroup.php

@@ -1,8 +1,8 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
-*   @package chamilo.admin
-*/
+ *   @package chamilo.admin
+ */
 // resetting the course id
 $cidReset = true;
 
@@ -65,10 +65,10 @@ function remove_item(origin) {
 function display_advanced_search () {
         if ($("#advancedSearch").css("display") == "none") {
                 $("#advancedSearch").css("display","block");
-                $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_hide.gif', get_lang('Hide'), ['style'=>'vertical-align:middle']).'&nbsp;'.get_lang('AdvancedSearch').'\');
+                $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_hide.gif', get_lang('Hide'), ['style' => 'vertical-align:middle']).'&nbsp;'.get_lang('AdvancedSearch').'\');
         } else {
                 $("#advancedSearch").css("display","none");
-                $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_show.gif', get_lang('Show'), ['style'=>'vertical-align:middle']).'&nbsp;'.get_lang('AdvancedSearch').'\');
+                $("#img_plus_and_minus").html(\'&nbsp;'.Display::return_icon('div_show.gif', get_lang('Show'), ['style' => 'vertical-align:middle']).'&nbsp;'.get_lang('AdvancedSearch').'\');
         }
 }
 
@@ -79,15 +79,14 @@ function validate_filter() {
 }
 </script>';
 
-
-$form_sent  = 0;
-$errorMsg   = '';
+$form_sent = 0;
+$errorMsg = '';
 $sessions = [];
 $usergroup = new UserGroup();
 $id = intval($_GET['id']);
 if (isset($_POST['form_sent']) && $_POST['form_sent']) {
-    $form_sent          = $_POST['form_sent'];
-    $elements_posted    = $_POST['elements_in_name'];
+    $form_sent = $_POST['form_sent'];
+    $elements_posted = $_POST['elements_in_name'];
     if (!is_array($elements_posted)) {
         $elements_posted = [];
     }
@@ -168,7 +167,7 @@ if ($add_type == 'multiple') {
 echo '<div class="actions">';
 echo '<a href="usergroups.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
 echo '<a href="javascript://" class="advanced_parameters" style="margin-top: 8px" onclick="display_advanced_search();"><span id="img_plus_and_minus">&nbsp;'.
-    Display::return_icon('div_show.gif', get_lang('Show'), ['style'=>'vertical-align:middle']).' '.get_lang('AdvancedSearch').'</span></a>';
+    Display::return_icon('div_show.gif', get_lang('Show'), ['style' => 'vertical-align:middle']).' '.get_lang('AdvancedSearch').'</span></a>';
 echo '</div>';
 echo '<div id="advancedSearch" style="display: none">'.get_lang('SearchSessions'); ?> :
      <input name="SearchSession" onchange = "xajax_search_usergroup_sessions(this.value,'searchbox')" onkeyup="this.onchange()">
@@ -190,10 +189,10 @@ if (!empty($errorMsg)) {
 
 <table border="0" cellpadding="5" cellspacing="0" width="100%">
 <tr>
-  <td align="center"><b><?php echo get_lang('SessionsInPlatform') ?> :</b>
+  <td align="center"><b><?php echo get_lang('SessionsInPlatform'); ?> :</b>
   </td>
   <td></td>
-  <td align="center"><b><?php echo get_lang('SessionsInGroup') ?> :</b></td>
+  <td align="center"><b><?php echo get_lang('SessionsInGroup'); ?> :</b></td>
 </tr>
 
 <?php if ($add_type == 'multiple') {
@@ -224,7 +223,7 @@ if (!empty($errorMsg)) {
       } else {
           ?>
       <div id="ajax_list_multiple">
-        <?php echo Display::select('elements_not_in_name', $elements_not_in, '', ['style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'elements_not_in', 'size'=>'15px'], false); ?>
+        <?php echo Display::select('elements_not_in_name', $elements_not_in, '', ['style' => 'width:360px', 'multiple' => 'multiple', 'id' => 'elements_not_in', 'size' => '15px'], false); ?>
       </div>
     <?php
       }
@@ -255,7 +254,7 @@ if (!empty($errorMsg)) {
   </td>
   <td align="center">
 <?php
-    echo Display::select('elements_in_name[]', $elements_in, '', ['style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'elements_in', 'size'=>'15px'], false);
+    echo Display::select('elements_in_name[]', $elements_in, '', ['style' => 'width:360px', 'multiple' => 'multiple', 'id' => 'elements_in', 'size' => '15px'], false);
     unset($sessionUsersList);
 ?>
  </td>

+ 21 - 21
main/admin/add_users_to_usergroup.php

@@ -2,8 +2,8 @@
 /* For licensing terms, see /license.txt */
 
 /**
-*   @package chamilo.admin
-*/
+ *   @package chamilo.admin
+ */
 
 // resetting the course id
 $cidReset = true;
@@ -95,8 +95,8 @@ if (is_array($extra_field_list)) {
         //if is enabled to filter and is a "<select>" field type
         if ($extra_field[8] == 1 && $extra_field[2] == 4) {
             $new_field_list[] = [
-                'name'=> $extra_field[3],
-                'variable' => $extra_field[1], 'data'=> $extra_field[9]
+                'name' => $extra_field[3],
+                'variable' => $extra_field[1], 'data' => $extra_field[9],
             ];
         }
     }
@@ -146,7 +146,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'export') {
     $users = $usergroup->getUserListByUserGroup($id);
     if (!empty($users)) {
         $data = [
-            ['UserName', 'ClassName']
+            ['UserName', 'ClassName'],
         ];
         foreach ($users as $user) {
             $data[] = [$user['username'], $groupInfo['name']];
@@ -195,12 +195,12 @@ $filters = [
     ['type' => 'text', 'name' => 'firstname', 'label' => get_lang('FirstName')],
     ['type' => 'text', 'name' => 'lastname', 'label' => get_lang('LastName')],
     ['type' => 'text', 'name' => 'official_code', 'label' => get_lang('OfficialCode')],
-    ['type' => 'text', 'name' => 'email', 'label' => get_lang('Email')]
+    ['type' => 'text', 'name' => 'email', 'label' => get_lang('Email')],
 ];
 
 $searchForm = new FormValidator('search', 'get', api_get_self().'?id='.$id);
 $searchForm->addHeader(get_lang('AdvancedSearch'));
-$renderer = & $searchForm->defaultRenderer();
+$renderer = &$searchForm->defaultRenderer();
 
 $searchForm->addElement('hidden', 'id', $id);
 foreach ($filters as $param) {
@@ -389,23 +389,23 @@ echo Display::input('hidden', 'add_type', null);
         <?php if ($data['group_type'] == UserGroup::SOCIAL_CLASS) {
     ?>
         <select name="relation" id="relation">
-            <option value=""><?php echo get_lang('SelectARelationType')?></option>
-            <option value="<?php echo GROUP_USER_PERMISSION_ADMIN ?>" <?php echo((isset($relation) && $relation == GROUP_USER_PERMISSION_ADMIN) ? 'selected=selected' : '') ?> >
-                <?php echo get_lang('Admin') ?></option>
-            <option value="<?php echo GROUP_USER_PERMISSION_READER ?>" <?php echo((isset($relation) && $relation == GROUP_USER_PERMISSION_READER) ? 'selected=selected' : '') ?> >
-                <?php echo get_lang('Reader') ?></option>
-            <option value="<?php echo GROUP_USER_PERMISSION_PENDING_INVITATION ?>" <?php echo((isset($relation) && $relation == GROUP_USER_PERMISSION_PENDING_INVITATION) ? 'selected=selected' : '') ?> >
-                <?php echo get_lang('PendingInvitation') ?></option>
-            <option value="<?php echo GROUP_USER_PERMISSION_MODERATOR ?>" <?php echo((isset($relation) && $relation == GROUP_USER_PERMISSION_MODERATOR) ? 'selected=selected' : '') ?> >
-                <?php echo get_lang('Moderator') ?></option>
-            <option value="<?php echo GROUP_USER_PERMISSION_HRM ?>" <?php echo((isset($relation) && $relation == GROUP_USER_PERMISSION_HRM) ? 'selected=selected' : '') ?> >
-                <?php echo get_lang('Drh') ?></option>
+            <option value=""><?php echo get_lang('SelectARelationType'); ?></option>
+            <option value="<?php echo GROUP_USER_PERMISSION_ADMIN; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_ADMIN) ? 'selected=selected' : ''; ?> >
+                <?php echo get_lang('Admin'); ?></option>
+            <option value="<?php echo GROUP_USER_PERMISSION_READER; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_READER) ? 'selected=selected' : ''; ?> >
+                <?php echo get_lang('Reader'); ?></option>
+            <option value="<?php echo GROUP_USER_PERMISSION_PENDING_INVITATION; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_PENDING_INVITATION) ? 'selected=selected' : ''; ?> >
+                <?php echo get_lang('PendingInvitation'); ?></option>
+            <option value="<?php echo GROUP_USER_PERMISSION_MODERATOR; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_MODERATOR) ? 'selected=selected' : ''; ?> >
+                <?php echo get_lang('Moderator'); ?></option>
+            <option value="<?php echo GROUP_USER_PERMISSION_HRM; ?>" <?php echo (isset($relation) && $relation == GROUP_USER_PERMISSION_HRM) ? 'selected=selected' : ''; ?> >
+                <?php echo get_lang('Drh'); ?></option>
         </select>
         <?php
 } ?>
 
         <div class="multiple_select_header">
-        <b><?php echo get_lang('UsersInPlatform') ?> :</b>
+        <b><?php echo get_lang('UsersInPlatform'); ?> :</b>
         <?php echo get_lang('FirstLetterUser'); ?> :
         <select id="first_letter_user" name="firstLetterUser" onchange="change_select();">
             <option value = "%">--</option>
@@ -449,7 +449,7 @@ echo Display::input('hidden', 'add_type', null);
     </div>
     <div class="col-md-5">
         <div class="multiple_select_header">
-            <b><?php echo get_lang('UsersInGroup') ?> :</b>
+            <b><?php echo get_lang('UsersInGroup'); ?> :</b>
         </div>
     <?php
         echo Display::select(
@@ -460,7 +460,7 @@ echo Display::input('hidden', 'add_type', null);
                 'class' => 'form-control',
                 'multiple' => 'multiple',
                 'id' => 'elements_in',
-                'size' => '15px'
+                'size' => '15px',
             ],
             false
         );

+ 4 - 4
main/admin/career_dashboard.php

@@ -2,10 +2,10 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * Careers dashboard
+ * Careers dashboard.
+ *
  * @package chamilo.admin.career
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
@@ -21,11 +21,11 @@ $htmlHeadXtra[] = api_get_jqgrid_js();
 // setting breadcrumbs
 $interbreadcrumb[] = [
     'url' => 'index.php',
-    'name' => get_lang('PlatformAdmin')
+    'name' => get_lang('PlatformAdmin'),
 ];
 $interbreadcrumb[] = [
     'url' => 'career_dashboard.php',
-    'name' => get_lang('CareersAndPromotions')
+    'name' => get_lang('CareersAndPromotions'),
 ];
 $tpl = new Template(get_lang('CareersAndPromotions'));
 

+ 0 - 2
main/admin/careers.php

@@ -6,7 +6,6 @@ use ChamiloSession as Session;
 /**
  *  @package chamilo.admin
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
@@ -100,7 +99,6 @@ if (api_is_platform_admin()) {
     }";
 }
 
-
 $career = new Career();
 $content = '';
 

+ 6 - 5
main/admin/cli.php

@@ -1,11 +1,12 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
-* Used for external support of chamilo's users
-*
-* @author Arnaud Ligot, CBlue SPRL
-* @package chamilo.admin.cli
-*/
+ * Used for external support of chamilo's users.
+ *
+ * @author Arnaud Ligot, CBlue SPRL
+ *
+ * @package chamilo.admin.cli
+ */
 
 // we are in the admin area so we do not need a course id
 $cidReset = true;

+ 4 - 3
main/admin/configure_extensions.php

@@ -4,7 +4,8 @@
 use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
 
 /**
- * Edition of extensions configuration
+ * Edition of extensions configuration.
+ *
  * @package chamilo.admin
  */
 $cidReset = true;
@@ -146,12 +147,12 @@ Display::display_header($nameTool);
     <div class="chamilo-rapid">
     <div class="row">
         <div class="col-md-12">
-            <?php echo Display::panel(get_lang('Ppt2lpDescription').' '.get_lang('Ppt2lpVoiceRecordingNeedsRed5'), get_lang('Ppt2lp')) ?>
+            <?php echo Display::panel(get_lang('Ppt2lpDescription').' '.get_lang('Ppt2lpVoiceRecordingNeedsRed5'), get_lang('Ppt2lp')); ?>
         </div>
     </div>
         <div class="row">
             <div class="col-md-5">
-                <?php Display::display_icon('screenshot_ppt2lp.jpg', get_lang('Ppt2lp'), ['class'=>'img-responsive']); ?>
+                <?php Display::display_icon('screenshot_ppt2lp.jpg', get_lang('Ppt2lp'), ['class' => 'img-responsive']); ?>
             </div>
             <div class="col-md-7">
                 <form method="POST" class="form-horizontal" action="<?php echo api_get_self(); ?>">

+ 7 - 8
main/admin/configure_homepage.php

@@ -2,12 +2,13 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * Configure the portal homepage (manages multi-urls and languages)
+ * Configure the portal homepage (manages multi-urls and languages).
+ *
  * @package chamilo.admin
  */
 
 /**
- * Creates menu tabs for logged and anonymous users
+ * Creates menu tabs for logged and anonymous users.
  *
  * This function copies the file containing private a public tabs (home_tabs_logged_in_$language.html)
  * in to the public tab template (home_tabs_$language.html) but without the private tabs.
@@ -74,13 +75,13 @@ $_languages = api_get_languages();
 $selfUrl = api_get_self();
 $interbreadcrumb[] = [
     'url' => 'index.php',
-    'name' => get_lang('PlatformAdmin')
+    'name' => get_lang('PlatformAdmin'),
 ];
 
 if (!empty($action)) {
     $interbreadcrumb[] = [
         'url' => 'configure_homepage.php',
-        'name' => get_lang('ConfigureHomePage')
+        'name' => get_lang('ConfigureHomePage'),
     ];
 
     switch ($action) {
@@ -220,7 +221,6 @@ if (!empty($action)) {
                 // Filter
                 $home_top = trim(stripslashes($_POST['home_top']));
 
-
                 // Write
                 if (is_writable($homep)) {
                     // Default
@@ -724,7 +724,6 @@ if (!empty($action)) {
 
                 // For each line of the home_menu file
                 foreach ($home_menu as $key => $enreg) {
-
                     // Check if the current item is the one we want to update
                     if ($key == $link_index) {
                         // This is the link we want to update
@@ -851,7 +850,7 @@ switch ($action) {
         }
         $default = [];
         $form = new FormValidator('configure_homepage_'.$action, 'post', $selfUrl.'?action='.$action, '', ['style' => 'margin: 0px;']);
-        $renderer = & $form->defaultRenderer();
+        $renderer = &$form->defaultRenderer();
 
         $form->addElement('header', '', $tool_name);
         $form->addElement('hidden', 'formSent', '1');
@@ -950,7 +949,7 @@ switch ($action) {
             '',
             ['style' => 'margin: 0px;']
         );
-        $renderer = & $form->defaultRenderer();
+        $renderer = &$form->defaultRenderer();
         $renderer->setHeaderTemplate('');
         $renderer->setFormTemplate('<form{attributes}><table border="0" cellpadding="5" cellspacing="0" width="100%">{content}</table></form>');
         $renderer->setCustomElementTemplate('<tr><td>{element}</td></tr>');

+ 3 - 3
main/admin/configure_inscription.php

@@ -3,6 +3,7 @@
 
 /**
  *	This script displays a form for registering new users.
+ *
  *	@package	 chamilo.admin
  */
 $cidReset = true;
@@ -73,7 +74,6 @@ if (api_is_multiple_url_enabled()) {
         $clean_url = str_replace('/', '-', $clean_url);
         $clean_url .= '/';
 
-
         $homep = api_get_path(SYS_APP_PATH).'home/'; //homep for Home Path
         $homep_new = api_get_path(SYS_APP_PATH).'home/'.$clean_url; //homep for Home Path added the url
         $new_url_dir = api_get_path(SYS_APP_PATH).'home/'.$clean_url;
@@ -374,7 +374,7 @@ switch ($action) {
             '',
             ['style' => 'margin: 0px;']
         );
-        $renderer = & $form->defaultRenderer();
+        $renderer = &$form->defaultRenderer();
         $renderer->setHeaderTemplate('');
         $renderer->setFormTemplate('<form{attributes}><table border="0" cellpadding="5" cellspacing="0" width="100%">{content}</table></form>');
         $renderer->setCustomElementTemplate('<tr><td>{element}</td></tr>');
@@ -389,7 +389,7 @@ switch ($action) {
             [
                 'ToolbarSet' => 'PortalHomePage',
                 'Width' => '100%',
-                'Height' => '400'
+                'Height' => '400',
             ]
         );
         $form->addButtonSave(get_lang('Save'));

+ 5 - 5
main/admin/configure_plugin.php

@@ -4,9 +4,9 @@
 /**
  * @author Julio Montoya <gugli100@gmail.com> BeezNest 2012
  * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
+ *
  * @package chamilo.admin
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
@@ -63,8 +63,8 @@ if (isset($form)) {
                     $accessUrlId,
                     $pluginName,
                     'setting',
-                    'status'
-                ]
+                    'status',
+                ],
             ]
         );
 
@@ -105,11 +105,11 @@ if (isset($form)) {
 
 $interbreadcrumb[] = [
     'url' => api_get_path(WEB_CODE_PATH).'admin/index.php',
-    'name' => get_lang('PlatformAdmin')
+    'name' => get_lang('PlatformAdmin'),
 ];
 $interbreadcrumb[] = [
     'url' => api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins',
-    'name' => get_lang('Plugins')
+    'name' => get_lang('Plugins'),
 ];
 
 $tpl = new Template($pluginName, true, true, false, true, false);

+ 6 - 7
main/admin/course_add.php

@@ -1,13 +1,12 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-use Chamilo\CoreBundle\Entity\Repository\CourseCategoryRepository;
 use Chamilo\CoreBundle\Entity\CourseCategory;
+use Chamilo\CoreBundle\Entity\Repository\CourseCategoryRepository;
 
 /**
  * @package chamilo.admin
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 $this_section = SECTION_PLATFORM_ADMIN;
@@ -34,7 +33,7 @@ $form->addText(
     get_lang('Title'),
     true,
     [
-        'aria-label' => get_lang('Title')
+        'aria-label' => get_lang('Title'),
     ]
 );
 $form->applyFilter('title', 'html_filter');
@@ -45,14 +44,14 @@ $form->addText(
     'visual_code',
     [
         get_lang('CourseCode'),
-        get_lang('OnlyLettersAndNumbers')
+        get_lang('OnlyLettersAndNumbers'),
     ],
     false,
     [
         'maxlength' => CourseManager::MAX_COURSE_LENGTH_CODE,
         'pattern' => '[a-zA-Z0-9]+',
         'title' => get_lang('OnlyLettersAndNumbers'),
-        'id' => 'visual_code'
+        'id' => 'visual_code',
     ]
 );
 
@@ -108,7 +107,7 @@ $form->addSelectAjax(
     [
         'url' => api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=teacher_to_basis_course',
         'id' => 'course_teachers',
-        'multiple' => 'multiple'
+        'multiple' => 'multiple',
     ]
 );
 $form->applyFilter('course_teachers', 'html_filter');
@@ -181,7 +180,7 @@ $group[] = $form->createElement('radio', 'unsubscribe', null, get_lang('NotAllow
 $form->addGroup($group, '', get_lang('Unsubscription'));
 
 $form->addElement('text', 'disk_quota', [get_lang('CourseQuota'), null, get_lang('MB')], [
-    'id' => 'disk_quota'
+    'id' => 'disk_quota',
 ]);
 $form->addRule('disk_quota', get_lang('ThisFieldShouldBeNumeric'), 'numeric');
 

+ 4 - 5
main/admin/course_edit.php

@@ -1,14 +1,13 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-use Chamilo\CoreBundle\Entity\Repository\CourseCategoryRepository;
 use Chamilo\CoreBundle\Entity\CourseCategory;
+use Chamilo\CoreBundle\Entity\Repository\CourseCategoryRepository;
 use Chamilo\UserBundle\Entity\User;
 
 /**
  * @package chamilo.admin
  */
-
 $cidReset = true;
 
 require_once __DIR__.'/../inc/global.inc.php';
@@ -132,13 +131,13 @@ $form->addText(
     [
         get_lang('VisualCode'),
         get_lang('OnlyLettersAndNumbers'),
-        get_lang('ThisValueIsUsedInTheCourseURL')
+        get_lang('ThisValueIsUsedInTheCourseURL'),
     ],
     true,
     [
         'maxlength' => CourseManager::MAX_COURSE_LENGTH_CODE,
         'pattern' => '[a-zA-Z0-9]+',
-        'title' => get_lang('OnlyLettersAndNumbers')
+        'title' => get_lang('OnlyLettersAndNumbers'),
     ]
 );
 
@@ -298,7 +297,7 @@ $extra = $extra_field->addElements(
 $htmlHeadXtra[] = '
 <script>
 $(function() {
-    ' . $extra['jquery_ready_content'].'
+    '.$extra['jquery_ready_content'].'
 });
 </script>';
 

+ 3 - 3
main/admin/course_export.php

@@ -2,10 +2,10 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * This tool allows platform admins to export courses to CSV file
+ * This tool allows platform admins to export courses to CSV file.
+ *
  * @package chamilo.admin
  */
-
 $cidReset = true;
 
 require_once __DIR__.'/../inc/global.inc.php';
@@ -53,7 +53,7 @@ if (isset($_POST['formSent']) && $_POST['formSent']) {
             'Teacher',
             'Language',
             'Users',
-            'OtherTeachers'
+            'OtherTeachers',
         ];
 
         $dataToExport = [];

+ 10 - 3
main/admin/course_import.php

@@ -3,7 +3,8 @@
 
 /**
  * This tool allows platform admins to create courses by uploading a CSV file
- * Copyright (c) 2005 Bart Mollet <bart.mollet@hogent.be>
+ * Copyright (c) 2005 Bart Mollet <bart.mollet@hogent.be>.
+ *
  * @package chamilo.admin
  */
 
@@ -11,6 +12,7 @@
  * Validates imported data.
  *
  * @param array $courses
+ *
  * @return array $errors
  */
 function validate_courses_data($courses)
@@ -79,9 +81,10 @@ function validate_courses_data($courses)
 }
 
 /**
- * Get the teacher list
+ * Get the teacher list.
  *
  * @param array $teachers
+ *
  * @return array
  */
 function getTeacherListInArray($teachers)
@@ -95,6 +98,7 @@ function getTeacherListInArray($teachers)
 
 /**
  * Saves imported data.
+ *
  * @param array $courses List of courses
  */
 function save_courses_data($courses)
@@ -147,13 +151,16 @@ function save_courses_data($courses)
 }
 
 /**
- * Read the CSV-file
+ * Read the CSV-file.
+ *
  * @param string $file Path to the CSV-file
+ *
  * @return array All course-information read from the file
  */
 function parse_csv_courses_data($file)
 {
     $courses = Import::csv_reader($file);
+
     return $courses;
 }
 

+ 9 - 6
main/admin/course_information.php

@@ -1,8 +1,10 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * This script gives information about a course
+ * This script gives information about a course.
+ *
  * @author Bart Mollet
+ *
  * @package chamilo.admin
  */
 $cidReset = true;
@@ -24,7 +26,8 @@ $sessionId = isset($_GET['id_session']) ? (int) $_GET['id_session'] : 0;
 
 /**
  * @param array $course
- * @param int $session_id
+ * @param int   $session_id
+ *
  * @return array
  */
 function get_course_usage($course, $session_id = 0)
@@ -62,7 +65,7 @@ function get_course_usage($course, $session_id = 0)
         [
             Database::get_course_table(TABLE_ANNOUNCEMENT),
             get_lang(ucfirst(TOOL_ANNOUNCEMENT)),
-        ]
+        ],
     ];
 
     $usage = [];
@@ -82,7 +85,7 @@ function get_course_usage($course, $session_id = 0)
 
         $usage[] = [
             $title,
-            $row['count']
+            $row['count'],
         ];
     }
 
@@ -117,7 +120,7 @@ $table->set_header(1, get_lang('NumberOfItems'), true);
 $table->display();
 
 /**
- * Show all users subscribed in this course
+ * Show all users subscribed in this course.
  */
 echo Display::page_header(get_lang('Users'));
 
@@ -140,7 +143,7 @@ $is_western_name_order = api_is_western_name_order();
 if (Database::num_rows($res) > 0) {
     $users = [];
     while ($obj = Database::fetch_object($res)) {
-        $user   = [];
+        $user = [];
         $user[] = $obj->official_code;
         if ($is_western_name_order) {
             $user[] = $obj->firstname;

+ 7 - 3
main/admin/course_intro_pdf_import.php

@@ -2,7 +2,8 @@
 /* For licensing terms, see /license.txt */
 /**
  * This tool allows platform admins to upload a massive amount of PDFs to be
- * uploaded in each course
+ * uploaded in each course.
+ *
  * @package chamilo.admin
  */
 $cidReset = true;
@@ -94,8 +95,10 @@ ENG101_Introduction_to_English-101.pdf
 Display::display_footer();
 
 /**
- * Import PDFs
- * @param   string $subDir  The subdirectory in which to put the files in each course
+ * Import PDFs.
+ *
+ * @param string $subDir The subdirectory in which to put the files in each course
+ *
  * @return array List of possible errors found
  */
 function import_pdfs($subDir = '/')
@@ -108,6 +111,7 @@ function import_pdfs($subDir = '/')
     }
     if (!unzip_uploaded_file($_FILES['import_file'], $uploadPath, $baseDir, 1024 * 1024 * 1024)) {
         error_log('Could not unzip uploaded file in '.__FILE__.', line '.__LINE__);
+
         return $errors;
     }
     $list = scandir($baseDir.$uploadPath);

+ 29 - 21
main/admin/course_list.php

@@ -3,10 +3,10 @@
 
 /**
  * This script shows a list of courses and allows searching for courses codes
- * and names
+ * and names.
+ *
  * @package chamilo.admin
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 $this_section = SECTION_PLATFORM_ADMIN;
@@ -16,9 +16,11 @@ api_protect_admin_script();
 $sessionId = isset($_GET['session_id']) ? $_GET['session_id'] : null;
 
 /**
- * Get the number of courses which will be displayed
- * @return int The number of matching courses
+ * Get the number of courses which will be displayed.
+ *
  * @throws Exception
+ *
+ * @return int The number of matching courses
  */
 function get_number_of_courses()
 {
@@ -75,14 +77,16 @@ function get_number_of_courses()
 }
 
 /**
- * Get course data to display
- * @param int $from
- * @param int $number_of_items
- * @param int $column
+ * Get course data to display.
+ *
+ * @param int    $from
+ * @param int    $number_of_items
+ * @param int    $column
  * @param string $direction
  *
- * @return array
  * @throws Exception
+ *
+ * @return array
  */
 function get_course_data($from, $number_of_items, $column, $direction)
 {
@@ -193,7 +197,7 @@ function get_course_data($from, $number_of_items, $column, $direction)
             $course[4],
             $course[5],
             $course[6],
-            $actions
+            $actions,
         ];
         $courses[] = $courseItem;
     }
@@ -202,13 +206,16 @@ function get_course_data($from, $number_of_items, $column, $direction)
 }
 
 /**
- * Get course data to display filtered by session name
- * @param int $from
- * @param int $number_of_items
- * @param int $column
+ * Get course data to display filtered by session name.
+ *
+ * @param int    $from
+ * @param int    $number_of_items
+ * @param int    $column
  * @param string $direction
- * @return array
+ *
  * @throws Exception
+ *
+ * @return array
  */
 function get_course_data_by_session($from, $number_of_items, $column, $direction)
 {
@@ -264,7 +271,7 @@ function get_course_data_by_session($from, $number_of_items, $column, $direction
             $course[4],
             $course[5],
             $course[6],
-            $course[7]
+            $course[7],
         ];
         $courses[] = $row;
     }
@@ -273,9 +280,10 @@ function get_course_data_by_session($from, $number_of_items, $column, $direction
 }
 
 /**
- * Return an icon representing the visibility of the course
+ * Return an icon representing the visibility of the course.
  *
  * @param string $visibility
+ *
  * @return string
  */
 function get_course_visibility_icon($visibility)
@@ -345,11 +353,11 @@ if (isset($_GET['search']) && $_GET['search'] === 'advanced') {
     // Get all course categories
     $interbreadcrumb[] = [
         'url' => 'index.php',
-        'name' => get_lang('PlatformAdmin')
+        'name' => get_lang('PlatformAdmin'),
     ];
     $interbreadcrumb[] = [
         'url' => 'course_list.php',
-        'name' => get_lang('CourseList')
+        'name' => get_lang('CourseList'),
     ];
     $tool_name = get_lang('SearchACourse');
     $form = new FormValidator('advanced_course_search', 'get');
@@ -366,7 +374,7 @@ if (isset($_GET['search']) && $_GET['search'] === 'advanced') {
         get_lang('CourseFaculty'),
         null,
         [
-            'url' => $url
+            'url' => $url,
         ]
     );
 
@@ -394,7 +402,7 @@ if (isset($_GET['search']) && $_GET['search'] === 'advanced') {
 } else {
     $interbreadcrumb[] = [
         'url' => 'index.php',
-        'name' => get_lang('PlatformAdmin')
+        'name' => get_lang('PlatformAdmin'),
     ];
     $tool_name = get_lang('CourseList');
     if (isset($_GET['delete_course'])) {

+ 4 - 4
main/admin/course_request_accepted.php

@@ -2,15 +2,15 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * A list containig the accepted course requests
+ * A list containig the accepted course requests.
+ *
  * @package chamilo.admin
+ *
  * @author José Manuel Abuin Mosquera <chema@cesga.es>, 2010
  * @author Bruno Rubio Gayo <brubio@cesga.es>, 2010
  * Centro de Supercomputacion de Galicia (CESGA)
- *
  * @author Ivan Tcholakov <ivantcholakov@gmail.com> (technical adaptation for Chamilo 1.8.8), 2010
  */
-
 $cidReset = true;
 
 require_once __DIR__.'/../inc/global.inc.php';
@@ -76,7 +76,7 @@ function get_number_of_requests()
 }
 
 /**
- * Get course data to display
+ * Get course data to display.
  */
 function get_request_data($from, $number_of_items, $column, $direction)
 {

+ 2 - 1
main/admin/course_request_edit.php

@@ -3,10 +3,11 @@
 
 /**
  * A page for detailed preview or edition of a given course request.
+ *
  * @package chamilo.admin
+ *
  * @author Ivan Tcholakov <ivantcholakov@gmail.com>, 2010
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 $this_section = SECTION_PLATFORM_ADMIN;

+ 4 - 4
main/admin/course_request_rejected.php

@@ -2,15 +2,15 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * A list containing the rejected course requests
+ * A list containing the rejected course requests.
+ *
  * @package chamilo.admin
+ *
  * @author José Manuel Abuin Mosquera <chema@cesga.es>, 2010
  * @author Bruno Rubio Gayo <brubio@cesga.es>, 2010
  * Centro de Supercomputacion de Galicia (CESGA)
- *
  * @author Ivan Tcholakov <ivantcholakov@gmail.com> (technical adaptation for Chamilo 1.8.8), 2010
  */
-
 $cidReset = true;
 
 require_once __DIR__.'/../inc/global.inc.php';
@@ -107,7 +107,7 @@ function get_number_of_requests()
 }
 
 /**
- * Get course data to display
+ * Get course data to display.
  */
 function get_request_data($from, $number_of_items, $column, $direction)
 {

+ 7 - 7
main/admin/course_request_review.php

@@ -2,14 +2,14 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * A list containing the pending course requests
+ * A list containing the pending course requests.
+ *
  * @package chamilo.admin
+ *
  * @author José Manuel Abuin Mosquera <chema@cesga.es>, 2010
  * Centro de Supercomputacion de Galicia (CESGA)
- *
  * @author Ivan Tcholakov <ivantcholakov@gmail.com> (technical adaptation for Chamilo 1.8.8), 2010
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 $this_section = SECTION_PLATFORM_ADMIN;
@@ -49,7 +49,7 @@ if ($course_validation_feature) {
         }
     } elseif (!empty($reject_course_request)) {
         /**
-         * Course rejection
+         * Course rejection.
          */
         $course_request_code = CourseRequestManager::get_course_request_code($reject_course_request);
         $result = CourseRequestManager::reject_course_request($reject_course_request);
@@ -61,7 +61,6 @@ if ($course_validation_feature) {
             $is_error_message = true;
         }
     } elseif (!empty($request_info)) {
-
         /**
          * Sending to the teacher a request for additional information about the proposed course.
          */
@@ -124,7 +123,7 @@ function get_number_of_requests()
 }
 
 /**
- * Get course data to display
+ * Get course data to display.
  */
 function get_request_data($from, $number_of_items, $column, $direction)
 {
@@ -174,7 +173,7 @@ function get_request_data($from, $number_of_items, $column, $direction)
 }
 
 /**
- * Enlace a la ficha del profesor
+ * Enlace a la ficha del profesor.
  */
 function email_filter($teacher)
 {
@@ -182,6 +181,7 @@ function email_filter($teacher)
             WHERE tutor_name LIKE '".$teacher."'";
     $res = Database::query($sql);
     $info = Database::fetch_array($res);
+
     return '<a href="./user_information.php?user_id='.$info[0].'">'.$teacher.'</a>';
 }
 

+ 10 - 6
main/admin/course_user_import.php

@@ -3,7 +3,8 @@
 
 /**
  * This tool allows platform admins to update course-user relations by uploading
- * a CSV file
+ * a CSV file.
+ *
  * @package chamilo.admin
  */
 
@@ -21,7 +22,7 @@ function validate_data($users_courses)
         foreach ($mandatory_fields as $key => $field) {
             if (!isset($user_course[$field]) || strlen($user_course[$field]) == 0) {
                 $user_course['error'] = get_lang($field.'Mandatory');
-                $errors[]             = $user_course;
+                $errors[] = $user_course;
             }
         }
 
@@ -36,7 +37,7 @@ function validate_data($users_courses)
                 $res = Database::query($sql);
                 if (Database::num_rows($res) == 0) {
                     $user_course['error'] = get_lang('CodeDoesNotExists');
-                    $errors[]             = $user_course;
+                    $errors[] = $user_course;
                 } else {
                     $coursecodes[$user_course['CourseCode']] = 1;
                 }
@@ -47,7 +48,7 @@ function validate_data($users_courses)
         if (isset($user_course['UserName']) && strlen($user_course['UserName']) != 0) {
             if (UserManager::is_username_available($user_course['UserName'])) {
                 $user_course['error'] = get_lang('UnknownUser');
-                $errors[]             = $user_course;
+                $errors[] = $user_course;
             }
         }
 
@@ -55,7 +56,7 @@ function validate_data($users_courses)
         if (isset($user_course['Status']) && strlen($user_course['Status']) != 0) {
             if ($user_course['Status'] != COURSEMANAGER && $user_course['Status'] != STUDENT) {
                 $user_course['error'] = get_lang('UnknownStatus');
-                $errors[]             = $user_course;
+                $errors[] = $user_course;
             }
         }
     }
@@ -99,7 +100,7 @@ function save_data($users_courses)
             $db_subscriptions[$obj->c_id] = $obj->status;
         }
 
-        $to_subscribe   = array_diff(array_keys($csv_subscriptions), array_keys($db_subscriptions));
+        $to_subscribe = array_diff(array_keys($csv_subscriptions), array_keys($db_subscriptions));
         $to_unsubscribe = array_diff(array_keys($db_subscriptions), array_keys($csv_subscriptions));
 
         if ($_POST['subscribe']) {
@@ -130,12 +131,15 @@ function save_data($users_courses)
 
 /**
  * Reads CSV-file.
+ *
  * @param string $file Path to the CSV-file
+ *
  * @return array All course-information read from the file
  */
 function parse_csv_data($file)
 {
     $courses = Import :: csvToArray($file);
+
     return $courses;
 }
 

+ 10 - 6
main/admin/course_user_import_by_email.php

@@ -3,7 +3,8 @@
 exit;
 /**
  * This tool allows platform admins to update course-user relations by uploading
- * a CSV file
+ * a CSV file.
+ *
  * @package chamilo.admin
  */
 /**
@@ -20,7 +21,7 @@ function validate_data($users_courses)
         foreach ($mandatory_fields as $key => $field) {
             if (!isset($user_course[$field]) || strlen($user_course[$field]) == 0) {
                 $user_course['error'] = get_lang($field.'Mandatory');
-                $errors[]             = $user_course;
+                $errors[] = $user_course;
             }
         }
 
@@ -35,7 +36,7 @@ function validate_data($users_courses)
                 $res = Database::query($sql);
                 if (Database::num_rows($res) == 0) {
                     $user_course['error'] = get_lang('CodeDoesNotExists');
-                    $errors[]             = $user_course;
+                    $errors[] = $user_course;
                 } else {
                     $coursecodes[$user_course['CourseCode']] = 1;
                 }
@@ -47,7 +48,7 @@ function validate_data($users_courses)
             $user = api_get_user_info_from_email($user_course['Email']);
             if (empty($user)) {
                 $user_course['error'] = get_lang('UnknownUser');
-                $errors[]             = $user_course;
+                $errors[] = $user_course;
             }
         }
 
@@ -55,7 +56,7 @@ function validate_data($users_courses)
         if (isset($user_course['Status']) && strlen($user_course['Status']) != 0) {
             if ($user_course['Status'] != COURSEMANAGER && $user_course['Status'] != STUDENT) {
                 $user_course['error'] = get_lang('UnknownStatus');
-                $errors[]             = $user_course;
+                $errors[] = $user_course;
             }
         }
     }
@@ -92,7 +93,7 @@ function save_data($users_courses)
             $db_subscriptions[$obj->c_id] = $obj->status;
         }
 
-        $to_subscribe   = array_diff(array_keys($csv_subscriptions), array_keys($db_subscriptions));
+        $to_subscribe = array_diff(array_keys($csv_subscriptions), array_keys($db_subscriptions));
         $to_unsubscribe = array_diff(array_keys($db_subscriptions), array_keys($csv_subscriptions));
 
         if (isset($_POST['subscribe']) && $_POST['subscribe']) {
@@ -132,12 +133,15 @@ function save_data($users_courses)
 
 /**
  * Reads CSV-file.
+ *
  * @param string $file Path to the CSV-file
+ *
  * @return array All course-information read from the file
  */
 function parse_csv_data($file)
 {
     $courses = Import::csv_reader($file);
+
     return $courses;
 }
 

+ 7 - 5
main/admin/dashboard_add_courses_to_user.php

@@ -2,7 +2,8 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * Interface for assigning courses to Human Resources Manager
+ * Interface for assigning courses to Human Resources Manager.
+ *
  * @package chamilo.admin
  */
 // resetting the course id
@@ -31,7 +32,7 @@ $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_
 // initializing variables
 $user_id = intval($_GET['user']);
 $user_info = api_get_user_info($user_id);
-$user_anonymous  = api_get_anonymous_id();
+$user_anonymous = api_get_anonymous_id();
 $current_user_id = api_get_user_id();
 
 // setting the name of the tool
@@ -94,8 +95,9 @@ function search_courses($needle, $type)
             $return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'], ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>';
         }
         $return .= '</select>';
-        $xajax_response -> addAssign('ajax_list_courses_multiple', 'innerHTML', api_utf8_encode($return));
+        $xajax_response->addAssign('ajax_list_courses_multiple', 'innerHTML', api_utf8_encode($return));
     }
+
     return $xajax_response;
 }
 
@@ -218,7 +220,7 @@ if (api_is_multiple_url_enabled()) {
 $result = Database::query($sql);
 
 ?>
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;">
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id; ?>" style="margin:0px;">
 <input type="hidden" name="formSent" value="1" />
 <?php
 if (!empty($msg)) {
@@ -228,7 +230,7 @@ if (!empty($msg)) {
 
 <div class="row">
     <div class="col-md-4">
-        <h5><?php echo get_lang('CoursesListInPlatform') ?> :</h5>
+        <h5><?php echo get_lang('CoursesListInPlatform'); ?> :</h5>
 
         <div id="ajax_list_courses_multiple">
     <select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" style="width:340px;">

+ 5 - 4
main/admin/dashboard_add_sessions_to_user.php

@@ -2,7 +2,8 @@
 /* For licensing terms, see /license.txt */
 
 /**
- *  Interface for assigning sessions to Human Resources Manager
+ *  Interface for assigning sessions to Human Resources Manager.
+ *
  *  @package chamilo.admin
  */
 // resetting the course id
@@ -216,14 +217,14 @@ if (api_is_multiple_url_enabled()) {
 }
 $result = Database::query($sql);
 ?>
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;" <?php if ($ajax_search) {
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id; ?>" style="margin:0px;" <?php if ($ajax_search) {
     echo ' onsubmit="valide();"';
 }?>>
     <input type="hidden" name="formSent" value="1" />
 
     <div class="row">
         <div class="col-md-4">
-            <h5><?php echo get_lang('SessionsListInPlatform') ?> :</h5>
+            <h5><?php echo get_lang('SessionsListInPlatform'); ?> :</h5>
             <div id="ajax_list_sessions_multiple">
                 <select id="origin" name="NoAssignedSessionsList[]" multiple="multiple" size="20" style="width:340px;">
                     <?php
@@ -296,7 +297,7 @@ $result = Database::query($sql);
                     foreach ($assigned_sessions_to_hrm as $enreg) {
                         ?>
                         <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; ?>>
-                            <?php echo $enreg['name'] ?>
+                            <?php echo $enreg['name']; ?>
                         </option>
                 <?php
                     }

+ 7 - 6
main/admin/dashboard_add_users_to_user.php

@@ -2,7 +2,8 @@
 /* For licensing terms, see /license.txt */
 
 /**
- *  Interface for assigning users to Human Resources Manager
+ *  Interface for assigning users to Human Resources Manager.
+ *
  *  @package chamilo.admin
  */
 
@@ -33,7 +34,7 @@ $tbl_access_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_US
 // initializing variables
 $user_id = intval($_GET['user']);
 $user_info = api_get_user_info($user_id);
-$user_anonymous  = api_get_anonymous_id();
+$user_anonymous = api_get_anonymous_id();
 $current_user_id = api_get_user_id();
 
 $userStatus = api_get_user_status($user_id);
@@ -254,12 +255,12 @@ $filters = [
     ['type' => 'text', 'name' => 'firstname', 'label' => get_lang('FirstName')],
     ['type' => 'text', 'name' => 'lastname', 'label' => get_lang('LastName')],
     ['type' => 'text', 'name' => 'official_code', 'label' => get_lang('OfficialCode')],
-    ['type' => 'text', 'name' => 'email', 'label' => get_lang('Email')]
+    ['type' => 'text', 'name' => 'email', 'label' => get_lang('Email')],
 ];
 
 $searchForm = new FormValidator('search', 'get', api_get_self().'?user='.$user_id);
 $searchForm->addHeader(get_lang('AdvancedSearch'));
-$renderer = & $searchForm->defaultRenderer();
+$renderer = &$searchForm->defaultRenderer();
 
 $searchForm->addElement('hidden', 'user', $user_id);
 foreach ($filters as $param) {
@@ -410,13 +411,13 @@ if (api_is_multiple_url_enabled()) {
 }
 $result = Database::query($sql);
 ?>
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" class="form-horizontal" <?php if ($ajax_search) {
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id; ?>" class="form-horizontal" <?php if ($ajax_search) {
     echo ' onsubmit="valide();"';
 }?>>
 <input type="hidden" name="formSent" value="1" />
 <div class="row">
     <div class="col-md-4">
-        <?php echo get_lang('UserListInPlatform') ?>
+        <?php echo get_lang('UserListInPlatform'); ?>
         <div class="form-group">
             <div class="col-sm-12">
                 <div id="ajax_list_users_multiple">

+ 3 - 2
main/admin/email_tester.php

@@ -1,7 +1,8 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Index page of the admin tools
+ * Index page of the admin tools.
+ *
  * @package chamilo.admin
  */
 // Resetting the course id.
@@ -31,7 +32,7 @@ $form->addHtmlEditor(
 $form->addButtonSend(get_lang('SendMessage'), 'submit', false, ['cols-size' => [2, 8, 2]]);
 $form->setDefaults([
     'smtp_host' => $platform_email['SMTP_HOST'],
-    'smtp_port' => $platform_email['SMTP_PORT']
+    'smtp_port' => $platform_email['SMTP_PORT'],
 ]);
 $form->freeze(['smtp_host', 'smtp_port']);
 

+ 3 - 1
main/admin/event_controller.php

@@ -1,8 +1,10 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Global events controller class
+ * Global events controller class.
+ *
  * @deprecated to be removed in 2.x
+ *
  * @package chamilo.admin
  */
 $cidReset = true;

+ 19 - 16
main/admin/event_type.php

@@ -1,11 +1,12 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Definition of new system event types
+ * Definition of new system event types.
+ *
  * @deprecated to be removed in 2.x
+ *
  * @package chamilo.admin.events
  */
-
 $cidReset = true;
 
 require_once __DIR__.'/../inc/global.inc.php';
@@ -60,7 +61,7 @@ $action_array = [
             [],
             ICON_SIZE_MEDIUM
         ),
-    ]
+    ],
 ];
 
 $key_lang = get_lang('YouHaveSomeUnsavedChanges');
@@ -74,7 +75,7 @@ foreach ($users as $user) {
 }
 
 /**
- * Header definition
+ * Header definition.
  */
 $interbreadcrumb[] = ['url' => 'index.php', 'name' => get_lang('PlatformAdmin')];
 $interbreadcrumb[] = ['url' => 'event_controller.php', 'name' => get_lang('Events')];
@@ -85,18 +86,19 @@ Display::display_header($tool_name);
 echo Display::actions($action_array);
 
 /**
- * JavaScript code
+ * JavaScript code.
+ *
  * @todo move into HTML header
  */
 ?>
 <script>
-    var usersList = <?php echo json_encode($new_user_list) ?>;
-    var eventTypes = <?php echo json_encode($ets) ?>;
-    var eventsConfig = <?php echo json_encode($event_config) ?>;
-    var currentLanguage = <?php echo json_encode(api_get_interface_language()) ?>;
+    var usersList = <?php echo json_encode($new_user_list); ?>;
+    var eventTypes = <?php echo json_encode($ets); ?>;
+    var eventsConfig = <?php echo json_encode($event_config); ?>;
+    var currentLanguage = <?php echo json_encode(api_get_interface_language()); ?>;
     var flagContentHasChanged = false;
-    var key_lang = "<?php echo $key_lang ?>";
-    var event_type_name = "<?php echo $event_name ?>";
+    var key_lang = "<?php echo $key_lang; ?>";
+    var event_type_name = "<?php echo $event_name; ?>";
 
     $(document).ready(function() {
         confirmMessage("eventList");
@@ -107,7 +109,7 @@ echo Display::actions($action_array);
 
     function ajax(params,func) {
         $.ajax({
-            url: "<?php echo $ajaxPath ?>",
+            url: "<?php echo $ajaxPath; ?>",
             type: "POST",
             data: params,
             success: func
@@ -195,7 +197,7 @@ echo Display::actions($action_array);
         if (self_sent == false ) {
 
             $.ajax({
-                url: '<?php echo $ajaxPath ?>?action=get_event_users&eventName=' +currentEventName,
+                url: '<?php echo $ajaxPath; ?>?action=get_event_users&eventName=' +currentEventName,
                 dataType: 'json',
                 success: function(data) {
                     removeAllOption($('#usersSubList'));
@@ -309,12 +311,13 @@ echo Display::actions($action_array);
 </script>
 <?php
 /**
- * HTML body
+ * HTML body.
+ *
  * @todo move as template layout
  */
 ?>
 <div class="page-header">
-<h2><?php echo get_lang('EventMessageManagement') ?></h2>
+<h2><?php echo get_lang('EventMessageManagement'); ?></h2>
 </div>
 
 <form method="POST" onSubmit="return submitForm(); ">
@@ -369,7 +372,7 @@ echo Display::actions($action_array);
     <input type="hidden" name="action" value="modEventType" />
     <input type="hidden" name="eventId" id="eventId"  />
     <input type="hidden" name="eventUsers" id="eventUsers" />
-    <input type="hidden" id="eventName" value="<?php echo $event_name ?>"/>
+    <input type="hidden" id="eventName" value="<?php echo $event_name; ?>"/>
 
     <br />
     <br />

+ 0 - 1
main/admin/export_certificates.php

@@ -4,7 +4,6 @@
 /**
  *  @package chamilo.admin
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 Display::display_header(null);

+ 4 - 5
main/admin/extra_field_options.php

@@ -4,7 +4,6 @@
 /**
  *  @package chamilo.admin
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
@@ -62,8 +61,8 @@ if ($action == 'add') {
 } else {
     $interbreadcrumb[] = ['url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName];
     $interbreadcrumb[] = [
-        'url' =>  'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'],
-        'name' => $extra_field_info['display_text']
+        'url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'],
+        'name' => $extra_field_info['display_text'],
     ];
     $interbreadcrumb[] = ['url' => '#', 'name' => get_lang('EditExtraFieldOptions')];
 }
@@ -152,7 +151,7 @@ switch ($action) {
         if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
             api_not_allowed();
         }
-        $url  = api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&'.$params;
+        $url = api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&'.$params;
         $form = $obj->return_form($url, 'add');
 
         // The validation or display
@@ -173,7 +172,7 @@ switch ($action) {
         break;
     case 'edit':
         // Action handling: Editing
-        $url  = api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&id='.intval($_GET['id']).'&'.$params;
+        $url = api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&id='.intval($_GET['id']).'&'.$params;
         $form = $obj->return_form($url, 'edit');
 
         // The validation or display

+ 10 - 11
main/admin/extra_field_workflow.php

@@ -4,7 +4,6 @@
 /**
  *  @package chamilo.admin
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
@@ -38,40 +37,40 @@ if ($action == 'add') {
     $interbreadcrumb[] = ['url' => 'extra_fields.php?type='.$extraField->type, 'name' => $extraField->pageName];
     $interbreadcrumb[] = [
         'url' => 'extra_fields.php?type='.$extraField->type.'&action=edit&id='.$extraFieldInfo['id'],
-        'name' => $extraFieldInfo['display_text']
+        'name' => $extraFieldInfo['display_text'],
     ];
     $interbreadcrumb[] = [
         'url' => 'extra_field_options.php?type='.$extraField->type.'&field_id='.$extraFieldInfo['id'],
-        'name' => get_lang('EditExtraFieldOptions')
+        'name' => get_lang('EditExtraFieldOptions'),
     ];
     $interbreadcrumb[] = ['url' => '#', 'name' => get_lang('Add')];
 } elseif ($action == 'edit') {
     $interbreadcrumb[] = [
         'url' => 'extra_fields.php?type='.$extraField->type,
-        'name' => $extraField->pageName
+        'name' => $extraField->pageName,
     ];
     $interbreadcrumb[] = [
         'url' => 'extra_fields.php?type='.$extraField->type.'&action=edit&id='.$extraFieldInfo['id'],
-        'name' => $extraFieldInfo['display_text']
+        'name' => $extraFieldInfo['display_text'],
     ];
     $interbreadcrumb[] = [
         'url' => 'extra_field_options.php?type='.$extraField->type.'&field_id='.$extraFieldInfo['id'],
-        'name' => get_lang('EditExtraFieldOptions')
+        'name' => get_lang('EditExtraFieldOptions'),
     ];
 
     $interbreadcrumb[] = ['url' => '#', 'name' => get_lang('Edit')];
 } else {
     $interbreadcrumb[] = [
         'url' => 'extra_fields.php?type='.$extraField->type,
-        'name' => $extraField->pageName
+        'name' => $extraField->pageName,
     ];
     $interbreadcrumb[] = [
         'url' => 'extra_fields.php?type='.$extraField->type.'&action=edit&id='.$extraFieldInfo['id'],
-        'name' => $extraFieldInfo['display_text']
+        'name' => $extraFieldInfo['display_text'],
     ];
     $interbreadcrumb[] = [
         'url' => '#',
-        'name' => get_lang('EditExtraFieldOptions')
+        'name' => get_lang('EditExtraFieldOptions'),
     ];
 }
 
@@ -125,7 +124,7 @@ $result = Database::select(
     $obj->table,
     [
         'where' => ["field_id = ? " => $field_id],
-        'order' => "option_order ASC"
+        'order' => "option_order ASC",
     ]
 );
 
@@ -207,7 +206,7 @@ if ($form->validate()) {
                     'fieldId' => $field_id,
                     'fieldOptionId' => $subItemId,
                     'roleId' => $roleId,
-                    'relatedFieldOptionId' => $id
+                    'relatedFieldOptionId' => $id,
                     ]
                 );
 

+ 12 - 13
main/admin/extra_fields.php

@@ -4,7 +4,6 @@
 /**
  *  @package chamilo.admin
  */
-
 $cidReset = true;
 
 require_once __DIR__.'/../inc/global.inc.php';
@@ -55,7 +54,7 @@ $action_links = $obj->getJqgridActionLinks($token);
 $htmlHeadXtra[] = '<script>
 $(function() {
     // grid definition see the $obj->display() function
-    ' .Display::grid_js(
+    '.Display::grid_js(
         $obj->type.'_fields',
         $url,
         $columns,
@@ -70,37 +69,37 @@ $(function() {
         id = $(this).val();
         switch(id) {
             case "1":
-                $("#example").html("' . addslashes(Display::return_icon('userfield_text.png')).'");
+                $("#example").html("'.addslashes(Display::return_icon('userfield_text.png')).'");
                 break;
             case "2":
-                $("#example").html("' . addslashes(Display::return_icon('userfield_text_area.png')).'");
+                $("#example").html("'.addslashes(Display::return_icon('userfield_text_area.png')).'");
                 break;
             case "3":
-                $("#example").html("' . addslashes(Display::return_icon('add_user_field_howto.png')).'");
+                $("#example").html("'.addslashes(Display::return_icon('add_user_field_howto.png')).'");
                 break;
             case "4":
-                $("#example").html("' . addslashes(Display::return_icon('userfield_drop_down.png')).'");
+                $("#example").html("'.addslashes(Display::return_icon('userfield_drop_down.png')).'");
                 break;
             case "5":
-                $("#example").html("' . addslashes(Display::return_icon('userfield_multidropdown.png')).'");
+                $("#example").html("'.addslashes(Display::return_icon('userfield_multidropdown.png')).'");
                 break;
             case "6":
-                $("#example").html("' . addslashes(Display::return_icon('userfield_data.png')).'");
+                $("#example").html("'.addslashes(Display::return_icon('userfield_data.png')).'");
                 break;
             case "7":
-                $("#example").html("' . addslashes(Display::return_icon('userfield_date_time.png')).'");
+                $("#example").html("'.addslashes(Display::return_icon('userfield_date_time.png')).'");
                 break;
             case "8":
-                $("#example").html("' . addslashes(Display::return_icon('userfield_doubleselect.png')).'");
+                $("#example").html("'.addslashes(Display::return_icon('userfield_doubleselect.png')).'");
                 break;
             case "9":
-                $("#example").html("' . addslashes(Display::return_icon('userfield_divider.png')).'");
+                $("#example").html("'.addslashes(Display::return_icon('userfield_divider.png')).'");
                 break;
             case "10":
-                $("#example").html("' . addslashes(Display::return_icon('userfield_user_tag.png')).'");
+                $("#example").html("'.addslashes(Display::return_icon('userfield_user_tag.png')).'");
                 break;
             case "11":
-                $("#example").html("' . addslashes(Display::return_icon('userfield_data.png')).'");
+                $("#example").html("'.addslashes(Display::return_icon('userfield_data.png')).'");
                 break;
         }
     });

+ 1 - 1
main/admin/filler.php

@@ -2,7 +2,7 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * Index of the admin tools
+ * Index of the admin tools.
  *
  * @package chamilo.admin
  */

+ 7 - 8
main/admin/grade_models.php

@@ -4,7 +4,6 @@
 /**
  *  @package chamilo.admin
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
@@ -86,14 +85,14 @@ $column_model = [
         'name' => 'name',
         'index' => 'name',
         'width' => '80',
-        'align' => 'left'
+        'align' => 'left',
     ],
     [
         'name' => 'description',
         'index' => 'description',
         'width' => '500',
         'align' => 'left',
-        'sortable' => 'false'
+        'sortable' => 'false',
     ],
     [
         'name' => 'actions',
@@ -101,8 +100,8 @@ $column_model = [
         'width' => '100',
         'align' => 'left',
         'formatter' => 'action_formatter',
-        'sortable' => 'false'
-    ]
+        'sortable' => 'false',
+    ],
 ];
 
 //Autowidth
@@ -144,13 +143,13 @@ switch ($action) {
             api_not_allowed();
         }
 
-        $url  = api_get_self().'?action='.Security::remove_XSS($_GET['action']);
+        $url = api_get_self().'?action='.Security::remove_XSS($_GET['action']);
         $form = $obj->return_form($url, 'add');
         // The validation or display
         if ($form->validate()) {
             if ($check) {
                 $values = $form->exportValues();
-                $res    = $obj->save($values);
+                $res = $obj->save($values);
                 if ($res) {
                     echo Display::return_message(get_lang('ItemAdded'), 'confirm');
                 }
@@ -169,7 +168,7 @@ switch ($action) {
         break;
     case 'edit':
         // Action handling: Editing
-        $url  = api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&id='.intval($_GET['id']);
+        $url = api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&id='.intval($_GET['id']);
         $form = $obj->return_form($url, 'edit');
 
         // The validation or display

+ 1 - 3
main/admin/gradebook_dependency.php

@@ -2,8 +2,6 @@
 /* For licensing terms, see /license.txt */
 
 use Chamilo\CoreBundle\Entity\GradebookCategory;
-use Doctrine\Common\Collections\Criteria;
-use Knp\Component\Pager\Paginator;
 
 require_once __DIR__.'/../inc/global.inc.php';
 
@@ -36,7 +34,7 @@ $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
 
 $interbreadcrumb[] = [
     'url' => api_get_path(WEB_CODE_PATH).'admin/gradebook_list.php',
-    'name' => get_lang('Gradebook')
+    'name' => get_lang('Gradebook'),
 ];
 
 $tpl = new Template(get_lang('CourseList'));

+ 5 - 6
main/admin/gradebook_list.php

@@ -52,13 +52,12 @@ switch ($action) {
     case 'edit':
         $interbreadcrumb[] = [
             'url' => $currentUrl,
-            'name' => get_lang('Gradebook')
+            'name' => get_lang('Gradebook'),
         ];
         $toolName = get_lang(ucfirst($action));
         break;
 }
 
-
 $tpl = new Template($toolName);
 
 switch ($action) {
@@ -79,7 +78,7 @@ switch ($action) {
             get_lang('Course'),
             null,
             [
-                'url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course'
+                'url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course',
             ]
         );
 
@@ -89,7 +88,7 @@ switch ($action) {
             null,
             [
                 'url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course',
-                'multiple' => 'multiple'
+                'multiple' => 'multiple',
             ]
         );
 
@@ -202,7 +201,7 @@ switch ($action) {
                 $options,
                 [
                     'url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course',
-                    'multiple' => 'multiple'
+                    'multiple' => 'multiple',
                 ]
             );
 
@@ -223,7 +222,7 @@ switch ($action) {
                 'weight' => $category->getWeight(),
                 'gradebooks_to_validate_in_dependence' => $categoryData['gradebooks_to_validate_in_dependence'],
                 'depends' => array_keys($options),
-                'minimum' => $categoryData['minimum_to_validate']
+                'minimum' => $categoryData['minimum_to_validate'],
             ];
             $form->setDefaults($defaults);
             $contentForm = $form->returnForm();

+ 33 - 32
main/admin/index.php

@@ -1,7 +1,8 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Index page of the admin tools
+ * Index page of the admin tools.
+ *
  * @package chamilo.admin
  */
 // Resetting the course id.
@@ -88,7 +89,7 @@ $search_form = '
             <input class="form-control" type="text" name="keyword" value=""
              aria-label="'.get_lang('Search').'">
             <button class="btn btn-default" type="submit">
-                <em class="fa fa-search"></em> ' . get_lang('Search').'
+                <em class="fa fa-search"></em> '.get_lang('Search').'
             </button>
         </div>
     </form>';
@@ -108,7 +109,7 @@ if (api_is_platform_admin()) {
         $items[] = ['url' => 'ldap_users_list.php', 'label' => get_lang('ImportLDAPUsersIntoPlatform')];
     }
     $items[] = ['url' => 'extra_fields.php?type=user', 'label' => get_lang('ManageUserFields')];
-    $items[] = ['url'=>'usergroups.php', 'label' => get_lang('Classes')];
+    $items[] = ['url' => 'usergroups.php', 'label' => get_lang('Classes')];
     if (api_get_configuration_value('show_link_request_hrm_user')) {
         $items[] = ['url' => 'user_linking_requests.php', 'label' => get_lang('UserLinkingRequests')];
     }
@@ -153,7 +154,7 @@ if (api_is_platform_admin()) {
                 <input class="form-control" type="text" name="keyword" value=""
                  aria-label="'.get_lang('Search').'">
                 <button class="btn btn-default" type="submit">
-                    <em class="fa fa-search"></em> ' . get_lang('Search').'
+                    <em class="fa fa-search"></em> '.get_lang('Search').'
                 </button>
             </div>
         </form>';
@@ -215,7 +216,7 @@ if (api_is_platform_admin()) {
                 aria-label="'.get_lang('Search').'" >
                 <input type="hidden" value="search_setting" name="category">
                 <button class="btn btn-default" type="submit">
-                    <em class="fa fa-search"></em> ' . get_lang('Search').'
+                    <em class="fa fa-search"></em> '.get_lang('Search').'
                 </button>
             </div>
         </form>';
@@ -229,24 +230,24 @@ if (api_is_platform_admin()) {
     $items[] = ['url' => 'system_announcements.php', 'label' => get_lang('SystemAnnouncements')];
     $items[] = [
         'url' => api_get_path(WEB_CODE_PATH).'calendar/agenda_js.php?type=admin',
-        'label' => get_lang('GlobalAgenda')
+        'label' => get_lang('GlobalAgenda'),
     ];
     $items[] = ['url' => 'configure_homepage.php', 'label' => get_lang('ConfigureHomePage')];
     $items[] = ['url' => 'configure_inscription.php', 'label' => get_lang('ConfigureInscription')];
     $items[] = ['url' => 'statistics/index.php', 'label' => get_lang('Statistics')];
     $items[] = [
         'url' => api_get_path(WEB_CODE_PATH).'mySpace/company_reports.php',
-        'label' => get_lang('Reports')
+        'label' => get_lang('Reports'),
     ];
     $items[] = [
         'url' => api_get_path(WEB_CODE_PATH).'admin/teacher_time_report.php',
-        'label' => get_lang('TeacherTimeReport')
+        'label' => get_lang('TeacherTimeReport'),
     ];
 
     if (api_get_configuration_value('chamilo_cms')) {
         $items[] = [
             'url' => api_get_path(WEB_PATH).'web/app_dev.php/administration/dashboard',
-            'label' => get_lang('CMS')
+            'label' => get_lang('CMS'),
         ];
     }
 
@@ -268,7 +269,7 @@ if (api_is_platform_admin()) {
     if (api_get_plugin_setting('dictionary', 'enable_plugin_dictionary') == 'true') {
         $items[] = [
             'url' => api_get_path(WEB_PLUGIN_PATH).'dictionary/terms.php',
-            'label' => get_lang('Dictionary')
+            'label' => get_lang('Dictionary'),
         ];
     }
 
@@ -310,7 +311,7 @@ $search_form = ' <form method="GET" class="form-inline" action="'.$sessionPath.'
                         value=""
                         aria-label="'.get_lang('Search').'">
                         <button class="btn btn-default" type="submit">
-                            <em class="fa fa-search"></em> ' . get_lang('Search').'
+                            <em class="fa fa-search"></em> '.get_lang('Search').'
                         </button>
                     </div>
                 </form>';
@@ -324,7 +325,7 @@ $items[] = ['url' => $sessionPath.'session_import_drh.php', 'label' => get_lang(
 if (isset($extAuthSource) && isset($extAuthSource['ldap']) && count($extAuthSource['ldap']) > 0) {
     $items[] = [
         'url' => 'ldap_import_students_to_session.php',
-        'label' => get_lang('ImportLDAPUsersIntoSession')
+        'label' => get_lang('ImportLDAPUsersIntoSession'),
     ];
 }
 $items[] = [
@@ -335,7 +336,7 @@ $items[] = [
 if (api_is_global_platform_admin()) {
     $items[] = [
         'url' => '../coursecopy/copy_course_session.php',
-        'label' => get_lang('CopyFromCourseInSessionToAnotherSession')
+        'label' => get_lang('CopyFromCourseInSessionToAnotherSession'),
     ];
 }
 
@@ -368,38 +369,38 @@ if (api_is_platform_admin()) {
     $items = [];
     $items[] = [
         'url' => 'archive_cleanup.php',
-        'label' => get_lang('ArchiveDirCleanup')
+        'label' => get_lang('ArchiveDirCleanup'),
     ];
 
     $items[] = [
         'url' => 'special_exports.php',
-        'label' => get_lang('SpecialExports')
+        'label' => get_lang('SpecialExports'),
     ];
     $items[] = [
         'url' => 'system_status.php',
-        'label' => get_lang('SystemStatus')
+        'label' => get_lang('SystemStatus'),
     ];
     if (is_dir(api_get_path(SYS_TEST_PATH).'datafiller/')) {
         $items[] = [
             'url' => 'filler.php',
-            'label' => get_lang('DataFiller')
+            'label' => get_lang('DataFiller'),
         ];
     }
 
     $items[] = [
         'url' => 'resource_sequence.php',
-        'label' => get_lang('ResourcesSequencing')
+        'label' => get_lang('ResourcesSequencing'),
     ];
     if (is_dir(api_get_path(SYS_TEST_PATH))) {
         $items[] = [
             'url' => 'email_tester.php',
-            'label' => get_lang('EMailTester')
+            'label' => get_lang('EMailTester'),
         ];
     }
 
     $items[] = [
         'url' => api_get_path(WEB_CODE_PATH).'ticket/tickets.php',
-        'label' => get_lang('TicketSystem')
+        'label' => get_lang('TicketSystem'),
     ];
 
     if (api_get_configuration_value('db_manager_enabled') == true &&
@@ -411,7 +412,7 @@ if (api_is_platform_admin()) {
 
         $items[] = [
             'url' => "db.php?username=$username&db=$databaseName&server=$host",
-            'label' => get_lang('DatabaseManager')
+            'label' => get_lang('DatabaseManager'),
         ];
     }
 
@@ -434,28 +435,28 @@ if (api_is_platform_admin()) {
         $items = [];
         $items[] = [
             'url' => 'skills_wheel.php',
-            'label' => get_lang('SkillsWheel')
+            'label' => get_lang('SkillsWheel'),
         ];
         $items[] = [
             'url' => 'skills_import.php',
-            'label' => get_lang('SkillsImport')
+            'label' => get_lang('SkillsImport'),
         ];
         $items[] = [
             'url' => 'skill_list.php',
-            'label' => get_lang('ManageSkills')
+            'label' => get_lang('ManageSkills'),
         ];
         $items[] = [
             'url' => 'skill.php',
-            'label' => get_lang('ManageSkillsLevels')
+            'label' => get_lang('ManageSkillsLevels'),
         ];
 
         $items[] = [
             'url' => api_get_path(WEB_CODE_PATH).'social/skills_ranking.php',
-            'label' => get_lang('SkillsRanking')
+            'label' => get_lang('SkillsRanking'),
         ];
         $items[] = [
             'url' => 'skills_gradebook.php',
-            'label' => get_lang('SkillsAndGradebooks')
+            'label' => get_lang('SkillsAndGradebooks'),
         ];
         /*$items[] = array(
             'url' => api_get_path(WEB_CODE_PATH).'admin/skill_badge.php',
@@ -481,7 +482,7 @@ if (api_is_platform_admin()) {
         $items = [];
         $items[] = [
             'url' => 'gradebook_list.php',
-            'label' => get_lang('List')
+            'label' => get_lang('List'),
         ];
         $blocks['gradebook']['items'] = $items;
         $blocks['gradebook']['extra'] = null;
@@ -524,7 +525,7 @@ if (api_is_platform_admin()) {
 
                 $items[] = [
                     'url' => $pluginUrl,
-                    'label' => $pluginInfo['title']
+                    'label' => $pluginInfo['title'],
                 ];
             }
 
@@ -557,7 +558,7 @@ if (api_is_platform_admin()) {
     $items[] = ['url' => 'http://www.chamilo.org/extensions', 'label' => get_lang('ChamiloExtensions')];
     $items[] = [
         'url' => 'http://www.chamilo.org/en/providers',
-        'label' => get_lang('ChamiloOfficialServicesProviders')
+        'label' => get_lang('ChamiloOfficialServicesProviders'),
     ];
 
     $blocks['chamilo']['items'] = $items;
@@ -644,7 +645,7 @@ if (api_is_platform_admin()) {
         null,
         [
             'id' => 'block-extra-data',
-            'class' => ''
+            'class' => '',
         ],
         FormValidator::LAYOUT_BOX_NO_LABEL
     );
@@ -691,7 +692,7 @@ if (api_is_platform_admin()) {
         'block',
         null,
         [
-            'id' => 'extra-block'
+            'id' => 'extra-block',
         ]
     );
     $extraContentForm->addButtonExport(

+ 16 - 14
main/admin/languages.php

@@ -10,7 +10,9 @@
  *
  * @author Patrick Cool, main author
  * @author Roan EMbrechts, code cleaning
+ *
  * @since Dokeos 1.6
+ *
  * @package chamilo.admin
  */
 
@@ -57,21 +59,21 @@ $htmlHeadXtra[] = '<script>
     var disabledLang = "'.$disabledLang.'"
 
     if (msgLang == 1) {
-        $("#id_content_message").html("<div class=\"warning-message alert alert-warning\">' . get_lang('ThereAreUsersUsingThisLanguagesDisableItManually').' <br /> " + disabledLang + "</div");
+        $("#id_content_message").html("<div class=\"warning-message alert alert-warning\">'.get_lang('ThereAreUsersUsingThisLanguagesDisableItManually').' <br /> " + disabledLang + "</div");
     }
 
     $("#disable_all_except_default").click(function () {
-        if(confirm("'. get_lang('ConfirmYourChoice').'")) {
+        if(confirm("'.get_lang('ConfirmYourChoice').'")) {
             $.ajax({
                 contentType: "application/x-www-form-urlencoded",
                 beforeSend: function(objeto) {
-                    $("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em>  ' . get_lang('Loading').'</div>");
+                    $("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em>  '.get_lang('Loading').'</div>");
                 },
                 type: "GET",
                 url: "../admin/languages.php",
                 data: "action=disable_all_except_default",
                 success: function(datos) {
-                    window.location.href = "' . api_get_self().'";
+                    window.location.href = "'.api_get_self().'";
                 }
             });
         }
@@ -107,7 +109,7 @@ $htmlHeadXtra[] = '<script>
 		$.ajax({
 			contentType: "application/x-www-form-urlencoded",
 			beforeSend: function(objeto) {
-				$("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em>  ' . get_lang('Loading').'</div>");
+				$("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em>  '.get_lang('Loading').'</div>");
 			},
 			type: "POST",
 			url: "../admin/languages.php",
@@ -118,19 +120,19 @@ $htmlHeadXtra[] = '<script>
                     $("#"+id_img_link_tool).attr("src",path_name_of_imglinktool);
 
                     if (my_image_tool=="visible.png") {
-                        $("#"+id_img_link_tool).attr("alt","' . get_lang('MakeAvailable', '').'");
-                        $("#"+id_img_link_tool).attr("title","' . get_lang('MakeAvailable', '').'");
+                        $("#"+id_img_link_tool).attr("alt","'.get_lang('MakeAvailable', '').'");
+                        $("#"+id_img_link_tool).attr("title","'.get_lang('MakeAvailable', '').'");
                     } else {
-                        $("#"+id_img_link_tool).attr("alt","' . get_lang('MakeUnavailable', '').'");
-                        $("#"+id_img_link_tool).attr("title","' . get_lang('MakeUnavailable', '').'");
+                        $("#"+id_img_link_tool).attr("alt","'.get_lang('MakeUnavailable', '').'");
+                        $("#"+id_img_link_tool).attr("title","'.get_lang('MakeUnavailable', '').'");
                     }
 
                     if (datos=="set_visible") {
-                        $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowVisible', '').'</div>");
+                        $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">'.get_lang('LanguageIsNowVisible', '').'</div>");
                     }
 
                     if (datos=="set_hidden") {
-                        $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowHidden', '').'</div>");
+                        $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">'.get_lang('LanguageIsNowHidden', '').'</div>");
                     }
                 }
 
@@ -199,7 +201,7 @@ if (isset($_POST['Submit']) && $_POST['Submit']) {
             WHERE id='{$_POST['edit_id']}'";
     $result = Database::query($sql);
     // changing the Platform language
-    if ($_POST['platformlanguage'] && $_POST['platformlanguage'] <> '') {
+    if ($_POST['platformlanguage'] && $_POST['platformlanguage'] != '') {
         //$sql_update_2 = "UPDATE $tbl_settings_current SET selected_value='{$_POST['platformlanguage']}' WHERE variable='platformLanguage'";
         //$result_2 = Database::query($sql_update_2);
         api_set_setting('platformLanguage', $_POST['platformlanguage'], null, null, $_configuration['access_url']);
@@ -273,7 +275,7 @@ while ($row = Database::fetch_array($result_select)) {
         }
 
         $row_td[] = '<input type="hidden" name="edit_id" value="'.Security::remove_XSS($_GET['id']).'" /><input type="text" name="txt_name" value="'.$row['original_name'].'" /> '
-                . '<input type="checkbox" '.$checked.'name="platformlanguage" id="platformlanguage" value="'.$row['english_name'].'" /><label for="platformlanguage">'.$row['original_name'].' '.get_lang('AsPlatformLanguage').'</label> <input type="submit" name="Submit" value="'.get_lang('Ok').'" /><a name="value" />';
+                .'<input type="checkbox" '.$checked.'name="platformlanguage" id="platformlanguage" value="'.$row['english_name'].'" /><label for="platformlanguage">'.$row['original_name'].' '.get_lang('AsPlatformLanguage').'</label> <input type="submit" name="Submit" value="'.get_lang('Ok').'" /><a name="value" />';
     } else {
         $row_td[] = $row['original_name'];
     }
@@ -317,7 +319,7 @@ while ($row = Database::fetch_array($result_select)) {
 
     if ($row['english_name'] == $row_lang['selected_value']) {
         $row_td[] = Display::return_icon('visible.png', get_lang('Visible'))."<a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>
-                     &nbsp;" . $setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language;
+                     &nbsp;".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language;
     } else {
         if ($row['available'] == 1) {
             $row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_".$row['id']."\" href='".api_get_self()."?action=makeunavailable&id=".$row['id']."'>".Display::return_icon('visible.png', get_lang('MakeUnavailable'), ['id' => 'imglinktool_'.$row['id']], ICON_SIZE_SMALL)."</a> <a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>&nbsp;".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language;

+ 3 - 2
main/admin/ldap_form_add_users_group.php

@@ -1,13 +1,14 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Form to add users through LDAP (deprecated?)
+ * Form to add users through LDAP (deprecated?).
+ *
  * @package chamilo.admin
  * Copyright (c) 2007 Mustapha Alouani (supervised by Michel Moreau-Belliard)
  */
 
 /**
- * This form is included by ldap_import_students.php and ldap_import_students_to_session.php
+ * This form is included by ldap_import_students.php and ldap_import_students_to_session.php.
  */
 $nbre = 0;
 echo '<form name="form" method="post" action="'.api_get_self().'?annee='.Security::remove_XSS($annee).'">';

+ 4 - 3
main/admin/ldap_import_students.php

@@ -2,7 +2,8 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * Script to import students from LDAP
+ * Script to import students from LDAP.
+ *
  * @package chamilo.admin
  * Copyright (c) 2007 Mustapha Alouani (supervised by Michel Moreau-Belliard)
  */
@@ -14,7 +15,7 @@ $this_section = SECTION_PLATFORM_ADMIN;
 
 // Access restrictions
 api_protect_admin_script();
-require('../auth/ldap/authldap.php');
+require '../auth/ldap/authldap.php';
 
 $annee_base = date('Y');
 
@@ -96,7 +97,7 @@ if (empty($annee) && empty($course)) {
 
         //$sr = @ ldap_search($ds, "ou=people,$LDAPbasedn", "(|(edupersonprimaryorgunitdn=ou=$etape,ou=$annee,ou=diploma,o=Paris1,$LDAPbasedn)(edupersonprimaryorgunitdn=ou=02PEL,ou=$annee,ou=diploma,o=Paris1,$LDAPbasedn))");
         //echo "(ou=*$annee,ou=$composante)";
-        $sr = @ ldap_search($ds, $ldap_basedn, "(ou=*$annee)");
+        $sr = @ldap_search($ds, $ldap_basedn, "(ou=*$annee)");
 
         $info = ldap_get_entries($ds, $sr);
 

+ 6 - 6
main/admin/ldap_import_students_to_session.php

@@ -1,19 +1,20 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Edition script for sessions categories
+ * Edition script for sessions categories.
+ *
  * @package chamilo.admin
  * Copyright (c) 2007 Mustapha Alouani (supervised by Michel Moreau-Belliard)
  */
 
 // resetting the course id
 $cidReset = true;
-require_once('../inc/global.inc.php');
+require_once '../inc/global.inc.php';
 // setting the section (for the tabs)
 $this_section = SECTION_PLATFORM_ADMIN;
 // Access restrictions
 api_protect_admin_script();
-require('../auth/ldap/authldap.php');
+ require('../auth/ldap/authldap.php');
 
 $annee_base = date('Y');
 
@@ -46,7 +47,6 @@ function checkAll() {
 $annee = $_GET['annee'];
 $id_session = $_POST['id_session'];
 
-
 // form1 annee = 0; composante= 0 etape = 0
 //if ($annee == "" && $composante == "" && $etape == "") {
 if (empty($annee) && empty($id_session)) {
@@ -102,7 +102,7 @@ elseif (!empty($annee) && !empty($id_session) && empty($_POST['confirmed'])) {
 
         //$sr = @ ldap_search($ds, "ou=people,$LDAPbasedn", "(|(edupersonprimaryorgunitdn=ou=$etape,ou=$annee,ou=diploma,o=Paris1,$LDAPbasedn)(edupersonprimaryorgunitdn=ou=02PEL,ou=$annee,ou=diploma,o=Paris1,$LDAPbasedn))");
         //echo "(ou=*$annee,ou=$composante)";
-        $sr = @ ldap_search($ds, $ldap_basedn, "(ou=*$annee)");
+        $sr = @ldap_search($ds, $ldap_basedn, "(ou=*$annee)");
 
         $info = ldap_get_entries($ds, $sr);
 
@@ -123,7 +123,7 @@ elseif (!empty($annee) && !empty($id_session) && empty($_POST['confirmed'])) {
         asort($nom_form);
         reset($nom_form);
         $statut = 5;
-        include('ldap_form_add_users_group.php');
+        include 'ldap_form_add_users_group.php';
     } else {
         echo '<h4>'.get_lang('UnableToConnectTo').' '.$host.'</h4>';
     }

+ 2 - 2
main/admin/ldap_users_list.php

@@ -2,11 +2,12 @@
 /* For licensing terms, see /license.txt */
 /**
  * @author Mustapha Alouani
+ *
  * @package chamilo.admin
  */
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
-require('../auth/ldap/authldap.php');
+require '../auth/ldap/authldap.php';
 $this_section = SECTION_PLATFORM_ADMIN;
 
 api_protect_admin_script();
@@ -133,7 +134,6 @@ if (isset($_POST['action'])) {
                     echo Display::return_message(get_lang('NoUserAdded'));
                 }
                 break;
-
         }
         Security::clear_token();
     }

+ 4 - 4
main/admin/ldap_users_synchro.php

@@ -4,15 +4,15 @@
  * @package chamilo.admin
  */
 /**
- * Code
+ * Code.
  */
 exit(); //not yet functional, needs to be revised
 
 $cidReset = true;
 
-require('../inc/global.inc.php');
+require '../inc/global.inc.php';
 $libpath = api_get_path(LIBRARY_PATH);
-require("../auth/ldap/authldap.php");
+require "../auth/ldap/authldap.php";
 $annee_base = date('Y');
 // setting the section (for the tabs)
 $this_section = SECTION_PLATFORM_ADMIN;
@@ -59,7 +59,7 @@ Display::display_header($tool_name);
 <?php
 if (isset($action) && ($action == "synchro")) {
     $included = true;
-    require('ldap_synchro.php');
+    require 'ldap_synchro.php';
     echo Display::return_message($message, 'normal', false);
 }
 Display::display_footer();

+ 3 - 2
main/admin/legal_add.php

@@ -2,7 +2,8 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * Management of legal conditions
+ * Management of legal conditions.
+ *
  * @package chamilo.admin
  */
 $cidReset = true;
@@ -22,7 +23,7 @@ $defaults = [];
 $term_preview = [
     'type' => 0,
     'content' => '',
-    'changes' => ''
+    'changes' => '',
 ];
 if ($form->validate()) {
     $check = Security::check_token('post');

+ 2 - 2
main/admin/legal_list.php

@@ -2,10 +2,10 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * Sessions list script
+ * Sessions list script.
+ *
  * @package chamilo.admin
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 $this_section = SECTION_PLATFORM_ADMIN;

+ 4 - 5
main/admin/promotions.php

@@ -4,7 +4,6 @@
 /**
  *  @package chamilo.admin
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
@@ -135,14 +134,14 @@ switch ($action) {
             exit;
         }
 
-        $url  = api_get_self().'?action='.Security::remove_XSS($_GET['action']);
+        $url = api_get_self().'?action='.Security::remove_XSS($_GET['action']);
         $form = $promotion->return_form($url, 'add');
 
         // The validation or display
         if ($form->validate()) {
             if ($check) {
                 $values = $form->exportValues();
-                $res    = $promotion->save($values);
+                $res = $promotion->save($values);
                 if ($res) {
                     echo Display::return_message(get_lang('ItemAdded'), 'confirm');
                 }
@@ -159,14 +158,14 @@ switch ($action) {
         break;
     case 'edit':
         //Editing
-        $url  = api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&id='.intval($_GET['id']);
+        $url = api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&id='.intval($_GET['id']);
         $form = $promotion->return_form($url, 'edit');
 
         // The validation or display
         if ($form->validate()) {
             if ($check) {
                 $values = $form->exportValues();
-                $res    = $promotion->update($values);
+                $res = $promotion->update($values);
                 $promotion->update_all_sessions_status_by_promotion_id($values['id'], $values['status']);
                 if ($res) {
                     echo Display::return_message(get_lang('PromotionUpdated').': '.$values['name'], 'confirm');

+ 1 - 1
main/admin/resource_sequence.php

@@ -40,7 +40,7 @@ if ($formSequence->validate()) {
 }
 
 $selectSequence = new FormValidator('');
-$selectSequence ->addHidden('sequence_type', 'session');
+$selectSequence->addHidden('sequence_type', 'session');
 $em = Database::getManager();
 
 $sequenceList = $em->getRepository('ChamiloCoreBundle:Sequence')->findAll();

+ 117 - 66
main/admin/settings.lib.php

@@ -1,25 +1,26 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-use ChamiloSession as Session;
-use Symfony\Component\Filesystem\Filesystem;
 use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
 use Chamilo\CoreBundle\Entity\SystemTemplate;
+use ChamiloSession as Session;
+use Symfony\Component\Filesystem\Filesystem;
 
 /**
- * Library of the settings.php file
+ * Library of the settings.php file.
  *
  * @author Julio Montoya <gugli100@gmail.com>
  * @author Guillaume Viguier <guillaume@viguierjust.com>
  *
  * @since Chamilo 1.8.7
+ *
  * @package chamilo.admin
  */
-
 define('CSS_UPLOAD_PATH', api_get_path(SYS_APP_PATH).'Resources/public/css/themes/');
 
 /**
- * This function allows easy activating and inactivating of regions
+ * This function allows easy activating and inactivating of regions.
+ *
  * @author Julio Montoya <gugli100@gmail.com> Beeznest 2012
  */
 function handleRegions()
@@ -117,8 +118,10 @@ function handleExtensions()
 }
 
 /**
- * This function allows easy activating and inactivating of plugins
+ * This function allows easy activating and inactivating of plugins.
+ *
  * @todo: a similar function needs to be written to activate or inactivate additional tools.
+ *
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  * @author Julio Montoya <gugli100@gmail.com> Beeznest 2012
  */
@@ -211,7 +214,7 @@ function handlePlugins()
                         'class' => 'btn btn-default ajax',
                         'data-title' => $plugin_info['title'],
                         'data-size' => 'lg',
-                        '_target' => '_blank'
+                        '_target' => '_blank',
                     ]
                 );
             }
@@ -225,7 +228,7 @@ function handlePlugins()
                         'class' => 'btn btn-default ajax',
                         'data-title' => $plugin_info['title'],
                         'data-size' => 'lg',
-                        '_target' => '_blank'
+                        '_target' => '_blank',
                     ]
                 );
             }
@@ -254,7 +257,8 @@ function handlePlugins()
 }
 
 /**
- * This function allows the platform admin to choose the default stylesheet
+ * This function allows the platform admin to choose the default stylesheet.
+ *
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  * @author Julio Montoya <gugli100@gmail.com>, Chamilo
  */
@@ -391,7 +395,7 @@ function handleStylesheets()
     if ($is_style_changeable) {
         $logoGroup = [
             $logoForm->addButtonUpload(get_lang('Upload'), 'logo_upload', true),
-            $logoForm->addButtonCancel(get_lang('Reset'), 'logo_reset', true)
+            $logoForm->addButtonCancel(get_lang('Reset'), 'logo_reset', true),
         ];
 
         $logoForm->addGroup($logoGroup);
@@ -402,8 +406,8 @@ function handleStylesheets()
             unlink($dir.$newLogoFileName);
             echo Display::return_message(get_lang('ResetToTheOriginalLogo'));
             echo '<script>'
-                . '$("#header-logo").attr("src","'.$url.$logoFileName.'");'
-            . '</script>';
+                .'$("#header-logo").attr("src","'.$url.$logoFileName.'");'
+            .'</script>';
         }
     } elseif (isset($_POST['logo_upload'])) {
         $logoForm->addRule(
@@ -435,8 +439,8 @@ function handleStylesheets()
                 if ($status) {
                     echo Display::return_message(get_lang('NewLogoUpdated'));
                     echo '<script>'
-                         . '$("#header-logo").attr("src","'.$url.$newLogoFileName.'");'
-                         . '</script>';
+                         .'$("#header-logo").attr("src","'.$url.$newLogoFileName.'");'
+                         .'</script>';
                 } else {
                     echo Display::return_message('Error - '.get_lang('UplNoFileUploaded'), 'error');
                 }
@@ -469,7 +473,7 @@ function handleStylesheets()
         $group = [
             $form_change->addButtonSave(get_lang('SaveSettings'), 'save', true),
             $form_change->addButtonPreview(get_lang('Preview'), 'preview', true),
-            $form_change->addButtonDownload(get_lang('Download'), 'download', true)
+            $form_change->addButtonDownload(get_lang('Download'), 'download', true),
         ];
 
         $form_change->addGroup($group);
@@ -486,12 +490,12 @@ function handleStylesheets()
         // Little hack to update the logo image in update form when submiting
         if (isset($_POST['logo_reset'])) {
             echo '<script>'
-                    . '$("#header-logo-custom").attr("src","'.$url.$logoFileName.'");'
-                . '</script>';
+                    .'$("#header-logo-custom").attr("src","'.$url.$logoFileName.'");'
+                .'</script>';
         } elseif (isset($_POST['logo_upload']) && is_file($dir.$newLogoFileName)) {
             echo '<script>'
-                    . '$("#header-logo-custom").attr("src","'.$url.$newLogoFileName.'");'
-                . '</script>';
+                    .'$("#header-logo-custom").attr("src","'.$url.$newLogoFileName.'");'
+                .'</script>';
         }
     } else {
         $form_change->freeze();
@@ -499,12 +503,17 @@ function handleStylesheets()
 }
 
 /**
- * Creates the folder (if needed) and uploads the stylesheet in it
- * @param array $values the values of the form
+ * Creates the folder (if needed) and uploads the stylesheet in it.
+ *
+ * @param array $values  the values of the form
  * @param array $picture the values of the uploaded file
+ *
  * @return bool
+ *
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
+ *
  * @version May 2008
+ *
  * @since v1.8.5
  */
 function uploadStylesheet($values, $picture)
@@ -660,7 +669,8 @@ function storeRegions()
 }
 
 /**
- * This function allows easy activating and inactivating of plugins
+ * This function allows easy activating and inactivating of plugins.
+ *
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  */
 function storePlugins()
@@ -689,7 +699,8 @@ function storePlugins()
 }
 
 /**
- * This function allows the platform admin to choose which should be the default stylesheet
+ * This function allows the platform admin to choose which should be the default stylesheet.
+ *
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  */
 function storeStylesheets()
@@ -704,14 +715,17 @@ function storeStylesheets()
             api_get_current_access_url_id()
         );
     }
+
     return true;
 }
 
 /**
  * This function checks if the given style is a recognize style that exists in the css directory as
  * a standalone directory.
+ *
  * @param string $style
- * @return bool     True if this style is recognized, false otherwise
+ *
+ * @return bool True if this style is recognized, false otherwise
  */
 function isStyle($style)
 {
@@ -722,7 +736,8 @@ function isStyle($style)
 
 /**
  * Search options
- * TODO: support for multiple site. aka $_configuration['access_url'] == 1
+ * TODO: support for multiple site. aka $_configuration['access_url'] == 1.
+ *
  * @author Marco Villegas <marvil07@gmail.com>
  */
 function handleSearch()
@@ -773,7 +788,7 @@ function handleSearch()
             'search_show_unlinked_results',
             [
                 get_lang('SearchShowUnlinkedResultsTitle'),
-                get_lang('SearchShowUnlinkedResultsComment')
+                get_lang('SearchShowUnlinkedResultsComment'),
             ],
             null,
             false
@@ -878,11 +893,13 @@ function handleSearch()
 }
 
 /**
- * Wrapper for the templates
+ * Wrapper for the templates.
  *
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
  * @author Julio Montoya.
+ *
  * @version August 2008
+ *
  * @since v1.8.6
  */
 function handleTemplates()
@@ -934,7 +951,9 @@ function handleTemplates()
  * Display a sortable table with all the templates that the platform administrator has defined.
  *
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
+ *
  * @version August 2008
+ *
  * @since v1.8.6
  */
 function displayTemplates()
@@ -959,10 +978,12 @@ function displayTemplates()
 /**
  * Gets the number of templates that are defined by the platform admin.
  *
- * @return integer
+ * @return int
  *
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
+ *
  * @version August 2008
+ *
  * @since v1.8.6
  */
 function getNumberOfTemplates()
@@ -982,14 +1003,17 @@ function getNumberOfTemplates()
 /**
  * Gets all the template data for the sortable table.
  *
- * @param integer $from the start of the limit statement
- * @param integer $number_of_items the number of elements that have to be retrieved from the database
- * @param integer $column the column that is
- * @param string $direction the sorting direction (ASC or DESC�
+ * @param int    $from            the start of the limit statement
+ * @param int    $number_of_items the number of elements that have to be retrieved from the database
+ * @param int    $column          the column that is
+ * @param string $direction       the sorting direction (ASC or DESC�
+ *
  * @return array
  *
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
+ *
  * @version August 2008
+ *
  * @since v1.8.6
  */
 function getTemplateData($from, $number_of_items, $column, $direction)
@@ -1012,30 +1036,37 @@ function getTemplateData($from, $number_of_items, $column, $direction)
 }
 
 /**
- * display the edit and delete icons in the sortable table
+ * display the edit and delete icons in the sortable table.
+ *
+ * @param int $id the id of the template
  *
- * @param integer $id the id of the template
  * @return string code for the link to edit and delete the template
  *
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
+ *
  * @version August 2008
+ *
  * @since v1.8.6
  */
 function actionsFilter($id)
 {
     $return = '<a href="settings.php?category=Templates&action=edit&id='.Security::remove_XSS($id).'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>';
     $return .= '<a href="settings.php?category=Templates&action=delete&id='.Security::remove_XSS($id).'" onClick="javascript:if(!confirm('."'".get_lang('ConfirmYourChoice')."'".')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
+
     return $return;
 }
 
 /**
- * Display the image of the template in the sortable table
+ * Display the image of the template in the sortable table.
  *
  * @param string $image the image
+ *
  * @return string code for the image
  *
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
+ *
  * @version August 2008
+ *
  * @since v1.8.6
  */
 function searchImageFilter($image)
@@ -1049,10 +1080,12 @@ function searchImageFilter($image)
 
 /**
  * Add (or edit) a template. This function displays the form and also takes
- * care of uploading the image and storing the information in the database
+ * care of uploading the image and storing the information in the database.
  *
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
+ *
  * @version August 2008
+ *
  * @since v1.8.6
  */
 function addEditTemplate()
@@ -1229,12 +1262,14 @@ function addEditTemplate()
 }
 
 /**
- * Delete a template
+ * Delete a template.
  *
- * @param integer $id the id of the template that has to be deleted
+ * @param int $id the id of the template that has to be deleted
  *
  * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
+ *
  * @version August 2008
+ *
  * @since v1.8.6
  */
 function deleteTemplate($id)
@@ -1260,9 +1295,11 @@ function deleteTemplate($id)
 /**
  * Returns the list of timezone identifiers used to populate the select
  * This function is called through a call_user_func() in the generate_settings_form function.
+ *
  * @return array List of timezone identifiers
  *
  * @author Guillaume Viguier <guillaume.viguier@beeznest.com>
+ *
  * @since Chamilo 1.8.7
  */
 function select_timezone_value()
@@ -1273,6 +1310,7 @@ function select_timezone_value()
 /**
  * Returns an array containing the list of options used to populate the gradebook_number_decimals variable
  * This function is called through a call_user_func() in the generate_settings_form function.
+ *
  * @return array List of gradebook_number_decimals options
  *
  * @author Guillaume Viguier <guillaume.viguier@beeznest.com>
@@ -1283,7 +1321,8 @@ function select_gradebook_number_decimals()
 }
 
 /**
- * Get the options for a select element to select gradebook default grade model
+ * Get the options for a select element to select gradebook default grade model.
+ *
  * @return array
  */
 function select_gradebook_default_grade_model_id()
@@ -1306,11 +1345,11 @@ function select_gradebook_default_grade_model_id()
  * @param array $settings
  * @param array $settings_by_access_list
  *
- * @return FormValidator
- *
  * @throws \Doctrine\ORM\ORMException
  * @throws \Doctrine\ORM\OptimisticLockException
  * @throws \Doctrine\ORM\TransactionRequiredException
+ *
+ * @return FormValidator
  */
 function generateSettingsForm($settings, $settings_by_access_list)
 {
@@ -1431,7 +1470,7 @@ function generateSettingsForm($settings, $settings_by_access_list)
                         [
                             get_lang($row['title']),
                             get_lang($row['comment']),
-                            get_lang('MB')
+                            get_lang('MB'),
                         ],
                         ['maxlength' => '8', 'aria-label' => get_lang($row['title'])]
                     );
@@ -1461,7 +1500,7 @@ function generateSettingsForm($settings, $settings_by_access_list)
                         $row['variable'],
                         [
                             get_lang($row['title']),
-                            get_lang($row['comment'])
+                            get_lang($row['comment']),
                         ],
                         $hideme
                     );
@@ -1503,7 +1542,7 @@ function generateSettingsForm($settings, $settings_by_access_list)
                         'textarea',
                         $row['variable'],
                         [get_lang($row['title']),
-                        get_lang($row['comment'])],
+                        get_lang($row['comment']), ],
                         ['rows' => '10', 'id' => $row['variable']],
                         $hideme
                     );
@@ -1678,12 +1717,15 @@ function generateSettingsForm($settings, $settings_by_access_list)
     $form->addHtml('<div class="bottom_actions">');
     $form->addButtonSave(get_lang('SaveSettings'));
     $form->addHtml('</div>');
+
     return $form;
 }
 
 /**
- * Searches a platform setting in all categories except from the Plugins category
+ * Searches a platform setting in all categories except from the Plugins category.
+ *
  * @param string $search
+ *
  * @return array
  */
 function searchSetting($search)
@@ -1726,12 +1768,15 @@ function searchSetting($search)
             }
         }
     }
+
     return $settings;
 }
 /**
- * Helper function to generates a form elements group
- * @param object $form The form where the elements group has to be added
- * @param array $values Values to browse through
+ * Helper function to generates a form elements group.
+ *
+ * @param object $form   The form where the elements group has to be added
+ * @param array  $values Values to browse through
+ *
  * @return array
  */
 function formGenerateElementsGroup($form, $values = [], $elementName)
@@ -1743,11 +1788,13 @@ function formGenerateElementsGroup($form, $values = [], $elementName)
             $group[] = $element;
         }
     }
+
     return $group;
 }
 /**
- * Helper function with allowed file types for CSS
- * @return  array Array of file types (no indexes)
+ * Helper function with allowed file types for CSS.
+ *
+ * @return array Array of file types (no indexes)
  */
 function getAllowedFileTypes()
 {
@@ -1764,15 +1811,16 @@ function getAllowedFileTypes()
         'svg',
         'webp',
         'woff',
-        'woff2'
+        'woff2',
     ];
+
     return $allowedFiles;
 }
 /**
- * Helper function to set settings in the database
- * @param   array   $parameters     List of values
- * @param   int     $accessUrl      The current access URL
- * @return  void
+ * Helper function to set settings in the database.
+ *
+ * @param array $parameters List of values
+ * @param int   $accessUrl  The current access URL
  */
 function setConfigurationSettingsInDatabase($parameters, $accessUrl)
 {
@@ -1784,9 +1832,9 @@ function setConfigurationSettingsInDatabase($parameters, $accessUrl)
 }
 
 /**
- * Helper function to show the status of the search settings table
- * @param   array   $data   Data to show
- * @return void
+ * Helper function to show the status of the search settings table.
+ *
+ * @param array $data Data to show
  */
 function showSearchSettingsTable($data)
 {
@@ -1797,8 +1845,7 @@ function showSearchSettingsTable($data)
     echo $table->display();
 }
 /**
- * Helper function to show status table for each command line tool installed
- * @return void
+ * Helper function to show status table for each command line tool installed.
  */
 function showSearchToolsStatusTable()
 {
@@ -1834,9 +1881,9 @@ function showSearchToolsStatusTable()
     }
 }
 /**
- * Helper function to generate and show CSS Zip download message
- * @param   string $style Style path
- * @return void
+ * Helper function to generate and show CSS Zip download message.
+ *
+ * @param string $style Style path
  */
 function generateCSSDownloadLink($style)
 {
@@ -1862,7 +1909,8 @@ function generateCSSDownloadLink($style)
 }
 
 /**
- * Helper function to tell if the style is changeable in the current URL
+ * Helper function to tell if the style is changeable in the current URL.
+ *
  * @return bool $changeable Whether the style can be changed in this URL or not
  */
 function isStyleChangeable()
@@ -1878,12 +1926,15 @@ function isStyleChangeable()
     } else {
         $changeable = true;
     }
+
     return $changeable;
 }
 
 /**
- * Get all settings of one category prepared for display in admin/settings.php
+ * Get all settings of one category prepared for display in admin/settings.php.
+ *
  * @param string $category
+ *
  * @return array
  */
 function getCategorySettings($category = '')
@@ -1934,6 +1985,6 @@ function getCategorySettings($category = '')
 
     return [
         'settings' => $settings,
-        'settings_by_access_list' => $settings_by_access_list
+        'settings_by_access_list' => $settings_by_access_list,
     ];
 }

+ 4 - 3
main/admin/settings.php

@@ -9,6 +9,7 @@ use ChamiloSession as Session;
  *
  * @author Patrick Cool
  * @author Julio Montoya - Multiple URL site
+ *
  * @package chamilo.admin
  */
 
@@ -36,14 +37,14 @@ $settings_to_avoid = [
     'use_session_mode' => 'true',
     'gradebook_enable' => 'false',
     // ON by default - now we have this option when  we create a course
-    'example_material_course_creation' => 'true'
+    'example_material_course_creation' => 'true',
 ];
 
 $convert_byte_to_mega_list = [
     'dropbox_max_filesize',
     'message_max_upload_filesize',
     'default_document_quotum',
-    'default_group_quotum'
+    'default_group_quotum',
 ];
 
 if (isset($_POST['style'])) {
@@ -82,7 +83,7 @@ $form_search = new FormValidator(
 );
 $form_search->addElement('text', 'search_field', null, [
     'id' => 'search_field',
-    'aria-label' => get_lang('Search')
+    'aria-label' => get_lang('Search'),
 ]);
 $form_search->addElement('hidden', 'category', 'search_setting');
 $form_search->addButtonSearch(get_lang('Search'), 'submit_button');

+ 0 - 1
main/admin/skill.php

@@ -8,7 +8,6 @@ use Chamilo\CoreBundle\Entity\Skill;
  *
  * @package chamilo.skill
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 api_protect_admin_script();

+ 5 - 3
main/admin/skill_badge.php

@@ -1,8 +1,10 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Show information about Mozilla OpenBadges
+ * Show information about Mozilla OpenBadges.
+ *
  * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
+ *
  * @package chamilo.admin.openbadges
  */
 $cidReset = true;
@@ -24,8 +26,8 @@ if (strcmp($backpack, $configBackpack) !== 0) {
 $interbreadcrumb = [
     [
         'url' => api_get_path(WEB_CODE_PATH).'admin/index.php',
-        'name' => get_lang('Administration')
-    ]
+        'name' => get_lang('Administration'),
+    ],
 ];
 
 $toolbar = Display::url(

+ 7 - 8
main/admin/skill_badge_create.php

@@ -1,14 +1,13 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-use ChamiloSession as Session;
-
 /**
- * Show information about Mozilla OpenBadges
+ * Show information about Mozilla OpenBadges.
+ *
  * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
+ *
  * @package chamilo.admin.openbadges
  */
-
 $cidReset = true;
 
 require_once __DIR__.'/../inc/global.inc.php';
@@ -30,12 +29,12 @@ $badgeStudio = [
     'media' => api_get_path(WEB_LIBRARY_JS_PATH).'badge-studio/media/',
     'templates' => api_get_path(WEB_LIBRARY_JS_PATH).'badge-studio/media/images/templates/',
     'masks' => api_get_path(WEB_LIBRARY_JS_PATH).'badge-studio/media/images/masks/',
-    'script_js' => '<script src="'.api_get_path(WEB_LIBRARY_JS_PATH).'badge-studio/media/js/studio.js?"></script>'
+    'script_js' => '<script src="'.api_get_path(WEB_LIBRARY_JS_PATH).'badge-studio/media/js/studio.js?"></script>',
 ];
 
 if ($_SERVER['REQUEST_METHOD'] === 'POST') {
     $params = [
-        'id' => $skillId
+        'id' => $skillId,
     ];
 
     if ((isset($_FILES['image']) && $_FILES['image']['error'] == 0) ||
@@ -93,8 +92,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
 $interbreadcrumb = [
     [
         'url' => api_get_path(WEB_CODE_PATH).'admin/index.php',
-        'name' => get_lang('Administration')
-    ]
+        'name' => get_lang('Administration'),
+    ],
 ];
 $interbreadcrumb[] = ['url' => 'skill_list.php', 'name' => get_lang('ManageSkills')];
 

+ 7 - 5
main/admin/skill_badge_list.php

@@ -2,12 +2,14 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * Show information about Mozilla OpenBadges
+ * Show information about Mozilla OpenBadges.
+ *
  * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
+ *
  * @package chamilo.admin.openbadges
+ *
  * @deprecated use skill_list.php
  */
-
 $cidReset = true;
 
 require_once __DIR__.'/../inc/global.inc.php';
@@ -23,12 +25,12 @@ $skills = $objSkill->get_all();
 $interbreadcrumb = [
     [
         'url' => api_get_path(WEB_CODE_PATH).'admin/index.php',
-        'name' => get_lang('Administration')
+        'name' => get_lang('Administration'),
     ],
     [
         'url' => api_get_path(WEB_CODE_PATH).'admin/skill_badge.php',
-        'name' => get_lang('Badges')
-    ]
+        'name' => get_lang('Badges'),
+    ],
 ];
 
 $toolbar = Display::url(

+ 5 - 4
main/admin/skill_create.php

@@ -2,11 +2,12 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * Create skill form
+ * Create skill form.
+ *
  * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
+ *
  * @package chamilo.admin
  */
-
 $cidReset = true;
 
 require_once __DIR__.'/../inc/global.inc.php';
@@ -29,7 +30,7 @@ if ($skillParentId > 0) {
 
     $formDefaultValues = [
         'parent_id' => $skillParentInfo['id'],
-        'gradebook_id' => []
+        'gradebook_id' => [],
     ];
 
     foreach ($skillParentInfo['gradebooks'] as $gradebook) {
@@ -47,7 +48,7 @@ $jquery_ready_content = $returnParams['jquery_ready_content'];
 if (!empty($jquery_ready_content)) {
     $htmlHeadXtra[] = '<script>
     $(document).ready(function(){
-        ' . $jquery_ready_content.'
+        '.$jquery_ready_content.'
     });
     </script>';
 }

+ 5 - 4
main/admin/skill_edit.php

@@ -2,11 +2,12 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * Skill edit form
+ * Skill edit form.
+ *
  * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
+ *
  * @package chamilo.admin
  */
-
 $cidReset = true;
 
 require_once __DIR__.'/../inc/global.inc.php';
@@ -35,7 +36,7 @@ $skillDefaultInfo = [
     'description' => $skillInfo['description'],
     'parent_id' => $skillInfo['extra']['parent_id'],
     'criteria' => $skillInfo['criteria'],
-    'gradebook_id' => []
+    'gradebook_id' => [],
 ];
 
 foreach ($skillInfo['gradebooks'] as $gradebook) {
@@ -59,7 +60,7 @@ $jquery_ready_content = $returnParams['jquery_ready_content'];
 if (!empty($jquery_ready_content)) {
     $htmlHeadXtra[] = '<script>
     $(document).ready(function(){
-        ' . $jquery_ready_content.'
+        '.$jquery_ready_content.'
     });
     </script>';
 }

+ 1 - 2
main/admin/skill_level.php

@@ -4,11 +4,10 @@
 use Chamilo\SkillBundle\Entity\Level;
 
 /**
- * Add a skill Level
+ * Add a skill Level.
  *
  * @package chamilo.skill
  */
-
 $cidReset = true;
 
 require_once __DIR__.'/../inc/global.inc.php';

+ 3 - 2
main/admin/skill_list.php

@@ -2,11 +2,12 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * Skill list for management
+ * Skill list for management.
+ *
  * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
+ *
  * @package chamilo.admin
  */
-
 $cidReset = true;
 
 require_once __DIR__.'/../inc/global.inc.php';

+ 3 - 5
main/admin/skill_profile.php

@@ -1,15 +1,14 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-use Chamilo\SkillBundle\Entity\Profile;
 use Chamilo\SkillBundle\Entity\Level;
+use Chamilo\SkillBundle\Entity\Profile;
 
 /**
- * Add a skill Profile
+ * Add a skill Profile.
  *
  * @package chamilo.skill
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
@@ -47,7 +46,7 @@ $formToDisplay = $form->returnForm();
 
 $interbreadcrumb[] = ['url' => 'index.php', 'name' => get_lang('PlatformAdmin')];
 $interbreadcrumb[] = ['url' => api_get_path(WEB_CODE_PATH).'admin/skill.php', 'name' => get_lang('ManageSkillsLevels')];
-$interbreadcrumb[] = ['url' =>  api_get_self(), 'name' => get_lang('SkillProfile')];
+$interbreadcrumb[] = ['url' => api_get_self(), 'name' => get_lang('SkillProfile')];
 
 $toolbar = null;
 
@@ -66,7 +65,6 @@ switch ($action) {
             Display::addFlash(Display::return_message(get_lang('Updated')));
         }
 
-
         header('Location: '.$listAction);
         exit;
         break;

+ 4 - 4
main/admin/skill_translate.php

@@ -1,10 +1,10 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-use \Chamilo\CoreBundle\Entity\ExtraField;
-use Chamilo\CoreBundle\Entity\Skill;
-use Chamilo\CoreBundle\Entity\Language;
 use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
+use Chamilo\CoreBundle\Entity\ExtraField;
+use Chamilo\CoreBundle\Entity\Language;
+use Chamilo\CoreBundle\Entity\Skill;
 
 $cidReset = true;
 
@@ -94,7 +94,7 @@ $form->setDefaults([
     'variable_language' => '$'.$variableLanguage,
     'original_name' => $originalName,
     'sub_language' => $languageId,
-    'new_language' => $action === 'code' ? $skill->getShortCode() : $skill->getName()
+    'new_language' => $action === 'code' ? $skill->getShortCode() : $skill->getName(),
 ]);
 $form->addRule('sub_language', get_lang('Required'), 'required');
 $form->freeze(['variable_language', 'original_name']);

+ 6 - 7
main/admin/skills_gradebook.php

@@ -4,7 +4,6 @@
 /**
  *  @package chamilo.admin
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
@@ -57,7 +56,7 @@ $columns = [
     get_lang('Name'),
     get_lang('CertificatesFiles'),
     get_lang('Skills'),
-    get_lang('Actions')
+    get_lang('Actions'),
 ];
 
 //Column config
@@ -66,21 +65,21 @@ $column_model = [
         'name' => 'name',
         'index' => 'name',
         'width' => '150',
-        'align' => 'left'
+        'align' => 'left',
     ],
     [
         'name' => 'certificate',
         'index' => 'certificate',
         'width' => '25',
         'align' => 'left',
-        'sortable' => 'false'
+        'sortable' => 'false',
     ],
     [
         'name' => 'skills',
         'index' => 'skills',
         'width' => '300',
         'align' => 'left',
-        'sortable' => 'false'
+        'sortable' => 'false',
     ],
     [
         'name' => 'actions',
@@ -88,8 +87,8 @@ $column_model = [
         'width' => '30',
         'align' => 'left',
         'formatter' => 'action_formatter',
-        'sortable' => 'false'
-    ]
+        'sortable' => 'false',
+    ],
 ];
 //Autowidth
 $extra_params['autowidth'] = 'true';

+ 17 - 10
main/admin/skills_import.php

@@ -1,18 +1,20 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * This tool allows platform admins to add skills by uploading a CSV or XML file
+ * This tool allows platform admins to add skills by uploading a CSV or XML file.
+ *
  * @package chamilo.admin
  * @documentation Some interesting basic skills can be found in the "Skills"
  * section here: http://en.wikipedia.org/wiki/Personal_knowledge_management
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 
 /**
  * Validate the imported data.
+ *
  * @param $skills
+ *
  * @return array
  */
 function validate_data($skills)
@@ -48,10 +50,11 @@ function validate_data($skills)
 }
 
 /**
- * Save the imported data
+ * Save the imported data.
+ *
  * @param   array   List of users
- * @return  void
- * @uses global variable $inserted_in_course,
+ *
+ * @uses \global variable $inserted_in_course,
  * which returns the list of courses the user was inserted in
  */
 function save_data($skills)
@@ -75,8 +78,10 @@ function save_data($skills)
 }
 
 /**
- * Read the CSV-file
+ * Read the CSV-file.
+ *
  * @param string $file Path to the CSV-file
+ *
  * @return array All userinformation read from the file
  */
 function parse_csv_data($file)
@@ -90,7 +95,7 @@ function parse_csv_data($file)
 }
 
 /**
- * XML-parser: handle start of element
+ * XML-parser: handle start of element.
  */
 function element_start($parser, $data)
 {
@@ -107,7 +112,7 @@ function element_start($parser, $data)
 }
 
 /**
- * XML-parser: handle end of element
+ * XML-parser: handle end of element.
  */
 function element_end($parser, $data)
 {
@@ -126,7 +131,7 @@ function element_end($parser, $data)
 }
 
 /**
- * XML-parser: handle character data
+ * XML-parser: handle character data.
  */
 function character_data($parser, $data)
 {
@@ -136,8 +141,10 @@ function character_data($parser, $data)
 }
 
 /**
- * Read the XML-file
+ * Read the XML-file.
+ *
  * @param string $file Path to the XML-file
+ *
  * @return array All userinformation read from the file
  */
 function parse_xml_data($file)

+ 1 - 2
main/admin/skills_profile.php

@@ -6,7 +6,6 @@ use ChamiloSession as Session;
 /**
  *  @package chamilo.admin
  */
-
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 $this_section = SECTION_PLATFORM_ADMIN;
@@ -28,7 +27,7 @@ $tpl = new Template(get_lang('Skills'));
 $form = new FormValidator('profile_search');
 
 $form->addElement('header', get_lang('SearchSkills'));
-$form->addElement('select', 'skills', null, null, ['id'=>'skills']);
+$form->addElement('select', 'skills', null, null, ['id' => 'skills']);
 $form->addButtonSearch(get_lang('Search'));
 
 $profiles = $skill_profile->get_all();

+ 4 - 2
main/admin/special_exports.php

@@ -5,10 +5,11 @@ use Chamilo\CourseBundle\Component\CourseCopy\CourseBuilder;
 use Chamilo\CourseBundle\Component\CourseCopy\CourseSelectForm;
 
 /**
- * Special exports
+ * Special exports.
  *
  * @author Jhon Hinojosa
  * @author Julio Montoya Fixing pclzip folder + some clean <gugli100@gmail.com>
+ *
  * @package chamilo.include.export
  */
 
@@ -197,7 +198,7 @@ function create_zip()
         'PATH_TEMP_ARCHIVE' => $temp_zip_dir,
         'PATH_COURSE' => $sys_course_path,
         'TEMP_FILE_ZIP' => $temp_zip_file,
-        'PATH_REMOVE' => $remove_dir
+        'PATH_REMOVE' => $remove_dir,
     ];
 }
 
@@ -312,6 +313,7 @@ function fullexportspecial()
     } else {
         echo Display::return_message(get_lang('ErrorMsgSpecialExport'), 'error'); //main API
         $export = false;
+
         return false;
     }
 }

+ 3 - 2
main/admin/specific_fields.php

@@ -1,7 +1,7 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Manage specific fields
+ * Manage specific fields.
  *
  * @package chamilo.admin
  */
@@ -24,7 +24,7 @@ include_once $libpath.'specific_fields_manager.lib.php';
 
 // Create an add-field box
 $form = new FormValidator('add_field', 'post', '', '', null, false);
-$renderer = & $form->defaultRenderer();
+$renderer = &$form->defaultRenderer();
 $renderer->setCustomElementTemplate('<span>{element}</span> ');
 $form->addElement(
     'static',
@@ -60,6 +60,7 @@ function edit_filter($id, $url_params, $row)
         Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
     $return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;">'.
         Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
+
     return $return;
 }
 

+ 3 - 2
main/admin/specific_fields_add.php

@@ -2,7 +2,8 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * Add form
+ * Add form.
+ *
  * @package chamilo.admin
  */
 
@@ -62,7 +63,7 @@ $form->addButtonCreate(get_lang('Add'), 'submit');
 if ($form->validate()) {
     $field = $form->exportValues();
     $field_name = $field['field_name'];
-    if (is_numeric($field['field_id']) && $field['field_id'] <> 0 && !empty($field['field_id'])) {
+    if (is_numeric($field['field_id']) && $field['field_id'] != 0 && !empty($field['field_id'])) {
         edit_specific_field($field['field_id'], $field['field_name']);
         $message = get_lang('FieldEdited');
     } else {

+ 2 - 3
main/admin/statistics.php

@@ -2,9 +2,8 @@
 /* For licensing terms, see /license.txt */
 
 /**
-*   @package chamilo.admin
-*/
-
+ *   @package chamilo.admin
+ */
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 $this_section = SECTION_PLATFORM_ADMIN;

+ 4 - 3
main/admin/statistics/index.php

@@ -2,7 +2,8 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * This tool show global Statistics on general platform events
+ * This tool show global Statistics on general platform events.
+ *
  * @package chamilo.Statistics
  */
 $cidReset = true;
@@ -20,7 +21,7 @@ if ($report) {
         <script>
             $(document).ready(function() {
                 $.ajax({
-                    url: "'. api_get_path(WEB_CODE_PATH).'inc/ajax/statistics.ajax.php?a=recentlogins",
+                    url: "'.api_get_path(WEB_CODE_PATH).'inc/ajax/statistics.ajax.php?a=recentlogins",
                     type: "POST",
                     success: function(data) {
                         Chart.defaults.global.responsive = true;
@@ -107,7 +108,7 @@ switch ($report) {
             get_lang('NumberOfUsers'),
             [
                 get_lang('Teachers') => Statistics::countUsers(COURSEMANAGER, null, $countInvisible),
-                get_lang('Students') => Statistics::countUsers(STUDENT, null, $countInvisible)
+                get_lang('Students') => Statistics::countUsers(STUDENT, null, $countInvisible),
             ]
         );
         foreach ($course_categories as $code => $name) {

+ 18 - 15
main/admin/sub_language.php

@@ -1,10 +1,10 @@
 <?php
 /* For licensing terms, see /license.txt */
 /**
- * Script for sub-language administration
+ * Script for sub-language administration.
+ *
  * @package chamilo.admin.sub_language
  */
-
 $cidReset = true;
 $this_script = 'sub_language';
 require_once __DIR__.'/../inc/global.inc.php';
@@ -36,27 +36,27 @@ $htmlHeadXtra[] = '<script>
                     \'new_language\': is_new_language,
                     \'variable_language\': is_variable_language,
                     \'file_id\': file_id,
-                    \'id\': ' . intval($_REQUEST['id']).',
-                    \'sub\': ' . intval($_REQUEST['sub_language_id']).',
-                    \'sub_language_id\': ' . intval($_REQUEST['sub_language_id']).'
+                    \'id\': '.intval($_REQUEST['id']).',
+                    \'sub\': '.intval($_REQUEST['sub_language_id']).',
+                    \'sub_language_id\': '.intval($_REQUEST['sub_language_id']).'
                 },
                 success: function(datos) {
                     if (datos == "1") {
-                        $("#div_message_information_id").html(\'' . Display::return_message(get_lang('TheNewWordHasBeenAdded'), 'success').'\');
+                        $("#div_message_information_id").html(\''.Display::return_message(get_lang('TheNewWordHasBeenAdded'), 'success').'\');
                     } else {
                         $("#div_message_information_id").html("<div class=\"alert alert-warning\">" + datos +"</div>");
                     }
                 }
             });
         } else {
-            $("#div_message_information_id").html(\'' . Display::return_message(get_lang('FormHasErrorsPleaseComplete'), 'error').'\');
+            $("#div_message_information_id").html(\''.Display::return_message(get_lang('FormHasErrorsPleaseComplete'), 'error').'\');
         }
     });
 });
 </script>';
 
 /**
- * Main code
+ * Main code.
  */
 // setting the name of the tool
 $tool_name = get_lang('CreateSubLanguage');
@@ -121,11 +121,13 @@ echo '<div id="div_message_information_id">&nbsp;</div>';
 
 /**
  * @param $term The term to search
- * @param bool $search_in_variable The search will include the variable definition of the term
- * @param bool $search_in_english The search will include the english language variables
- * @param bool $search_in_parent The search will include the parent language variables of the sub language
+ * @param bool $search_in_variable     The search will include the variable definition of the term
+ * @param bool $search_in_english      The search will include the english language variables
+ * @param bool $search_in_parent       The search will include the parent language variables of the sub language
  * @param bool $search_in_sub_language The search will include the sub language variables
+ *
  * @author Julio Montoya
+ *
  * @return array
  */
 function search_language_term(
@@ -185,7 +187,7 @@ function search_language_term(
                         $english_name_variable,
                         $parent_variable_value,
                         $obj_text,
-                        $obj_button
+                        $obj_button,
                     ];
                 }
             }
@@ -245,7 +247,7 @@ function search_language_term(
                         $english_name_variable,
                         $parent_variable_value,
                         $obj_text,
-                        $obj_button
+                        $obj_button,
                     ];
                 }
             }
@@ -281,13 +283,14 @@ function search_language_term(
                     $list_info[] = [$lang_file.'.inc.php',
                         $name_variable,
                         $english_name_variable,
-                        $parent_variable_value, $obj_text, $obj_button];
+                        $parent_variable_value, $obj_text, $obj_button, ];
                 }
             }
         }
     }
 
     $list_info = array_unique_dimensional($list_info);
+
     return $list_info;
 }
 
@@ -309,7 +312,7 @@ if (isset($_REQUEST['txt_search_word'])) {
 $parameters = [
     'id' => intval($_GET['id']),
     'sub_language_id' => intval($_GET['sub_language_id']),
-    'txt_search_word' => $txt_search_word
+    'txt_search_word' => $txt_search_word,
 ];
 $table = new SortableTableFromArrayConfig($list_info, 1, 20, 'data_info');
 $table->set_additional_parameters($parameters);

+ 32 - 18
main/admin/sub_language_add.php

@@ -2,7 +2,8 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * This script allows for the addition of sub-languages
+ * This script allows for the addition of sub-languages.
+ *
  * @package chamilo.admin
  */
 $cidReset = true;
@@ -12,7 +13,7 @@ $this_section = SECTION_PLATFORM_ADMIN;
 api_protect_admin_script();
 
 /**
- *        MAIN CODE
+ *        MAIN CODE.
  */
 // setting the name of the tool
 $tool_name = get_lang('CreateSubLanguage');
@@ -22,13 +23,15 @@ $interbreadcrumb[] = ['url' => 'index.php', 'name' => get_lang('PlatformAdmin')]
 $interbreadcrumb[] = ['url' => 'languages.php', 'name' => get_lang('PlatformLanguages')];
 
 /**
- * Add sub-language
+ * Add sub-language.
+ *
  * @param   string  Original language name (Occitan, Wallon, Vlaams)
  * @param   string  English language name (occitan, wallon, flanders)
  * @param   string  ISO code (fr_FR, ...)
  * @param   int     Whether the sublanguage is published (0=unpublished, 1=published)
  * @param   int     ID del idioma padre
- * @return  false|string     New sub language ID or false on error
+ *
+ * @return false|string New sub language ID or false on error
  */
 function add_sub_language($original_name, $english_name, $isocode, $sublanguage_available, $parent_id)
 {
@@ -40,25 +43,29 @@ function add_sub_language($original_name, $english_name, $isocode, $sublanguage_
     $parent_id = intval($parent_id);
 
     $sql = 'INSERT INTO '.$tbl_admin_languages.'(original_name,english_name,isocode,dokeos_folder,available,parent_id)
-    	  VALUES ("' . $original_name.'","'.$english_name.'","'.$isocode.'","'.$english_name.'","'.$sublanguage_available.'","'.$parent_id.'")';
+    	  VALUES ("'.$original_name.'","'.$english_name.'","'.$isocode.'","'.$english_name.'","'.$sublanguage_available.'","'.$parent_id.'")';
     $res = Database::query($sql);
     if ($res === false) {
         return false;
     }
+
     return Database::insert_id();
 }
 
 /**
- * Check if language exists
+ * Check if language exists.
+ *
  * @param   string  Original language name (Occitan, Wallon, Vlaams)
  * @param   string  English language name (occitan, wallon, flanders)
  * @param   string  ISO code (fr_FR, ...)
  * @param   int     Whether the sublanguage is published (0=unpublished, 1=published)
- * @return  array   Array describing the number of items found that match the
- *                  current language insert attempt (original_name => true,
- *                  english_name => true, isocode => true,
- *                  execute_add => true/false). If execute_add is true, then we
- *                  can proceed.
+ *
+ * @return array Array describing the number of items found that match the
+ *               current language insert attempt (original_name => true,
+ *               english_name => true, isocode => true,
+ *               execute_add => true/false). If execute_add is true, then we
+ *               can proceed.
+ *
  * @todo This function is not transaction-safe and should probably be included
  *       inside the add_sub_language function.
  */
@@ -105,9 +112,12 @@ function check_if_language_exist($original_name, $english_name, $isocode, $subla
 
 /**
  * Check if language exist, given its ID. This is just a wrapper for the
- * SubLanguageManager::check_if_exist_language_by_id() method and should not exist
+ * SubLanguageManager::check_if_exist_language_by_id() method and should not exist.
+ *
  * @param   int     Language ID
- * @return  bool
+ *
+ * @return bool
+ *
  * @todo    deprecate this function and use the static method directly
  */
 function check_if_exist_language_by_id($language_id)
@@ -116,9 +126,11 @@ function check_if_exist_language_by_id($language_id)
 }
 
 /**
- * Check if the given language is a parent of any sub-language
+ * Check if the given language is a parent of any sub-language.
+ *
  * @param   int     Language ID of the presumed parent
- * @return  bool    True if this language has children, false otherwise
+ *
+ * @return bool True if this language has children, false otherwise
  */
 function ckeck_if_is_parent_of_sub_language($parent_id)
 {
@@ -132,10 +144,12 @@ function ckeck_if_is_parent_of_sub_language($parent_id)
 }
 
 /**
- * Get all information of sub-language
+ * Get all information of sub-language.
+ *
  * @param   int     Parent language ID
  * @param   int     Child language ID
- * @return  array
+ *
+ * @return array
  */
 function allow_get_all_information_of_sub_language($parent_id, $sub_language_id)
 {
@@ -319,6 +333,6 @@ if (isset($_GET['action']) && $_GET['action'] == 'definenewsublanguage') {
     }
 }
 /**
- * Footer
+ * Footer.
  */
 Display:: display_footer();

+ 3 - 2
main/admin/sub_language_ajax.inc.php

@@ -1,10 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-use \Chamilo\CoreBundle\Entity\ExtraField;
+use Chamilo\CoreBundle\Entity\ExtraField;
 
 /**
- * Sub language AJAX script to update variables
+ * Sub language AJAX script to update variables.
+ *
  * @package chamilo.admin.sub_language
  */
 $this_script = 'sub_language';

+ 12 - 13
main/admin/subscribe_user2course.php

@@ -2,15 +2,15 @@
 /* For licensing terms, see /license.txt */
 
 /**
-*	This script allows platform admins to add users to courses.
-*	It displays a list of users and a list of courses;
-*	you can select multiple users and courses and then click on
-*	'Add to this(these) course(s)'.
-*
-*	@package chamilo.admin
-* 	@todo use formvalidator for the form
-*/
-
+ *	This script allows platform admins to add users to courses.
+ *	It displays a list of users and a list of courses;
+ *	you can select multiple users and courses and then click on
+ *	'Add to this(these) course(s)'.
+ *
+ *	@package chamilo.admin
+ *
+ * 	@todo use formvalidator for the form
+ */
 $cidReset = true;
 require_once __DIR__.'/../inc/global.inc.php';
 $this_section = SECTION_PLATFORM_ADMIN;
@@ -98,7 +98,7 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) {
             foreach ($courses as $course_code) {
                 foreach ($users as $user_id) {
                     $user = api_get_user_info($user_id);
-                    if ($user['status'] <> DRH) {
+                    if ($user['status'] != DRH) {
                         CourseManager::subscribe_user($user_id, $course_code);
                     } else {
                         $errorDrh = 1;
@@ -158,7 +158,6 @@ if (is_array($extra_field_list)) {
     }
 }
 
-
 if ($use_extra_fields) {
     $final_result = [];
     if (count($extra_field_result) > 1) {
@@ -226,7 +225,7 @@ unset($result);
 $sql = "SELECT code,visual_code,title
         FROM $tbl_course
         WHERE visual_code LIKE '".$first_letter_course."%'
-        ORDER BY ". (count($courses) > 0 ? "(code IN('".implode("','", $courses)."')) DESC," : "")." visual_code";
+        ORDER BY ".(count($courses) > 0 ? "(code IN('".implode("','", $courses)."')) DESC," : "")." visual_code";
 
 if (api_is_multiple_url_enabled()) {
     $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
@@ -239,7 +238,7 @@ if (api_is_multiple_url_enabled()) {
                 WHERE
                     access_url_id =  $access_url_id  AND
                     (visual_code LIKE '".$first_letter_course."%' )
-                ORDER BY ". (count($courses) > 0 ? "(code IN('".implode("','", $courses)."')) DESC," : "")." visual_code";
+                ORDER BY ".(count($courses) > 0 ? "(code IN('".implode("','", $courses)."')) DESC," : "")." visual_code";
     }
 }
 

+ 1 - 1
main/admin/system_announcements.php

@@ -3,6 +3,7 @@
 
 /**
  * This page allows the administrator to manage the system announcements.
+ *
  * @package chamilo.admin.announcement
  */
 
@@ -323,7 +324,6 @@ if ($show_announcement_list) {
         $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_STUDENT."&action=".($announcement->visible_student ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_student ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>";
         $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_GUEST."&action=".($announcement->visible_guest ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_guest ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>";*/
 
-
         $row[] = $announcement->lang;
         $row[] = "<a href=\"?action=edit&id=".$announcement->id."\">".Display::return_icon('edit.png', get_lang('Edit'), [], ICON_SIZE_SMALL)."</a> <a href=\"?action=delete&id=".$announcement->id."\"  onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."')) return false;\">".Display::return_icon('delete.png', get_lang('Delete'), [], ICON_SIZE_SMALL)."</a>";
         $announcement_data[] = $row;

+ 1 - 0
main/admin/system_status.php

@@ -2,6 +2,7 @@
 /* For licensing terms, see /license.txt */
 /**
  * @package chamilo.admin
+ *
  * @author Julio Montoya <gugli100@gmail.com>
  */
 $cidReset = true;

+ 27 - 26
main/admin/teacher_time_report.php

@@ -2,9 +2,10 @@
 /* For licensing terms, see /license.txt */
 
 /**
- * Generate a teacher time report in platform or sessions/courses
+ * Generate a teacher time report in platform or sessions/courses.
  *
  * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
+ *
  * @package chamilo.admin
  */
 
@@ -19,7 +20,7 @@ $this_section = SECTION_PLATFORM_ADMIN;
 
 $interbreadcrumb[] = [
     'url' => 'index.php',
-    'name' => get_lang('PlatformAdmin')
+    'name' => get_lang('PlatformAdmin'),
 ];
 $toolName = get_lang('TeacherTimeReport');
 
@@ -112,7 +113,7 @@ if (!empty($selectedCourse)) {
             'session' => null,
             'course' => [
                 'id' => $course['real_id'],
-                'name' => $course['title']
+                'name' => $course['title'],
             ],
             'coach' => [
                 'userId' => $teacher['user_id'],
@@ -122,9 +123,9 @@ if (!empty($selectedCourse)) {
                 'complete_name' => api_get_person_name(
                     $teacher['firstname'],
                     $teacher['lastname']
-                )
+                ),
             ],
-            'total_time' => $formattedTime
+            'total_time' => $formattedTime,
         ];
     }
 
@@ -150,11 +151,11 @@ if (!empty($selectedCourse)) {
                 $timeReport->data[] = [
                     'session' => [
                         'id' => $session['id'],
-                        'name' => $session['name']
+                        'name' => $session['name'],
                     ],
                     'course' => [
                         'id' => $course['real_id'],
-                        'name' => $course['title']
+                        'name' => $course['title'],
                     ],
                     'coach' => [
                         'userId' => $coach['user_id'],
@@ -164,9 +165,9 @@ if (!empty($selectedCourse)) {
                         'complete_name' => api_get_person_name(
                             $coach['firstname'],
                             $coach['lastname']
-                        )
+                        ),
                     ],
-                    'total_time' => $formattedTime
+                    'total_time' => $formattedTime,
                 ];
             }
         }
@@ -179,7 +180,7 @@ if (!empty($selectedSession)) {
     $session = api_get_session_info($selectedSession);
     $sessionData = [
         'id' => $session['id'],
-        'name' => $session['name']
+        'name' => $session['name'],
     ];
 
     $reportTitle = sprintf(get_lang('TimeReportForSessionX'), $session['name']);
@@ -188,7 +189,7 @@ if (!empty($selectedSession)) {
     foreach ($courses as $course) {
         $courseData = [
             'id' => $course['id'],
-            'name' => $course['title']
+            'name' => $course['title'],
         ];
 
         $coaches = CourseManager::get_coachs_from_course(
@@ -218,9 +219,9 @@ if (!empty($selectedSession)) {
                         'complete_name' => api_get_person_name(
                             $coach['firstname'],
                             $coach['lastname']
-                        )
+                        ),
                     ],
-                    'total_time' => $formattedTime
+                    'total_time' => $formattedTime,
                 ];
             }
         }
@@ -235,7 +236,7 @@ if (!empty($selectedTeacher)) {
         'lastname' => $teacher['lastname'],
         'firstname' => $teacher['firstname'],
         'username' => $teacher['username'],
-        'complete_name' => $teacher['complete_name']
+        'complete_name' => $teacher['complete_name'],
     ];
 
     $reportTitle = sprintf(
@@ -264,10 +265,10 @@ if (!empty($selectedTeacher)) {
                 'session' => null,
                 'course' => [
                     'id' => $courseInfo['real_id'],
-                    'name' => $courseInfo['title']
+                    'name' => $courseInfo['title'],
                 ],
                 'coach' => $teacherData,
-                'total_time' => $formattedTime
+                'total_time' => $formattedTime,
             ];
         }
     }
@@ -290,14 +291,14 @@ if (!empty($selectedTeacher)) {
         $timeReport->data[] = [
             'session' => [
                 'id' => $session->getId(),
-                'name' => $session->getName()
+                'name' => $session->getName(),
             ],
             'course' => [
                 'id' => $course->getId(),
-                'name' => $course->getTitle()
+                'name' => $course->getTitle(),
             ],
             'coach' => $teacherData,
-            'total_time' => $formattedTime
+            'total_time' => $formattedTime,
         ];
     }
 }
@@ -315,7 +316,7 @@ if (empty($selectedCourse) && empty($selectedSession) &&
                 $teacher['user_id'],
                 $selectedFrom,
                 $selectedUntil
-            )
+            ),
         ];
     }
 }
@@ -333,7 +334,7 @@ if (isset($_GET['export'])) {
                 'pdf_title' => "$reportTitle - $reportSubTitle",
                 'pdf_description' => get_lang('TeacherTimeReport'),
                 'format' => 'A4-L',
-                'orientation' => 'L'
+                'orientation' => 'L',
             ];
 
             $pdfContent = Export::convert_array_to_html($dataToExport);
@@ -342,9 +343,9 @@ if (isset($_GET['export'])) {
             break;
         case 'xls':
             array_unshift($dataToExport, [
-                $reportTitle
+                $reportTitle,
             ], [
-                $reportSubTitle
+                $reportSubTitle,
             ], []);
 
             Export::export_table_xls_html($dataToExport, $fileName);
@@ -380,7 +381,7 @@ $form->addDateRangePicker(
         'maxDate' => $limitDate->format('Y-m-d'),
         'format' => 'YYYY-MM-DD',
         'timePicker' => 'false',
-        'value' => "$selectedFrom / $selectedUntil"
+        'value' => "$selectedFrom / $selectedUntil",
     ]
 );
 $form->addButtonFilter(get_lang('Filter'));
@@ -392,7 +393,7 @@ $form->setDefaults([
     'teacher' => $selectedTeacher,
     'date_range' => "$selectedFrom / $selectedUntil",
     'from' => $selectedFrom,
-    'until' => $selectedUntil
+    'until' => $selectedUntil,
 ]);
 
 $leftActions = Display::url(
@@ -410,7 +411,7 @@ $exportUrlParams = [
     'course' => $selectedCourse,
     'session' => $selectedSession,
     'teacher' => $selectedTeacher,
-    '_qf__teacher_time_report' => ''
+    '_qf__teacher_time_report' => '',
 ];
 $rightActions = Display::url(
     Display::return_icon(

+ 5 - 5
main/admin/teachers_time_by_session_report.php

@@ -2,14 +2,14 @@
 /* For licensing terms, see /license.txt */
 
 use Chamilo\CoreBundle\Entity\Session;
-use Doctrine\Common\Collections\Criteria;
 use Chamilo\CourseBundle\Entity\Repository\CStudentPublicationRepository;
+use Doctrine\Common\Collections\Criteria;
 
 /**
- * Generate a teacher time report in platform by session only
+ * Generate a teacher time report in platform by session only.
+ *
  * @package chamilo.admin
  */
-
 $cidReset = true;
 
 require_once __DIR__.'/../inc/global.inc.php';
@@ -136,7 +136,7 @@ if (isset($_GET['export']) && $session && ($coursesInfo && $usersInfo)) {
             $row['complete_name'],
             $row['time_in_platform'],
             $row['first_connection'],
-            $row['last_connection']
+            $row['last_connection'],
         ];
 
         foreach ($row['courses'] as $course) {
@@ -170,7 +170,7 @@ $this_section = SECTION_PLATFORM_ADMIN;
 $interbreadcrumb[] = ['url' => api_get_path(WEB_CODE_PATH).'mySpace/', 'name' => get_lang('Reporting')];
 $interbreadcrumb[] = [
     'url' => api_get_path(WEB_CODE_PATH).'mySpace/session.php',
-    'name' => get_lang('FollowedSessions')
+    'name' => get_lang('FollowedSessions'),
 ];
 
 $view = new Template($toolName);

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio