Completed
Pull Request — 1.11.x (#1688)
by José
28:44
created
main/lp/lp_edit.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 }
21 21
 
22 22
 if (!empty($gradebook) && $gradebook == 'view') {
23
-    $interbreadcrumb[] = array (
23
+    $interbreadcrumb[] = array(
24 24
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
25 25
         'name' => get_lang('ToolGradebook')
26 26
     );
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 );
77 77
 if (api_get_setting('allow_course_theme') === 'true') {
78 78
     $mycourselptheme = api_get_course_setting('allow_learning_path_theme');
79
-    if (!empty($mycourselptheme) && $mycourselptheme!=-1 && $mycourselptheme== 1) {
79
+    if (!empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
80 80
         //LP theme picker
81 81
         $theme_select = $form->addElement('SelectTheme', 'lp_theme', get_lang('Theme'));
82 82
         $form->applyFilter('lp_theme', 'trim');
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 $label = ($_SESSION['oLP']->get_preview_image() != '' ? get_lang('UpdateImage') : get_lang('AddImage'));
106 106
 $form->addElement('file', 'lp_preview_image', array($label, get_lang('ImageWillResizeMsg')));
107 107
 
108
-$form->addRule('lp_preview_image', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif'));
108
+$form->addRule('lp_preview_image', get_lang('OnlyImagesAllowed'), 'filetype', array('jpg', 'jpeg', 'png', 'gif'));
109 109
 
110 110
 // Search terms (only if search is activated).
111 111
 if (api_get_setting('search_enabled') === 'true') {
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 $defaults['lp_author'] = Security::remove_XSS($_SESSION['oLP']->get_author());
135 135
 $defaults['hide_toc_frame'] = Security::remove_XSS($_SESSION['oLP']->get_hide_toc_frame());
136 136
 $defaults['category_id'] = intval($_SESSION['oLP']->getCategoryId());
137
-$defaults['accumulate_scorm_time']  = $_SESSION['oLP']->getAccumulateScormTime();
137
+$defaults['accumulate_scorm_time'] = $_SESSION['oLP']->getAccumulateScormTime();
138 138
 
139 139
 $expired_on = $_SESSION['oLP']->expired_on;
140 140
 $publicated_on = $_SESSION['oLP']->publicated_on;
@@ -214,14 +214,14 @@  discard block
 block discarded – undo
214 214
 if ($enableLpExtraFields) {
215 215
     $htmlHeadXtra[] = '<script>
216 216
     $(function() {
217
-        ' . $extra['jquery_ready_content'] . '
217
+        ' . $extra['jquery_ready_content'].'
218 218
     });
219 219
     </script>';
220 220
 }
221 221
 
222 222
 
223 223
 $defaults['publicated_on'] = !empty($publicated_on) && $publicated_on !== '0000-00-00 00:00:00' ? api_get_local_time($publicated_on) : null;
224
-$defaults['expired_on'] = (!empty($expired_on) )? api_get_local_time($expired_on): date('Y-m-d 12:00:00', time()+84600);
224
+$defaults['expired_on'] = (!empty($expired_on)) ? api_get_local_time($expired_on) : date('Y-m-d 12:00:00', time() + 84600);
225 225
 $defaults['subscribe_users'] = $_SESSION['oLP']->getSubscribeUsers();
226 226
 $form->setDefaults($defaults);
227 227
 
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/Element/Color.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      */
35 35
     public function toHtml()
36 36
     {
37
-        return parent::toHtml() . <<<JS
37
+        return parent::toHtml().<<<JS
38 38
             <script>
39 39
                 $(document).on('ready', function () {
40 40
                     var txtColor = $('#{$this->getAttribute('id')}'),
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/Element/DatePicker.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
         return '
47 47
             <div class="input-group">
48 48
                 <span class="input-group-addon cursor-pointer">
49
-                    <input ' . $this->_getAttrString($this->_attributes) . '>
49
+                    <input ' . $this->_getAttrString($this->_attributes).'>
50 50
                 </span>
51
-                <p class="form-control disabled" id="' . $id . '_alt_text">' . $value . '</p>
52
-                <input class="form-control" type="hidden" id="' . $id . '_alt" value="' . $value . '">
51
+                <p class="form-control disabled" id="' . $id.'_alt_text">'.$value.'</p>
52
+                <input class="form-control" type="hidden" id="' . $id.'_alt" value="'.$value.'">
53 53
                 <span class="input-group-btn">
54 54
                     <button class="btn btn-default" type="button">
55 55
                         <span class="fa fa-times text-danger" aria-hidden="true"></span>
56
-                        <span class="sr-only">' . get_lang('Reset') . '</span>
56
+                        <span class="sr-only">' . get_lang('Reset').'</span>
57 57
                     </button>
58 58
                 </span>
59 59
             </div>
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
                 txtDate
93 93
                     .hide()
94 94
                     .datepicker({
95
-                        defaultDate: '" . $this->getValue() . "',
95
+                        defaultDate: '".$this->getValue()."',
96 96
                         dateFormat: 'yy-mm-dd',
97 97
                         altField: '#{$id}_alt',
98
-                        altFormat: \"" . get_lang('DateFormatLongNoDayJS') . "\",
98
+                        altFormat: \"".get_lang('DateFormatLongNoDayJS')."\",
99 99
                         showOn: 'both',
100
-                        buttonImage: '" . Display::return_icon('attendance.png', null, [], ICON_SIZE_TINY, true, true) . "',
100
+                        buttonImage: '" . Display::return_icon('attendance.png', null, [], ICON_SIZE_TINY, true, true)."',
101 101
                         buttonImageOnly: true,
102
-                        buttonText: '" . get_lang('SelectDate') . "',
102
+                        buttonText: '" . get_lang('SelectDate')."',
103 103
                         changeMonth: true,
104 104
                         changeYear: true,
105 105
                         yearRange: 'c-60y:c+5y'
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/Element/DateTimePicker.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
         return '
40 40
             <div class="input-group">
41 41
                 <span class="input-group-addon cursor-pointer">
42
-                    <input ' . $this->_getAttrString($this->_attributes) . '>
42
+                    <input ' . $this->_getAttrString($this->_attributes).'>
43 43
                 </span>
44
-                <p class="form-control disabled" id="' . $id . '_alt_text">' . $value . '</p>
45
-                <input class="form-control" type="hidden" id="' . $id . '_alt" value="' . $value . '">
44
+                <p class="form-control disabled" id="' . $id.'_alt_text">'.$value.'</p>
45
+                <input class="form-control" type="hidden" id="' . $id.'_alt" value="'.$value.'">
46 46
                 <span class="input-group-btn">
47 47
                     <button class="btn btn-default" type="button">
48 48
                         <span class="fa fa-times text-danger" aria-hidden="true"></span>
49
-                        <span class="sr-only">' . get_lang('Reset') . '</span>
49
+                        <span class="sr-only">' . get_lang('Reset').'</span>
50 50
                     </button>
51 51
                 </span>
52 52
             </div>
@@ -85,18 +85,18 @@  discard block
 block discarded – undo
85 85
                 txtDateTime
86 86
                     .hide()
87 87
                     .datetimepicker({
88
-                        defaultDate: '" . $this->getValue() . "',
88
+                        defaultDate: '".$this->getValue()."',
89 89
                         dateFormat: 'yy-mm-dd',
90 90
                         timeFormat: 'HH:mm',
91 91
                         altField: '#{$id}_alt',
92
-                        altFormat: \"" . get_lang('DateFormatLongNoDayJS') . "\",
93
-                        altTimeFormat: \"" . get_lang('TimeFormatNoSecJS') . "\",
94
-                        altSeparator: \" " . get_lang('AtTime') . " \",
92
+                        altFormat: \"".get_lang('DateFormatLongNoDayJS')."\",
93
+                        altTimeFormat: \"" . get_lang('TimeFormatNoSecJS')."\",
94
+                        altSeparator: \" " . get_lang('AtTime')." \",
95 95
                         altFieldTimeOnly: false,
96 96
                         showOn: 'both',
97
-                        buttonImage: '" . Display::return_icon('attendance.png', null, [], ICON_SIZE_TINY, true, true) . "',
97
+                        buttonImage: '" . Display::return_icon('attendance.png', null, [], ICON_SIZE_TINY, true, true)."',
98 98
                         buttonImageOnly: true,
99
-                        buttonText: '" . get_lang('SelectDate') . "',
99
+                        buttonText: '" . get_lang('SelectDate')."',
100 100
                         changeMonth: true,
101 101
                         changeYear: true
102 102
                     })
Please login to merge, or discard this patch.
main/survey/survey_question.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         if ($surveyData['survey_type'] == 1) {
65 65
             $table_survey_question_group = Database::get_course_table(TABLE_SURVEY_QUESTION_GROUP);
66 66
             $sql = 'SELECT id,name FROM '.$table_survey_question_group.'
67
-                    WHERE survey_id = '.(int)$_GET['survey_id'].'
67
+                    WHERE survey_id = '.(int) $_GET['survey_id'].'
68 68
                     ORDER BY name';
69 69
             $rs = Database::query($sql);
70 70
             $glist = null;
@@ -75,15 +75,15 @@  discard block
 block discarded – undo
75 75
             $grouplist = $grouplist1 = $grouplist2 = $glist;
76 76
 
77 77
             if (!empty($formData['assigned'])) {
78
-                $grouplist = str_replace('<option value="'.$formData['assigned'].'"','<option value="'.$formData['assigned'].'" selected',$glist);
78
+                $grouplist = str_replace('<option value="'.$formData['assigned'].'"', '<option value="'.$formData['assigned'].'" selected', $glist);
79 79
             }
80 80
 
81 81
             if (!empty($formData['assigned1'])) {
82
-                $grouplist1 = str_replace('<option value="'.$formData['assigned1'].'"','<option value="'.$formData['assigned1'].'" selected',$glist);
82
+                $grouplist1 = str_replace('<option value="'.$formData['assigned1'].'"', '<option value="'.$formData['assigned1'].'" selected', $glist);
83 83
             }
84 84
 
85 85
             if (!empty($formData['assigned2'])) {
86
-                $grouplist2 = str_replace('<option value="'.$formData['assigned2'].'"','<option value="'.$formData['assigned2'].'" selected',$glist);
86
+                $grouplist2 = str_replace('<option value="'.$formData['assigned2'].'"', '<option value="'.$formData['assigned2'].'" selected', $glist);
87 87
             }
88 88
 
89 89
             $this->html .= '	<tr><td colspan="">
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
             $this->html .= '
97 97
 			<b>'.get_lang('Secondary').'</b><br />
98
-			'.'<input type="radio" name="choose" value="2" '.(($formData['choose']==2)?'checked':'').
98
+			'.'<input type="radio" name="choose" value="2" '.(($formData['choose'] == 2) ? 'checked' : '').
99 99
                 '><select name="assigned1">'.$grouplist1.'</select> '.
100 100
                 '<select name="assigned2">'.$grouplist2.'</select>'
101 101
                 .'</fieldset><br />';
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
                     <div class="form-group">
132 132
                         <label class="col-sm-2 control-label"></label>
133 133
                         <div class="col-sm-8">
134
-                            <div class="alert alert-info">' . get_lang('YouCantNotEditThisQuestionBecauseAlreadyExistAnswers') . '</div>
134
+                            <div class="alert alert-info">' . get_lang('YouCantNotEditThisQuestionBecauseAlreadyExistAnswers').'</div>
135 135
                         </div>
136 136
                         <div class="col-sm-2"></div>
137 137
                     </div>
Please login to merge, or discard this patch.
main/inc/lib/userportal.lib.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
                 );
73 73
 
74 74
                 foreach ($exercises as $exercise_item) {
75
-                    $exercise_item['course_code']     = $course_code;
76
-                    $exercise_item['session_id']     = $session_id;
77
-                    $exercise_item['tms']     = api_strtotime($exercise_item['end_time'], 'UTC');
75
+                    $exercise_item['course_code'] = $course_code;
76
+                    $exercise_item['session_id'] = $session_id;
77
+                    $exercise_item['tms'] = api_strtotime($exercise_item['end_time'], 'UTC');
78 78
 
79 79
                     $exercise_list[] = $exercise_item;
80 80
                 }
@@ -214,16 +214,16 @@  discard block
 block discarded – undo
214 214
         if ($show_menu) {
215 215
             $html .= '<ul class="nav nav-pills nav-stacked">';
216 216
             if ($show_create_link) {
217
-                $html .= '<li class="add-course"><a href="' . api_get_path(WEB_CODE_PATH) . 'create_course/add_course.php">'.
218
-                    Display::return_icon('new-course.png',  get_lang('CourseCreate')).(api_get_setting('course_validation') == 'true' ? get_lang('CreateCourseRequest') : get_lang('CourseCreate')).'</a></li>';
217
+                $html .= '<li class="add-course"><a href="'.api_get_path(WEB_CODE_PATH).'create_course/add_course.php">'.
218
+                    Display::return_icon('new-course.png', get_lang('CourseCreate')).(api_get_setting('course_validation') == 'true' ? get_lang('CreateCourseRequest') : get_lang('CourseCreate')).'</a></li>';
219 219
             }
220 220
 
221 221
             if ($show_course_link) {
222 222
                 if (!api_is_drh() && !api_is_session_admin()) {
223
-                    $html .=  '<li class="list-course"><a href="'. api_get_path(WEB_CODE_PATH) . 'auth/courses.php">'.
224
-                        Display::return_icon('catalog-course.png', get_lang('CourseCatalog')) .get_lang('CourseCatalog').'</a></li>';
223
+                    $html .= '<li class="list-course"><a href="'.api_get_path(WEB_CODE_PATH).'auth/courses.php">'.
224
+                        Display::return_icon('catalog-course.png', get_lang('CourseCatalog')).get_lang('CourseCatalog').'</a></li>';
225 225
                 } else {
226
-                    $html .= '<li><a href="' . api_get_path(WEB_CODE_PATH) . 'dashboard/index.php">'.get_lang('Dashboard').'</a></li>';
226
+                    $html .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'dashboard/index.php">'.get_lang('Dashboard').'</a></li>';
227 227
                 }
228 228
             }
229 229
             $html .= '</ul>';
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
         // Including the page for the news
254 254
         $html = '';
255 255
         if (!empty($_GET['include']) && preg_match('/^[a-zA-Z0-9_-]*\.html$/', $_GET['include'])) {
256
-            $open = @(string)file_get_contents($this->home.$_GET['include']);
256
+            $open = @(string) file_get_contents($this->home.$_GET['include']);
257 257
             $html = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
258 258
         } else {
259 259
             // Hiding home top when user not connected.
@@ -283,15 +283,15 @@  discard block
 block discarded – undo
283 283
                     $home_top_temp = file_get_contents($this->home.'home_top.html');
284 284
                 } else {
285 285
                     if (file_exists($this->default_home.'home_top.html')) {
286
-                        $home_top_temp = file_get_contents($this->default_home . 'home_top.html');
286
+                        $home_top_temp = file_get_contents($this->default_home.'home_top.html');
287 287
                     }
288 288
                 }
289 289
             }
290 290
 
291 291
 			if (trim($home_top_temp) == '' && api_is_platform_admin()) {
292
-				$home_top_temp = '<div class="welcome-mascot">' . get_lang('PortalHomepageDefaultIntroduction') . '</div>';
292
+				$home_top_temp = '<div class="welcome-mascot">'.get_lang('PortalHomepageDefaultIntroduction').'</div>';
293 293
 			} else {
294
-				$home_top_temp = '<div class="welcome-home-top-temp">' . $home_top_temp . '</div>';
294
+				$home_top_temp = '<div class="welcome-home-top-temp">'.$home_top_temp.'</div>';
295 295
 			}
296 296
 			$open = str_replace('{rel_path}', api_get_path(REL_PATH), $home_top_temp);
297 297
 			$html = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 
310 310
         $html = '';
311 311
         // Notice
312
-        $home_notice = @(string)file_get_contents($this->home.'home_notice_'.$user_selected_language.'.html');
312
+        $home_notice = @(string) file_get_contents($this->home.'home_notice_'.$user_selected_language.'.html');
313 313
         if (empty($home_notice)) {
314
-            $home_notice = @(string)file_get_contents($this->home.'home_notice.html');
314
+            $home_notice = @(string) file_get_contents($this->home.'home_notice.html');
315 315
         }
316 316
 
317 317
         if (!empty($home_notice)) {
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
         }
345 345
 
346 346
         $html = '';
347
-        $home_menu = @(string)file_get_contents($this->home.'home_menu_'.$user_selected_language.'.html');
347
+        $home_menu = @(string) file_get_contents($this->home.'home_menu_'.$user_selected_language.'.html');
348 348
         if (!empty($home_menu)) {
349 349
             $home_menu_content = '<ul class="nav nav-pills nav-stacked">';
350 350
             $home_menu_content .= api_to_system_encoding($home_menu, api_detect_encoding(strip_tags($home_menu)));
@@ -395,9 +395,9 @@  discard block
 block discarded – undo
395 395
         if (api_get_setting('allow_public_certificates') == 'true') {
396 396
             $searchItem = Display::tag(
397 397
                 'li',
398
-                Display::url(Display::return_icon('search_graduation.png',get_lang('Search'),null,ICON_SIZE_SMALL).
398
+                Display::url(Display::return_icon('search_graduation.png', get_lang('Search'), null, ICON_SIZE_SMALL).
399 399
                     get_lang('Search'),
400
-                    api_get_path(WEB_CODE_PATH) . "gradebook/search.php"
400
+                    api_get_path(WEB_CODE_PATH)."gradebook/search.php"
401 401
                 )
402 402
             );
403 403
         }
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
             $content .= Display::tag(
414 414
                 'li',
415 415
                 Display::url(
416
-                    Display::return_icon('skill-badges.png',get_lang('MySkills'),null,ICON_SIZE_SMALL).get_lang('MySkills'),
416
+                    Display::return_icon('skill-badges.png', get_lang('MySkills'), null, ICON_SIZE_SMALL).get_lang('MySkills'),
417 417
                     api_get_path(WEB_CODE_PATH).'social/my_skills_report.php'
418 418
                 )
419 419
             );
@@ -421,8 +421,8 @@  discard block
 block discarded – undo
421 421
             if (($allowSkillsManagement && api_is_drh()) || api_is_platform_admin()) {
422 422
                 $content .= Display::tag('li',
423 423
                     Display::url(Display::return_icon('edit-skill.png', get_lang('MySkills'), null,
424
-                            ICON_SIZE_SMALL) . get_lang('ManageSkills'),
425
-                        api_get_path(WEB_CODE_PATH) . 'admin/skills_wheel.php'));
424
+                            ICON_SIZE_SMALL).get_lang('ManageSkills'),
425
+                        api_get_path(WEB_CODE_PATH).'admin/skills_wheel.php'));
426 426
             }
427 427
         }
428 428
 
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 
476 476
         // Get list of courses in category $category.
477 477
         $sql = "SELECT * FROM $main_course_table cours
478
-                WHERE category_code = '" . $category . "'
478
+                WHERE category_code = '".$category."'
479 479
                 ORDER BY title, UPPER(visual_code)";
480 480
 
481 481
         // Showing only the courses of the current access_url_id.
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
                     FROM $main_category_table t1
522 522
                     LEFT JOIN $main_category_table t2 ON t1.code=t2.parent_id
523 523
                     LEFT JOIN $main_course_table t3 ON (t3.category_code = t1.code $platform_visible_courses)
524
-                    WHERE t1.parent_id ". (empty($category) ? "IS NULL" : "='$category'")."
524
+                    WHERE t1.parent_id ".(empty($category) ? "IS NULL" : "='$category'")."
525 525
                     GROUP BY t1.name,t1.code,t1.parent_id,t1.children_count 
526 526
                     ORDER BY t1.tree_pos, t1.name";
527 527
 
@@ -596,10 +596,10 @@  discard block
 block discarded – undo
596 596
         }
597 597
         $result .= $htmlTitre;
598 598
         if ($thereIsSubCat) {
599
-            $result .=  $htmlListCat;
599
+            $result .= $htmlListCat;
600 600
         }
601 601
         while ($categoryName = Database::fetch_array($resCats)) {
602
-            $result .= '<h3>' . $categoryName['name'] . "</h3>\n";
602
+            $result .= '<h3>'.$categoryName['name']."</h3>\n";
603 603
         }
604 604
         $numrows = Database::num_rows($sql_result_courses);
605 605
         $courses_list_string = '';
@@ -697,12 +697,12 @@  discard block
 block discarded – undo
697 697
         if ($courses_shown > 0) {
698 698
             // Only display the list of courses and categories if there was more than
699 699
                     // 0 courses visible to the world (we're in the anonymous list here).
700
-            $result .=  $courses_list_string;
700
+            $result .= $courses_list_string;
701 701
         }
702 702
         if ($category != '') {
703
-            $result .=  '<p><a href="'.api_get_self().'"> ' .
703
+            $result .= '<p><a href="'.api_get_self().'"> '.
704 704
                 Display :: return_icon('back.png', get_lang('BackToHomePage')).
705
-                get_lang('BackToHomePage') . '</a></p>';
705
+                get_lang('BackToHomePage').'</a></p>';
706 706
         }
707 707
         return $result;
708 708
     }
@@ -797,7 +797,7 @@  discard block
 block discarded – undo
797 797
             if (!empty($title)) {
798 798
                 $html .= '<div class="panel-heading">'.$title.'</div>';
799 799
             }
800
-            $html.= '<div class="panel-body">'.$content.'</div>';
800
+            $html .= '<div class="panel-body">'.$content.'</div>';
801 801
             $html = Display::div($html, $params);
802 802
         }
803 803
 
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
             $usergroup_list = $usergroup->get_usergroup_by_user(api_get_user_id());
845 845
             $classes = '';
846 846
             if (!empty($usergroup_list)) {
847
-                foreach($usergroup_list as $group_id) {
847
+                foreach ($usergroup_list as $group_id) {
848 848
                     $data = $usergroup->get($group_id);
849 849
                     $data['name'] = Display::url($data['name'], api_get_path(WEB_CODE_PATH).'user/classes.php?id='.$data['id']);
850 850
                     $classes .= Display::tag('li', $data['name']);
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
             if (api_is_platform_admin()) {
854 854
                 $classes .= Display::tag(
855 855
                     'li',
856
-                    Display::url(get_lang('AddClasses') ,api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add')
856
+                    Display::url(get_lang('AddClasses'), api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add')
857 857
                 );
858 858
             }
859 859
             if (!empty($classes)) {
@@ -875,11 +875,11 @@  discard block
 block discarded – undo
875 875
             $content = null;
876 876
 
877 877
             if (api_get_setting('allow_social_tool') == 'true') {
878
-                $content .= '<a style="text-align:center" href="' . api_get_path(WEB_PATH) . 'main/social/home.php">
879
-                <img class="img-circle" src="' . $userPicture . '" ></a>';
878
+                $content .= '<a style="text-align:center" href="'.api_get_path(WEB_PATH).'main/social/home.php">
879
+                <img class="img-circle" src="' . $userPicture.'" ></a>';
880 880
             } else {
881
-                $content .= '<a style="text-align:center" href="' . api_get_path(WEB_PATH) . 'main/auth/profile.php">
882
-                <img class="img-circle" title="' . get_lang('EditProfile') . '" src="' . $userPicture. '" ></a>';
881
+                $content .= '<a style="text-align:center" href="'.api_get_path(WEB_PATH).'main/auth/profile.php">
882
+                <img class="img-circle" title="' . get_lang('EditProfile').'" src="'.$userPicture.'" ></a>';
883 883
             }
884 884
 
885 885
             $html = self::show_right_block(
@@ -932,19 +932,19 @@  discard block
 block discarded – undo
932 932
                 $link = '?f=social';
933 933
             }
934 934
             $profile_content .= '<li class="inbox-message-social"><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php'.$link.'">'.
935
-                Display::return_icon('inbox.png',get_lang('Inbox'),null,ICON_SIZE_SMALL).get_lang('Inbox').$cant_msg.' </a></li>';
935
+                Display::return_icon('inbox.png', get_lang('Inbox'), null, ICON_SIZE_SMALL).get_lang('Inbox').$cant_msg.' </a></li>';
936 936
             $profile_content .= '<li class="new-message-social"><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php'.$link.'">'.
937
-                Display::return_icon('new-message.png',get_lang('Compose'),null,ICON_SIZE_SMALL).get_lang('Compose').' </a></li>';
937
+                Display::return_icon('new-message.png', get_lang('Compose'), null, ICON_SIZE_SMALL).get_lang('Compose').' </a></li>';
938 938
 
939 939
             if (api_get_setting('allow_social_tool') == 'true') {
940 940
                 $total_invitations = Display::badge($total_invitations);
941 941
                 $profile_content .= '<li class="invitations-social"><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php">'.
942
-                    Display::return_icon('invitations.png',get_lang('PendingInvitations'),null,ICON_SIZE_SMALL).get_lang('PendingInvitations').$total_invitations.'</a></li>';
942
+                    Display::return_icon('invitations.png', get_lang('PendingInvitations'), null, ICON_SIZE_SMALL).get_lang('PendingInvitations').$total_invitations.'</a></li>';
943 943
             }
944 944
 
945 945
             if (isset($_configuration['allow_my_files_link_in_homepage']) && $_configuration['allow_my_files_link_in_homepage']) {
946 946
                 $myFiles = '<li class="myfiles-social"><a href="'.api_get_path(WEB_PATH).'main/social/myfiles.php">'.
947
-                    Display::return_icon('sn-files.png',get_lang('Files'),null,ICON_SIZE_SMALL).get_lang('MyFiles').'</a></li>';
947
+                    Display::return_icon('sn-files.png', get_lang('Files'), null, ICON_SIZE_SMALL).get_lang('MyFiles').'</a></li>';
948 948
 
949 949
                 if (api_get_setting('allow_my_files') === 'false') {
950 950
                     $myFiles = '';
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 
957 957
         $editProfileUrl = Display::getProfileEditionLink($user_id);
958 958
 
959
-        $profile_content .= '<li class="profile-social"><a href="' . $editProfileUrl . '">'.
959
+        $profile_content .= '<li class="profile-social"><a href="'.$editProfileUrl.'">'.
960 960
             Display::return_icon(
961 961
                 'edit-profile.png',
962 962
                 get_lang('EditProfile'),
@@ -1046,17 +1046,17 @@  discard block
 block discarded – undo
1046 1046
         if ($show_create_link) {
1047 1047
             $my_account_content .= '<li class="add-course"><a href="main/create_course/add_course.php">';
1048 1048
             if (api_get_setting('course_validation') == 'true' && !api_is_platform_admin()) {
1049
-                $my_account_content .= Display::return_icon('new-course.png',get_lang('CreateCourseRequest'),null,ICON_SIZE_SMALL);
1049
+                $my_account_content .= Display::return_icon('new-course.png', get_lang('CreateCourseRequest'), null, ICON_SIZE_SMALL);
1050 1050
                 $my_account_content .= get_lang('CreateCourseRequest');
1051 1051
             } else {
1052
-                $my_account_content .= Display::return_icon('new-course.png',get_lang('CourseCreate'),null,ICON_SIZE_SMALL);
1052
+                $my_account_content .= Display::return_icon('new-course.png', get_lang('CourseCreate'), null, ICON_SIZE_SMALL);
1053 1053
                 $my_account_content .= get_lang('CourseCreate');
1054 1054
             }
1055 1055
             $my_account_content .= '</a></li>';
1056 1056
 
1057 1057
             if (SessionManager::allowToManageSessions()) {
1058 1058
                 $my_account_content .= '<li class="add-course"><a href="main/session/session_add.php">';
1059
-                $my_account_content .= Display::return_icon('session.png',get_lang('AddSession'),null,ICON_SIZE_SMALL);
1059
+                $my_account_content .= Display::return_icon('session.png', get_lang('AddSession'), null, ICON_SIZE_SMALL);
1060 1060
                 $my_account_content .= get_lang('AddSession');
1061 1061
                 $my_account_content .= '</a></li>';
1062 1062
             }
@@ -1064,20 +1064,20 @@  discard block
 block discarded – undo
1064 1064
 
1065 1065
         //Sort courses
1066 1066
         $url = api_get_path(WEB_CODE_PATH).'auth/courses.php?action=sortmycourses';
1067
-        $img_order= Display::return_icon('order-course.png',get_lang('SortMyCourses'),null,ICON_SIZE_SMALL);
1067
+        $img_order = Display::return_icon('order-course.png', get_lang('SortMyCourses'), null, ICON_SIZE_SMALL);
1068 1068
         $my_account_content .= '<li class="order-course">'.Display::url($img_order.get_lang('SortMyCourses'), $url, array('class' => 'sort course')).'</li>';
1069 1069
 
1070 1070
         // Session history
1071 1071
         if (isset($_GET['history']) && intval($_GET['history']) == 1) {
1072
-            $my_account_content .= '<li class="history-course"><a href="user_portal.php">'.Display::return_icon('history-course.png',get_lang('DisplayTrainingList'),null,ICON_SIZE_SMALL).get_lang('DisplayTrainingList').'</a></li>';
1072
+            $my_account_content .= '<li class="history-course"><a href="user_portal.php">'.Display::return_icon('history-course.png', get_lang('DisplayTrainingList'), null, ICON_SIZE_SMALL).get_lang('DisplayTrainingList').'</a></li>';
1073 1073
         } else {
1074
-            $my_account_content .= '<li class="history-course"><a href="user_portal.php?history=1" >'.Display::return_icon('history-course.png',get_lang('HistoryTrainingSessions'),null,ICON_SIZE_SMALL).get_lang('HistoryTrainingSessions').'</a></li>';
1074
+            $my_account_content .= '<li class="history-course"><a href="user_portal.php?history=1" >'.Display::return_icon('history-course.png', get_lang('HistoryTrainingSessions'), null, ICON_SIZE_SMALL).get_lang('HistoryTrainingSessions').'</a></li>';
1075 1075
         }
1076 1076
 
1077 1077
         // Course catalog
1078 1078
         if ($show_course_link) {
1079 1079
             if (!api_is_drh()) {
1080
-                $my_account_content .= '<li class="list-course"><a href="main/auth/courses.php" >'.Display::return_icon('catalog-course.png',get_lang('CourseCatalog'),null,ICON_SIZE_SMALL).get_lang('CourseCatalog').'</a></li>';
1080
+                $my_account_content .= '<li class="list-course"><a href="main/auth/courses.php" >'.Display::return_icon('catalog-course.png', get_lang('CourseCatalog'), null, ICON_SIZE_SMALL).get_lang('CourseCatalog').'</a></li>';
1081 1081
             } else {
1082 1082
                 $my_account_content .= '<li><a href="main/dashboard/index.php">'.get_lang('Dashboard').'</a></li>';
1083 1083
             }
@@ -1282,7 +1282,7 @@  discard block
 block discarded – undo
1282 1282
 
1283 1283
                             $actions = null;
1284 1284
                             if (api_is_platform_admin()) {
1285
-                                $actions = api_get_path(WEB_CODE_PATH) .'session/resume_session.php?id_session='.$session_id;
1285
+                                $actions = api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$session_id;
1286 1286
                             }
1287 1287
 
1288 1288
                             $coachId = $session_box['id_coach'];
@@ -1292,12 +1292,12 @@  discard block
 block discarded – undo
1292 1292
                             $params['category_id'] = $session_box['category_id'];
1293 1293
                             $params['title'] = $session_box['title'];
1294 1294
                             $params['id_coach'] = $coachId;
1295
-                            $params['coach_url'] = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=get_user_popup&user_id=' . $coachId;
1295
+                            $params['coach_url'] = api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=get_user_popup&user_id='.$coachId;
1296 1296
                             $params['coach_name'] = !empty($session_box['coach']) ? $session_box['coach'] : null;
1297 1297
                             $params['coach_avatar'] = UserManager::getUserPicture($coachId, USER_IMAGE_SIZE_SMALL);
1298 1298
                             $params['date'] = $session_box['dates'];
1299 1299
                             $params['image'] = isset($imageField['value']) ? $imageField['value'] : null;
1300
-                            $params['duration'] = isset($session_box['duration']) ? ' ' . $session_box['duration'] : null;
1300
+                            $params['duration'] = isset($session_box['duration']) ? ' '.$session_box['duration'] : null;
1301 1301
                             $params['edit_actions'] = $actions;
1302 1302
                             $params['show_description'] = $session_box['show_description'];
1303 1303
                             $params['description'] = $session_box['description'];
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
                                 $sessionParams[0]['date'] = $session_box['dates'];
1402 1402
                                 $sessionParams[0]['course_list_session_style'] = $coursesListSessionStyle;
1403 1403
                                 $sessionParams[0]['title'] = $session_box['title'];
1404
-                                $sessionParams[0]['subtitle'] = (!empty($session_box['coach']) ? $session_box['coach'] . ' | ': '') . $session_box['dates'];
1404
+                                $sessionParams[0]['subtitle'] = (!empty($session_box['coach']) ? $session_box['coach'].' | ' : '').$session_box['dates'];
1405 1405
                                 $sessionParams[0]['show_actions'] = api_is_platform_admin();
1406 1406
                                 $sessionParams[0]['courses'] = $html_courses_session;
1407 1407
                                 $sessionParams[0]['show_simple_session_info'] = false;
@@ -1452,13 +1452,13 @@  discard block
 block discarded – undo
1452 1452
                             if (
1453 1453
                                 !empty($session_category_start_date)
1454 1454
                             ) {
1455
-                                $categoryParams['subtitle'] = get_lang('From') . ' ' . $session_category_start_date;
1455
+                                $categoryParams['subtitle'] = get_lang('From').' '.$session_category_start_date;
1456 1456
                             }
1457 1457
 
1458 1458
                             if (
1459 1459
                                 !empty($session_category_end_date)
1460 1460
                             ) {
1461
-                                $categoryParams['subtitle'] = get_lang('Until') . ' ' . $session_category_end_date;
1461
+                                $categoryParams['subtitle'] = get_lang('Until').' '.$session_category_end_date;
1462 1462
                             }
1463 1463
                         }
1464 1464
 
@@ -1483,7 +1483,7 @@  discard block
 block discarded – undo
1483 1483
 
1484 1484
             $this->tpl->assign('all_courses', $allCoursesInSessions);
1485 1485
             $this->tpl->assign('session', $listSession);
1486
-            $this->tpl->assign('show_tutor', (api_get_setting('show_session_coach')==='true' ? true : false));
1486
+            $this->tpl->assign('show_tutor', (api_get_setting('show_session_coach') === 'true' ? true : false));
1487 1487
             $this->tpl->assign('gamification_mode', $gameModeIsActive);
1488 1488
 
1489 1489
             if (api_get_configuration_value('view_grid_courses')) {
@@ -1498,7 +1498,7 @@  discard block
 block discarded – undo
1498 1498
         }
1499 1499
 
1500 1500
         return [
1501
-            'html' => $specialCourseList . $sessions_with_category.$sessions_with_no_category.$listCourse,
1501
+            'html' => $specialCourseList.$sessions_with_category.$sessions_with_no_category.$listCourse,
1502 1502
             'session_count' => $sessionCount,
1503 1503
             'course_count' => $courseCount
1504 1504
         ];
@@ -1632,7 +1632,7 @@  discard block
 block discarded – undo
1632 1632
                         $htmlCategory .= '<div class="panel panel-default">';
1633 1633
                     }
1634 1634
                     $htmlCategory .= '<div class="panel-body">';
1635
-                    $coursesInfo =  $listCourse['course'];
1635
+                    $coursesInfo = $listCourse['course'];
1636 1636
 
1637 1637
                     $htmlCategory .= self::getHtmlForCourse(
1638 1638
                         $coursesInfo,
@@ -1649,7 +1649,7 @@  discard block
 block discarded – undo
1649 1649
                             $listCategorySession['catSessionName']
1650 1650
                         );
1651 1651
                         // list of session
1652
-                        $htmlSession = '';    // start
1652
+                        $htmlSession = ''; // start
1653 1653
                         foreach ($listCategorySession['sessionList'] as $k => $listSession) {
1654 1654
                             // add session
1655 1655
                             $htmlSession .= '<div class="session-view-row">';
@@ -1666,8 +1666,8 @@  discard block
 block discarded – undo
1666 1666
                         $htmlSessionCategory .= $htmlSession;
1667 1667
                     }
1668 1668
                     $htmlSessionCategory .= '</div>'; // end session cat block
1669
-                    $htmlCategory .=  $htmlSessionCategory .'</div></div>' ;
1670
-                    $htmlCategory .= '';   // end course block
1669
+                    $htmlCategory .= $htmlSessionCategory.'</div></div>';
1670
+                    $htmlCategory .= ''; // end course block
1671 1671
                 }
1672 1672
                 $userCategoryHtml .= $htmlCategory;
1673 1673
             }
@@ -1694,11 +1694,11 @@  discard block
 block discarded – undo
1694 1694
                 }
1695 1695
             }
1696 1696
             $htmlCategory .= '';
1697
-            $userCategoryHtml .= $htmlCategory;   // end user cat block
1697
+            $userCategoryHtml .= $htmlCategory; // end user cat block
1698 1698
             if ($userCategoryId != 0) {
1699 1699
                 $userCategoryHtml .= '</div>';
1700 1700
             }
1701
-            $html .= $userCategoryHtml;   //
1701
+            $html .= $userCategoryHtml; //
1702 1702
         }
1703 1703
         $html .= '</div>';
1704 1704
 
@@ -1839,11 +1839,11 @@  discard block
 block discarded – undo
1839 1839
         $html = '';
1840 1840
 
1841 1841
         if ($categorySessionId == 0) {
1842
-            $class1 = 'session-view-lvl-2';    // session
1843
-            $class2 = 'session-view-lvl-4';    // got to course in session link
1842
+            $class1 = 'session-view-lvl-2'; // session
1843
+            $class2 = 'session-view-lvl-4'; // got to course in session link
1844 1844
         } else {
1845
-            $class1 = 'session-view-lvl-3';    // session
1846
-            $class2 = 'session-view-lvl-5';    // got to course in session link
1845
+            $class1 = 'session-view-lvl-3'; // session
1846
+            $class2 = 'session-view-lvl-5'; // got to course in session link
1847 1847
         }
1848 1848
 
1849 1849
         $icon = Display::return_icon(
@@ -1871,7 +1871,7 @@  discard block
 block discarded – undo
1871 1871
         if ($listA['userCatTitle'] == $listB['userCatTitle']) {
1872 1872
             if ($listA['title'] == $listB['title']) {
1873 1873
                 return 0;
1874
-            } else if($listA['title'] > $listB['title']) {
1874
+            } else if ($listA['title'] > $listB['title']) {
1875 1875
                 return 1;
1876 1876
             } else {
1877 1877
                 return -1;
@@ -1892,7 +1892,7 @@  discard block
 block discarded – undo
1892 1892
     {
1893 1893
         if ($listA['title'] == $listB['title']) {
1894 1894
             return 0;
1895
-        } else if($listA['title'] > $listB['title']) {
1895
+        } else if ($listA['title'] > $listB['title']) {
1896 1896
             return 1;
1897 1897
         } else {
1898 1898
             return -1;
Please login to merge, or discard this patch.
main/inc/lib/AnnouncementManager.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
                             ip.tool='announcement' AND
229 229
                             (
230 230
                                 ip.toUser = $userId OR
231
-                                ip.group IN ('0', '" . implode("', '", $group_list) . "') OR
231
+                                ip.group IN ('0', '".implode("', '", $group_list)."') OR
232 232
                                 ip.group IS NULL
233 233
                             ) AND
234 234
                             ip.visibility = '1' AND                       
@@ -293,13 +293,13 @@  discard block
 block discarded – undo
293 293
         $content = $announcement->getContent();
294 294
 
295 295
         $html .= "<table height=\"100\" width=\"100%\" cellpadding=\"5\" cellspacing=\"0\" class=\"data_table\">";
296
-        $html .= "<tr><td><h2>" . $title . "</h2></td></tr>";
296
+        $html .= "<tr><td><h2>".$title."</h2></td></tr>";
297 297
 
298 298
         if (api_is_allowed_to_edit(false, true) ||
299 299
             (api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous())
300 300
         ) {
301
-            $modify_icons = "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&action=modify&id=" . $announcement_id . "\">" .
302
-                Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a>";
301
+            $modify_icons = "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=modify&id=".$announcement_id."\">".
302
+                Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>";
303 303
             if ($itemProperty->getVisibility() === 1) {
304 304
                 $image_visibility = "visible";
305 305
                 $alt_visibility = get_lang('Hide');
@@ -309,12 +309,12 @@  discard block
 block discarded – undo
309 309
             }
310 310
             global $stok;
311 311
 
312
-            $modify_icons .= "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&action=showhide&id=" . $announcement_id . "&sec_token=" . $stok . "\">" .
313
-                Display::return_icon($image_visibility . '.png', $alt_visibility, '', ICON_SIZE_SMALL) . "</a>";
312
+            $modify_icons .= "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=showhide&id=".$announcement_id."&sec_token=".$stok."\">".
313
+                Display::return_icon($image_visibility.'.png', $alt_visibility, '', ICON_SIZE_SMALL)."</a>";
314 314
 
315 315
             if (api_is_allowed_to_edit(false, true)) {
316
-                $modify_icons .= "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&action=delete&id=" . $announcement_id . "&sec_token=" . $stok . "\" onclick=\"javascript:if(!confirm('" . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)) . "')) return false;\">" .
317
-                    Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) .
316
+                $modify_icons .= "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete&id=".$announcement_id."&sec_token=".$stok."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset))."')) return false;\">".
317
+                    Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).
318 318
                     "</a>";
319 319
             }
320 320
             $html .= "<tr><th style='text-align:right'>$modify_icons</th></tr>";
@@ -333,10 +333,10 @@  discard block
 block discarded – undo
333 333
         $lastEdit = $itemProperty->getLasteditDate();
334 334
 
335 335
         $html .= "<tr><td>$content</td></tr>";
336
-        $html .= "<tr><td class=\"announcements_datum\">" . get_lang('LastUpdateDate') . " : " .
336
+        $html .= "<tr><td class=\"announcements_datum\">".get_lang('LastUpdateDate')." : ".
337 337
             Display::dateToStringAgoAndLongDate(
338 338
                 !empty($lastEdit) ? $lastEdit->format('Y-m-d h:i:s') : ''
339
-            ) . "</td></tr>";
339
+            )."</td></tr>";
340 340
 
341 341
         if ($itemProperty->getGroup() !== null) {
342 342
             $sent_to_icon = Display::return_icon('group.gif', get_lang('AnnounceSentToUserSelection'));
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             $sent_to_form = self::sent_to_form($sent_to);
348 348
             $html .= Display::tag(
349 349
                 'td',
350
-                get_lang('SentTo').': ' . $sent_to_form,
350
+                get_lang('SentTo').': '.$sent_to_form,
351 351
                 array('class' => 'announcements_datum')
352 352
             );
353 353
         }
@@ -357,15 +357,15 @@  discard block
 block discarded – undo
357 357
             $html .= "<tr><td>";
358 358
             $realname = $attachment_list['path'];
359 359
             $user_filename = $attachment_list['filename'];
360
-            $full_file_name = 'download.php?'.api_get_cidreq().'&file=' . $realname;
360
+            $full_file_name = 'download.php?'.api_get_cidreq().'&file='.$realname;
361 361
             $html .= '<br/>';
362 362
             $html .= Display::return_icon('attachment.gif', get_lang('Attachment'));
363
-            $html .= '<a href="' . $full_file_name . ' "> ' . $user_filename . ' </a>';
364
-            $html .= ' - <span class="forum_attach_comment" >' . $attachment_list['comment'] . '</span>';
363
+            $html .= '<a href="'.$full_file_name.' "> '.$user_filename.' </a>';
364
+            $html .= ' - <span class="forum_attach_comment" >'.$attachment_list['comment'].'</span>';
365 365
             if (api_is_allowed_to_edit(false, true)) {
366 366
                 $html .= Display::url(
367 367
                     Display::return_icon('delete.png', get_lang('Delete'), '', 16),
368
-                    api_get_self() . "?" . api_get_cidreq() . "&action=delete_attachment&id_attach=" . $attachment_list['id'] . "&sec_token=" . $stok
368
+                    api_get_self()."?".api_get_cidreq()."&action=delete_attachment&id_attach=".$attachment_list['id']."&sec_token=".$stok
369 369
                 );
370 370
             }
371 371
             $html .= '</td></tr>';
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
         $order = 0;
391 391
         if (Database::num_rows($res_max)) {
392 392
             $row_max = Database::fetch_array($res_max);
393
-            $order = intval($row_max[0])+1;
393
+            $order = intval($row_max[0]) + 1;
394 394
         }
395 395
 
396 396
         return $order;
@@ -831,8 +831,8 @@  discard block
 block discarded – undo
831 831
             $result = array();
832 832
             if ($num_rows > 0) {
833 833
                 while ($myrow = Database::fetch_array($rs)) {
834
-                    $content.= '<strong>' . $myrow['title'] . '</strong><br /><br />';
835
-                    $content.= $myrow['content'];
834
+                    $content .= '<strong>'.$myrow['title'].'</strong><br /><br />';
835
+                    $content .= $myrow['content'];
836 836
                     $i++;
837 837
                 }
838 838
                 $result['content'] = $content;
@@ -954,14 +954,14 @@  discard block
 block discarded – undo
954 954
             switch ($to_group) {
955 955
                 // it was send to one specific user
956 956
                 case null:
957
-                    $to[] = "USER:" . $row['to_user_id'];
957
+                    $to[] = "USER:".$row['to_user_id'];
958 958
                     break;
959 959
                 // it was sent to everyone
960 960
                 case 0:
961 961
                     return "everyone";
962 962
                     break;
963 963
                 default:
964
-                    $to[] = "GROUP:" . $row['to_group_id'];
964
+                    $to[] = "GROUP:".$row['to_group_id'];
965 965
             }
966 966
         }
967 967
         return $to;
@@ -1024,10 +1024,10 @@  discard block
 block discarded – undo
1024 1024
                 $sent_to_array['groups'][0] !== 0
1025 1025
             ) {
1026 1026
                 $group_id = $sent_to_array['groups'][0];
1027
-                $output[] = "&nbsp;" . $group_names[$group_id]['name'];
1027
+                $output[] = "&nbsp;".$group_names[$group_id]['name'];
1028 1028
             }
1029 1029
             if (empty($sent_to_array['groups']) and empty($sent_to_array['users'])) {
1030
-                $output[] = "&nbsp;" . get_lang('Everybody');
1030
+                $output[] = "&nbsp;".get_lang('Everybody');
1031 1031
             }
1032 1032
         }
1033 1033
 
@@ -1060,7 +1060,7 @@  discard block
 block discarded – undo
1060 1060
 
1061 1061
         $sql = "SELECT to_group_id, to_user_id
1062 1062
                 FROM $tbl_item_property
1063
-                WHERE c_id = $course_id AND tool = '$tool' AND ref=" . $id;
1063
+                WHERE c_id = $course_id AND tool = '$tool' AND ref=".$id;
1064 1064
         $result = Database::query($sql);
1065 1065
 
1066 1066
         while ($row = Database::fetch_array($result)) {
@@ -1102,8 +1102,8 @@  discard block
 block discarded – undo
1102 1102
         $course_id = api_get_course_int_id();
1103 1103
         $row = array();
1104 1104
         $sql = 'SELECT id, path, filename, comment 
1105
-                FROM ' . $tbl_announcement_attachment . '
1106
-				WHERE c_id = ' . $course_id . ' AND announcement_id = ' . $announcementId;
1105
+                FROM ' . $tbl_announcement_attachment.'
1106
+				WHERE c_id = ' . $course_id.' AND announcement_id = '.$announcementId;
1107 1107
         $result = Database::query($sql);
1108 1108
         if (Database::num_rows($result) != 0) {
1109 1109
             $row = Database::fetch_array($result, 'ASSOC');
@@ -1128,9 +1128,9 @@  discard block
 block discarded – undo
1128 1128
 
1129 1129
         if (is_array($file) && $file['error'] == 0) {
1130 1130
             // TODO: This path is obsolete. The new document repository scheme should be kept in mind here.
1131
-            $courseDir = $_course['path'] . '/upload/announcements';
1131
+            $courseDir = $_course['path'].'/upload/announcements';
1132 1132
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
1133
-            $updir = $sys_course_path . $courseDir;
1133
+            $updir = $sys_course_path.$courseDir;
1134 1134
 
1135 1135
             // Try to add an extension to the file if it hasn't one
1136 1136
             $new_file_name = add_ext_on_mime(stripslashes($file['name']), $file['type']);
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
                 Display :: display_error_message(get_lang('UplUnableToSaveFileFilteredExtension'));
1143 1143
             } else {
1144 1144
                 $new_file_name = uniqid('');
1145
-                $new_path = $updir . '/' . $new_file_name;
1145
+                $new_path = $updir.'/'.$new_file_name;
1146 1146
 
1147 1147
                 // This file is copy here but its cleaned in api_mail_html in api.lib.php
1148 1148
                 copy($file['tmp_name'], $new_path);
@@ -1185,9 +1185,9 @@  discard block
 block discarded – undo
1185 1185
 
1186 1186
         if (is_array($file) && $file['error'] == 0) {
1187 1187
             // TODO: This path is obsolete. The new document repository scheme should be kept in mind here.
1188
-            $courseDir = $_course['path'] . '/upload/announcements';
1188
+            $courseDir = $_course['path'].'/upload/announcements';
1189 1189
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
1190
-            $updir = $sys_course_path . $courseDir;
1190
+            $updir = $sys_course_path.$courseDir;
1191 1191
 
1192 1192
             // Try to add an extension to the file if it hasn't one
1193 1193
             $new_file_name = add_ext_on_mime(stripslashes($file['name']), $file['type']);
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
                 Display :: display_error_message(get_lang('UplUnableToSaveFileFilteredExtension'));
1200 1200
             } else {
1201 1201
                 $new_file_name = uniqid('');
1202
-                $new_path = $updir . '/' . $new_file_name;
1202
+                $new_path = $updir.'/'.$new_file_name;
1203 1203
                 copy($file['tmp_name'], $new_path);
1204 1204
                 $safe_file_comment = Database::escape_string($file_comment);
1205 1205
                 $safe_file_name = Database::escape_string($file_name);
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
                             filename = '$safe_file_name', 
1210 1210
                             comment = '$safe_file_comment', 
1211 1211
                             path = '$safe_new_file_name', 
1212
-                            size ='" . intval($file['size']) . "'
1212
+                            size ='".intval($file['size'])."'
1213 1213
 					 	WHERE c_id = $course_id AND id = '$id_attach'";
1214 1214
                 $result = Database::query($sql);
1215 1215
                 if ($result === false) {
@@ -1527,8 +1527,8 @@  discard block
 block discarded – undo
1527 1527
                 if ($myrow['email_sent'] == '1') {
1528 1528
                     $sent_to_icon = ' '.Display::return_icon('email.gif', get_lang('AnnounceSentByEmail'));
1529 1529
                 }
1530
-                $groupReference = ($myrow['to_group_id'] > 0) ? ' <span class="label label-info">' . get_lang('Group') . '</span> ' : '' ;
1531
-                $title = $myrow['title'] . $groupReference . $sent_to_icon;
1530
+                $groupReference = ($myrow['to_group_id'] > 0) ? ' <span class="label label-info">'.get_lang('Group').'</span> ' : '';
1531
+                $title = $myrow['title'].$groupReference.$sent_to_icon;
1532 1532
                 $item_visibility = api_get_item_visibility($_course, TOOL_ANNOUNCEMENT, $myrow['id'], $session_id);
1533 1533
                 $myrow['visibility'] = $item_visibility;
1534 1534
 
@@ -1536,8 +1536,8 @@  discard block
 block discarded – undo
1536 1536
                 $attachment_list = AnnouncementManager::get_attachment($myrow['id']);
1537 1537
 
1538 1538
                 $attachment_icon = '';
1539
-                if (count($attachment_list)>0) {
1540
-                    $attachment_icon = ' '.Display::return_icon('attachment.gif',get_lang('Attachment'));
1539
+                if (count($attachment_list) > 0) {
1540
+                    $attachment_icon = ' '.Display::return_icon('attachment.gif', get_lang('Attachment'));
1541 1541
                 }
1542 1542
 
1543 1543
                 /* TITLE */
@@ -1556,16 +1556,16 @@  discard block
 block discarded – undo
1556 1556
                     || (api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous())
1557 1557
                 ) {
1558 1558
                     $modify_icons = "<a href=\"".$actionUrl."&action=modify&id=".$myrow['id']."\">".
1559
-                        Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL)."</a>";
1560
-                    if ($myrow['visibility']==1) {
1561
-                        $image_visibility="visible";
1562
-                        $alt_visibility=get_lang('Hide');
1559
+                        Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>";
1560
+                    if ($myrow['visibility'] == 1) {
1561
+                        $image_visibility = "visible";
1562
+                        $alt_visibility = get_lang('Hide');
1563 1563
                     } else {
1564
-                        $image_visibility="invisible";
1565
-                        $alt_visibility=get_lang('Visible');
1564
+                        $image_visibility = "invisible";
1565
+                        $alt_visibility = get_lang('Visible');
1566 1566
                     }
1567
-                    $modify_icons .=  "<a href=\"".$actionUrl."&action=showhide&id=".$myrow['id']."&sec_token=".$stok."\">".
1568
-                        Display::return_icon($image_visibility.'.png', $alt_visibility,'',ICON_SIZE_SMALL)."</a>";
1567
+                    $modify_icons .= "<a href=\"".$actionUrl."&action=showhide&id=".$myrow['id']."&sec_token=".$stok."\">".
1568
+                        Display::return_icon($image_visibility.'.png', $alt_visibility, '', ICON_SIZE_SMALL)."</a>";
1569 1569
 
1570 1570
                     // DISPLAY MOVE UP COMMAND only if it is not the top announcement
1571 1571
                     if ($iterator != 1) {
@@ -1580,12 +1580,12 @@  discard block
 block discarded – undo
1580 1580
                     } else {
1581 1581
                         $modify_icons .= Display::return_icon('down_na.gif', get_lang('Down'));
1582 1582
                     }
1583
-                    if (api_is_allowed_to_edit(false,true)) {
1584
-                        $modify_icons .= "<a href=\"".$actionUrl."&action=delete&id=".$myrow['id']."&sec_token=".$stok."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,api_get_system_encoding()))."')) return false;\">".
1585
-                            Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).
1583
+                    if (api_is_allowed_to_edit(false, true)) {
1584
+                        $modify_icons .= "<a href=\"".$actionUrl."&action=delete&id=".$myrow['id']."&sec_token=".$stok."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, api_get_system_encoding()))."')) return false;\">".
1585
+                            Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).
1586 1586
                             "</a>";
1587 1587
                     }
1588
-                    $iterator ++;
1588
+                    $iterator++;
1589 1589
                 } else {
1590 1590
                     $modify_icons = Display::url(
1591 1591
                         Display::return_icon('default.png'),
@@ -1631,7 +1631,7 @@  discard block
 block discarded – undo
1631 1631
             'announcement.session_id'
1632 1632
         );
1633 1633
 
1634
-        if (api_is_allowed_to_edit(false,true))  {
1634
+        if (api_is_allowed_to_edit(false, true)) {
1635 1635
             // check teacher status
1636 1636
             if (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath') {
1637 1637
 
@@ -1700,7 +1700,7 @@  discard block
 block discarded – undo
1700 1700
 
1701 1701
                 // the user is member of several groups => display personal announcements AND
1702 1702
                 // his group announcements AND the general announcements
1703
-                if (is_array($group_memberships) && count($group_memberships)>0) {
1703
+                if (is_array($group_memberships) && count($group_memberships) > 0) {
1704 1704
                     $sql = "SELECT announcement.*, ip.visibility, ip.to_group_id, ip.insert_user_id
1705 1705
                             FROM $tbl_announcement announcement 
1706 1706
                             INNER JOIN $tbl_item_property ip
Please login to merge, or discard this patch.
main/exercise/admin.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
  */
49 49
 
50 50
 require_once __DIR__.'/../inc/global.inc.php';
51
-$current_course_tool  = TOOL_QUIZ;
51
+$current_course_tool = TOOL_QUIZ;
52 52
 $this_section = SECTION_COURSES;
53 53
 
54 54
 // Access control
@@ -64,20 +64,20 @@  discard block
 block discarded – undo
64 64
 
65 65
 /*  stripslashes POST data  */
66 66
 if ($_SERVER['REQUEST_METHOD'] == 'POST') {
67
-    foreach($_POST as $key=>$val) {
68
-        if(is_string($val)) {
69
-            $_POST[$key]=stripslashes($val);
70
-        } elseif(is_array($val)) {
71
-            foreach($val as $key2=>$val2) {
72
-                $_POST[$key][$key2]=stripslashes($val2);
67
+    foreach ($_POST as $key=>$val) {
68
+        if (is_string($val)) {
69
+            $_POST[$key] = stripslashes($val);
70
+        } elseif (is_array($val)) {
71
+            foreach ($val as $key2=>$val2) {
72
+                $_POST[$key][$key2] = stripslashes($val2);
73 73
             }
74 74
         }
75
-        $GLOBALS[$key]=$_POST[$key];
75
+        $GLOBALS[$key] = $_POST[$key];
76 76
     }
77 77
 }
78 78
 
79 79
 if (empty($exerciseId)) {
80
-    $exerciseId = isset($_GET['exerciseId']) ? intval($_GET['exerciseId']):'0';
80
+    $exerciseId = isset($_GET['exerciseId']) ? intval($_GET['exerciseId']) : '0';
81 81
 }
82 82
 
83 83
 $newQuestion = isset($_GET['newQuestion']) ? $_GET['newQuestion'] : 0;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 if (!empty($_GET['action']) && $_GET['action'] == 'exportqti2' && !empty($_GET['questionId'])) {
152 152
     require_once 'export/qti2/qti2_export.php';
153 153
     $export = export_question_qti($_GET['questionId'], true);
154
-    $qid = (int)$_GET['questionId'];
154
+    $qid = (int) $_GET['questionId'];
155 155
     $archive_path = api_get_path(SYS_ARCHIVE_PATH);
156 156
     $temp_dir_short = uniqid();
157 157
     $temp_zip_dir = $archive_path."/".$temp_dir_short;
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 if (!$fromExercise) {
196 196
     // gets the right exercise ID, and if 0 creates a new exercise
197 197
     if (!$exerciseId = $objExercise->selectId()) {
198
-        $modifyExercise='yes';
198
+        $modifyExercise = 'yes';
199 199
     }
200 200
 }
201 201
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     } else {
246 246
         // goes back to the question viewing
247 247
         $editQuestion = $modifyQuestion;
248
-        unset($newQuestion,$modifyQuestion);
248
+        unset($newQuestion, $modifyQuestion);
249 249
     }
250 250
 }
251 251
 
@@ -281,27 +281,27 @@  discard block
 block discarded – undo
281 281
     $nameTools = get_lang('QuestionManagement');
282 282
 }
283 283
 
284
-if (isset($_SESSION['gradebook'])){
285
-    $gradebook=	$_SESSION['gradebook'];
284
+if (isset($_SESSION['gradebook'])) {
285
+    $gradebook = $_SESSION['gradebook'];
286 286
 }
287 287
 
288
-if (!empty($gradebook) && $gradebook=='view') {
289
-    $interbreadcrumb[]= array(
288
+if (!empty($gradebook) && $gradebook == 'view') {
289
+    $interbreadcrumb[] = array(
290 290
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
291 291
         'name' => get_lang('ToolGradebook')
292 292
     );
293 293
 }
294 294
 
295
-$interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises'));
296
-if (isset($_GET['newQuestion']) || isset($_GET['editQuestion']) ) {
295
+$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises'));
296
+if (isset($_GET['newQuestion']) || isset($_GET['editQuestion'])) {
297 297
     $interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->name);
298 298
 } else {
299 299
     $interbreadcrumb[] = array("url" => "#", "name" => $objExercise->name);
300 300
 }
301 301
 
302 302
 // shows a link to go back to the question pool
303
-if (!$exerciseId && $nameTools != get_lang('ExerciseManagement')){
304
-    $interbreadcrumb[]=array(
303
+if (!$exerciseId && $nameTools != get_lang('ExerciseManagement')) {
304
+    $interbreadcrumb[] = array(
305 305
         "url" => api_get_path(WEB_CODE_PATH)."exercise/question_pool.php?fromExercise=$fromExercise&".api_get_cidreq(),
306 306
         "name" => get_lang('QuestionPool')
307 307
     );
@@ -309,10 +309,10 @@  discard block
 block discarded – undo
309 309
 
310 310
 // if the question is duplicated, disable the link of tool name
311 311
 if ($modifyIn == 'thisExercise') {
312
-    if($buttonBack)	{
313
-        $modifyIn='allExercises';
312
+    if ($buttonBack) {
313
+        $modifyIn = 'allExercises';
314 314
     } else {
315
-        $noPHP_SELF=true;
315
+        $noPHP_SELF = true;
316 316
     }
317 317
 }
318 318
 $htmlHeadXtra[] = '<script>
@@ -344,10 +344,10 @@  discard block
 block discarded – undo
344 344
 $htmlHeadXtra[] = $template->fetch($templateName);
345 345
 $htmlHeadXtra[] = api_get_js('d3/jquery.xcolor.js');
346 346
 
347
-$htmlHeadXtra[] = '<link rel="stylesheet" href="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/css/hotspot.css">';
348
-$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/js/hotspot.js"></script>';
347
+$htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_JS_PATH).'hotspot/css/hotspot.css">';
348
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_JS_PATH).'hotspot/js/hotspot.js"></script>';
349 349
 
350
-Display::display_header($nameTools,'Exercise');
350
+Display::display_header($nameTools, 'Exercise');
351 351
 /*
352 352
 if ($objExercise->exercise_was_added_in_lp) {
353 353
     if ($objExercise->force_edit_exercise_in_lp == true) {
@@ -364,22 +364,22 @@  discard block
 block discarded – undo
364 364
     echo '<div class="actions">';
365 365
     if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['myid']))
366 366
         echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/admin.php?exerciseId='.$exerciseId.'&'.api_get_cidreq().'">'.
367
-            Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
367
+            Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>';
368 368
 
369
-    if (!isset($_GET['hotspotadmin']) && !isset($_GET['newQuestion']) && !isset($_GET['myid']) &&  !isset($_GET['editQuestion'])) {
369
+    if (!isset($_GET['hotspotadmin']) && !isset($_GET['newQuestion']) && !isset($_GET['myid']) && !isset($_GET['editQuestion'])) {
370 370
         echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?'.api_get_cidreq().'">'.
371
-            Display::return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
371
+            Display::return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).'</a>';
372 372
     }
373 373
     echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/overview.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&preview=1">'.
374
-        Display::return_icon('preview_view.png', get_lang('Preview'),'',ICON_SIZE_MEDIUM).'</a>';
374
+        Display::return_icon('preview_view.png', get_lang('Preview'), '', ICON_SIZE_MEDIUM).'</a>';
375 375
 
376 376
     echo Display::url(
377
-        Display::return_icon('test_results.png', get_lang('Results'),'',ICON_SIZE_MEDIUM),
377
+        Display::return_icon('test_results.png', get_lang('Results'), '', ICON_SIZE_MEDIUM),
378 378
         api_get_path(WEB_CODE_PATH).'exercise/exercise_report.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id
379 379
     );
380 380
 
381 381
     echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$objExercise->id.'">'.
382
-        Display::return_icon('settings.png', get_lang('ModifyExercise'),'',ICON_SIZE_MEDIUM).'</a>';
382
+        Display::return_icon('settings.png', get_lang('ModifyExercise'), '', ICON_SIZE_MEDIUM).'</a>';
383 383
 
384 384
     $maxScoreAllQuestions = 0;
385 385
     if (!empty($objExercise->questionList)) {
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
     echo '<div class="alert alert-info">'.
396 396
         sprintf(get_lang('XQuestionsWithTotalScoreY'), $objExercise->selectNbrQuestions(), $maxScoreAllQuestions);
397 397
     if ($objExercise->random > 0) {
398
-        echo '<br />' .
398
+        echo '<br />'.
399 399
             sprintf(get_lang('OnlyXQuestionsPickedRandomly'), $objExercise->random);
400 400
     }
401 401
     echo '</div>';
@@ -404,13 +404,13 @@  discard block
 block discarded – undo
404 404
     // we are in create a new question from question pool not in a test
405 405
     echo '<div class="actions">';
406 406
     echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'">'.
407
-        Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
407
+        Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>';
408 408
     echo '</div>';
409 409
 } else {
410 410
     // If we are in question_pool but not in an test, go back to question create in pool
411 411
     echo '<div class="actions">';
412 412
     echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/question_pool.php?'.api_get_cidreq().'">'.
413
-        Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).
413
+        Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).
414 414
         '</a>';
415 415
     echo '</div>';
416 416
 }
Please login to merge, or discard this patch.
main/inc/lib/document.lib.php 1 patch
Spacing   +331 added lines, -331 removed lines patch added patch discarded remove patch
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
             return true;
291 291
         } else {
292 292
             $tbl_document = Database::get_course_table(TABLE_DOCUMENT);
293
-            $tbl_item_property = $this_course . 'item_property';
293
+            $tbl_item_property = $this_course.'item_property';
294 294
             $doc_url = Database::escape_string($doc_url);
295 295
             $query = "SELECT 1 FROM $tbl_document AS docs,$tbl_item_property AS props
296 296
                       WHERE
@@ -340,18 +340,18 @@  discard block
 block discarded – undo
340 340
             }
341 341
 
342 342
             header('Content-type: application/octet-stream');
343
-            header('Content-length: ' . $len);
343
+            header('Content-length: '.$len);
344 344
             if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {
345
-                header('Content-Disposition: filename= ' . $filename);
345
+                header('Content-Disposition: filename= '.$filename);
346 346
             } else {
347
-                header('Content-Disposition: attachment; filename= ' . $filename);
347
+                header('Content-Disposition: attachment; filename= '.$filename);
348 348
             }
349 349
             if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
350 350
                 header('Pragma: ');
351 351
                 header('Cache-Control: ');
352 352
                 header('Cache-Control: public'); // IE cannot download from sessions without a cache
353 353
             }
354
-            header('Content-Description: ' . $filename);
354
+            header('Content-Description: '.$filename);
355 355
             header('Content-Transfer-Encoding: binary');
356 356
 
357 357
             $res = fopen($full_file_name, 'r');
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
                     } else {
379 379
                         $encoding = @api_detect_encoding_html(file_get_contents($full_file_name));
380 380
                         if (!empty($encoding)) {
381
-                            $content_type .= '; charset=' . $encoding;
381
+                            $content_type .= '; charset='.$encoding;
382 382
                         }
383 383
                     }
384 384
                     break;
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
                     } else {
389 389
                         $encoding = @api_detect_encoding(strip_tags(file_get_contents($full_file_name)));
390 390
                         if (!empty($encoding)) {
391
-                            $content_type .= '; charset=' . $encoding;
391
+                            $content_type .= '; charset='.$encoding;
392 392
                         }
393 393
                     }
394 394
                     break;
@@ -397,13 +397,13 @@  discard block
 block discarded – undo
397 397
                     header('Content-type: application/octet-stream');
398 398
                     break;
399 399
             }
400
-            header('Content-type: ' . $content_type);
401
-            header('Content-Length: ' . $len);
400
+            header('Content-type: '.$content_type);
401
+            header('Content-Length: '.$len);
402 402
             $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
403 403
             if (strpos($user_agent, 'msie')) {
404
-                header('Content-Disposition: ; filename= ' . $filename);
404
+                header('Content-Disposition: ; filename= '.$filename);
405 405
             } else {
406
-                header('Content-Disposition: inline; filename= ' . $filename);
406
+                header('Content-Disposition: inline; filename= '.$filename);
407 407
             }
408 408
 
409 409
             if ($fixLinksHttpToHttps) {
@@ -444,18 +444,18 @@  discard block
 block discarded – undo
444 444
 
445 445
             header('Content-type: application/octet-stream');
446 446
             //header('Content-Type: application/force-download');
447
-            header('Content-length: ' . $len);
447
+            header('Content-length: '.$len);
448 448
             if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {
449
-                header('Content-Disposition: filename= ' . $filename);
449
+                header('Content-Disposition: filename= '.$filename);
450 450
             } else {
451
-                header('Content-Disposition: attachment; filename= ' . $filename);
451
+                header('Content-Disposition: attachment; filename= '.$filename);
452 452
             }
453 453
             if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
454 454
                 header('Pragma: ');
455 455
                 header('Cache-Control: ');
456 456
                 header('Cache-Control: public'); // IE cannot download from sessions without a cache
457 457
             }
458
-            header('Content-Description: ' . $filename);
458
+            header('Content-Description: '.$filename);
459 459
             header('Content-transfer-encoding: binary');
460 460
             echo $full_string;
461 461
 
@@ -468,30 +468,30 @@  discard block
 block discarded – undo
468 468
 
469 469
             $content_type = self::file_get_mime_type($filename);
470 470
             header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');
471
-            header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
471
+            header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
472 472
             header('Cache-Control: no-cache, must-revalidate');
473 473
             header('Pragma: no-cache');
474 474
             switch ($content_type) {
475 475
                 case 'text/html':
476 476
                     $encoding = @api_detect_encoding_html($full_string);
477 477
                     if (!empty($encoding)) {
478
-                        $content_type .= '; charset=' . $encoding;
478
+                        $content_type .= '; charset='.$encoding;
479 479
                     }
480 480
                     break;
481 481
                 case 'text/plain':
482 482
                     $encoding = @api_detect_encoding(strip_tags($full_string));
483 483
                     if (!empty($encoding)) {
484
-                        $content_type .= '; charset=' . $encoding;
484
+                        $content_type .= '; charset='.$encoding;
485 485
                     }
486 486
                     break;
487 487
             }
488
-            header('Content-type: ' . $content_type);
489
-            header('Content-Length: ' . $len);
488
+            header('Content-type: '.$content_type);
489
+            header('Content-Length: '.$len);
490 490
             $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
491 491
             if (strpos($user_agent, 'msie')) {
492
-                header('Content-Disposition: ; filename= ' . $filename);
492
+                header('Content-Disposition: ; filename= '.$filename);
493 493
             } else {
494
-                header('Content-Disposition: inline; filename= ' . $filename);
494
+                header('Content-Disposition: inline; filename= '.$filename);
495 495
             }
496 496
             echo($full_string);
497 497
             //You have to ensure that the calling script then stops processing (exit();)
@@ -586,9 +586,9 @@  discard block
 block discarded – undo
586 586
             if (!empty($students)) {
587 587
                 $conditionList = array();
588 588
                 foreach ($students as $studentId => $studentInfo) {
589
-                    $conditionList[] = '/shared_folder/sf_user_' . $studentInfo['user_id'];
589
+                    $conditionList[] = '/shared_folder/sf_user_'.$studentInfo['user_id'];
590 590
                 }
591
-                $sharedCondition .= ' AND docs.path IN ("' . implode('","', $conditionList) . '")';
591
+                $sharedCondition .= ' AND docs.path IN ("'.implode('","', $conditionList).'")';
592 592
             }
593 593
         }
594 594
 
@@ -615,8 +615,8 @@  discard block
 block discarded – undo
615 615
                     last.tool = '".TOOL_DOCUMENT."' AND 
616 616
                     docs.c_id = {$_course['real_id']} AND
617 617
                     last.c_id = {$_course['real_id']} AND
618
-                    docs.path LIKE '" . Database::escape_string($path . $added_slash.'%'). "' AND
619
-                    docs.path NOT LIKE '" . Database::escape_string($path . $added_slash.'%/%')."' AND
618
+                    docs.path LIKE '".Database::escape_string($path.$added_slash.'%')."' AND
619
+                    docs.path NOT LIKE '" . Database::escape_string($path.$added_slash.'%/%')."' AND
620 620
                     docs.path NOT LIKE '%_DELETED_%' AND
621 621
                     $userGroupFilter AND
622 622
                     last.visibility $visibility_bit
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
                     $table_template = Database::get_main_table(TABLE_MAIN_TEMPLATES);
658 658
                     $sql = "SELECT id FROM $table_template
659 659
                             WHERE
660
-                                course_code = '" . $_course['code'] . "' AND
660
+                                course_code = '".$_course['code']."' AND
661 661
                                 user_id = '".api_get_user_id()."' AND
662 662
                                 ref_doc = '".$row['id']."'";
663 663
                     $template_result = Database::query($sql);
@@ -770,7 +770,7 @@  discard block
 block discarded – undo
770 770
         $conditionList = array();
771 771
         if (!empty($students)) {
772 772
             foreach ($students as $studentId => $studentInfo) {
773
-                $conditionList[] = '/shared_folder/sf_user_' . $studentInfo['user_id'];
773
+                $conditionList[] = '/shared_folder/sf_user_'.$studentInfo['user_id'];
774 774
             }
775 775
         }
776 776
 
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
                             docs.c_id = last.c_id
803 803
                        )
804 804
                        WHERE                       
805
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
805
+                            last.tool = '".TOOL_DOCUMENT."' AND
806 806
                             last.c_id = {$_course['real_id']} AND
807 807
                             docs.c_id = {$_course['real_id']} AND
808 808
                             docs.filetype = 'folder' AND
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
                             docs.c_id = last.c_id                          
821 821
                         )
822 822
                         WHERE
823
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
823
+                            last.tool = '".TOOL_DOCUMENT."' AND
824 824
                             last.c_id = {$_course['real_id']} AND
825 825
                             docs.c_id = {$_course['real_id']} AND
826 826
                             docs.filetype = 'folder' AND
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
                     ON (docs.id = last.ref AND last.c_id = docs.c_id)
877 877
                     WHERE
878 878
                         $fileType
879
-                        last.tool = '" . TOOL_DOCUMENT . "' AND
879
+                        last.tool = '".TOOL_DOCUMENT."' AND
880 880
                         $groupCondition AND
881 881
                         $visibilityCondition
882 882
                         $show_users_condition
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
                     ON (docs.id = last.ref AND last.c_id = docs.c_id)
906 906
                     WHERE                        
907 907
                         docs.filetype = 'folder' AND
908
-                        last.tool = '" . TOOL_DOCUMENT . "' AND
908
+                        last.tool = '".TOOL_DOCUMENT."' AND
909 909
                         $groupCondition AND
910 910
                         last.visibility = 0 $condition_session AND
911 911
                         last.c_id = {$_course['real_id']} AND
@@ -922,9 +922,9 @@  discard block
 block discarded – undo
922 922
                         INNER JOIN $TABLE_DOCUMENT AS docs
923 923
                         ON (docs.id = last.ref AND docs.c_id = last.c_id)
924 924
                         WHERE                            
925
-                            docs.path LIKE '" . Database::escape_string($row['path'].'/%') . "' AND
925
+                            docs.path LIKE '".Database::escape_string($row['path'].'/%')."' AND
926 926
                             docs.filetype = 'folder' AND
927
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
927
+                            last.tool = '" . TOOL_DOCUMENT."' AND
928 928
                             $groupCondition AND
929 929
                             last.visibility = 1 $condition_session AND
930 930
                             last.c_id = {$_course['real_id']} AND
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
                                 td.c_id = $course_id AND
1003 1003
                                 tp.c_id = $course_id AND
1004 1004
                                 td.session_id = $sessionId AND                                
1005
-                                (path='" . $path . "' OR path LIKE BINARY '" . $path . "/%' ) ";
1005
+                                (path='".$path."' OR path LIKE BINARY '".$path."/%' ) ";
1006 1006
                     // Get all id's of documents that are deleted
1007 1007
                     $what_to_check_result = Database::query($sql);
1008 1008
 
@@ -1352,7 +1352,7 @@  discard block
 block discarded – undo
1352 1352
             $res = Database::query($sql);
1353 1353
             if (Database::num_rows($res) > 0) {
1354 1354
                 $row2 = Database::fetch_array($res);
1355
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
1355
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
1356 1356
                 $di = new ChamiloIndexer();
1357 1357
                 $di->remove_document((int) $row2['search_did']);
1358 1358
             }
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
             Database::query($sql);
1362 1362
 
1363 1363
             // remove terms from db
1364
-            require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
1364
+            require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
1365 1365
             delete_all_values_for_item($course_id, TOOL_DOCUMENT, $document_id);
1366 1366
         }
1367 1367
     }
@@ -1447,12 +1447,12 @@  discard block
 block discarded – undo
1447 1447
             $path = str_replace('%2F', '/', $url_path);
1448 1448
             $pathinfo = pathinfo($row['path']);
1449 1449
 
1450
-            $row['url'] = api_get_path(WEB_CODE_PATH) . 'document/showinframes.php?cidReq=' . $course_code . '&id=' . $id;
1451
-            $row['document_url'] = api_get_path(WEB_CODE_PATH) . 'document/document.php?cidReq=' . $course_code . '&id=' . $id;
1452
-            $row['absolute_path'] = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $row['path'];
1453
-            $row['absolute_path_from_document'] = '/document' . $row['path'];
1454
-            $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'] . '/';
1455
-            $row['direct_url'] = $www . $path;
1450
+            $row['url'] = api_get_path(WEB_CODE_PATH).'document/showinframes.php?cidReq='.$course_code.'&id='.$id;
1451
+            $row['document_url'] = api_get_path(WEB_CODE_PATH).'document/document.php?cidReq='.$course_code.'&id='.$id;
1452
+            $row['absolute_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$row['path'];
1453
+            $row['absolute_path_from_document'] = '/document'.$row['path'];
1454
+            $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'].'/';
1455
+            $row['direct_url'] = $www.$path;
1456 1456
             $row['basename'] = basename($row['path']);
1457 1457
 
1458 1458
             if (dirname($row['path']) == '.') {
@@ -1472,7 +1472,7 @@  discard block
 block discarded – undo
1472 1472
                 $real_dir = '';
1473 1473
 
1474 1474
                 for ($i = 1; $i < $array_len; $i++) {
1475
-                    $real_dir .= '/' . (isset($dir_array[$i]) ? $dir_array[$i] : '');
1475
+                    $real_dir .= '/'.(isset($dir_array[$i]) ? $dir_array[$i] : '');
1476 1476
                     $parent_id = self::get_document_id($course_info, $real_dir);
1477 1477
                     if ($session_id != 0 && empty($parent_id)) {
1478 1478
                         $parent_id = self::get_document_id($course_info, $real_dir, 0);
@@ -1546,21 +1546,21 @@  discard block
 block discarded – undo
1546 1546
         $user_id = intval($user_id);
1547 1547
         $document_id = intval($document_id);
1548 1548
 
1549
-        $sql = 'SELECT id FROM ' . $table_template . '
1549
+        $sql = 'SELECT id FROM '.$table_template.'
1550 1550
                 WHERE
1551
-                    course_code="' . $course_code . '" AND
1552
-                    user_id="' . $user_id . '" AND
1553
-                    ref_doc="' . $document_id . '"';
1551
+                    course_code="' . $course_code.'" AND
1552
+                    user_id="' . $user_id.'" AND
1553
+                    ref_doc="' . $document_id.'"';
1554 1554
         $result = Database::query($sql);
1555 1555
         $template_id = Database::result($result, 0, 0);
1556 1556
 
1557
-        my_delete(api_get_path(SYS_CODE_PATH) . 'upload/template_thumbnails/' . $template_id . '.jpg');
1557
+        my_delete(api_get_path(SYS_CODE_PATH).'upload/template_thumbnails/'.$template_id.'.jpg');
1558 1558
 
1559
-        $sql = 'DELETE FROM ' . $table_template . '
1559
+        $sql = 'DELETE FROM '.$table_template.'
1560 1560
                 WHERE
1561
-                    course_code="' . $course_code . '" AND
1562
-                    user_id="' . $user_id . '" AND
1563
-                    ref_doc="' . $document_id . '"';
1561
+                    course_code="' . $course_code.'" AND
1562
+                    user_id="' . $user_id.'" AND
1563
+                    ref_doc="' . $document_id.'"';
1564 1564
 
1565 1565
         Database::query($sql);
1566 1566
     }
@@ -1623,7 +1623,7 @@  discard block
 block discarded – undo
1623 1623
         		WHERE
1624 1624
         		    d.c_id  = $course_id AND 
1625 1625
         		    ip.c_id = $course_id AND
1626
-        		    ip.tool = '" . TOOL_DOCUMENT . "' $condition AND
1626
+        		    ip.tool = '".TOOL_DOCUMENT."' $condition AND
1627 1627
         			filetype = '$file_type' AND
1628 1628
         			locate(concat(path,'/'), '$doc_path')=1
1629 1629
                 ";
@@ -1797,12 +1797,12 @@  discard block
 block discarded – undo
1797 1797
         if (empty($session_id)) {
1798 1798
             $sql_session = 'AND (session_id = 0 OR isnull(session_id)) ';
1799 1799
         } elseif ($session_id > 0) {
1800
-            $sql_session = 'AND session_id=' . intval($session_id);
1800
+            $sql_session = 'AND session_id='.intval($session_id);
1801 1801
         } else {
1802 1802
             $sql_session = '';
1803 1803
         }
1804
-        $sql = 'UPDATE ' . $tbl_category . ' SET document_id="' . intval($document_id) . '"
1805
-                WHERE course_code="' . Database::escape_string($course_id) . '" ' . $sql_session;
1804
+        $sql = 'UPDATE '.$tbl_category.' SET document_id="'.intval($document_id).'"
1805
+                WHERE course_code="' . Database::escape_string($course_id).'" '.$sql_session;
1806 1806
         Database::query($sql);
1807 1807
     }
1808 1808
 
@@ -1824,12 +1824,12 @@  discard block
 block discarded – undo
1824 1824
         if (empty($session_id)) {
1825 1825
             $sql_session = 'AND (session_id = 0 OR isnull(session_id)) ';
1826 1826
         } elseif ($session_id > 0) {
1827
-            $sql_session = 'AND session_id=' . intval($session_id);
1827
+            $sql_session = 'AND session_id='.intval($session_id);
1828 1828
         } else {
1829 1829
             $sql_session = '';
1830 1830
         }
1831
-        $sql = 'SELECT document_id FROM ' . $tbl_category . '
1832
-                WHERE course_code="' . Database::escape_string($course_id) . '" ' . $sql_session;
1831
+        $sql = 'SELECT document_id FROM '.$tbl_category.'
1832
+                WHERE course_code="' . Database::escape_string($course_id).'" '.$sql_session;
1833 1833
 
1834 1834
         $rs = Database::query($sql);
1835 1835
         $num = Database::num_rows($rs);
@@ -1870,7 +1870,7 @@  discard block
 block discarded – undo
1870 1870
             $all_user_info = array();
1871 1871
             if (Database::num_rows($rs)) {
1872 1872
                 $row = Database::fetch_array($rs);
1873
-                $filepath = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $row['path'];
1873
+                $filepath = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$row['path'];
1874 1874
                 if (is_file($filepath)) {
1875 1875
                     $my_content_html = file_get_contents($filepath);
1876 1876
                 }
@@ -1953,9 +1953,9 @@  discard block
 block discarded – undo
1953 1953
             $date_no_time = api_convert_and_format_date(api_get_utc_datetime(), DATE_FORMAT_LONG_NO_DAY);
1954 1954
         }
1955 1955
 
1956
-        $url = api_get_path(WEB_PATH) . 'certificates/index.php?id=' . $info_grade_certificate['id'];
1956
+        $url = api_get_path(WEB_PATH).'certificates/index.php?id='.$info_grade_certificate['id'];
1957 1957
 
1958
-        $externalStyleFile = api_get_path(SYS_CSS_PATH) . 'themes/' . api_get_visual_theme() . '/certificate.css';
1958
+        $externalStyleFile = api_get_path(SYS_CSS_PATH).'themes/'.api_get_visual_theme().'/certificate.css';
1959 1959
         $externalStyle = '';
1960 1960
 
1961 1961
         if (is_file($externalStyleFile)) {
@@ -1977,7 +1977,7 @@  discard block
 block discarded – undo
1977 1977
             $course_info['name'],
1978 1978
             $info_grade_certificate['grade'],
1979 1979
             $url,
1980
-            '<a href="' . $url . '" target="_blank">' . get_lang('CertificateOnlineLink') . '</a>',
1980
+            '<a href="'.$url.'" target="_blank">'.get_lang('CertificateOnlineLink').'</a>',
1981 1981
             '((certificate_barcode))',
1982 1982
             $externalStyle
1983 1983
         );
@@ -2003,7 +2003,7 @@  discard block
 block discarded – undo
2003 2003
         if (!empty($extraFields)) {
2004 2004
             foreach ($extraFields as $extraField) {
2005 2005
                 $valueExtra = isset($extra_user_info_data[$extraField['variable']]) ? $extra_user_info_data[$extraField['variable']] : '';
2006
-                $info_to_be_replaced_in_content_html[] = '((' . strtolower($extraField['variable']) . '))';
2006
+                $info_to_be_replaced_in_content_html[] = '(('.strtolower($extraField['variable']).'))';
2007 2007
                 $info_to_replace_in_content_html[] = $valueExtra;
2008 2008
             }
2009 2009
         }
@@ -2031,17 +2031,17 @@  discard block
 block discarded – undo
2031 2031
             $tbl_category = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
2032 2032
             $session_id = api_get_session_id();
2033 2033
             if ($session_id == 0 || is_null($session_id)) {
2034
-                $sql_session = 'AND (session_id=' . intval($session_id) . ' OR isnull(session_id)) ';
2034
+                $sql_session = 'AND (session_id='.intval($session_id).' OR isnull(session_id)) ';
2035 2035
             } elseif ($session_id > 0) {
2036
-                $sql_session = 'AND session_id=' . intval($session_id);
2036
+                $sql_session = 'AND session_id='.intval($session_id);
2037 2037
             } else {
2038 2038
                 $sql_session = '';
2039 2039
             }
2040 2040
 
2041
-            $sql = 'UPDATE ' . $tbl_category . ' SET document_id = null
2041
+            $sql = 'UPDATE '.$tbl_category.' SET document_id = null
2042 2042
                     WHERE
2043
-                        course_code = "' . Database::escape_string($course_id) . '" AND
2044
-                        document_id="' . $default_certificate_id . '" ' . $sql_session;
2043
+                        course_code = "' . Database::escape_string($course_id).'" AND
2044
+                        document_id="' . $default_certificate_id.'" '.$sql_session;
2045 2045
             Database::query($sql);
2046 2046
         }
2047 2047
     }
@@ -2056,10 +2056,10 @@  discard block
 block discarded – undo
2056 2056
         if (!empty($courseInfo)) {
2057 2057
             $to_group_id = 0;
2058 2058
             $to_user_id = null;
2059
-            $course_dir = $courseInfo['path'] . "/document/";
2059
+            $course_dir = $courseInfo['path']."/document/";
2060 2060
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
2061
-            $base_work_dir = $sys_course_path . $course_dir;
2062
-            $base_work_dir_test = $base_work_dir . 'certificates';
2061
+            $base_work_dir = $sys_course_path.$course_dir;
2062
+            $base_work_dir_test = $base_work_dir.'certificates';
2063 2063
             $dir_name = '/certificates';
2064 2064
             $post_dir_name = get_lang('CertificatesFiles');
2065 2065
             $visibility_command = 'invisible';
@@ -2285,9 +2285,9 @@  discard block
 block discarded – undo
2285 2285
                                             //$new_abs_path = realpath($dir.'/'.$second_part);
2286 2286
                                             $dir = '';
2287 2287
                                             if (!empty($abs_path)) {
2288
-                                                $dir = dirname($abs_path) . '/';
2288
+                                                $dir = dirname($abs_path).'/';
2289 2289
                                             }
2290
-                                            $new_abs_path = realpath($dir . $second_part);
2290
+                                            $new_abs_path = realpath($dir.$second_part);
2291 2291
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2292 2292
                                             if (count($in_files_list) > 0) {
2293 2293
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2300,9 +2300,9 @@  discard block
 block discarded – undo
2300 2300
                                             $files_list[] = array($second_part, 'local', 'rel');
2301 2301
                                             $dir = '';
2302 2302
                                             if (!empty($abs_path)) {
2303
-                                                $dir = dirname($abs_path) . '/';
2303
+                                                $dir = dirname($abs_path).'/';
2304 2304
                                             }
2305
-                                            $new_abs_path = realpath($dir . $second_part);
2305
+                                            $new_abs_path = realpath($dir.$second_part);
2306 2306
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2307 2307
                                             if (count($in_files_list) > 0) {
2308 2308
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2336,9 +2336,9 @@  discard block
 block discarded – undo
2336 2336
                                             $files_list[] = array($source, 'local', 'rel');
2337 2337
                                             $dir = '';
2338 2338
                                             if (!empty($abs_path)) {
2339
-                                                $dir = dirname($abs_path) . '/';
2339
+                                                $dir = dirname($abs_path).'/';
2340 2340
                                             }
2341
-                                            $new_abs_path = realpath($dir . $source);
2341
+                                            $new_abs_path = realpath($dir.$source);
2342 2342
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2343 2343
                                             if (count($in_files_list) > 0) {
2344 2344
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2351,9 +2351,9 @@  discard block
 block discarded – undo
2351 2351
                                             $files_list[] = array($source, 'local', 'rel');
2352 2352
                                             $dir = '';
2353 2353
                                             if (!empty($abs_path)) {
2354
-                                                $dir = dirname($abs_path) . '/';
2354
+                                                $dir = dirname($abs_path).'/';
2355 2355
                                             }
2356
-                                            $new_abs_path = realpath($dir . $source);
2356
+                                            $new_abs_path = realpath($dir.$source);
2357 2357
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2358 2358
                                             if (count($in_files_list) > 0) {
2359 2359
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2387,9 +2387,9 @@  discard block
 block discarded – undo
2387 2387
                                     $files_list[] = array($source, 'local', 'rel');
2388 2388
                                     $dir = '';
2389 2389
                                     if (!empty($abs_path)) {
2390
-                                        $dir = dirname($abs_path) . '/';
2390
+                                        $dir = dirname($abs_path).'/';
2391 2391
                                     }
2392
-                                    $new_abs_path = realpath($dir . $source);
2392
+                                    $new_abs_path = realpath($dir.$source);
2393 2393
                                     $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2394 2394
                                     if (count($in_files_list) > 0) {
2395 2395
                                         $files_list = array_merge($files_list, $in_files_list);
@@ -2402,9 +2402,9 @@  discard block
 block discarded – undo
2402 2402
                                     $files_list[] = array($source, 'local', 'rel');
2403 2403
                                     $dir = '';
2404 2404
                                     if (!empty($abs_path)) {
2405
-                                        $dir = dirname($abs_path) . '/';
2405
+                                        $dir = dirname($abs_path).'/';
2406 2406
                                     }
2407
-                                    $new_abs_path = realpath($dir . $source);
2407
+                                    $new_abs_path = realpath($dir.$source);
2408 2408
                                     $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2409 2409
                                     if (count($in_files_list) > 0) {
2410 2410
                                         $files_list = array_merge($files_list, $in_files_list);
@@ -2463,24 +2463,24 @@  discard block
 block discarded – undo
2463 2463
             // then possible closing brackets if we were in the opening bracket case
2464 2464
             // OR something like @import()
2465 2465
             $res = preg_match_all(
2466
-                '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]*))' .
2466
+                '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]*))'.
2467 2467
                 // '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]|[^\x00-\x7F])*)' . -> seems to be taking too much
2468 2468
                 // '/(((([A-Za-z_:])([^\x00-\x7F])*)' . -> takes only last letter of parameter name
2469
-                '([ \n\t\r]+)?(' .
2469
+                '([ \n\t\r]+)?('.
2470 2470
                 // '(=([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+))' . -> doesn't restrict close enough to the url itself
2471
-                '(=([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+))' .
2472
-                '|' .
2471
+                '(=([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+))'.
2472
+                '|'.
2473 2473
                 // '(\(([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)\))' . -> doesn't restrict close enough to the url itself
2474
-                '(\(([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+)\))' .
2475
-                '))' .
2476
-                '|' .
2474
+                '(\(([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+)\))'.
2475
+                '))'.
2476
+                '|'.
2477 2477
                 // '(@import([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)))?/', -> takes a lot (like 100's of thousands of empty possibilities)
2478 2478
                 '(@import([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)))/',
2479 2479
                 $attrString,
2480 2480
                 $regs
2481 2481
             );
2482 2482
         } catch (Exception $e) {
2483
-            error_log('Caught exception: ' . $e->getMessage(), 0);
2483
+            error_log('Caught exception: '.$e->getMessage(), 0);
2484 2484
         }
2485 2485
         if ($res) {
2486 2486
             for ($i = 0; $i < count($regs[1]); $i++) {
@@ -2558,14 +2558,14 @@  discard block
 block discarded – undo
2558 2558
                 $orig_course_info_path = $origin_course_info_path;
2559 2559
             }
2560 2560
         } else {
2561
-            $orig_course_path = api_get_path(SYS_COURSE_PATH).$orig_course_info['path'] . '/';
2561
+            $orig_course_path = api_get_path(SYS_COURSE_PATH).$orig_course_info['path'].'/';
2562 2562
             $orig_course_info_path = $orig_course_info['path'];
2563 2563
         }
2564 2564
 
2565 2565
         $destination_course_code = CourseManager::get_course_id_from_path($destination_course_directory);
2566 2566
         $destination_course_info = api_get_course_info($destination_course_code);
2567
-        $dest_course_path = api_get_path(SYS_COURSE_PATH) . $destination_course_directory . '/';
2568
-        $dest_course_path_rel = api_get_path(REL_COURSE_PATH) . $destination_course_directory . '/';
2567
+        $dest_course_path = api_get_path(SYS_COURSE_PATH).$destination_course_directory.'/';
2568
+        $dest_course_path_rel = api_get_path(REL_COURSE_PATH).$destination_course_directory.'/';
2569 2569
 
2570 2570
         $user_id = api_get_user_id();
2571 2571
 
@@ -2574,7 +2574,7 @@  discard block
 block discarded – undo
2574 2574
 
2575 2575
                 // Get information about source url
2576 2576
                 $real_orig_url = $source[0]; // url
2577
-                $scope_url = $source[1];   // scope (local, remote)
2577
+                $scope_url = $source[1]; // scope (local, remote)
2578 2578
                 $type_url = $source[2]; // type (rel, abs, url)
2579 2579
 
2580 2580
                 // Get path and query from origin url
@@ -2586,7 +2586,7 @@  discard block
 block discarded – undo
2586 2586
                 $dest_url_query = '';
2587 2587
 
2588 2588
                 if (!empty($real_orig_query)) {
2589
-                    $dest_url_query = '?' . $real_orig_query;
2589
+                    $dest_url_query = '?'.$real_orig_query;
2590 2590
                     if (strpos($dest_url_query, $origin_course_code) !== false) {
2591 2591
                         $dest_url_query = str_replace($origin_course_code, $destination_course_code, $dest_url_query);
2592 2592
                     }
@@ -2667,7 +2667,7 @@  discard block
 block discarded – undo
2667 2667
 
2668 2668
                                 //$destination_url = $url_course_path . $destination_course_directory . '/' . $document_file . $dest_url_query;
2669 2669
                                 // See BT#7780
2670
-                                $destination_url = $dest_course_path_rel . $document_file . $dest_url_query;
2670
+                                $destination_url = $dest_course_path_rel.$document_file.$dest_url_query;
2671 2671
 
2672 2672
                                 // If the course code doesn't exist in the path? what we do? Nothing! see BT#1985
2673 2673
                                 if (strpos($real_orig_path, $origin_course_code) === false) {
@@ -2702,14 +2702,14 @@  discard block
 block discarded – undo
2702 2702
     public function replace_urls_inside_content_html_when_moving_file($file_name, $original_path, $destiny_path)
2703 2703
     {
2704 2704
         if (substr($original_path, strlen($original_path) - 1, strlen($original_path)) == '/') {
2705
-            $original = $original_path . $file_name;
2705
+            $original = $original_path.$file_name;
2706 2706
         } else {
2707
-            $original = $original_path . '/' . $file_name;
2707
+            $original = $original_path.'/'.$file_name;
2708 2708
         }
2709 2709
         if (substr($destiny_path, strlen($destiny_path) - 1, strlen($destiny_path)) == '/') {
2710
-            $destination = $destiny_path . $file_name;
2710
+            $destination = $destiny_path.$file_name;
2711 2711
         } else {
2712
-            $destination = $destiny_path . '/' . $file_name;
2712
+            $destination = $destiny_path.'/'.$file_name;
2713 2713
         }
2714 2714
         $original_count = count(explode('/', $original));
2715 2715
         $destination_count = count(explode('/', $destination));
@@ -2723,8 +2723,8 @@  discard block
 block discarded – undo
2723 2723
             $mode = 'inside';
2724 2724
         }
2725 2725
         //We do not select the $original_path becayse the file was already moved
2726
-        $content_html = file_get_contents($destiny_path . '/' . $file_name);
2727
-        $destination_file = $destiny_path . '/' . $file_name;
2726
+        $content_html = file_get_contents($destiny_path.'/'.$file_name);
2727
+        $destination_file = $destiny_path.'/'.$file_name;
2728 2728
 
2729 2729
         $pre_original = strstr($original_path, 'document');
2730 2730
         $pre_destin = strstr($destiny_path, 'document');
@@ -2746,11 +2746,11 @@  discard block
 block discarded – undo
2746 2746
         }
2747 2747
 
2748 2748
         if ($pre_original != '') {
2749
-            $pre_original = '..' . $pre_original . '/';
2749
+            $pre_original = '..'.$pre_original.'/';
2750 2750
         }
2751 2751
 
2752 2752
         if ($pre_destin != '') {
2753
-            $pre_destin = '..' . $pre_destin . '/';
2753
+            $pre_destin = '..'.$pre_destin.'/';
2754 2754
         }
2755 2755
 
2756 2756
         $levels = explode('/', $pre_original);
@@ -2768,7 +2768,7 @@  discard block
 block discarded – undo
2768 2768
         //echo '$count_pre_destination_levels '. $count_pre_destination_levels;
2769 2769
         $pre_remove = '';
2770 2770
         for ($i = 1; $i <= $count_pre_destination_levels; $i++) {
2771
-            $pre_remove .='..\/';
2771
+            $pre_remove .= '..\/';
2772 2772
         }
2773 2773
 
2774 2774
         $orig_source_html = DocumentManager::get_resources_from_source_html($content_html);
@@ -2776,9 +2776,9 @@  discard block
 block discarded – undo
2776 2776
         foreach ($orig_source_html as $source) {
2777 2777
 
2778 2778
             // get information about source url
2779
-            $real_orig_url = $source[0];   // url
2780
-            $scope_url = $source[1];   // scope (local, remote)
2781
-            $type_url = $source[2];   // tyle (rel, abs, url)
2779
+            $real_orig_url = $source[0]; // url
2780
+            $scope_url = $source[1]; // scope (local, remote)
2781
+            $type_url = $source[2]; // tyle (rel, abs, url)
2782 2782
             // Get path and query from origin url
2783 2783
             $orig_parse_url = parse_url($real_orig_url);
2784 2784
             $real_orig_path = $orig_parse_url['path'];
@@ -2805,11 +2805,11 @@  discard block
 block discarded – undo
2805 2805
                         $real_orig_url_temp = '';
2806 2806
                         if ($mode == 'inside') {
2807 2807
                             $real_orig_url_temp = str_replace('../', '', $real_orig_url);
2808
-                            $destination_url = $link_to_add . $real_orig_url_temp;
2808
+                            $destination_url = $link_to_add.$real_orig_url_temp;
2809 2809
                         } else {
2810 2810
                             $real_orig_url_temp = $real_orig_url;
2811 2811
 
2812
-                            $destination_url = preg_replace("/" . $pre_remove . "/", '', $real_orig_url, 1);
2812
+                            $destination_url = preg_replace("/".$pre_remove."/", '', $real_orig_url, 1);
2813 2813
                         }
2814 2814
                         if ($real_orig_url == $destination_url) {
2815 2815
                             //echo 'continue2';
@@ -2835,7 +2835,7 @@  discard block
 block discarded – undo
2835 2835
     {
2836 2836
         $course_data = api_get_course_info($course_code);
2837 2837
         $document_data = self::get_document_data_by_id($document_id, $course_code);
2838
-        $file_path = api_get_path(SYS_COURSE_PATH) . $course_data['path'] . '/document' . $document_data['path'];
2838
+        $file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$document_data['path'];
2839 2839
         $pdf = new PDF('A4-L', 'L');
2840 2840
         $pdf->html_to_pdf($file_path, $document_data['title'], $course_code);
2841 2841
     }
@@ -2870,9 +2870,9 @@  discard block
 block discarded – undo
2870 2870
     ) {
2871 2871
         $course_info = api_get_course_info();
2872 2872
         $sessionId = api_get_session_id();
2873
-        $course_dir = $course_info['path'] . '/document';
2873
+        $course_dir = $course_info['path'].'/document';
2874 2874
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
2875
-        $base_work_dir = $sys_course_path . $course_dir;
2875
+        $base_work_dir = $sys_course_path.$course_dir;
2876 2876
 
2877 2877
         $group_properties = GroupManager::get_group_properties(api_get_group_id());
2878 2878
         $groupIid = isset($group_properties['iid']) ? $group_properties['iid'] : 0;
@@ -3060,7 +3060,7 @@  discard block
 block discarded – undo
3060 3060
         }
3061 3061
         if (isset($output)) {
3062 3062
             foreach ($output as & $line) {
3063
-                $content .= $line . "\n";
3063
+                $content .= $line."\n";
3064 3064
             }
3065 3065
             return $content;
3066 3066
         } else {
@@ -3092,13 +3092,13 @@  discard block
 block discarded – undo
3092 3092
         $group_condition = null;
3093 3093
         if (isset($group_id)) {
3094 3094
             $group_id = intval($group_id);
3095
-            $group_condition = " AND props.to_group_id='" . $group_id . "' ";
3095
+            $group_condition = " AND props.to_group_id='".$group_id."' ";
3096 3096
         }
3097 3097
 
3098 3098
         $session_condition = null;
3099 3099
         if (isset($session_id)) {
3100 3100
             $session_id = intval($session_id);
3101
-            $session_condition = " AND props.session_id='" . $session_id . "' ";
3101
+            $session_condition = " AND props.session_id='".$session_id."' ";
3102 3102
         }
3103 3103
 
3104 3104
         $sql = "SELECT SUM(size)
@@ -3108,7 +3108,7 @@  discard block
 block discarded – undo
3108 3108
                 WHERE
3109 3109
                     props.c_id 	= $course_id AND
3110 3110
                     docs.c_id 	= $course_id AND
3111
-                    props.tool 	= '" . TOOL_DOCUMENT . "' AND
3111
+                    props.tool 	= '".TOOL_DOCUMENT."' AND
3112 3112
                     props.visibility <> 2
3113 3113
                     $group_condition
3114 3114
                     $session_condition
@@ -3131,8 +3131,8 @@  discard block
 block discarded – undo
3131 3131
         $course_quota_m = round($course_quota / 1048576);
3132 3132
         $already_consumed_space_m = round($already_consumed_space / 1048576);
3133 3133
 
3134
-        $message = get_lang('MaximumAllowedQuota') . ' <strong>' . $course_quota_m . ' megabyte</strong>.<br />';
3135
-        $message .= get_lang('CourseCurrentlyUses') . ' <strong>' . $already_consumed_space_m . ' megabyte</strong>.<br />';
3134
+        $message = get_lang('MaximumAllowedQuota').' <strong>'.$course_quota_m.' megabyte</strong>.<br />';
3135
+        $message .= get_lang('CourseCurrentlyUses').' <strong>'.$already_consumed_space_m.' megabyte</strong>.<br />';
3136 3136
 
3137 3137
         $percentage = round(($already_consumed_space / $course_quota * 100), 1);
3138 3138
 
@@ -3140,33 +3140,33 @@  discard block
 block discarded – undo
3140 3140
 
3141 3141
         // Decide where to place percentage in graph
3142 3142
         if ($percentage >= 50) {
3143
-            $text_in_filled = '&nbsp;' . $other_percentage . '%';
3143
+            $text_in_filled = '&nbsp;'.$other_percentage.'%';
3144 3144
             $text_in_unfilled = '';
3145 3145
         } else {
3146
-            $text_in_unfilled = '&nbsp;' . $other_percentage . '%';
3146
+            $text_in_unfilled = '&nbsp;'.$other_percentage.'%';
3147 3147
             $text_in_filled = '';
3148 3148
         }
3149 3149
 
3150 3150
         // Decide the background colour of the graph
3151 3151
         if ($percentage < 65) {
3152
-            $colour = '#00BB00';        // Safe - green
3152
+            $colour = '#00BB00'; // Safe - green
3153 3153
         } elseif ($percentage < 90) {
3154
-            $colour = '#ffd400';        // Filling up - yelloworange
3154
+            $colour = '#ffd400'; // Filling up - yelloworange
3155 3155
         } else {
3156
-            $colour = '#DD0000';        // Full - red
3156
+            $colour = '#DD0000'; // Full - red
3157 3157
         }
3158 3158
 
3159 3159
         // This is used for the table width: a table of only 100 pixels looks too small
3160 3160
         $visual_percentage = 4 * $percentage;
3161 3161
         $visual_other_percentage = 4 * $other_percentage;
3162 3162
 
3163
-        $message .= get_lang('PercentageQuotaInUse') . ': <strong>' . $percentage . '%</strong>.<br />' .
3164
-            get_lang('PercentageQuotaFree') . ': <strong>' . $other_percentage . '%</strong>.<br />';
3163
+        $message .= get_lang('PercentageQuotaInUse').': <strong>'.$percentage.'%</strong>.<br />'.
3164
+            get_lang('PercentageQuotaFree').': <strong>'.$other_percentage.'%</strong>.<br />';
3165 3165
 
3166
-        $show_percentage = '&nbsp;' . $percentage . '%';
3167
-        $message .= '<div style="width: 80%; text-align: center; -moz-border-radius: 5px 5px 5px 5px; border: 1px solid #aaa; background-image: url(\'' . api_get_path(WEB_CODE_PATH) . 'css/' . api_get_visual_theme() . '/images/bg-header4.png\');" class="document-quota-bar">' .
3168
-            '<div style="width:' . $percentage . '%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;">&nbsp;</div>' .
3169
-            '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">' . $show_percentage . '</span></div>';
3166
+        $show_percentage = '&nbsp;'.$percentage.'%';
3167
+        $message .= '<div style="width: 80%; text-align: center; -moz-border-radius: 5px 5px 5px 5px; border: 1px solid #aaa; background-image: url(\''.api_get_path(WEB_CODE_PATH).'css/'.api_get_visual_theme().'/images/bg-header4.png\');" class="document-quota-bar">'.
3168
+            '<div style="width:'.$percentage.'%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;">&nbsp;</div>'.
3169
+            '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">'.$show_percentage.'</span></div>';
3170 3170
         echo $message;
3171 3171
     }
3172 3172
 
@@ -3182,7 +3182,7 @@  discard block
 block discarded – undo
3182 3182
         $percentage = $already_consumed_space / $course_quota * 100;
3183 3183
         $percentage = round($percentage, 1);
3184 3184
         $message = get_lang('YouAreCurrentlyUsingXOfYourX');
3185
-        $message = sprintf($message, $already_consumed_space_m, $percentage . '%', $course_quota_m . ' ');
3185
+        $message = sprintf($message, $already_consumed_space_m, $percentage.'%', $course_quota_m.' ');
3186 3186
 
3187 3187
         return Display::div($message, array('id' => 'document_quota'));
3188 3188
     }
@@ -3215,13 +3215,13 @@  discard block
 block discarded – undo
3215 3215
      */
3216 3216
     public static function generate_jplayer_jquery($params = array())
3217 3217
     {
3218
-        $js_path = api_get_path(WEB_LIBRARY_PATH) . 'javascript/';
3218
+        $js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/';
3219 3219
 
3220 3220
         $js = '
3221
-            $("#jquery_jplayer_' . $params['count'] . '").jPlayer({
3221
+            $("#jquery_jplayer_' . $params['count'].'").jPlayer({
3222 3222
                 ready: function() {
3223 3223
                     $(this).jPlayer("setMedia", {
3224
-                        ' . $params['extension'] . ' : "' . $params['url'] . '"
3224
+                        ' . $params['extension'].' : "'.$params['url'].'"
3225 3225
                     });
3226 3226
                 },
3227 3227
                 play: function() { // To avoid both jPlayers playing together.
@@ -3229,12 +3229,12 @@  discard block
 block discarded – undo
3229 3229
                 },
3230 3230
                 //errorAlerts: true,
3231 3231
                 //warningAlerts: true,
3232
-                swfPath: "' . $js_path . 'jquery-jplayer/jplayer/",
3232
+                swfPath: "' . $js_path.'jquery-jplayer/jplayer/",
3233 3233
                 //supplied: "m4a, oga, mp3, ogg, wav",
3234
-                supplied: "' . $params['extension'] . '",
3234
+                supplied: "' . $params['extension'].'",
3235 3235
                 wmode: "window",
3236 3236
                 solution: "flash, html",  // Do not change this setting
3237
-                cssSelectorAncestor: "#jp_container_' . $params['count'] . '",
3237
+                cssSelectorAncestor: "#jp_container_' . $params['count'].'",
3238 3238
             });  	 ' . "\n\n";
3239 3239
 
3240 3240
         return $js;
@@ -3263,16 +3263,16 @@  discard block
 block discarded – undo
3263 3263
         }
3264 3264
 
3265 3265
         //Shows only the play button
3266
-        $html = '<div id="jquery_jplayer_' . $i . '" class="jp-jplayer"></div>
3267
-                <div id="jp_container_' . $i . '" class="jp-audio">
3266
+        $html = '<div id="jquery_jplayer_'.$i.'" class="jp-jplayer"></div>
3267
+                <div id="jp_container_' . $i.'" class="jp-audio">
3268 3268
                     <div class="jp-type-single">
3269 3269
                         <div class="jp-gui jp-interface">
3270 3270
                             <ul class="jp-controls">
3271 3271
                                 <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
3272 3272
                                 <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
3273
-                                ' . $extra_controls . '
3273
+                                ' . $extra_controls.'
3274 3274
                             </ul>
3275
-                            ' . $progress . '
3275
+                            ' . $progress.'
3276 3276
                         </div>
3277 3277
                     </div>
3278 3278
                 </div>';
@@ -3325,8 +3325,8 @@  discard block
 block discarded – undo
3325 3325
                     </div>
3326 3326
                 </div>
3327 3327
                 <div class="jp-no-solution">
3328
-                    <span>' . get_lang('UpdateRequire') . '</span>
3329
-                    ' . get_lang("ToPlayTheMediaYouWillNeedToUpdateYourBrowserToARecentVersionYouCanAlsoDownloadTheFile") . '
3328
+                    <span>' . get_lang('UpdateRequire').'</span>
3329
+                    ' . get_lang("ToPlayTheMediaYouWillNeedToUpdateYourBrowserToARecentVersionYouCanAlsoDownloadTheFile").'
3330 3330
                 </div>
3331 3331
             </div>
3332 3332
         </div>';
@@ -3407,7 +3407,7 @@  discard block
 block discarded – undo
3407 3407
 
3408 3408
         $add_folder_filter = null;
3409 3409
         if (!empty($filter_by_folder)) {
3410
-            $add_folder_filter = " AND docs.path LIKE '" . Database::escape_string($filter_by_folder) . "%'";
3410
+            $add_folder_filter = " AND docs.path LIKE '".Database::escape_string($filter_by_folder)."%'";
3411 3411
         }
3412 3412
 
3413 3413
         // If we are in LP display hidden folder https://support.chamilo.org/issues/6679
@@ -3442,7 +3442,7 @@  discard block
 block discarded – undo
3442 3442
 
3443 3443
                 $notLikeCondition = null;
3444 3444
                 for ($i = 1; $i <= $num; $i++) {
3445
-                    $repeat = str_repeat('/%', $i+1);
3445
+                    $repeat = str_repeat('/%', $i + 1);
3446 3446
                     $notLikeCondition .= " AND docs.path NOT LIKE '".Database::escape_string($cleanedPath.$repeat)."' ";
3447 3447
                 }
3448 3448
 
@@ -3467,7 +3467,7 @@  discard block
 block discarded – undo
3467 3467
                 ON (docs.id = last.ref AND docs.c_id = last.c_id)
3468 3468
                 WHERE
3469 3469
                     docs.path NOT LIKE '%_DELETED_%' AND
3470
-                    last.tool = '" . TOOL_DOCUMENT . "' $condition_session AND
3470
+                    last.tool = '".TOOL_DOCUMENT."' $condition_session AND
3471 3471
                     (last.visibility = '1' $lp_visibility_condition) AND
3472 3472
                     last.visibility <> 2 AND
3473 3473
                     docs.c_id = {$course_info['real_id']} AND
@@ -3497,7 +3497,7 @@  discard block
 block discarded – undo
3497 3497
                 Display::url(
3498 3498
                     Display::return_icon('close.png', get_lang('Close'), array(), ICON_SIZE_SMALL),
3499 3499
                     ' javascript:void(0);',
3500
-                    array('id' => 'close_div_' . $course_info['real_id'] . '_' . $session_id, 'class' => 'close_div')
3500
+                    array('id' => 'close_div_'.$course_info['real_id'].'_'.$session_id, 'class' => 'close_div')
3501 3501
                 ),
3502 3502
                 array('style' => 'position:absolute;right:10px')
3503 3503
             );
@@ -3604,7 +3604,7 @@  discard block
 block discarded – undo
3604 3604
                     $('#'+tempId).hide();
3605 3605
                 } else {
3606 3606
                     image.addClass('open');
3607
-                    image.attr('src', '" . Display::returnIconPath('nolines_minus.gif') . "');
3607
+                    image.attr('src', '" . Display::returnIconPath('nolines_minus.gif')."');
3608 3608
                     $('#'+id).hide();
3609 3609
                     $('#'+tempId).show();
3610 3610
 
@@ -3651,7 +3651,7 @@  discard block
 block discarded – undo
3651 3651
         $target,
3652 3652
         $overwrite_url
3653 3653
     ) {
3654
-        $img_sys_path = api_get_path(SYS_CODE_PATH) . 'img/';
3654
+        $img_sys_path = api_get_path(SYS_CODE_PATH).'img/';
3655 3655
         $web_code_path = api_get_path(WEB_CODE_PATH);
3656 3656
 
3657 3657
         $documentId = $resource['id'];
@@ -3666,7 +3666,7 @@  discard block
 block discarded – undo
3666 3666
         // It's a file.
3667 3667
         $icon = choose_image($path);
3668 3668
         $position = strrpos($icon, '.');
3669
-        $icon = substr($icon, 0, $position) . '_small.gif';
3669
+        $icon = substr($icon, 0, $position).'_small.gif';
3670 3670
         $my_file_title = $resource['title'];
3671 3671
         $visibility = $resource['visibility'];
3672 3672
 
@@ -3678,29 +3678,29 @@  discard block
 block discarded – undo
3678 3678
         // Show the "image name" not the filename of the image.
3679 3679
         if ($lp_id) {
3680 3680
             // LP URL
3681
-            $url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq().'&amp;action=add_item&amp;type=' . TOOL_DOCUMENT . '&amp;file=' . $documentId . '&amp;lp_id=' . $lp_id;
3681
+            $url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq().'&amp;action=add_item&amp;type='.TOOL_DOCUMENT.'&amp;file='.$documentId.'&amp;lp_id='.$lp_id;
3682 3682
             if (!empty($overwrite_url)) {
3683
-                $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId.'';
3683
+                $url = $overwrite_url.'&cidReq='.$course_info['code'].'&id_session='.$session_id.'&document_id='.$documentId.'';
3684 3684
             }
3685 3685
         } else {
3686 3686
             // Direct document URL
3687
-            $url = $web_code_path . 'document/document.php?cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&id=' . $documentId;
3687
+            $url = $web_code_path.'document/document.php?cidReq='.$course_info['code'].'&id_session='.$session_id.'&id='.$documentId;
3688 3688
             if (!empty($overwrite_url)) {
3689
-                $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId;
3689
+                $url = $overwrite_url.'&cidReq='.$course_info['code'].'&id_session='.$session_id.'&document_id='.$documentId;
3690 3690
             }
3691 3691
         }
3692 3692
 
3693 3693
         $img = Display::returnIconPath($icon);
3694
-        if (!file_exists($img_sys_path . $icon)) {
3694
+        if (!file_exists($img_sys_path.$icon)) {
3695 3695
             $img = Display::returnIconPath('default_small.gif');
3696 3696
         }
3697 3697
 
3698 3698
         $link = Display::url(
3699
-            '<img alt="" src="' . $img . '" title="" />&nbsp;' . $my_file_title, $url,
3699
+            '<img alt="" src="'.$img.'" title="" />&nbsp;'.$my_file_title, $url,
3700 3700
             array('target' => $target, 'class' => 'moved')
3701 3701
         );
3702 3702
 
3703
-        $directUrl = $web_code_path . 'document/document.php?cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&id=' . $documentId;
3703
+        $directUrl = $web_code_path.'document/document.php?cidReq='.$course_info['code'].'&id_session='.$session_id.'&id='.$documentId;
3704 3704
 
3705 3705
         $link .= Display::url(
3706 3706
             Display::return_icon('preview_view.png', get_lang('Preview')),
@@ -3715,12 +3715,12 @@  discard block
 block discarded – undo
3715 3715
         $return = null;
3716 3716
 
3717 3717
         if ($lp_id == false) {
3718
-            $return .= '<li class="doc_resource '.$visibilityClass.' " data_id="' . $documentId . '" data_type="document" title="' . $my_file_title . '" >';
3718
+            $return .= '<li class="doc_resource '.$visibilityClass.' " data_id="'.$documentId.'" data_type="document" title="'.$my_file_title.'" >';
3719 3719
         } else {
3720
-            $return .= '<li class="doc_resource lp_resource_element '.$visibilityClass.' " data_id="' . $documentId . '" data_type="document" title="' . $my_file_title . '" >';
3720
+            $return .= '<li class="doc_resource lp_resource_element '.$visibilityClass.' " data_id="'.$documentId.'" data_type="document" title="'.$my_file_title.'" >';
3721 3721
         }
3722 3722
 
3723
-        $return .= '<div class="item_data" style="margin-left:' . ($num  * 5 ) . 'px;margin-right:5px;">';
3723
+        $return .= '<div class="item_data" style="margin-left:'.($num * 5).'px;margin-right:5px;">';
3724 3724
 
3725 3725
         if ($add_move_button) {
3726 3726
             $return .= '<a class="moved" href="#">';
@@ -3785,7 +3785,7 @@  discard block
 block discarded – undo
3785 3785
             if (isset($resource['visible']) && $resource['visible'] == 0) {
3786 3786
                 $folder_class_hidden = "doc_folder_hidden"; // in base.css
3787 3787
             }
3788
-            $onclick = 'onclick="javascript: testResources(\'res_' . $resource['id'] . '\',\'img_' . $resource['id'] . '\')"';
3788
+            $onclick = 'onclick="javascript: testResources(\'res_'.$resource['id'].'\',\'img_'.$resource['id'].'\')"';
3789 3789
         }
3790 3790
         $return = null;
3791 3791
 
@@ -3793,22 +3793,22 @@  discard block
 block discarded – undo
3793 3793
             $return = '<ul class="lp_resource">';
3794 3794
         }
3795 3795
 
3796
-        $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_' . $resource['id'] . '"  style="margin-left:' . ($num * 18) . 'px; ">';
3796
+        $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_'.$resource['id'].'"  style="margin-left:'.($num * 18).'px; ">';
3797 3797
 
3798 3798
         $image = Display::returnIconPath('nolines_plus.gif');
3799 3799
         if (empty($path)) {
3800 3800
             $image = Display::returnIconPath('nolines_minus.gif');
3801 3801
         }
3802
-        $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'] . '" '.$onclick.'>';
3802
+        $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'].'" '.$onclick.'>';
3803 3803
         $return .= Display::return_icon('lp_folder.gif').'&nbsp;';
3804 3804
         $return .= '<span '.$onclick.' style="cursor: pointer;" >'.$title.'</span>';
3805 3805
         $return .= '</li>';
3806 3806
 
3807 3807
         if (empty($path)) {
3808 3808
             if ($folderId == false) {
3809
-                $return .= '<div id="res_' . $resource['id'] . '" >';
3809
+                $return .= '<div id="res_'.$resource['id'].'" >';
3810 3810
             } else {
3811
-                $return .= '<div id="res_' . $resource['id'] . '" style="display: none;" >';
3811
+                $return .= '<div id="res_'.$resource['id'].'" style="display: none;" >';
3812 3812
             }
3813 3813
         }
3814 3814
 
@@ -3970,9 +3970,9 @@  discard block
 block discarded – undo
3970 3970
             $session_id = api_get_session_id();
3971 3971
         }
3972 3972
         $course_info = api_get_course_info($course_code);
3973
-        $course_dir = $course_info['path'] . '/document';
3973
+        $course_dir = $course_info['path'].'/document';
3974 3974
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
3975
-        $base_work_dir = $sys_course_path . $course_dir;
3975
+        $base_work_dir = $sys_course_path.$course_dir;
3976 3976
 
3977 3977
         $course_id = $course_info['real_id'];
3978 3978
         $table_document = Database::get_course_table(TABLE_DOCUMENT);
@@ -3981,7 +3981,7 @@  discard block
 block discarded – undo
3981 3981
         $result = Database::query($qry);
3982 3982
         if (Database::num_rows($result) == 1) {
3983 3983
             $row = Database::fetch_array($result);
3984
-            $doc_path = api_get_path(SYS_COURSE_PATH) . $course_dir . $row['path'];
3984
+            $doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path'];
3985 3985
             //TODO: mime_content_type is deprecated, fileinfo php extension is enabled by default as of PHP 5.3.0
3986 3986
             // now versions of PHP on Debian testing(5.2.6-5) and Ubuntu(5.2.6-2ubuntu) are lower, so wait for a while
3987 3987
             $doc_mime = mime_content_type($doc_path);
@@ -4012,8 +4012,8 @@  discard block
 block discarded – undo
4012 4012
                 $file_content = self::get_text_content($doc_path, $doc_mime);
4013 4013
                 $course_code = Database::escape_string($course_code);
4014 4014
 
4015
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
4016
-                require_once api_get_path(LIBRARY_PATH) . 'search/IndexableChunk.class.php';
4015
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
4016
+                require_once api_get_path(LIBRARY_PATH).'search/IndexableChunk.class.php';
4017 4017
 
4018 4018
                 $ic_slide = new IndexableChunk();
4019 4019
                 $ic_slide->addValue('title', $file_title);
@@ -4030,7 +4030,7 @@  discard block
 block discarded – undo
4030 4030
                 $di = new ChamiloIndexer();
4031 4031
                 $return = $di->connectDb(null, null, $lang);
4032 4032
 
4033
-                require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
4033
+                require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
4034 4034
                 $specific_fields = get_specific_field_list();
4035 4035
 
4036 4036
                 // process different depending on what to do if file exists
@@ -4067,7 +4067,7 @@  discard block
 block discarded – undo
4067 4067
                             } else { //if the specific field is not defined, force an empty one
4068 4068
                                 $sterms = '';
4069 4069
                             }
4070
-                            $all_specific_terms .= ' ' . $sterms;
4070
+                            $all_specific_terms .= ' '.$sterms;
4071 4071
                             $sterms = explode(',', $sterms);
4072 4072
                             foreach ($sterms as $sterm) {
4073 4073
                                 $sterm = trim($sterm);
@@ -4081,7 +4081,7 @@  discard block
 block discarded – undo
4081 4081
                             }
4082 4082
                         }
4083 4083
                         // Add terms also to content to make terms findable by probabilistic search
4084
-                        $file_content = $all_specific_terms . ' ' . $file_content;
4084
+                        $file_content = $all_specific_terms.' '.$file_content;
4085 4085
 
4086 4086
                         if (!$simulation) {
4087 4087
                             $ic_slide->addValue('content', $file_content);
@@ -4107,7 +4107,7 @@  discard block
 block discarded – undo
4107 4107
                         } else { //if the specific field is not defined, force an empty one
4108 4108
                             $sterms = '';
4109 4109
                         }
4110
-                        $all_specific_terms .= ' ' . $sterms;
4110
+                        $all_specific_terms .= ' '.$sterms;
4111 4111
                         if (!empty($sterms)) {
4112 4112
                             $sterms = explode(',', $sterms);
4113 4113
                             foreach ($sterms as $sterm) {
@@ -4119,7 +4119,7 @@  discard block
 block discarded – undo
4119 4119
                         }
4120 4120
                     }
4121 4121
                     // Add terms also to content to make terms findable by probabilistic search
4122
-                    $file_content = $all_specific_terms . ' ' . $file_content;
4122
+                    $file_content = $all_specific_terms.' '.$file_content;
4123 4123
                     if (!$simulation) {
4124 4124
                         $ic_slide->addValue('content', $file_content);
4125 4125
                         $di->addChunk($ic_slide);
@@ -4402,7 +4402,7 @@  discard block
 block discarded – undo
4402 4402
         $defaultVisibility = 'visible';
4403 4403
 
4404 4404
         if (isset($settings['documents'])) {
4405
-            $portalDefaultVisibility =  'invisible';
4405
+            $portalDefaultVisibility = 'invisible';
4406 4406
             if ($settings['documents'] == 'true') {
4407 4407
                 $portalDefaultVisibility = 'visible';
4408 4408
             }
@@ -4642,7 +4642,7 @@  discard block
 block discarded – undo
4642 4642
         //make htaccess with allow from all, and file index.html into temp/audio
4643 4643
         $htaccess = api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess';
4644 4644
         if (!file_exists($htaccess)) {
4645
-            $htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
4645
+            $htaccess_content = "order deny,allow\r\nallow from all\r\nOptions -Indexes";
4646 4646
             $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess', 'w');
4647 4647
             if ($fp) {
4648 4648
                 fwrite($fp, $htaccess_content);
@@ -4651,9 +4651,9 @@  discard block
 block discarded – undo
4651 4651
         }
4652 4652
 
4653 4653
         //encript temp name file
4654
-        $name_crip = sha1(uniqid());//encript
4655
-        $findext= explode(".", $file);
4656
-        $extension = $findext[count($findext)-1];
4654
+        $name_crip = sha1(uniqid()); //encript
4655
+        $findext = explode(".", $file);
4656
+        $extension = $findext[count($findext) - 1];
4657 4657
         $file_crip = $name_crip.'.'.$extension;
4658 4658
 
4659 4659
         //copy file to temp/audio directory
@@ -4757,7 +4757,7 @@  discard block
 block discarded – undo
4757 4757
         $comment = null;
4758 4758
 
4759 4759
         $fileName = api_replace_dangerous_char($title);
4760
-        $filePath = api_get_path(SYS_COURSE_PATH) . "{$courseData['path']}/document{$dir}";
4760
+        $filePath = api_get_path(SYS_COURSE_PATH)."{$courseData['path']}/document{$dir}";
4761 4761
         $fileFullPath = "{$filePath}/{$fileName}.html";
4762 4762
         $fileSize = 0;
4763 4763
         $fileType = 'file';
@@ -4809,7 +4809,7 @@  discard block
 block discarded – undo
4809 4809
             $fileSize,
4810 4810
             $title,
4811 4811
             $comment,
4812
-            0,//$readonly = 0,
4812
+            0, //$readonly = 0,
4813 4813
             true, //$save_visibility = true,
4814 4814
             null, //$group_id = null,
4815 4815
             $sessionId
@@ -5095,8 +5095,8 @@  discard block
 block discarded – undo
5095 5095
             $sessionId,
5096 5096
             $groupId
5097 5097
         )) {
5098
-            $uniqueName = self::addSuffixToFileName($name, '_' . $counter);
5099
-            $filePath = $path . $uniqueName;
5098
+            $uniqueName = self::addSuffixToFileName($name, '_'.$counter);
5099
+            $filePath = $path.$uniqueName;
5100 5100
             $counter++;
5101 5101
         }
5102 5102
 
@@ -5138,7 +5138,7 @@  discard block
 block discarded – undo
5138 5138
                     WHERE 
5139 5139
                         filetype = 'folder' AND 
5140 5140
                         c_id = $course_id AND 
5141
-                        path IN ('" . $folder_sql . "')";
5141
+                        path IN ('".$folder_sql."')";
5142 5142
             $res = Database::query($sql);
5143 5143
             $folder_titles = array();
5144 5144
             while ($obj = Database::fetch_object($res)) {
@@ -5175,9 +5175,9 @@  discard block
 block discarded – undo
5175 5175
                     $folder_titles[$folder] = cut($folder_titles[$folder], 80);
5176 5176
                     $counter = count($path_parts) - 2;
5177 5177
                     if ($counter > 0) {
5178
-                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', $counter) . ' &mdash; ' . $folder_titles[$folder];
5178
+                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', $counter).' &mdash; '.$folder_titles[$folder];
5179 5179
                     } else {
5180
-                        $label = ' &mdash; ' . $folder_titles[$folder];
5180
+                        $label = ' &mdash; '.$folder_titles[$folder];
5181 5181
                     }
5182 5182
                     $parent_select->addOption($label, $folder_id);
5183 5183
                     if ($selected != '') {
@@ -5195,7 +5195,7 @@  discard block
 block discarded – undo
5195 5195
                     } else {
5196 5196
                         $path_parts = explode('/', str_replace($group_dir, '', $folder));
5197 5197
                         $label = cut($label, 80);
5198
-                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2) . ' &mdash; ' . $label;
5198
+                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2).' &mdash; '.$label;
5199 5199
                     }
5200 5200
                     $parent_select->addOption($label, $folder_id);
5201 5201
                     if ($selected != '') {
@@ -5236,7 +5236,7 @@  discard block
 block discarded – undo
5236 5236
 
5237 5237
         $current_session_id = api_get_session_id();
5238 5238
         $courseParams = api_get_cidreq();
5239
-        $www = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/document';
5239
+        $www = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/document';
5240 5240
         $webODFList = DocumentManager::get_web_odf_extension_list();
5241 5241
 
5242 5242
         // Get the title or the basename depending on what we're using
@@ -5258,11 +5258,11 @@  discard block
 block discarded – undo
5258 5258
 
5259 5259
         if (!$show_as_icon) {
5260 5260
             // Build download link (icon)
5261
-            $forcedownload_link = ($filetype == 'folder') ? api_get_self() . '?' . $courseParams . '&action=downloadfolder&id=' . $document_data['id'] : api_get_self() . '?' . $courseParams . '&amp;action=download&amp;id=' . $document_data['id'];
5261
+            $forcedownload_link = ($filetype == 'folder') ? api_get_self().'?'.$courseParams.'&action=downloadfolder&id='.$document_data['id'] : api_get_self().'?'.$courseParams.'&amp;action=download&amp;id='.$document_data['id'];
5262 5262
             // Folder download or file download?
5263 5263
             $forcedownload_icon = ($filetype == 'folder') ? 'save_pack.png' : 'save.png';
5264 5264
             // Prevent multiple clicks on zipped folder download
5265
-            $prevent_multiple_click = ($filetype == 'folder') ? " onclick=\"javascript: if(typeof clic_$dbl_click_id == 'undefined' || !clic_$dbl_click_id) { clic_$dbl_click_id=true; window.setTimeout('clic_" . ($dbl_click_id++) . "=false;',10000); } else { return false; }\"" : '';
5265
+            $prevent_multiple_click = ($filetype == 'folder') ? " onclick=\"javascript: if(typeof clic_$dbl_click_id == 'undefined' || !clic_$dbl_click_id) { clic_$dbl_click_id=true; window.setTimeout('clic_".($dbl_click_id++)."=false;',10000); } else { return false; }\"" : '';
5266 5266
         }
5267 5267
 
5268 5268
         $target = '_self';
@@ -5278,17 +5278,17 @@  discard block
 block discarded – undo
5278 5278
 
5279 5279
             if ($is_browser_viewable_file) {
5280 5280
                 if ($ext == 'pdf' || in_array($ext, $webODFList)) {
5281
-                    $url = api_get_self() . '?' . $courseParams . '&amp;action=download&amp;id=' . $document_data['id'];
5281
+                    $url = api_get_self().'?'.$courseParams.'&amp;action=download&amp;id='.$document_data['id'];
5282 5282
                 } else {
5283
-                    $url = 'showinframes.php?' . $courseParams . '&id=' . $document_data['id'];
5283
+                    $url = 'showinframes.php?'.$courseParams.'&id='.$document_data['id'];
5284 5284
                 }
5285 5285
             } else {
5286 5286
                 // url-encode for problematic characters (we may not call them dangerous characters...)
5287
-                $path = str_replace('%2F', '/', $url_path) . '?' . $courseParams;
5288
-                $url = $www . $path;
5287
+                $path = str_replace('%2F', '/', $url_path).'?'.$courseParams;
5288
+                $url = $www.$path;
5289 5289
             }
5290 5290
         } else {
5291
-            $url = api_get_self() . '?' . $courseParams . '&id=' . $document_data['id'];
5291
+            $url = api_get_self().'?'.$courseParams.'&id='.$document_data['id'];
5292 5292
         }
5293 5293
 
5294 5294
         // The little download icon
@@ -5298,10 +5298,10 @@  discard block
 block discarded – undo
5298 5298
         if ($path == '/shared_folder') {
5299 5299
             $tooltip_title_alt = get_lang('UserFolders');
5300 5300
         } elseif (strstr($path, 'shared_folder_session_')) {
5301
-            $tooltip_title_alt = get_lang('UserFolders') . ' (' . api_get_session_name(api_get_session_id()) . ')';
5301
+            $tooltip_title_alt = get_lang('UserFolders').' ('.api_get_session_name(api_get_session_id()).')';
5302 5302
         } elseif (strstr($tooltip_title, 'sf_user_')) {
5303 5303
             $userinfo = api_get_user_info(substr($tooltip_title, 8));
5304
-            $tooltip_title_alt = get_lang('UserFolder') . ' ' . $userinfo['complete_name'];
5304
+            $tooltip_title_alt = get_lang('UserFolder').' '.$userinfo['complete_name'];
5305 5305
         } elseif ($path == '/chat_files') {
5306 5306
             $tooltip_title_alt = get_lang('ChatFiles');
5307 5307
         } elseif ($path == '/learning_path') {
@@ -5331,34 +5331,34 @@  discard block
 block discarded – undo
5331 5331
                 ) {
5332 5332
                     //filter: when I am into a shared folder, I can only show "my shared folder" for donwload
5333 5333
                     if (DocumentManager::is_shared_folder($curdirpath, $current_session_id)) {
5334
-                        if (preg_match('/shared_folder\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) ||
5335
-                            preg_match('/shared_folder_session_' . $current_session_id . '\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) ||
5334
+                        if (preg_match('/shared_folder\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) ||
5335
+                            preg_match('/shared_folder_session_'.$current_session_id.'\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) ||
5336 5336
                             $isAllowedToEdit || api_is_platform_admin()
5337 5337
                         ) {
5338
-                            $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5339
-                                Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5338
+                            $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5339
+                                Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5340 5340
                         }
5341 5341
                     } elseif (!preg_match('/shared_folder/', urldecode($forcedownload_link)) ||
5342 5342
                         $isAllowedToEdit ||
5343 5343
                         api_is_platform_admin()
5344 5344
                     ) {
5345
-                        $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5346
-                            Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5345
+                        $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5346
+                            Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5347 5347
                     }
5348 5348
                 }
5349 5349
             } else {
5350
-                $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . ' download="' . $document_data['basename'] . '">' .
5351
-                    Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5350
+                $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.' download="'.$document_data['basename'].'">'.
5351
+                    Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5352 5352
             }
5353 5353
 
5354 5354
             // Copy files to user's myfiles
5355 5355
             if (api_get_setting('allow_my_files') === 'true' &&
5356 5356
                 api_get_setting('users_copy_files') === 'true'
5357 5357
             ) {
5358
-                $copy_myfiles_link = ($filetype == 'file') ? api_get_self() . '?' . $courseParams . '&action=copytomyfiles&id=' . $document_data['id'] : api_get_self() . '?' . $courseParams;
5358
+                $copy_myfiles_link = ($filetype == 'file') ? api_get_self().'?'.$courseParams.'&action=copytomyfiles&id='.$document_data['id'] : api_get_self().'?'.$courseParams;
5359 5359
                 if ($filetype == 'file') {
5360
-                    $copy_to_myfiles = '<a href="' . $copy_myfiles_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5361
-                        Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL) . '&nbsp;&nbsp;</a>';
5360
+                    $copy_to_myfiles = '<a href="'.$copy_myfiles_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5361
+                        Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL).'&nbsp;&nbsp;</a>';
5362 5362
 
5363 5363
                     if (api_get_setting('allow_my_files') === 'false') {
5364 5364
                         $copy_to_myfiles = '';
@@ -5377,13 +5377,13 @@  discard block
 block discarded – undo
5377 5377
                 $filetype == 'file' &&
5378 5378
                 in_array($extension, array('html', 'htm'))
5379 5379
             ) {
5380
-                $pdf_icon = ' <a style="float:right".' . $prevent_multiple_click . ' href="' . api_get_self() . '?' . $courseParams . '&action=export_to_pdf&id=' . $document_data['id'] . '">' .
5381
-                    Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a> ';
5380
+                $pdf_icon = ' <a style="float:right".'.$prevent_multiple_click.' href="'.api_get_self().'?'.$courseParams.'&action=export_to_pdf&id='.$document_data['id'].'">'.
5381
+                    Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL).'</a> ';
5382 5382
             }
5383 5383
 
5384 5384
             if ($is_browser_viewable_file) {
5385
-                $open_in_new_window_link = '<a href="' . $www . str_replace('%2F', '/', $url_path) . '?' . $courseParams . '" style="float:right"' . $prevent_multiple_click . ' target="_blank">' .
5386
-                    Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL) . '&nbsp;&nbsp;</a>';
5385
+                $open_in_new_window_link = '<a href="'.$www.str_replace('%2F', '/', $url_path).'?'.$courseParams.'" style="float:right"'.$prevent_multiple_click.' target="_blank">'.
5386
+                    Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL).'&nbsp;&nbsp;</a>';
5387 5387
             }
5388 5388
 
5389 5389
             if ($filetype == 'file') {
@@ -5392,9 +5392,9 @@  discard block
 block discarded – undo
5392 5392
                     (preg_match('/wav$/i', urldecode($checkExtension))) ||
5393 5393
                     preg_match('/ogg$/i', urldecode($checkExtension))
5394 5394
                 ) {
5395
-                    return '<span style="float:left" ' . $visibility_class . '>' .
5396
-                    $title .
5397
-                    '</span>' . $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5395
+                    return '<span style="float:left" '.$visibility_class.'>'.
5396
+                    $title.
5397
+                    '</span>'.$force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5398 5398
                 } elseif (
5399 5399
 
5400 5400
                     // Show preview
@@ -5407,7 +5407,7 @@  discard block
 block discarded – undo
5407 5407
                     preg_match('/svg$/i', urldecode($checkExtension))
5408 5408
                 ) {
5409 5409
                     // Simpler version of showinframesmin.php with no headers
5410
-                    $url = 'show_content.php?' . $courseParams . '&id=' . $document_data['id'];
5410
+                    $url = 'show_content.php?'.$courseParams.'&id='.$document_data['id'];
5411 5411
                     $class = 'ajax';
5412 5412
                     if ($visibility == false) {
5413 5413
                         $class = "ajax text-muted";
@@ -5422,34 +5422,34 @@  discard block
 block discarded – undo
5422 5422
                             'style' => 'float:left;'
5423 5423
                         ]
5424 5424
                     )
5425
-                    . $force_download_html . $send_to . $copy_to_myfiles
5426
-                    . $open_in_new_window_link . $pdf_icon;
5425
+                    . $force_download_html.$send_to.$copy_to_myfiles
5426
+                    . $open_in_new_window_link.$pdf_icon;
5427 5427
                 } else {
5428 5428
                     // For a "PDF Download" of the file.
5429 5429
                     $pdfPreview = null;
5430 5430
                     if ($ext != 'pdf' && !in_array($ext, $webODFList)) {
5431
-                        $url = 'showinframes.php?' . $courseParams . '&id=' . $document_data['id'];
5431
+                        $url = 'showinframes.php?'.$courseParams.'&id='.$document_data['id'];
5432 5432
                     } else {
5433 5433
                         $pdfPreview = Display::url(
5434 5434
                             Display::return_icon('preview.gif', get_lang('Preview')),
5435
-                            api_get_path(WEB_CODE_PATH).'document/showinframes.php?' . $courseParams . '&id=' . $document_data['id'],
5435
+                            api_get_path(WEB_CODE_PATH).'document/showinframes.php?'.$courseParams.'&id='.$document_data['id'],
5436 5436
                             array('style' => 'float:right')
5437 5437
                         );
5438 5438
                     }
5439 5439
                     // No plugin just the old and good showinframes.php page
5440
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" style="float:left" ' . $visibility_class . ' >' . $title . '</a>' .
5441
-                    $pdfPreview.$force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5440
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" style="float:left" '.$visibility_class.' >'.$title.'</a>'.
5441
+                    $pdfPreview.$force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5442 5442
                 }
5443 5443
             } else {
5444
-                return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . $title . '</a>' .
5445
-                $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5444
+                return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.$title.'</a>'.
5445
+                $force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5446 5446
             }
5447 5447
             // end copy files to users myfiles
5448 5448
         } else {
5449 5449
             // Icon column
5450 5450
             if (preg_match('/shared_folder/', urldecode($checkExtension)) &&
5451 5451
                 preg_match('/shared_folder$/', urldecode($checkExtension)) == false &&
5452
-                preg_match('/shared_folder_session_' . $current_session_id . '$/', urldecode($url)) == false
5452
+                preg_match('/shared_folder_session_'.$current_session_id.'$/', urldecode($url)) == false
5453 5453
             ) {
5454 5454
                 if ($filetype == 'file') {
5455 5455
                     //Sound preview with jplayer
@@ -5469,19 +5469,19 @@  discard block
 block discarded – undo
5469 5469
                         preg_match('/bmp$/i', urldecode($checkExtension)) ||
5470 5470
                         preg_match('/svg$/i', urldecode($checkExtension))
5471 5471
                     ) {
5472
-                        $url = 'showinframes.php?' . $courseParams . '&id=' . $document_data['id'];
5473
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5474
-                        DocumentManager::build_document_icon_tag($filetype, $path, $isAllowedToEdit) .
5475
-                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5472
+                        $url = 'showinframes.php?'.$courseParams.'&id='.$document_data['id'];
5473
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5474
+                        DocumentManager::build_document_icon_tag($filetype, $path, $isAllowedToEdit).
5475
+                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5476 5476
                     } else {
5477
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5478
-                        DocumentManager::build_document_icon_tag($filetype, $path, $isAllowedToEdit) .
5479
-                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5477
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5478
+                        DocumentManager::build_document_icon_tag($filetype, $path, $isAllowedToEdit).
5479
+                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5480 5480
                     }
5481 5481
                 } else {
5482
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' .
5483
-                    DocumentManager::build_document_icon_tag($filetype, $path, $isAllowedToEdit) .
5484
-                    Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5482
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.
5483
+                    DocumentManager::build_document_icon_tag($filetype, $path, $isAllowedToEdit).
5484
+                    Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5485 5485
                 }
5486 5486
             } else {
5487 5487
                 if ($filetype == 'file') {
@@ -5504,16 +5504,16 @@  discard block
 block discarded – undo
5504 5504
                         preg_match('/bmp$/i', urldecode($checkExtension)) ||
5505 5505
                         preg_match('/svg$/i', urldecode($checkExtension))
5506 5506
                     ) {
5507
-                        $url = 'showinframes.php?' . $courseParams . '&id=' . $document_data['id']; //without preview
5508
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5509
-                        DocumentManager::build_document_icon_tag($filetype, $path, $isAllowedToEdit) . '</a>';
5507
+                        $url = 'showinframes.php?'.$courseParams.'&id='.$document_data['id']; //without preview
5508
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5509
+                        DocumentManager::build_document_icon_tag($filetype, $path, $isAllowedToEdit).'</a>';
5510 5510
                     } else {
5511
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5512
-                        DocumentManager::build_document_icon_tag($filetype, $path, $isAllowedToEdit) . '</a>';
5511
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5512
+                        DocumentManager::build_document_icon_tag($filetype, $path, $isAllowedToEdit).'</a>';
5513 5513
                     }
5514 5514
                 } else {
5515
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' .
5516
-                    DocumentManager::build_document_icon_tag($filetype, $path, $isAllowedToEdit) . '</a>';
5515
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.
5516
+                    DocumentManager::build_document_icon_tag($filetype, $path, $isAllowedToEdit).'</a>';
5517 5517
                 }
5518 5518
             }
5519 5519
         }
@@ -5549,14 +5549,14 @@  discard block
 block discarded – undo
5549 5549
             } elseif (strstr($basename, 'sf_user_')) {
5550 5550
                 $userInfo = api_get_user_info(substr($basename, 8));
5551 5551
                 $icon = $userInfo['avatar_small'];
5552
-                $basename = get_lang('UserFolder') . ' ' . $userInfo['complete_name'];
5552
+                $basename = get_lang('UserFolder').' '.$userInfo['complete_name'];
5553 5553
                 $user_image = true;
5554 5554
             } elseif (strstr($path, 'shared_folder_session_')) {
5555 5555
                 $sessionName = api_get_session_name($current_session_id);
5556 5556
                 if ($isAllowedToEdit) {
5557
-                    $basename = '***(' . $sessionName . ')*** ' . get_lang('HelpUsersFolder');
5557
+                    $basename = '***('.$sessionName.')*** '.get_lang('HelpUsersFolder');
5558 5558
                 } else {
5559
-                    $basename = get_lang('UserFolders') . ' (' . $sessionName . ')';
5559
+                    $basename = get_lang('UserFolders').' ('.$sessionName.')';
5560 5560
                 }
5561 5561
                 $icon = 'folder_users.png';
5562 5562
             } else {
@@ -5668,16 +5668,16 @@  discard block
 block discarded – undo
5668 5668
         // Build URL-parameters for table-sorting
5669 5669
         $sort_params = array();
5670 5670
         if (isset($_GET['column'])) {
5671
-            $sort_params[] = 'column=' . Security::remove_XSS($_GET['column']);
5671
+            $sort_params[] = 'column='.Security::remove_XSS($_GET['column']);
5672 5672
         }
5673 5673
         if (isset($_GET['page_nr'])) {
5674
-            $sort_params[] = 'page_nr=' . Security::remove_XSS($_GET['page_nr']);
5674
+            $sort_params[] = 'page_nr='.Security::remove_XSS($_GET['page_nr']);
5675 5675
         }
5676 5676
         if (isset($_GET['per_page'])) {
5677
-            $sort_params[] = 'per_page=' . Security::remove_XSS($_GET['per_page']);
5677
+            $sort_params[] = 'per_page='.Security::remove_XSS($_GET['per_page']);
5678 5678
         }
5679 5679
         if (isset($_GET['direction'])) {
5680
-            $sort_params[] = 'direction=' . Security::remove_XSS($_GET['direction']);
5680
+            $sort_params[] = 'direction='.Security::remove_XSS($_GET['direction']);
5681 5681
         }
5682 5682
         $sort_params = implode('&amp;', $sort_params);
5683 5683
         $visibility_icon = ($visibility == 0) ? 'invisible' : 'visible';
@@ -5690,89 +5690,89 @@  discard block
 block discarded – undo
5690 5690
         if ($is_read_only /* or ($session_id!=api_get_session_id()) */) {
5691 5691
             if (api_is_course_admin() || api_is_platform_admin()) {
5692 5692
                 if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5693
-                    $modify_icons = '<a href="edit_draw.php?' . $courseParams . '&id=' . $document_id . '">' .
5694
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5695
-                } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5696
-                    $modify_icons = '<a href="edit_odf.php?' . $courseParams . '&id=' . $document_id . '">' .
5697
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5693
+                    $modify_icons = '<a href="edit_draw.php?'.$courseParams.'&id='.$document_id.'">'.
5694
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5695
+                } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5696
+                    $modify_icons = '<a href="edit_odf.php?'.$courseParams.'&id='.$document_id.'">'.
5697
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5698 5698
                 } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5699
-                    $modify_icons = '<a href="edit_paint.php?' . $courseParams . '&id=' . $document_id . '">' .
5700
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5699
+                    $modify_icons = '<a href="edit_paint.php?'.$courseParams.'&id='.$document_id.'">'.
5700
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5701 5701
                 } else {
5702
-                    $modify_icons = '<a href="edit_document.php?' . $courseParams . '&id=' . $document_id. '">' .
5703
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5702
+                    $modify_icons = '<a href="edit_document.php?'.$courseParams.'&id='.$document_id.'">'.
5703
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5704 5704
                 }
5705 5705
             } else {
5706 5706
                 $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
5707 5707
             }
5708
-            $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
5708
+            $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
5709 5709
             if (api_is_allowed_to_edit() || api_is_platform_admin()) {
5710
-                $modify_icons .= '&nbsp;' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL);
5710
+                $modify_icons .= '&nbsp;'.Display::return_icon($visibility_icon.'.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL);
5711 5711
             }
5712
-            $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
5712
+            $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
5713 5713
         } else {
5714 5714
             //Edit button
5715 5715
             if (in_array($path, DocumentManager::get_system_folders())) {
5716 5716
                 $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
5717
-            } elseif ($is_certificate_mode ) {
5717
+            } elseif ($is_certificate_mode) {
5718 5718
                 // gradebook category doesn't seem to be taken into account
5719
-                $modify_icons = '<a href="edit_document.php?' . $courseParams . '&amp;id=' . $document_id . '&curdirpath=/certificates">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5719
+                $modify_icons = '<a href="edit_document.php?'.$courseParams.'&amp;id='.$document_id.'&curdirpath=/certificates">'.Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5720 5720
             } else {
5721 5721
                 if ($sessionId) {
5722 5722
                     if ($document_data['session_id'] == $sessionId) {
5723 5723
                         if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5724
-                            $modify_icons = '<a href="edit_draw.php?' . $courseParams . '&amp;id=' . $document_id  . '">' .
5725
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5726
-                        } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5727
-                            $modify_icons = '<a href="edit_odf.php?' . $courseParams . '&id=' . $document_id  . '">' .
5728
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5724
+                            $modify_icons = '<a href="edit_draw.php?'.$courseParams.'&amp;id='.$document_id.'">'.
5725
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5726
+                        } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5727
+                            $modify_icons = '<a href="edit_odf.php?'.$courseParams.'&id='.$document_id.'">'.
5728
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5729 5729
                         } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5730
-                            $modify_icons = '<a href="edit_paint.php?' . $courseParams . '&id=' . $document_id  . '">' .
5731
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5730
+                            $modify_icons = '<a href="edit_paint.php?'.$courseParams.'&id='.$document_id.'">'.
5731
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5732 5732
                         } else {
5733
-                            $modify_icons = '<a href="edit_document.php?' . $courseParams . '&amp;id=' . $document_id  . '">' .
5734
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5733
+                            $modify_icons = '<a href="edit_document.php?'.$courseParams.'&amp;id='.$document_id.'">'.
5734
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5735 5735
                         }
5736 5736
                     } else {
5737
-                        $modify_icons .= '&nbsp;' . Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
5737
+                        $modify_icons .= '&nbsp;'.Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>';
5738 5738
                     }
5739 5739
                 } else {
5740 5740
                     if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5741
-                        $modify_icons = '<a href="edit_draw.php?' . $courseParams . '&amp;id=' . $document_id  . '">' .
5742
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5743
-                    } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5744
-                        $modify_icons = '<a href="edit_odf.php?' . $courseParams . '&id=' . $document_id  . '">' .
5745
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5741
+                        $modify_icons = '<a href="edit_draw.php?'.$courseParams.'&amp;id='.$document_id.'">'.
5742
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5743
+                    } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5744
+                        $modify_icons = '<a href="edit_odf.php?'.$courseParams.'&id='.$document_id.'">'.
5745
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5746 5746
                     } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5747
-                        $modify_icons = '<a href="edit_paint.php?' . $courseParams . '&amp;id=' . $document_id . '">' .
5748
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5747
+                        $modify_icons = '<a href="edit_paint.php?'.$courseParams.'&amp;id='.$document_id.'">'.
5748
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5749 5749
                     } else {
5750
-                        $modify_icons = '<a href="edit_document.php?' . $courseParams . '&amp;id=' . $document_id  . '">' .
5751
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5750
+                        $modify_icons = '<a href="edit_document.php?'.$courseParams.'&amp;id='.$document_id.'">'.
5751
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5752 5752
                     }
5753 5753
                 }
5754 5754
             }
5755 5755
 
5756 5756
             // Move button.
5757 5757
             if ($is_certificate_mode || in_array($path, DocumentManager::get_system_folders())) {
5758
-                $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5758
+                $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5759 5759
             } else {
5760 5760
                 if ($sessionId) {
5761 5761
                     if ($document_data['session_id'] == $sessionId) {
5762
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . $courseParams . '&amp;id=' . $parent_id . '&amp;move=' . $document_id .  '">' .
5763
-                            Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5762
+                        $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.$courseParams.'&amp;id='.$parent_id.'&amp;move='.$document_id.'">'.
5763
+                            Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5764 5764
                     } else {
5765
-                        $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5765
+                        $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5766 5766
                     }
5767 5767
                 } else {
5768
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . $courseParams . '&amp;id=' . $parent_id . '&amp;move=' . $document_id .  '">' .
5769
-                        Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5768
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.$courseParams.'&amp;id='.$parent_id.'&amp;move='.$document_id.'">'.
5769
+                        Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5770 5770
                 }
5771 5771
             }
5772 5772
 
5773 5773
             //Visibility button
5774 5774
             if ($is_certificate_mode) {
5775
-                $modify_icons .= '&nbsp;' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL) . '</a>';
5775
+                $modify_icons .= '&nbsp;'.Display::return_icon($visibility_icon.'.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL).'</a>';
5776 5776
             } else {
5777 5777
                 if (api_is_allowed_to_edit() || api_is_platform_admin()) {
5778 5778
                     if ($visibility_icon == 'invisible') {
@@ -5780,14 +5780,14 @@  discard block
 block discarded – undo
5780 5780
                     } else {
5781 5781
                         $tip_visibility = get_lang('Hide');
5782 5782
                     }
5783
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . $courseParams . '&amp;id=' . $parent_id . '&amp;' . $visibility_command . '=' . $id . '&amp;' . $sort_params . '">' .
5784
-                        Display::return_icon($visibility_icon . '.png', $tip_visibility, '', ICON_SIZE_SMALL) . '</a>';
5783
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.$courseParams.'&amp;id='.$parent_id.'&amp;'.$visibility_command.'='.$id.'&amp;'.$sort_params.'">'.
5784
+                        Display::return_icon($visibility_icon.'.png', $tip_visibility, '', ICON_SIZE_SMALL).'</a>';
5785 5785
                 }
5786 5786
             }
5787 5787
 
5788 5788
             // Delete button
5789 5789
             if (in_array($path, DocumentManager::get_system_folders())) {
5790
-                $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5790
+                $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5791 5791
             } else {
5792 5792
                 $titleToShow = addslashes(basename($document_data['title']));
5793 5793
 
@@ -5795,23 +5795,23 @@  discard block
 block discarded – undo
5795 5795
                     $_GET['curdirpath'] == '/certificates' &&
5796 5796
                     DocumentManager::get_default_certificate_id(api_get_course_id()) == $id
5797 5797
                 ) {
5798
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . $courseParams . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;' . $sort_params . 'delete_certificate_id=' . $id . '" onclick="return confirmation(\'' . $titleToShow . '\');">' .
5799
-                        Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5798
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.$courseParams.'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'delete_certificate_id='.$id.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5799
+                        Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5800 5800
                 } else {
5801 5801
                     if ($is_certificate_mode) {
5802
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . $courseParams . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid=' . $document_id  . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow . '\');">' .
5803
-                            Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5802
+                        $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.$courseParams.'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5803
+                            Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5804 5804
                     } else {
5805 5805
                         if ($sessionId) {
5806 5806
                             if ($document_data['session_id'] == $sessionId) {
5807
-                                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . $courseParams . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id  . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow . '\');">'.
5808
-                                    Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5807
+                                $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.$courseParams.'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5808
+                                    Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5809 5809
                             } else {
5810
-                                $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5810
+                                $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5811 5811
                             }
5812 5812
                         } else {
5813
-                            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . $courseParams . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow. '\');">' .
5814
-                                Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5813
+                            $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.$courseParams.'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5814
+                                Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5815 5815
                         }
5816 5816
                     }
5817 5817
                 }
@@ -5823,15 +5823,15 @@  discard block
 block discarded – undo
5823 5823
                 // nothing to do
5824 5824
             } else {
5825 5825
                 if ($usePpt2lp && $formatType) {
5826
-                    $modify_icons .= '&nbsp;<a class="convertAction" href="#" ' .
5827
-                        'data-documentId = ' . $document_id .
5828
-                        ' data-formatType = ' . $formatType . '>' .
5826
+                    $modify_icons .= '&nbsp;<a class="convertAction" href="#" '.
5827
+                        'data-documentId = '.$document_id.
5828
+                        ' data-formatType = '.$formatType.'>'.
5829 5829
                         Display::return_icon(
5830 5830
                             'convert.png',
5831 5831
                             get_lang('Convert'),
5832 5832
                             array(),
5833 5833
                             ICON_SIZE_SMALL
5834
-                        ) . '</a>';
5834
+                        ).'</a>';
5835 5835
                 }
5836 5836
             }
5837 5837
         }
@@ -5839,8 +5839,8 @@  discard block
 block discarded – undo
5839 5839
         if ($type == 'file' && ($extension == 'html' || $extension == 'htm')) {
5840 5840
             if ($is_template == 0) {
5841 5841
                 if ((isset($_GET['curdirpath']) && $_GET['curdirpath'] != '/certificates') || !isset($_GET['curdirpath'])) {
5842
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . $courseParams . '&amp;curdirpath=' . $curdirpath . '&amp;add_as_template=' . $id .  '&amp;' . $sort_params . '">' .
5843
-                        Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL) . '</a>';
5842
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.$courseParams.'&amp;curdirpath='.$curdirpath.'&amp;add_as_template='.$id.'&amp;'.$sort_params.'">'.
5843
+                        Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL).'</a>';
5844 5844
                 }
5845 5845
                 if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates') {//allow attach certificate to course
5846 5846
                     $visibility_icon_certificate = 'nocertificate';
@@ -5854,21 +5854,21 @@  discard block
 block discarded – undo
5854 5854
                         $certificate = get_lang('NoDefaultCertificate');
5855 5855
                     }
5856 5856
                     if (isset($_GET['selectcat'])) {
5857
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . $courseParams . '&amp;curdirpath=' . $curdirpath . '&amp;selectcat=' . intval($_GET['selectcat']) . '&amp;set_certificate=' . $id . '&amp;' . $sort_params . '">';
5857
+                        $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.$courseParams.'&amp;curdirpath='.$curdirpath.'&amp;selectcat='.intval($_GET['selectcat']).'&amp;set_certificate='.$id.'&amp;'.$sort_params.'">';
5858 5858
                         $modify_icons .= Display::return_icon($visibility_icon_certificate.'.png', $certificate);
5859 5859
                         $modify_icons .= '</a>';
5860 5860
                         if ($is_preview) {
5861
-                            $modify_icons .= '&nbsp;<a target="_blank"  href="' . api_get_self() . '?' . $courseParams . '&amp;curdirpath=' . $curdirpath . '&amp;set_preview=' . $id . '&amp;' . $sort_params . '" >' .
5862
-                                Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL) . '</a>';
5861
+                            $modify_icons .= '&nbsp;<a target="_blank"  href="'.api_get_self().'?'.$courseParams.'&amp;curdirpath='.$curdirpath.'&amp;set_preview='.$id.'&amp;'.$sort_params.'" >'.
5862
+                                Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL).'</a>';
5863 5863
                         }
5864 5864
                     }
5865 5865
                 }
5866 5866
             } else {
5867
-                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . $courseParams . '&curdirpath=' . $curdirpath . '&amp;remove_as_template=' . $id. '&amp;' . $sort_params . '">' .
5868
-                    Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL) . '</a>';
5867
+                $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.$courseParams.'&curdirpath='.$curdirpath.'&amp;remove_as_template='.$id.'&amp;'.$sort_params.'">'.
5868
+                    Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL).'</a>';
5869 5869
             }
5870
-            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . $courseParams . '&action=export_to_pdf&id=' . $id . '">' .
5871
-                Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a>';
5870
+            $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.$courseParams.'&action=export_to_pdf&id='.$id.'">'.
5871
+                Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL).'</a>';
5872 5872
         }
