@@ -222,14 +222,14 @@ |
||
222 | 222 | return \Display::return_icon('badges-default.png', null, null, ICON_SIZE_BIG, null, true); |
223 | 223 | } |
224 | 224 | |
225 | - return api_get_path(WEB_UPLOAD_PATH) . 'badges/' . sha1($this->name) . '-small.png'; |
|
225 | + return api_get_path(WEB_UPLOAD_PATH).'badges/'.sha1($this->name).'-small.png'; |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | if (empty($this->icon)) { |
229 | 229 | return \Display::return_icon('badges-default.png', null, null, ICON_SIZE_HUGE, null, true); |
230 | 230 | } |
231 | 231 | |
232 | - return api_get_path(WEB_UPLOAD_PATH) . "badges/{$this->icon}"; |
|
232 | + return api_get_path(WEB_UPLOAD_PATH)."badges/{$this->icon}"; |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | /** |
@@ -215,8 +215,8 @@ discard block |
||
215 | 215 | // We are sure that the extra field exists. |
216 | 216 | foreach ($extra_fields as $extras) { |
217 | 217 | if (isset($user[$extras[1]])) { |
218 | - $key = $extras[1]; |
|
219 | - $value = $user[$extras[1]]; |
|
218 | + $key = $extras[1]; |
|
219 | + $value = $user[$extras[1]]; |
|
220 | 220 | UserManager::update_extra_field_value($user_id, $key, $value); |
221 | 221 | } |
222 | 222 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | global $current_tag; |
254 | 254 | switch ($data) { |
255 | 255 | case 'Contact': |
256 | - $user = array (); |
|
256 | + $user = array(); |
|
257 | 257 | break; |
258 | 258 | default: |
259 | 259 | $current_tag = $data; |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | |
351 | 351 | if (in_array($ext_import_file, $allowed_file_mimetype)) { |
352 | 352 | if (strcmp($file_type, 'csv') === 0 && $ext_import_file == $allowed_file_mimetype[0]) { |
353 | - $users = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
353 | + $users = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
354 | 354 | $errors = validate_data($users); |
355 | 355 | $error_kind_file = false; |
356 | 356 | } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) { |
@@ -19,24 +19,24 @@ discard block |
||
19 | 19 | $join_url = ''; |
20 | 20 | |
21 | 21 | $this_section = SECTION_SOCIAL; |
22 | -$allowed_views = array('mygroups','newest','pop'); |
|
22 | +$allowed_views = array('mygroups', 'newest', 'pop'); |
|
23 | 23 | $content = null; |
24 | 24 | |
25 | 25 | if (isset($_GET['view']) && in_array($_GET['view'], $allowed_views)) { |
26 | 26 | if ($_GET['view'] == 'mygroups') { |
27 | - $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); |
|
28 | - $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('MyGroups')); |
|
29 | - } else if ( $_GET['view'] == 'newest') { |
|
30 | - $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); |
|
31 | - $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Newest')); |
|
32 | - } else { |
|
33 | - $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); |
|
34 | - $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Popular')); |
|
27 | + $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); |
|
28 | + $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('MyGroups')); |
|
29 | + } else if ($_GET['view'] == 'newest') { |
|
30 | + $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); |
|
31 | + $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Newest')); |
|
32 | + } else { |
|
33 | + $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); |
|
34 | + $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Popular')); |
|
35 | 35 | } |
36 | 36 | } else { |
37 | - $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); |
|
37 | + $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); |
|
38 | 38 | if (!isset($_GET['id'])) { |
39 | - $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('GroupList')); |
|
39 | + $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('GroupList')); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
@@ -73,16 +73,16 @@ discard block |
||
73 | 73 | } elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) { |
74 | 74 | $name .= ' '.Display::return_icon('social_group_moderator.png', get_lang('Moderator'), array('style'=>'vertical-align:middle')); |
75 | 75 | } |
76 | - $url = '<a href="group_view.php?id='.$id.'">' . $name . '</a>'; |
|
76 | + $url = '<a href="group_view.php?id='.$id.'">'.$name.'</a>'; |
|
77 | 77 | |
78 | - $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000)); |
|
79 | - if ($count_users_group == 1 ) { |
|
78 | + $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0, 1000)); |
|
79 | + if ($count_users_group == 1) { |
|
80 | 80 | $count_users_group = $count_users_group.' '.get_lang('Member'); |
81 | 81 | } else { |
82 | 82 | $count_users_group = $count_users_group.' '.get_lang('Members'); |
83 | 83 | } |
84 | 84 | |
85 | - $picture = $usergroup->get_picture_group($result['id'], $result['picture'],80); |
|
85 | + $picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80); |
|
86 | 86 | $result['picture'] = '<img class="social-groups-image" src="'.$picture['file'].'" />'; |
87 | 87 | |
88 | 88 | $members = Display::returnFontAwesomeIcon('user').$count_users_group; |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | $html .= '<div class="title-groups">'; |
95 | 95 | $html .= Display::tag('h5', $url); |
96 | 96 | $html .= '</div>'; |
97 | - $html .= '<div class="members-groups">' . $members . '</div>'; |
|
97 | + $html .= '<div class="members-groups">'.$members.'</div>'; |
|
98 | 98 | if ($result['description'] != '') { |
99 | - $html .= '<div class="description-groups">' . cut($result['description'],100,true) . '</div>'; |
|
99 | + $html .= '<div class="description-groups">'.cut($result['description'], 100, true).'</div>'; |
|
100 | 100 | } else { |
101 | 101 | $html .= ''; |
102 | 102 | } |
@@ -104,12 +104,12 @@ discard block |
||
104 | 104 | $html .= '</div>'; |
105 | 105 | |
106 | 106 | $grid_item_2 = $html; |
107 | - $grid_my_groups[]= array($grid_item_2); |
|
107 | + $grid_my_groups[] = array($grid_item_2); |
|
108 | 108 | } |
109 | 109 | } |
110 | 110 | |
111 | 111 | // Newest groups |
112 | -$results = $usergroup->get_groups_by_age(4,false); |
|
112 | +$results = $usergroup->get_groups_by_age(4, false); |
|
113 | 113 | |
114 | 114 | $grid_newest_groups = array(); |
115 | 115 | foreach ($results as $result) { |
@@ -118,16 +118,16 @@ discard block |
||
118 | 118 | $id = $result['id']; |
119 | 119 | $name = cut($result['name'], GROUP_TITLE_LENGTH, true); |
120 | 120 | |
121 | - $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000)); |
|
122 | - if ($count_users_group == 1 ) { |
|
121 | + $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0, 1000)); |
|
122 | + if ($count_users_group == 1) { |
|
123 | 123 | $count_users_group = $count_users_group.' '.get_lang('Member'); |
124 | 124 | } else { |
125 | 125 | $count_users_group = $count_users_group.' '.get_lang('Members'); |
126 | 126 | } |
127 | 127 | |
128 | - $url = '<a href="group_view.php?id='.$id.'">' . $name . '</a>'; |
|
128 | + $url = '<a href="group_view.php?id='.$id.'">'.$name.'</a>'; |
|
129 | 129 | |
130 | - $picture = $usergroup->get_picture_group($result['id'], $result['picture'],80); |
|
130 | + $picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80); |
|
131 | 131 | $result['picture'] = '<img class="social-groups-image" src="'.$picture['file'].'" />'; |
132 | 132 | $members = Display::returnFontAwesomeIcon('user').$count_users_group; |
133 | 133 | |
@@ -139,15 +139,15 @@ discard block |
||
139 | 139 | $html .= '<div class="title-groups">'; |
140 | 140 | $html .= Display::tag('h5', $url); |
141 | 141 | $html .= '</div>'; |
142 | - $html .= '<div class="members-groups">' . $members . '</div>'; |
|
142 | + $html .= '<div class="members-groups">'.$members.'</div>'; |
|
143 | 143 | if ($result['description'] != '') { |
144 | - $html .= '<div class="description-groups">' . cut($result['description'],100,true) . '</div>'; |
|
144 | + $html .= '<div class="description-groups">'.cut($result['description'], 100, true).'</div>'; |
|
145 | 145 | } else { |
146 | 146 | $html .= ''; |
147 | 147 | } |
148 | 148 | //Avoiding my groups |
149 | 149 | |
150 | - if (!in_array($id,$my_group_list)) { |
|
150 | + if (!in_array($id, $my_group_list)) { |
|
151 | 151 | $html .= '<a class="btn" href="group_view.php?id='.$id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a> '; |
152 | 152 | } |
153 | 153 | |
@@ -157,11 +157,11 @@ discard block |
||
157 | 157 | |
158 | 158 | $grid_item_2 = $html; |
159 | 159 | |
160 | - $grid_newest_groups[]= array($grid_item_2); |
|
160 | + $grid_newest_groups[] = array($grid_item_2); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | // Pop groups |
164 | -$results = $usergroup->get_groups_by_popularity(4,false); |
|
164 | +$results = $usergroup->get_groups_by_popularity(4, false); |
|
165 | 165 | $grid_pop_groups = array(); |
166 | 166 | |
167 | 167 | if (is_array($results) && count($results) > 0) { |
@@ -169,18 +169,18 @@ discard block |
||
169 | 169 | $result['name'] = Security::remove_XSS($result['name'], STUDENT, true); |
170 | 170 | $result['description'] = Security::remove_XSS($result['description'], STUDENT, true); |
171 | 171 | $id = $result['id']; |
172 | - $name = cut($result['name'],GROUP_TITLE_LENGTH,true); |
|
172 | + $name = cut($result['name'], GROUP_TITLE_LENGTH, true); |
|
173 | 173 | |
174 | - $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000)); |
|
175 | - if ($count_users_group == 1 ) { |
|
174 | + $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0, 1000)); |
|
175 | + if ($count_users_group == 1) { |
|
176 | 176 | $count_users_group = $count_users_group.' '.get_lang('Member'); |
177 | 177 | } else { |
178 | 178 | $count_users_group = $count_users_group.' '.get_lang('Members'); |
179 | 179 | } |
180 | 180 | |
181 | - $url = '<a href="group_view.php?id='.$id.'">' . $name . '</a>'; |
|
181 | + $url = '<a href="group_view.php?id='.$id.'">'.$name.'</a>'; |
|
182 | 182 | |
183 | - $picture = $usergroup->get_picture_group($result['id'], $result['picture'],80); |
|
183 | + $picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80); |
|
184 | 184 | $result['picture'] = '<img class="social-groups-image" src="'.$picture['file'].'" />'; |
185 | 185 | |
186 | 186 | $html = '<div class="row">'; |
@@ -191,15 +191,15 @@ discard block |
||
191 | 191 | $html .= '<div class="title-groups">'; |
192 | 192 | $html .= Display::tag('h5', $url); |
193 | 193 | $html .= '</div>'; |
194 | - $html .= '<div class="members-groups">' . $members . '</div>'; |
|
194 | + $html .= '<div class="members-groups">'.$members.'</div>'; |
|
195 | 195 | if ($result['description'] != '') { |
196 | - $html .= '<div class="description-groups">' . cut($result['description'],100,true) . '</div>'; |
|
196 | + $html .= '<div class="description-groups">'.cut($result['description'], 100, true).'</div>'; |
|
197 | 197 | } else { |
198 | 198 | $html .= ''; |
199 | 199 | } |
200 | 200 | //Avoiding my groups |
201 | 201 | |
202 | - if (!in_array($id,$my_group_list)) { |
|
202 | + if (!in_array($id, $my_group_list)) { |
|
203 | 203 | $html .= '<a class="btn" href="group_view.php?id='.$id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a> '; |
204 | 204 | } |
205 | 205 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $html .= '</div>'; |
209 | 209 | |
210 | 210 | $grid_item_2 = $html; |
211 | - $grid_pop_groups[]= array($grid_item_2); |
|
211 | + $grid_pop_groups[] = array($grid_item_2); |
|
212 | 212 | } |
213 | 213 | } |
214 | 214 | |
@@ -222,36 +222,36 @@ discard block |
||
222 | 222 | switch ($view_group) { |
223 | 223 | case 'mygroups': |
224 | 224 | if (count($grid_my_groups) > 0) { |
225 | - $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false)); |
|
225 | + $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true, false)); |
|
226 | 226 | } |
227 | 227 | if (api_get_setting( |
228 | 228 | 'social.allow_students_to_create_groups_in_social' |
229 | 229 | ) == 'true' |
230 | 230 | ) { |
231 | - $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'. |
|
231 | + $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'. |
|
232 | 232 | get_lang('CreateASocialGroup').'</a>'; |
233 | 233 | } else { |
234 | - if (api_is_allowed_to_edit(null,true)) { |
|
235 | - $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'. |
|
234 | + if (api_is_allowed_to_edit(null, true)) { |
|
235 | + $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'. |
|
236 | 236 | get_lang('CreateASocialGroup').'</a>'; |
237 | 237 | } |
238 | 238 | } |
239 | 239 | break; |
240 | 240 | case 'newest': |
241 | 241 | if (count($grid_newest_groups) > 0) { |
242 | - $newest_content = Display::return_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false)); |
|
242 | + $newest_content = Display::return_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, false)); |
|
243 | 243 | } |
244 | 244 | break; |
245 | 245 | default: |
246 | 246 | if (count($grid_pop_groups) > 0) { |
247 | - $popular_content = Display::return_sortable_grid('popular', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true,true)); |
|
247 | + $popular_content = Display::return_sortable_grid('popular', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, true, true)); |
|
248 | 248 | } |
249 | 249 | break; |
250 | 250 | } |
251 | 251 | } else { |
252 | 252 | $my_group_content = null; |
253 | 253 | if (count($grid_my_groups) > 0) { |
254 | - $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false)); |
|
254 | + $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true, false)); |
|
255 | 255 | } else { |
256 | 256 | $my_group_content = '<span class="muted">'.get_lang('GroupNone').'</span>'; |
257 | 257 | } |
@@ -259,30 +259,30 @@ discard block |
||
259 | 259 | 'social.allow_students_to_create_groups_in_social' |
260 | 260 | ) == 'true' |
261 | 261 | ) { |
262 | - $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'. |
|
262 | + $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'. |
|
263 | 263 | get_lang('CreateASocialGroup').'</a>'; |
264 | 264 | } else { |
265 | - if (api_is_allowed_to_edit(null,true)) { |
|
266 | - $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.get_lang('CreateASocialGroup').'</a>'; |
|
265 | + if (api_is_allowed_to_edit(null, true)) { |
|
266 | + $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.get_lang('CreateASocialGroup').'</a>'; |
|
267 | 267 | } |
268 | 268 | } |
269 | 269 | if (count($grid_newest_groups) > 0) { |
270 | - $newest_content = Display::return_sortable_grid('mygroups', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false)); |
|
270 | + $newest_content = Display::return_sortable_grid('mygroups', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, false)); |
|
271 | 271 | } else { |
272 | 272 | $newest_content = '<span class="muted">'.get_lang('GroupNone').'</span>'; |
273 | 273 | } |
274 | 274 | if (count($grid_pop_groups) > 0) { |
275 | - $popular_content = Display::return_sortable_grid('mygroups', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true,true)); |
|
275 | + $popular_content = Display::return_sortable_grid('mygroups', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, true, true)); |
|
276 | 276 | } else { |
277 | 277 | $popular_content = '<span class="muted">'.get_lang('GroupNone').'</span>'; |
278 | 278 | } |
279 | 279 | } |
280 | 280 | |
281 | 281 | if (!empty($create_group_item)) { |
282 | - $social_right_content .= Display::page_subheader($create_group_item); |
|
282 | + $social_right_content .= Display::page_subheader($create_group_item); |
|
283 | 283 | } |
284 | 284 | $headers = array(get_lang('Newest'), get_lang('Popular'), get_lang('MyGroups')); |
285 | -$social_right_content .= Display::tabs($headers, array($newest_content, $popular_content, $my_group_content),'tab_browse'); |
|
285 | +$social_right_content .= Display::tabs($headers, array($newest_content, $popular_content, $my_group_content), 'tab_browse'); |
|
286 | 286 | |
287 | 287 | if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'show_message' && isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'topic_deleted') { |
288 | 288 | Display::return_message(get_lang('Deleted'), 'success'); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | /* For licensing terms, see /license.txt */ |
3 | 3 | |
4 | 4 | require_once '../inc/global.inc.php'; |
5 | -$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
5 | +$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
6 | 6 | |
7 | 7 | require_once 'work.lib.php'; |
8 | 8 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $userInfo = api_get_user_info($work['user_id']); |
53 | 53 | $interbreadcrumb[] = array('url' => $url_dir, 'name' => $my_folder_data['title']); |
54 | 54 | $interbreadcrumb[] = array('url' => '#', 'name' => $userInfo['complete_name']); |
55 | - $interbreadcrumb[] = array('url' => '#','name' => $work['title']); |
|
55 | + $interbreadcrumb[] = array('url' => '#', 'name' => $work['title']); |
|
56 | 56 | |
57 | 57 | if (($courseInfo['show_score'] == 0 && |
58 | 58 | $work['active'] == 1 && |
@@ -4,7 +4,7 @@ discard block |
||
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 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $token = Security::get_token(); |
51 | 51 | |
52 | 52 | $student_can_edit_in_session = api_is_allowed_to_session_edit(false, true); |
53 | -$has_ended = false; |
|
53 | +$has_ended = false; |
|
54 | 54 | $is_author = false; |
55 | 55 | $work_item = get_work_data_by_id($item_id); |
56 | 56 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $form->setDefaults($defaults); |
221 | 221 | $error_message = null; |
222 | 222 | $_course = api_get_course_info(); |
223 | -$currentCourseRepositorySys = api_get_path(SYS_COURSE_PATH).$_course['path'] . '/'; |
|
223 | +$currentCourseRepositorySys = api_get_path(SYS_COURSE_PATH).$_course['path'].'/'; |
|
224 | 224 | |
225 | 225 | $succeed = false; |
226 | 226 | if ($form->validate()) { |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $description = isset($_POST['description']) ? $_POST['description'] : $work_data['description']; |
242 | 242 | |
243 | 243 | $add_to_update = null; |
244 | - if ($is_allowed_to_edit && ($_POST['qualification'] !='' )) { |
|
244 | + if ($is_allowed_to_edit && ($_POST['qualification'] != '')) { |
|
245 | 245 | $add_to_update = ', qualificator_id ='."'".api_get_user_id()."', "; |
246 | 246 | $add_to_update .= ' qualification = '."'".Database::escape_string($_POST['qualification'])."',"; |
247 | 247 | $add_to_update .= ' date_of_qualification = '."'".api_get_utc_datetime()."'"; |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | 'error' |
268 | 268 | ); |
269 | 269 | } else { |
270 | - $sql = "UPDATE " . $work_table . " |
|
270 | + $sql = "UPDATE ".$work_table." |
|
271 | 271 | SET title = '".Database::escape_string($title)."', |
272 | 272 | description = '".Database::escape_string($description)."' |
273 | 273 | ".$add_to_update." |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | /* For licensing terms, see /license.txt */ |
3 | 3 | |
4 | 4 | require_once '../inc/global.inc.php'; |
5 | -$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
5 | +$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
6 | 6 | |
7 | 7 | /* Configuration settings */ |
8 | 8 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $token = Security::get_token(); |
57 | 57 | |
58 | 58 | if (!empty($group_id)) { |
59 | - $group_properties = GroupManager::get_group_properties($group_id); |
|
59 | + $group_properties = GroupManager::get_group_properties($group_id); |
|
60 | 60 | $show_work = false; |
61 | 61 | |
62 | 62 | if (api_is_allowed_to_edit(false, true)) { |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | if (!empty($workId)) { |
109 | 109 | if (empty($_GET['list']) or Security::remove_XSS($_GET['list']) == 'with') { |
110 | 110 | $output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$workId.'&list=without">'. |
111 | - Display::return_icon('exercice_uncheck.png', get_lang('ViewUsersWithoutTask'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
111 | + Display::return_icon('exercice_uncheck.png', get_lang('ViewUsersWithoutTask'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
112 | 112 | } else { |
113 | 113 | if (!isset($_GET['action']) || (isset($_GET['action']) && $_GET['action'] != 'send_mail')) { |
114 | 114 | $output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$workId.'&list=without&action=send_mail&sec_token='.$token.'">'. |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | // STEP 2: at least one file has to be selected. If not we return an error message |
43 | 43 | $ids = isset($_GET['id']) ? $_GET['id'] : array(); |
44 | - if (count($ids)>0) { |
|
44 | + if (count($ids) > 0) { |
|
45 | 45 | $checked_file_ids = $_POST['id']; |
46 | 46 | } else { |
47 | 47 | foreach ($_POST as $key => $value) { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | $cat = get_dropbox_category($id); |
136 | - if (count($cat)==0) { |
|
136 | + if (count($cat) == 0) { |
|
137 | 137 | return false; |
138 | 138 | } |
139 | 139 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | WHERE c_id = $course_id AND cat_id='".intval($id)."'"; |
167 | 167 | $result = Database::query($sql); |
168 | 168 | |
169 | - while($row = Database::fetch_array($result)) { |
|
169 | + while ($row = Database::fetch_array($result)) { |
|
170 | 170 | $dropboxfile = new Dropbox_Person($user_id, $is_courseAdmin, $is_courseTutor); |
171 | 171 | if ($action == 'deletereceivedcategory') { |
172 | 172 | $dropboxfile->deleteReceivedWork($row[$id_field]); |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | |
658 | 658 | $full_name = $userInfo['complete_name'].$groupNameListToString; |
659 | 659 | $current_user_id = $current_user['user_id']; |
660 | - $options['user_' . $current_user_id] = $full_name; |
|
660 | + $options['user_'.$current_user_id] = $full_name; |
|
661 | 661 | } |
662 | 662 | } |
663 | 663 | } |
@@ -706,11 +706,11 @@ discard block |
||
706 | 706 | |
707 | 707 | $mailingId = $id - dropbox_cnf('mailingIdBase'); |
708 | 708 | if ($mailingId > 0) { |
709 | - return get_lang('MailingAsUsername', '') . $mailingId; |
|
709 | + return get_lang('MailingAsUsername', '').$mailingId; |
|
710 | 710 | } |
711 | 711 | $id = intval($id); |
712 | 712 | $sql = "SELECT ".(api_is_western_name_order() ? "CONCAT(firstname,' ', lastname)" : "CONCAT(lastname,' ', firstname)")." AS name |
713 | - FROM " . $dropbox_cnf['tbl_user'] . " |
|
713 | + FROM " . $dropbox_cnf['tbl_user']." |
|
714 | 714 | WHERE user_id='$id'"; |
715 | 715 | $result = Database::query($sql); |
716 | 716 | $res = Database::fetch_array($result); |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | { |
731 | 731 | $id = intval($id); |
732 | 732 | $sql = "SELECT username |
733 | - FROM " . dropbox_cnf('tbl_user') . " |
|
733 | + FROM " . dropbox_cnf('tbl_user')." |
|
734 | 734 | WHERE user_id='$id'"; |
735 | 735 | $result = Database::query($sql); |
736 | 736 | $res = Database::fetch_array($result); |
@@ -762,8 +762,8 @@ discard block |
||
762 | 762 | |
763 | 763 | // select all files that aren't referenced anymore |
764 | 764 | $sql = "SELECT DISTINCT f.id, f.filename |
765 | - FROM " . dropbox_cnf('tbl_file') . " f |
|
766 | - LEFT JOIN " . dropbox_cnf('tbl_person') . " p |
|
765 | + FROM " . dropbox_cnf('tbl_file')." f |
|
766 | + LEFT JOIN " . dropbox_cnf('tbl_person')." p |
|
767 | 767 | ON (f.id = p.file_id) |
768 | 768 | WHERE p.user_id IS NULL AND |
769 | 769 | f.c_id = $course_id |
@@ -771,14 +771,14 @@ discard block |
||
771 | 771 | $result = Database::query($sql); |
772 | 772 | while ($res = Database::fetch_array($result)) { |
773 | 773 | //delete the selected files from the post and file tables |
774 | - $sql = "DELETE FROM " . dropbox_cnf('tbl_post') . " |
|
775 | - WHERE c_id = $course_id AND file_id = '" . $res['id'] . "'"; |
|
774 | + $sql = "DELETE FROM ".dropbox_cnf('tbl_post')." |
|
775 | + WHERE c_id = $course_id AND file_id = '".$res['id']."'"; |
|
776 | 776 | Database::query($sql); |
777 | - $sql = "DELETE FROM " . dropbox_cnf('tbl_file') . " |
|
778 | - WHERE c_id = $course_id AND id ='" . $res['id'] . "'"; |
|
777 | + $sql = "DELETE FROM ".dropbox_cnf('tbl_file')." |
|
778 | + WHERE c_id = $course_id AND id ='".$res['id']."'"; |
|
779 | 779 | Database::query($sql); |
780 | 780 | //delete file from server |
781 | - @unlink( dropbox_cnf('sysPath') . '/' . $res['filename']); |
|
781 | + @unlink(dropbox_cnf('sysPath').'/'.$res['filename']); |
|
782 | 782 | } |
783 | 783 | } |
784 | 784 | |
@@ -801,11 +801,11 @@ discard block |
||
801 | 801 | |
802 | 802 | $mailingPseudoId = intval($mailingPseudoId); |
803 | 803 | $sql = "SELECT f.uploader_id |
804 | - FROM " . $dropbox_cnf['tbl_file'] . " f |
|
805 | - LEFT JOIN " . $dropbox_cnf['tbl_post'] . " p |
|
804 | + FROM " . $dropbox_cnf['tbl_file']." f |
|
805 | + LEFT JOIN " . $dropbox_cnf['tbl_post']." p |
|
806 | 806 | ON (f.id = p.file_id AND f.c_id = $course_id AND p.c_id = $course_id) |
807 | 807 | WHERE |
808 | - p.dest_user_id = '" . $mailingPseudoId . "' AND |
|
808 | + p.dest_user_id = '".$mailingPseudoId."' AND |
|
809 | 809 | p.c_id = $course_id |
810 | 810 | "; |
811 | 811 | $result = Database::query($sql); |
@@ -832,20 +832,20 @@ discard block |
||
832 | 832 | // for all content files, replace mailingPseudoId by owner as uploader |
833 | 833 | $file_id = intval($file_id); |
834 | 834 | $sql = "SELECT p.dest_user_id |
835 | - FROM " . $dropbox_cnf['tbl_post'] . " p |
|
836 | - WHERE c_id = $course_id AND p.file_id = '" . $file_id . "'"; |
|
835 | + FROM " . $dropbox_cnf['tbl_post']." p |
|
836 | + WHERE c_id = $course_id AND p.file_id = '".$file_id."'"; |
|
837 | 837 | $result = Database::query($sql); |
838 | 838 | |
839 | 839 | if ($res = Database::fetch_array($result)) { |
840 | 840 | $mailingPseudoId = $res['dest_user_id']; |
841 | 841 | if ($mailingPseudoId > dropbox_cnf('mailingIdBase')) { |
842 | - $sql = "DELETE FROM " . dropbox_cnf('tbl_person') . " |
|
843 | - WHERE c_id = $course_id AND user_id='" . $mailingPseudoId . "'"; |
|
842 | + $sql = "DELETE FROM ".dropbox_cnf('tbl_person')." |
|
843 | + WHERE c_id = $course_id AND user_id='".$mailingPseudoId."'"; |
|
844 | 844 | Database::query($sql); |
845 | 845 | |
846 | - $sql = "UPDATE " . dropbox_cnf('tbl_file') ." |
|
847 | - SET uploader_id='" . api_get_user_id() . "' |
|
848 | - WHERE c_id = $course_id AND uploader_id='" . $mailingPseudoId . "'"; |
|
846 | + $sql = "UPDATE ".dropbox_cnf('tbl_file')." |
|
847 | + SET uploader_id='" . api_get_user_id()."' |
|
848 | + WHERE c_id = $course_id AND uploader_id='".$mailingPseudoId."'"; |
|
849 | 849 | Database::query($sql); |
850 | 850 | } |
851 | 851 | } |
@@ -984,7 +984,7 @@ discard block |
||
984 | 984 | } |
985 | 985 | } |
986 | 986 | } else { // rename file to login_filename_uniqueId format |
987 | - $dropbox_filename = getLoginFromId($_user['user_id']) . "_" . $dropbox_filename . "_".uniqid(''); |
|
987 | + $dropbox_filename = getLoginFromId($_user['user_id'])."_".$dropbox_filename."_".uniqid(''); |
|
988 | 988 | } |
989 | 989 | |
990 | 990 | // creating the array that contains all the users who will receive the file |
@@ -1002,7 +1002,7 @@ discard block |
||
1002 | 1002 | } |
1003 | 1003 | } |
1004 | 1004 | |
1005 | - @move_uploaded_file($dropbox_filetmpname, dropbox_cnf('sysPath') . '/' . $dropbox_filename); |
|
1005 | + @move_uploaded_file($dropbox_filetmpname, dropbox_cnf('sysPath').'/'.$dropbox_filename); |
|
1006 | 1006 | |
1007 | 1007 | $b_send_mail = api_get_course_setting('email_alert_on_new_doc_dropbox'); |
1008 | 1008 | |
@@ -1023,14 +1023,14 @@ discard block |
||
1023 | 1023 | ), |
1024 | 1024 | $recipent_temp['email'], |
1025 | 1025 | get_lang('NewDropboxFileUploaded'), |
1026 | - get_lang('NewDropboxFileUploadedContent').' <a href="'.api_get_path(WEB_CODE_PATH).'dropbox/index.php?' . api_get_cidreq() . '">'.get_lang('SeeFile').'</a>'. |
|
1026 | + get_lang('NewDropboxFileUploadedContent').' <a href="'.api_get_path(WEB_CODE_PATH).'dropbox/index.php?'.api_get_cidreq().'">'.get_lang('SeeFile').'</a>'. |
|
1027 | 1027 | "\n\n". |
1028 | 1028 | api_get_person_name( |
1029 | 1029 | $_user['firstName'], |
1030 | 1030 | $_user['lastName'], |
1031 | 1031 | null, |
1032 | 1032 | PERSON_NAME_EMAIL_ADDRESS |
1033 | - )."\n". get_lang('Email') ." : ".$_user['mail'], |
|
1033 | + )."\n".get_lang('Email')." : ".$_user['mail'], |
|
1034 | 1034 | api_get_person_name( |
1035 | 1035 | $_user['firstName'], |
1036 | 1036 | $_user['lastName'], |
@@ -1308,7 +1308,7 @@ discard block |
||
1308 | 1308 | // Adding the content. |
1309 | 1309 | $return .= "\n<tr>"; |
1310 | 1310 | foreach ($column as $column_key => $column_value) { |
1311 | - if (!in_array($column_value,$dont_show_columns)) { |
|
1311 | + if (!in_array($column_value, $dont_show_columns)) { |
|
1312 | 1312 | $return .= "\n\t<td>"; |
1313 | 1313 | if (in_array($column_value, $make_link)) { |
1314 | 1314 | $return .= '<a href="'.$value[$column_value].'">'.$value[$column_value].'</a>'; |
@@ -1341,7 +1341,7 @@ discard block |
||
1341 | 1341 | WHERE c_id = $course_id GROUP BY file_id"; |
1342 | 1342 | $result = Database::query($sql); |
1343 | 1343 | $return = array(); |
1344 | - while ($row=Database::fetch_array($result)) { |
|
1344 | + while ($row = Database::fetch_array($result)) { |
|
1345 | 1345 | $return[$row['file_id']] = $row['total']; |
1346 | 1346 | } |
1347 | 1347 | return $return; |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $result = Database::query($sql); |
34 | 34 | |
35 | 35 | if (Database::num_rows($result)) { |
36 | - $files = Database::store_result($result); |
|
36 | + $files = Database::store_result($result); |
|
37 | 37 | $rows = array(); |
38 | 38 | foreach ($files as $file) { |
39 | 39 | //Check if I have this file: |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $is_courseTutor = api_is_course_tutor(); |
127 | 127 | $is_courseAdmin = api_is_course_admin(); |
128 | 128 | |
129 | -$current_course_tool = TOOL_DROPBOX; |
|
129 | +$current_course_tool = TOOL_DROPBOX; |
|
130 | 130 | |
131 | 131 | // the dropbox configuration parameters |
132 | 132 | $dropbox_cnf = require_once 'dropbox_config.inc.php'; |
@@ -278,10 +278,10 @@ discard block |
||
278 | 278 | $javascript .= " |
279 | 279 | </script>"; |
280 | 280 | $htmlHeadXtra[] = $javascript; |
281 | -$htmlHeadXtra[] ="<script> |
|
281 | +$htmlHeadXtra[] = "<script> |
|
282 | 282 | function confirmation (name) |
283 | 283 | { |
284 | - if (confirm(\" ". get_lang("AreYouSureToDeleteJS") ." \"+ name + \" ?\")) |
|
284 | + if (confirm(\" ". get_lang("AreYouSureToDeleteJS")." \"+ name + \" ?\")) |
|
285 | 285 | {return true;} |
286 | 286 | else |
287 | 287 | {return false;} |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | |
322 | 322 | if ((!$is_allowed_in_course || !$is_course_member) && !api_is_allowed_to_edit(null, true)) { |
323 | 323 | if ($origin != 'learnpath') { |
324 | - api_not_allowed(true);//print headers/footers |
|
324 | + api_not_allowed(true); //print headers/footers |
|
325 | 325 | } else { |
326 | 326 | api_not_allowed(); |
327 | 327 | } |