Completed
Pull Request — 1.11.x (#1215)
by José
45:23
created
main/work/downloadfolder.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 $work_id = $_GET['id'];
11 11
 require_once '../inc/global.inc.php';
12
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
12
+$current_course_tool = TOOL_STUDENTPUBLICATION;
13 13
 $_course = api_get_course_info();
14 14
 
15 15
 // Protection
@@ -178,10 +178,10 @@  discard block
 block discarded – undo
178 178
 if (!empty($files)) {
179 179
     $fileName = api_replace_dangerous_char($work_data['title']);
180 180
     // Logging
181
-    Event::event_download($fileName .'.zip (folder)');
181
+    Event::event_download($fileName.'.zip (folder)');
182 182
 
183 183
     //start download of created file
184
-    $name = $fileName .'.zip';
184
+    $name = $fileName.'.zip';
185 185
     if (Security::check_abs_path($temp_zip_file, api_get_path(SYS_ARCHIVE_PATH))) {
186 186
         DocumentManager::file_send_for_download($temp_zip_file, true, $name);
187 187
         @unlink($temp_zip_file);
Please login to merge, or discard this patch.
main/work/add_user.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
         $usersAdded[] = $myUserId;
75 75
         $userInfo = api_get_user_info($myUserId);
76 76
         $url = api_get_path(WEB_CODE_PATH).'work/add_user.php?action=delete&id='.$workId.'&user_id='.$myUserId;
77
-        $link = Display::url('<em class="fa fa-trash"></em> ' . get_lang('Delete'), $url, array('class' => 'btn btn-danger btn-sm'));
78
-        echo '<li class="list-group-item">' . $userInfo['complete_name_with_username'] . '<div class="pull-right">' . $link . '</div></li>';
77
+        $link = Display::url('<em class="fa fa-trash"></em> '.get_lang('Delete'), $url, array('class' => 'btn btn-danger btn-sm'));
78
+        echo '<li class="list-group-item">'.$userInfo['complete_name_with_username'].'<div class="pull-right">'.$link.'</div></li>';
79 79
     }
80 80
     echo '</ul>';
81 81
 }
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
     foreach ($userToAddList as $user) {
109 109
         $userName = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') ';
110 110
         $url = api_get_path(WEB_CODE_PATH).'work/add_user.php?action=add&id='.$workId.'&user_id='.$user['user_id'];
111
-        $link = Display::url('<em class="fa fa-plus"></em> ' . get_lang('Add'), $url, array('class' => 'btn btn-primary btn-sm'));
112
-        echo '<li class="list-group-item">' . $userName . '<div class="pull-right"> ' . $link . '</div></li>';
111
+        $link = Display::url('<em class="fa fa-plus"></em> '.get_lang('Add'), $url, array('class' => 'btn btn-primary btn-sm'));
112
+        echo '<li class="list-group-item">'.$userName.'<div class="pull-right"> '.$link.'</div></li>';
113 113
     }
114 114
     echo '</ul>';
115 115
 } else {
Please login to merge, or discard this patch.
main/work/upload_from_template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 use ChamiloSession as Session;
5 5
 
6 6
 require_once '../inc/global.inc.php';
7
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
7
+$current_course_tool = TOOL_STUDENTPUBLICATION;
8 8
 
9 9
 api_protect_course_script(true);
10 10
 
Please login to merge, or discard this patch.
main/coursecopy/create_backup.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 
73 73
     $zip_file = CourseArchiver::write_course($course);
74 74
     Display::display_confirmation_message(get_lang('BackupCreated'));
75
-    echo '<br /><a class="btn btn-primary btn-large" href="' . api_get_path(WEB_CODE_PATH) . 'course_info/download.php?archive=' . $zip_file . '&' . api_get_cidreq() . '">
76
-    ' . get_lang('Download') . '</a>';
75
+    echo '<br /><a class="btn btn-primary btn-large" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.$zip_file.'&'.api_get_cidreq().'">
76
+    ' . get_lang('Download').'</a>';
77 77
 
78 78
 } elseif (Security::check_token('post') && (
79 79
         isset($_POST['backup_option']) &&
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     if (!$course->has_resources()) {
96 96
         echo get_lang('NoResourcesToBackup');
97 97
     } else {
98
-        $form = new FormValidator('create_backup_form', 'post', api_get_self() . '?' . api_get_cidreq());
98
+        $form = new FormValidator('create_backup_form', 'post', api_get_self().'?'.api_get_cidreq());
99 99
         $form->addElement('header', get_lang('SelectOptionForBackup'));
100 100
         $form->addElement('radio', 'backup_option', '', get_lang('CreateFullBackup'), 'full_backup');
101 101
         $form->addElement('radio', 'backup_option', '', get_lang('LetMeSelectItems'), 'select_items');
Please login to merge, or discard this patch.
main/coursecopy/copy_course.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 
8 8
 // Setting the global file that gets the general configuration, the databases, the languages, ...
9 9
 require_once '../inc/global.inc.php';
10
-$current_course_tool  = TOOL_COURSE_MAINTENANCE;
10
+$current_course_tool = TOOL_COURSE_MAINTENANCE;
11 11
 api_protect_course_script(true);
12 12
 
13 13
 // Including additional libraries
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $form->addGroup($group, '', get_lang('SameFilename'));
121 121
         $form->add_progress_bar();
122 122
         $form->addButtonSave(get_lang('CopyCourse'));
123
-        $form->setDefaults(array('copy_option' =>'select_items','same_file_name_option' => FILE_OVERWRITE));
123
+        $form->setDefaults(array('copy_option' =>'select_items', 'same_file_name_option' => FILE_OVERWRITE));
124 124
 
125 125
         // Add Security token
126 126
         $token = Security::get_token();
Please login to merge, or discard this patch.
main/coursecopy/import_backup.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -98,21 +98,21 @@  discard block
 block discarded – undo
98 98
         $cr->set_file_option($_POST['same_file_name_option']);
99 99
         $cr->restore();
100 100
         Display::display_normal_message(get_lang('ImportFinished'));
101
-        echo '<a class="btn btn-default" href="' . api_get_path(WEB_COURSE_PATH) . api_get_course_path() . '/index.php">' . get_lang('CourseHomepage') . '</a>';
101
+        echo '<a class="btn btn-default" href="'.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/index.php">'.get_lang('CourseHomepage').'</a>';
102 102
     } else {
103 103
         if (!$error) {
104 104
             Display::display_warning_message(get_lang('NoResourcesInBackupFile'));
105
-            echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
105
+            echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>';
106 106
         } elseif ($filename === false) {
107 107
             Display::display_error_message(get_lang('ArchivesDirectoryNotWriteableContactAdmin'));
108
-            echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
108
+            echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>';
109 109
         } else {
110 110
             if ($filename == '') {
111 111
                 Display::display_error_message(get_lang('SelectBackupFile'));
112
-                echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
112
+                echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>';
113 113
             } else {
114 114
                 Display::display_error_message(get_lang('UploadError'));
115
-                echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
115
+                echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>';
116 116
             }
117 117
         }
118 118
     }
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
         CourseSelectForm::display_form($course, $hiddenFields);
143 143
     } elseif ($filename === false) {
144 144
         Display::display_error_message(get_lang('ArchivesDirectoryNotWriteableContactAdmin'));
145
-        echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
145
+        echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>';
146 146
     } else {
147 147
         Display::display_warning_message(get_lang('NoResourcesInBackupFile'));
148
-        echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>';
148
+        echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>';
149 149
     }
150 150
 } else {
151 151
     $user = api_get_user_info();
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     $form = new FormValidator(
158 158
         'import_backup_form',
159 159
         'post',
160
-        api_get_path(WEB_CODE_PATH) . 'coursecopy/import_backup.php?' . api_get_cidreq(),
160
+        api_get_path(WEB_CODE_PATH).'coursecopy/import_backup.php?'.api_get_cidreq(),
161 161
         '',
162 162
         array('enctype' => 'multipart/form-data')
163 163
     );
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
         );