5873 5873
 
5874 5874
         return $modify_icons;
@@ -5940,7 +5940,7 @@  discard block
 block discarded – undo
5940 5940
                     // 3. inside a subfolder of the folder you want to move
5941 5941
                     if (($curdirpath != $folder) &&
5942 5942
                         ($folder != $move_file) &&
5943
-                        (substr($folder, 0, strlen($move_file) + 1) != $move_file . '/')
5943
+                        (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')
5944 5944
                     ) {
5945 5945
                         $path_displayed = $folder;
5946 5946
                         // If document title is used, we have to display titles instead of real paths...
@@ -5957,7 +5957,7 @@  discard block
 block discarded – undo
5957 5957
             foreach ($folders as $folder) {
5958 5958
                 if (($curdirpath != $folder) &&
5959 5959
                     ($folder != $move_file) &&
5960
-                    (substr($folder, 0, strlen($move_file) + 1) != $move_file . '/')
5960
+                    (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')
5961 5961
                 ) {
5962 5962
                     // Cannot copy dir into his own subdir
5963 5963
                     $path_displayed = DocumentManager::get_titles_of_path($folder);
@@ -6000,10 +6000,10 @@  discard block
 block discarded – undo
6000 6000
                 // If this path has soon been stored here we don't need a new query
6001 6001
                 $path_displayed .= $tmp_folders_titles[$tmp_path];
6002 6002
             } else {
6003
-                $sql = 'SELECT title FROM ' . Database::get_course_table(TABLE_DOCUMENT) . '
6004
-                    WHERE c_id = ' . $course_id . ' AND path LIKE BINARY "' . $tmp_path . '"';
6003
+                $sql = 'SELECT title FROM '.Database::get_course_table(TABLE_DOCUMENT).'
6004
+                    WHERE c_id = ' . $course_id.' AND path LIKE BINARY "'.$tmp_path.'"';
6005 6005
                 $rs = Database::query($sql);
6006
-                $tmp_title = '/' . Database::result($rs, 0, 0);
6006
+                $tmp_title = '/'.Database::result($rs, 0, 0);
6007 6007
                 $path_displayed .= $tmp_title;
6008 6008
                 $tmp_folders_titles[$tmp_path] = $tmp_title;
6009 6009
             }
@@ -6040,7 +6040,7 @@  discard block
 block discarded – undo
6040 6040
         $clean_curdirpath = Security::remove_XSS($curdirpath);
6041 6041
         if ($clean_curdirpath == '/shared_folder') {
6042 6042
             return true;
6043
-        } elseif ($clean_curdirpath == '/shared_folder_session_' . $current_session_id) {
6043
+        } elseif ($clean_curdirpath == '/shared_folder_session_'.$current_session_id) {
6044 6044
             return true;
6045 6045
         } else {
6046 6046
             return false;
@@ -6056,7 +6056,7 @@  discard block
 block discarded – undo
6056 6056
         $clean_path = Security::remove_XSS($path);
6057 6057
         if (strpos($clean_path, 'shared_folder/sf_user_')) {
6058 6058
             return true;
6059
-        } elseif (strpos($clean_path, 'shared_folder_session_' . $current_session_id . '/sf_user_')) {
6059
+        } elseif (strpos($clean_path, 'shared_folder_session_'.$current_session_id.'/sf_user_')) {
6060 6060
             return true;
6061 6061
         } else {
6062 6062
             return false;
@@ -6069,11 +6069,11 @@  discard block
 block discarded – undo
6069 6069
      */
6070 6070
     public static function is_my_shared_folder($user_id, $path, $current_session_id)
6071 6071
     {
6072
-        $clean_path = Security::remove_XSS($path) . '/';
6072
+        $clean_path = Security::remove_XSS($path).'/';
6073 6073
         //for security does not remove the last slash
6074
-        $main_user_shared_folder = '/shared_folder\/sf_user_' . $user_id . '\//';
6074
+        $main_user_shared_folder = '/shared_folder\/sf_user_'.$user_id.'\//';
6075 6075
         //for security does not remove the last slash
6076
-        $main_user_shared_folder_session = '/shared_folder_session_' . $current_session_id . '\/sf_user_' . $user_id . '\//';
6076
+        $main_user_shared_folder_session = '/shared_folder_session_'.$current_session_id.'\/sf_user_'.$user_id.'\//';
6077 6077
 
6078 6078
         if (preg_match($main_user_shared_folder, $clean_path)) {
6079 6079
             return true;
@@ -6346,7 +6346,7 @@  discard block
 block discarded – undo
6346 6346
                 ON (i.c_id = d.c_id)
6347 6347
                 WHERE
6348 6348
                     d.id = i.ref AND
6349
-                    i.tool = '" . TOOL_DOCUMENT . "'
6349
+                    i.tool = '".TOOL_DOCUMENT."'
6350 6350
                     $conditionSession AND
6351 6351
                     i.c_id = $courseId AND
6352 6352
                     d.c_id = $courseId ";
@@ -6354,9 +6354,9 @@  discard block
 block discarded – undo
6354 6354
         $result = Database::query($sql);
6355 6355
         $documents = Database::store_result($result, 'ASSOC');
6356 6356
         if ($documents) {
6357
-            $course_dir = $courseInfo['directory'] . '/document';
6357
+            $course_dir = $courseInfo['directory'].'/document';
6358 6358
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
6359
-            $base_work_dir = $sys_course_path . $course_dir;
6359
+            $base_work_dir = $sys_course_path.$course_dir;
6360 6360
 
6361 6361
             foreach ($documents as $document) {
6362 6362
                 $documentId = $document['id'];
Please login to merge, or discard this patch.