190 190
         $options['null'] = '-';
191 191
         foreach ($backups as $index => $backup) {
192
-            $options[$backup['file']] = $backup['course_code'] . ' (' . $backup['date'] . ')';
192
+            $options[$backup['file']] = $backup['course_code'].' ('.$backup['date'].')';
193 193
         }
194 194
         $form->addElement(
195 195
             'select',
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
             'radio',
208 208
             '',
209 209
             '',
210
-            '<i>' . get_lang('NoBackupsAvailable') . '</i>',
210
+            '<i>'.get_lang('NoBackupsAvailable').'</i>',
211 211
             '',
212 212
             'disabled="true"'
213 213
         );
Please login to merge, or discard this patch.
main/search/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
  */
8 8
 
9 9
 require_once '../inc/global.inc.php';
10
-$this_section =  SECTION_COURSES;
10
+$this_section = SECTION_COURSES;
11 11
 
12 12
 if (extension_loaded('xapian')) {
13 13
 	require '../newscorm/lp_list_search.php';
Please login to merge, or discard this patch.
main/social/home.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 api_block_anonymous_users();
21 21
 
22 22
 if (api_get_setting('allow_social_tool') != 'true') {
23
-    $url = api_get_path(WEB_CODE_PATH) . 'auth/profile.php';
24
-    header('Location: ' . $url);
23
+    $url = api_get_path(WEB_CODE_PATH).'auth/profile.php';
24
+    header('Location: '.$url);
25 25
     exit;
26 26
 }
27 27
 
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
     $allowed_picture_types = api_get_supported_image_extensions();
46 46
     $form->addRule(
47 47
         'picture',
48
-        get_lang('OnlyImagesAllowed') . ' (' . implode(
48
+        get_lang('OnlyImagesAllowed').' ('.implode(
49 49
             ',',
50 50
             $allowed_picture_types
51
-        ) . ')',
51
+        ).')',
52 52
         'filetype',
53 53
         $allowed_picture_types
54 54
     );
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                 $table_user = Database :: get_main_table(TABLE_MAIN_USER);
68 68
 
69 69
                 $sql = "UPDATE $table_user
70
-                    SET picture_uri = '$new_picture' WHERE user_id =  " . api_get_user_id();
70
+                    SET picture_uri = '$new_picture' WHERE user_id =  ".api_get_user_id();
71 71
 
72 72
                 $result = Database::query($sql);
73 73
             }
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
         $result['name'] = Security::remove_XSS($result['name'], STUDENT, true);
94 94
 
95 95
         if ($result['count'] == 1) {
96
-            $result['count'] = '1 ' . get_lang('Member');
96
+            $result['count'] = '1 '.get_lang('Member');
97 97
         } else {
98
-            $result['count'] = $result['count'] . ' ' . get_lang('Members');
98
+            $result['count'] = $result['count'].' '.get_lang('Members');
99 99
         }
100 100
 
101 101
         $group_url = "group_view.php?id=$id";
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
             80
112 112
         );
113 113
 
114
-        $result['picture'] = '<img class="group-image" src="' . $picture['file'] . '" />';
115
-        $group_actions = '<div class="group-more"><a href="groups.php?#tab_browse-2">' . get_lang('SeeMore') . '</a></div>';
116
-        $group_info= '<div class="description"><p>' . cut($result['description'], 120, true) . "</p></div>";
114
+        $result['picture'] = '<img class="group-image" src="'.$picture['file'].'" />';
115
+        $group_actions = '<div class="group-more"><a href="groups.php?#tab_browse-2">'.get_lang('SeeMore').'</a></div>';
116
+        $group_info = '<div class="description"><p>'.cut($result['description'], 120, true)."</p></div>";
117 117
         $groups_newest[] = array(
118 118
             Display::url(
119 119
                 $result['picture'],
@@ -140,12 +140,12 @@  discard block
 block discarded – undo
140 140
     $group_url = "group_view.php?id=$id";
141 141
 
142 142
     if ($result['count'] == 1) {
143
-        $result['count'] = '1 ' . get_lang('Member');
143
+        $result['count'] = '1 '.get_lang('Member');
144 144
     } else {
145
-        $result['count'] = $result['count'] . ' ' . get_lang('Members');
145
+        $result['count'] = $result['count'].' '.get_lang('Members');
146 146
     }
147 147
     $result['name'] = '<div class="group-name">'.Display::url(
148
-            api_ucwords(cut($result['name'], 40, true)),$group_url)
148
+            api_ucwords(cut($result['name'], 40, true)), $group_url)
149 149
         .'</div><div class="count-username">'.Display::returnFontAwesomeIcon('user').$result['count'].'</div>';
150 150
 
151 151
     $picture = $userGroup->get_picture_group(
@@ -153,42 +153,42 @@  discard block
 block discarded – undo
153 153
         $result['picture'],
154 154
         80
155 155
     );
156
-    $result['picture_uri'] = '<img class="group-image" src="' . $picture['file'] . '" />';
157
-    $group_actions = '<div class="group-more" ><a href="groups.php?#tab_browse-3">' . get_lang('SeeMore') . '</a></div>';
158
-    $group_info= '<div class="description"><p>' . cut($result['description'], 120, true) . "</p></div>";
156
+    $result['picture_uri'] = '<img class="group-image" src="'.$picture['file'].'" />';
157
+    $group_actions = '<div class="group-more" ><a href="groups.php?#tab_browse-3">'.get_lang('SeeMore').'</a></div>';
158
+    $group_info = '<div class="description"><p>'.cut($result['description'], 120, true)."</p></div>";
159 159
     $groups_pop[] = array(
160 160
         Display::url($result['picture_uri'], $group_url),
161
-        $result['name'],$group_info. $group_actions
161
+        $result['name'], $group_info.$group_actions
162 162
     );
163 163
 }
164 164
 
165
-$list=count($groups_newest);
165
+$list = count($groups_newest);
166 166
 $social_group_block = null;
167 167
 if ($list > 0) {
168 168
     $social_group_block .= '<div class="list-group-newest">';
169
-    $social_group_block .= '<div class="group-title">' . get_lang('Newest') . '</div>';
170
-    for($i = 0;$i < $list; $i++){
171
-        $social_group_block.='<div class="row">';
172
-        $social_group_block.='<div class="col-md-2">' . $groups_newest[$i][0] . '</div>';
173
-        $social_group_block.='<div class="col-md-10">' . $groups_newest[$i][1];
174
-        $social_group_block.= $groups_newest[$i][2] . '</div>';
175
-        $social_group_block.="</div>";
169
+    $social_group_block .= '<div class="group-title">'.get_lang('Newest').'</div>';
170
+    for ($i = 0; $i < $list; $i++) {
171
+        $social_group_block .= '<div class="row">';
172
+        $social_group_block .= '<div class="col-md-2">'.$groups_newest[$i][0].'</div>';
173
+        $social_group_block .= '<div class="col-md-10">'.$groups_newest[$i][1];
174
+        $social_group_block .= $groups_newest[$i][2].'</div>';
175
+        $social_group_block .= "</div>";
176 176
     }
177
-    $social_group_block.= "</div>";
177
+    $social_group_block .= "</div>";
178 178
 }
179
-$list=count($groups_pop);
179
+$list = count($groups_pop);
180 180
 if ($list > 0) {
181 181
     $social_group_block .= '<div class="list-group-newest">';
182
-    $social_group_block .= '<div class="group-title">' . get_lang('Popular') . '</div>';
183
-
184
-    for($i = 0;$i < $list; $i++){
185
-        $social_group_block.='<div class="row">';
186
-        $social_group_block.='<div class="col-md-2">' . $groups_pop[$i][0] . '</div>';
187
-        $social_group_block.='<div class="col-md-10">' . $groups_pop[$i][1];
188
-        $social_group_block.= $groups_pop[$i][2] . '</div>';
189
-        $social_group_block.="</div>";
182
+    $social_group_block .= '<div class="group-title">'.get_lang('Popular').'</div>';
183
+
184
+    for ($i = 0; $i < $list; $i++) {
185
+        $social_group_block .= '<div class="row">';
186
+        $social_group_block .= '<div class="col-md-2">'.$groups_pop[$i][0].'</div>';
187
+        $social_group_block .= '<div class="col-md-10">'.$groups_pop[$i][1];
188
+        $social_group_block .= $groups_pop[$i][2].'</div>';
189
+        $social_group_block .= "</div>";
190 190
     }
191
-    $social_group_block.= "</div>";
191
+    $social_group_block .= "</div>";
192 192
 }
193 193
 // My friends
194 194
 $friend_html = SocialManager::listMyFriendsBlock(
Please login to merge, or discard this patch.
main/social/my_skills_report.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 $isDRH = api_is_drh();
13 13
 
14 14
 if (!$isStudent && !$isStudentBoss && !$isDRH) {
15
-    header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/skills_wheel.php');
15
+    header('Location: '.api_get_path(WEB_CODE_PATH).'social/skills_wheel.php');
16 16
     exit;
17 17
 }
18 18
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
 $tpl->assign('rows', $tableRows);
193 193
 
194
-$contentTemplate = $tpl->fetch("default/" . $tplPath);
194
+$contentTemplate = $tpl->fetch("default/".$tplPath);
195 195
 
196 196
 $tpl->assign('content', $contentTemplate);
197 197
 $tpl->display_one_col_template();
Please login to merge, or discard this patch.