@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $iso = api_get_language_isocode(api_get_interface_language()); |
26 | 26 | $languageCondition = ''; |
27 | 27 | |
28 | - if (file_exists(api_get_path(SYS_PATH) . "web/assets/select2/dist/js/i18n/$iso.js")) { |
|
28 | + if (file_exists(api_get_path(SYS_PATH)."web/assets/select2/dist/js/i18n/$iso.js")) { |
|
29 | 29 | $html .= api_get_asset("select2/dist/js/i18n/$iso.js"); |
30 | 30 | $languageCondition = "language: '$iso',"; |
31 | 31 | } |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | //Get the minimumInputLength for select2 |
52 | 52 | $minimumInputLength = $this->getAttribute('minimumInputLength') > 3 ? |
53 | - $this->getAttribute('minimumInputLength') : |
|
54 | - 3 |
|
53 | + $this->getAttribute('minimumInputLength') : 3 |
|
55 | 54 | ; |
56 | 55 | |
57 | 56 | $plHolder = $this->getAttribute('placeholder'); |
@@ -81,7 +80,7 @@ discard block |
||
81 | 80 | $multiple = $multiple ? 'true' : 'false'; |
82 | 81 | |
83 | 82 | $max = $this->getAttribute('maximumSelectionLength'); |
84 | - $max = !empty($max) ? "maximumSelectionLength: $max, ": ''; |
|
83 | + $max = !empty($max) ? "maximumSelectionLength: $max, " : ''; |
|
85 | 84 | |
86 | 85 | $html .= <<<JS |
87 | 86 | <script> |
@@ -125,7 +124,7 @@ discard block |
||
125 | 124 | $this->removeAttribute('url_function'); |
126 | 125 | $this->setAttribute('style', 'width: 100%;'); |
127 | 126 | |
128 | - return parent::toHtml() . $html; |
|
127 | + return parent::toHtml().$html; |
|
129 | 128 | } |
130 | 129 | |
131 | 130 | /** |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | require_once '../inc/global.inc.php'; |
9 | 9 | require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/fe/exportgradebook.php'; |
10 | 10 | |
11 | -$current_course_tool = TOOL_GRADEBOOK; |
|
11 | +$current_course_tool = TOOL_GRADEBOOK; |
|
12 | 12 | |
13 | 13 | api_protect_course_script(true); |
14 | 14 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | null, |
75 | 75 | 'simple_search_form', |
76 | 76 | null, |
77 | - api_get_self() . '?selectcat=' . $category_id |
|
77 | + api_get_self().'?selectcat='.$category_id |
|
78 | 78 | ); |
79 | 79 | $values = $simple_search_form->exportValues(); |
80 | 80 | |
@@ -148,15 +148,15 @@ discard block |
||
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
151 | -if (isset($_GET['exportpdf'])) { |
|
152 | - $interbreadcrumb[] = array ( |
|
153 | - 'url' => api_get_self().'?selectcat=' . Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq(), |
|
151 | +if (isset($_GET['exportpdf'])) { |
|
152 | + $interbreadcrumb[] = array( |
|
153 | + 'url' => api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq(), |
|
154 | 154 | 'name' => get_lang('FlatView') |
155 | 155 | ); |
156 | 156 | |
157 | 157 | $pageNum = isset($_GET['flatviewlist_page_nr']) ? intval($_GET['flatviewlist_page_nr']) : null; |
158 | 158 | $perPage = isset($_GET['flatviewlist_per_page']) ? intval($_GET['flatviewlist_per_page']) : null; |
159 | - $url = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
159 | + $url = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
160 | 160 | 'exportpdf' => '', |
161 | 161 | 'offset' => $offset, |
162 | 162 | 'selectcat' => intval($_GET['selectcat']), |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | } |
196 | 196 | } |
197 | 197 | |
198 | -if (isset($_GET['print'])) { |
|
198 | +if (isset($_GET['print'])) { |
|
199 | 199 | $printable_data = GradebookUtils::get_printable_data( |
200 | 200 | $cat[0], |
201 | 201 | $users, |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | require_once '../inc/global.inc.php'; |
15 | 15 | $this_section = SECTION_COURSES; |
16 | -$current_course_tool = TOOL_GROUP; |
|
16 | +$current_course_tool = TOOL_GROUP; |
|
17 | 17 | |
18 | 18 | // Notice for unauthorized people. |
19 | 19 | api_protect_course_script(true); |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | $current_group = GroupManager :: get_group_properties($group_id); |
23 | 23 | |
24 | 24 | $nameTools = get_lang('EditGroup'); |
25 | -$interbreadcrumb[] = array ('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups')); |
|
26 | -$interbreadcrumb[] = array ('url' => 'group_space.php?'.api_get_cidreq(), 'name' => $current_group['name']); |
|
25 | +$interbreadcrumb[] = array('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups')); |
|
26 | +$interbreadcrumb[] = array('url' => 'group_space.php?'.api_get_cidreq(), 'name' => $current_group['name']); |
|
27 | 27 | |
28 | 28 | $is_group_member = GroupManager :: is_tutor_of_group(api_get_user_id(), $group_id); |
29 | 29 |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | $formSent = 0; |
16 | 16 | |
17 | 17 | // Crop picture plugin for session images |
18 | -$htmlHeadXtra[] = '<link href="'. api_get_path(WEB_PATH) .'web/assets/cropper/dist/cropper.min.css" rel="stylesheet">'; |
|
19 | -$htmlHeadXtra[] = '<script src="'. api_get_path(WEB_PATH) .'web/assets/cropper/dist/cropper.min.js"></script>'; |
|
18 | +$htmlHeadXtra[] = '<link href="'.api_get_path(WEB_PATH).'web/assets/cropper/dist/cropper.min.css" rel="stylesheet">'; |
|
19 | +$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_PATH).'web/assets/cropper/dist/cropper.min.js"></script>'; |
|
20 | 20 | $htmlHeadXtra[] = '<script> |
21 | 21 | $(document).ready(function() { |
22 | 22 | var $image = $("#previewImage"); |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | $tool_name = get_lang('EditSession'); |
104 | 104 | |
105 | 105 | //$interbreadcrumb[] = array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
106 | -$interbreadcrumb[] = array('url' => "session_list.php","name" => get_lang('SessionList')); |
|
107 | -$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id,"name" => get_lang('SessionOverview')); |
|
106 | +$interbreadcrumb[] = array('url' => "session_list.php", "name" => get_lang('SessionList')); |
|
107 | +$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id, "name" => get_lang('SessionOverview')); |
|
108 | 108 | |
109 | 109 | if (isset($_POST['formSent']) && $_POST['formSent']) { |
110 | 110 | $formSent = 1; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | WHERE status='1'".$order_clause; |
119 | 119 | |
120 | 120 | if (api_is_multiple_url_enabled()) { |
121 | - $table_access_url_rel_user= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
121 | + $table_access_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
122 | 122 | $access_url_id = api_get_current_access_url_id(); |
123 | 123 | if ($access_url_id != -1) { |
124 | 124 | $sql = "SELECT DISTINCT u.user_id,lastname,firstname,username |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $thisYear = date('Y'); |
135 | 135 | |
136 | 136 | $coachesOption = array( |
137 | - '' => '----- ' . get_lang('None') . ' -----' |
|
137 | + '' => '----- '.get_lang('None').' -----' |
|
138 | 138 | ); |
139 | 139 | |
140 | 140 | foreach ($coaches as $coach) { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | } |
155 | 155 | } |
156 | 156 | |
157 | -$formAction = api_get_self() . '?'; |
|
157 | +$formAction = api_get_self().'?'; |
|
158 | 158 | $formAction .= http_build_query(array( |
159 | 159 | 'page' => Security::remove_XSS($_GET['page']), |
160 | 160 | 'id' => $id |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $duration = null; |
221 | 221 | } |
222 | 222 | $description = $params['description']; |
223 | - $showDescription = isset($params['show_description']) ? 1: 0; |
|
223 | + $showDescription = isset($params['show_description']) ? 1 : 0; |
|
224 | 224 | $sendSubscriptionNotification = isset($params['send_subscription_notification']); |
225 | 225 | $isThisImageCropped = isset($params['cropResult']); |
226 | 226 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | ); |
257 | 257 | |
258 | 258 | if ($return == strval(intval($return))) { |
259 | - header('Location: resume_session.php?id_session=' . $return); |
|
259 | + header('Location: resume_session.php?id_session='.$return); |
|
260 | 260 | exit(); |
261 | 261 | } |
262 | 262 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | // Including the global initialization file. |
28 | 28 | require_once '../inc/global.inc.php'; |
29 | -$current_course_tool = TOOL_FORUM; |
|
29 | +$current_course_tool = TOOL_FORUM; |
|
30 | 30 | |
31 | 31 | // Notification for unauthorized people. |
32 | 32 | api_protect_course_script(true); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | // Course |
79 | 79 | if ( |
80 | - !api_is_allowed_to_edit(false, true) && //is a student |
|
80 | + !api_is_allowed_to_edit(false, true) && //is a student |
|
81 | 81 | (($current_forum_category && $current_forum_category['visibility'] == 0) || |
82 | 82 | $current_forum['visibility'] == 0 || !$user_has_access_in_group) |
83 | 83 | ) { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | } else { |
87 | 87 | //Course |
88 | 88 | if ( |
89 | - !api_is_allowed_to_edit(false, true) && //is a student |
|
89 | + !api_is_allowed_to_edit(false, true) && //is a student |
|
90 | 90 | ( |
91 | 91 | ($current_forum_category && $current_forum_category['visibility'] == 0) || |
92 | 92 | $current_forum['visibility'] == 0 |
@@ -102,12 +102,12 @@ discard block |
||
102 | 102 | $my_action = isset($_GET['action']) ? $_GET['action'] : ''; |
103 | 103 | |
104 | 104 | $gradebook = null; |
105 | -if (isset($_SESSION['gradebook'])){ |
|
105 | +if (isset($_SESSION['gradebook'])) { |
|
106 | 106 | $gradebook = $_SESSION['gradebook']; |
107 | 107 | } |
108 | 108 | |
109 | 109 | if (!empty($gradebook) && $gradebook == 'view') { |
110 | - $interbreadcrumb[] = array ( |
|
110 | + $interbreadcrumb[] = array( |
|
111 | 111 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
112 | 112 | 'name' => get_lang('ToolGradebook') |
113 | 113 | ); |
@@ -117,25 +117,25 @@ discard block |
||
117 | 117 | |
118 | 118 | if ($origin == 'group') { |
119 | 119 | $interbreadcrumb[] = array( |
120 | - 'url' => api_get_path(WEB_CODE_PATH) . 'group/group.php?'.api_get_cidreq(), |
|
120 | + 'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), |
|
121 | 121 | 'name' => get_lang('Groups') |
122 | 122 | ); |
123 | 123 | $interbreadcrumb[] = array( |
124 | - 'url' => api_get_path(WEB_CODE_PATH) . 'group/group_space.php?' . api_get_cidreq(), |
|
125 | - 'name' => get_lang('GroupSpace') . ' ' . $group_properties['name'] |
|
124 | + 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), |
|
125 | + 'name' => get_lang('GroupSpace').' '.$group_properties['name'] |
|
126 | 126 | ); |
127 | 127 | $interbreadcrumb[] = array( |
128 | 128 | 'url' => '#', |
129 | - 'name' => get_lang('Forum') . ' ' . Security::remove_XSS($current_forum['forum_title']) |
|
129 | + 'name' => get_lang('Forum').' '.Security::remove_XSS($current_forum['forum_title']) |
|
130 | 130 | ); |
131 | 131 | } else { |
132 | 132 | $interbreadcrumb[] = array( |
133 | - 'url' => $forumUrl . 'index.php?search=' . Security::remove_XSS($my_search), |
|
133 | + 'url' => $forumUrl.'index.php?search='.Security::remove_XSS($my_search), |
|
134 | 134 | 'name' => get_lang('ForumCategories') |
135 | 135 | ); |
136 | 136 | $interbreadcrumb[] = array( |
137 | - 'url' => $forumUrl . 'viewforumcategory.php?forumcategory=' . $current_forum_category['cat_id'] |
|
138 | - . '&search=' . Security::remove_XSS(urlencode($my_search)), |
|
137 | + 'url' => $forumUrl.'viewforumcategory.php?forumcategory='.$current_forum_category['cat_id'] |
|
138 | + . '&search='.Security::remove_XSS(urlencode($my_search)), |
|
139 | 139 | 'name' => prepare4display($current_forum_category['cat_title']) |
140 | 140 | ); |
141 | 141 | $interbreadcrumb[] = array( |
@@ -243,24 +243,24 @@ discard block |
||
243 | 243 | break; |
244 | 244 | } |
245 | 245 | |
246 | - $table_list = Display::page_subheader(get_lang('ThreadUsersList') . ': ' . get_name_thread_by_id($_GET['id'])); |
|
246 | + $table_list = Display::page_subheader(get_lang('ThreadUsersList').': '.get_name_thread_by_id($_GET['id'])); |
|
247 | 247 | |
248 | 248 | if ($nrorow3 > 0 || $nrorow3 == -2) { |
249 | - $url = api_get_cidreq() .'&forum=' . intval($my_forum) . '&action=' |
|
250 | - . Security::remove_XSS($_GET['action']) . '&content=' |
|
251 | - . Security::remove_XSS($_GET['content'], STUDENT) . '&id=' . intval($_GET['id']); |
|
249 | + $url = api_get_cidreq().'&forum='.intval($my_forum).'&action=' |
|
250 | + . Security::remove_XSS($_GET['action']).'&content=' |
|
251 | + . Security::remove_XSS($_GET['content'], STUDENT).'&id='.intval($_GET['id']); |
|
252 | 252 | $tabs = array( |
253 | 253 | array( |
254 | 254 | 'content' => get_lang('AllStudents'), |
255 | - 'url' => $forumUrl . 'viewforum.php?' . $url . '&origin=' . $origin . '&list=all' |
|
255 | + 'url' => $forumUrl.'viewforum.php?'.$url.'&origin='.$origin.'&list=all' |
|
256 | 256 | ), |
257 | 257 | array( |
258 | 258 | 'content' => get_lang('StudentsQualified'), |
259 | - 'url' => $forumUrl . 'viewforum.php?' . $url . '&origin=' . $origin . '&list=qualify' |
|
259 | + 'url' => $forumUrl.'viewforum.php?'.$url.'&origin='.$origin.'&list=qualify' |
|
260 | 260 | ), |
261 | 261 | array( |
262 | 262 | 'content' => get_lang('StudentsNotQualified'), |
263 | - 'url' => $forumUrl . 'viewforum.php?' . $url . '&origin=' . $origin . '&list=notqualify' |
|
263 | + 'url' => $forumUrl.'viewforum.php?'.$url.'&origin='.$origin.'&list=notqualify' |
|
264 | 264 | ), |
265 | 265 | ); |
266 | 266 | $table_list .= Display::tabsOnlyLink($tabs, $active); |
@@ -269,32 +269,32 @@ discard block |
||
269 | 269 | $table_list .= '<center><br /><table class="data_table" style="width:50%">'; |
270 | 270 | // The column headers (TODO: Make this sortable). |
271 | 271 | $table_list .= '<tr >'; |
272 | - $table_list .= '<th height="24">' . get_lang('NamesAndLastNames') . '</th>'; |
|
272 | + $table_list .= '<th height="24">'.get_lang('NamesAndLastNames').'</th>'; |
|
273 | 273 | |
274 | 274 | if ($listType == 'qualify') { |
275 | - $table_list .= '<th>' . get_lang('Qualification') . '</th>'; |
|
275 | + $table_list .= '<th>'.get_lang('Qualification').'</th>'; |
|
276 | 276 | } |
277 | 277 | if (api_is_allowed_to_edit(null, true)) { |
278 | - $table_list .= '<th>' . get_lang('Qualify') . '</th>'; |
|
278 | + $table_list .= '<th>'.get_lang('Qualify').'</th>'; |
|
279 | 279 | } |
280 | 280 | $table_list .= '</tr>'; |
281 | 281 | $max_qualify = showQualify('2', $userId, $_GET['id']); |
282 | 282 | $counter_stdlist = 0; |
283 | 283 | |
284 | 284 | if (Database::num_rows($student_list) > 0) { |
285 | - while ($row_student_list=Database::fetch_array($student_list)) { |
|
285 | + while ($row_student_list = Database::fetch_array($student_list)) { |
|
286 | 286 | $userInfo = api_get_user_info($row_student_list['id']); |
287 | 287 | if ($counter_stdlist % 2 == 0) { |
288 | 288 | $class_stdlist = 'row_odd'; |
289 | 289 | } else { |
290 | 290 | $class_stdlist = 'row_even'; |
291 | 291 | } |
292 | - $table_list .= '<tr class="' . $class_stdlist . '"><td>'; |
|
292 | + $table_list .= '<tr class="'.$class_stdlist.'"><td>'; |
|
293 | 293 | $table_list .= UserManager::getUserProfileLink($userInfo); |
294 | 294 | |
295 | 295 | $table_list .= '</td>'; |
296 | 296 | if ($listType == 'qualify') { |
297 | - $table_list .= '<td>' . $row_student_list['qualify'] . '/' . $max_qualify . '</td>'; |
|
297 | + $table_list .= '<td>'.$row_student_list['qualify'].'/'.$max_qualify.'</td>'; |
|
298 | 298 | } |
299 | 299 | if (api_is_allowed_to_edit(null, true)) { |
300 | 300 | $current_qualify_thread = showQualify( |
@@ -303,20 +303,20 @@ discard block |
||
303 | 303 | $_GET['id'] |
304 | 304 | ); |
305 | 305 | $table_list .= '<td> |
306 | - <a href="' . $forumUrl . 'forumqualify.php?' . api_get_cidreq() |
|
307 | - . '&forum=' . Security::remove_XSS($my_forum) . '&thread=' |
|
308 | - . Security::remove_XSS($_GET['id']) . '&user=' . $row_student_list['id'] |
|
309 | - . '&user_id=' . $row_student_list['id'] . '&idtextqualify=' |
|
310 | - . $current_qualify_thread . '&origin=' . $origin . '">' |
|
311 | - . Display::return_icon($icon_qualify, get_lang('Qualify')) . '</a></td></tr>'; |
|
306 | + <a href="' . $forumUrl.'forumqualify.php?'.api_get_cidreq() |
|
307 | + . '&forum='.Security::remove_XSS($my_forum).'&thread=' |
|
308 | + . Security::remove_XSS($_GET['id']).'&user='.$row_student_list['id'] |
|
309 | + . '&user_id='.$row_student_list['id'].'&idtextqualify=' |
|
310 | + . $current_qualify_thread.'&origin='.$origin.'">' |
|
311 | + . Display::return_icon($icon_qualify, get_lang('Qualify')).'</a></td></tr>'; |
|
312 | 312 | } |
313 | 313 | $counter_stdlist++; |
314 | 314 | } |
315 | 315 | } else { |
316 | 316 | if ($listType == 'qualify') { |
317 | - $table_list .= '<tr><td colspan="2">' . get_lang('ThereIsNotQualifiedLearners') . '</td></tr>'; |
|
317 | + $table_list .= '<tr><td colspan="2">'.get_lang('ThereIsNotQualifiedLearners').'</td></tr>'; |
|
318 | 318 | } else { |
319 | - $table_list .= '<tr><td colspan="2">' . get_lang('ThereIsNotUnqualifiedLearners') . '</td></tr>'; |
|
319 | + $table_list .= '<tr><td colspan="2">'.get_lang('ThereIsNotUnqualifiedLearners').'</td></tr>'; |
|
320 | 320 | } |
321 | 321 | } |
322 | 322 | |
@@ -342,14 +342,14 @@ discard block |
||
342 | 342 | echo '<div class="actions">'; |
343 | 343 | |
344 | 344 | if ($origin != 'learnpath') { |
345 | - if ($origin=='group') { |
|
346 | - echo '<a href="' . api_get_path(WEB_CODE_PATH) . 'group/group_space.php?' |
|
347 | - . api_get_cidreq() . '&gradebook=' . $gradebook . '">' |
|
345 | + if ($origin == 'group') { |
|
346 | + echo '<a href="'.api_get_path(WEB_CODE_PATH).'group/group_space.php?' |
|
347 | + . api_get_cidreq().'&gradebook='.$gradebook.'">' |
|
348 | 348 | . Display::return_icon('back.png', get_lang('BackTo') |
349 | - . ' ' . get_lang('Groups'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
349 | + . ' '.get_lang('Groups'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
350 | 350 | } else { |
351 | 351 | echo '<span style="float:right;">'.search_link().'</span>'; |
352 | - echo '<a href="' . $forumUrl . 'index.php?' . api_get_cidreq() . '">' |
|
352 | + echo '<a href="'.$forumUrl.'index.php?'.api_get_cidreq().'">' |
|
353 | 353 | . Display::return_icon('back.png', get_lang('BackToForumOverview'), '', ICON_SIZE_MEDIUM) |
354 | 354 | . '</a>'; |
355 | 355 | } |
@@ -367,14 +367,14 @@ discard block |
||
367 | 367 | if ($current_forum['locked'] <> 1 AND $current_forum['locked'] <> 1) { |
368 | 368 | if (!api_is_anonymous() && !api_is_invitee()) { |
369 | 369 | if ($my_forum == strval(intval($my_forum))) { |
370 | - echo '<a href="' . $forumUrl . 'newthread.php?' . api_get_cidreq() . '&forum=' |
|
371 | - . Security::remove_XSS($my_forum) . $origin_string . '">' |
|
370 | + echo '<a href="'.$forumUrl.'newthread.php?'.api_get_cidreq().'&forum=' |
|
371 | + . Security::remove_XSS($my_forum).$origin_string.'">' |
|
372 | 372 | . Display::return_icon('new_thread.png', get_lang('NewTopic'), '', ICON_SIZE_MEDIUM) |
373 | 373 | . '</a>'; |
374 | 374 | } else { |
375 | 375 | $my_forum = strval(intval($my_forum)); |
376 | - echo '<a href="' . $forumUrl . 'newthread.php?' . api_get_cidreq() |
|
377 | - . '&forum=' . $my_forum . $origin_string . '">' |
|
376 | + echo '<a href="'.$forumUrl.'newthread.php?'.api_get_cidreq() |
|
377 | + . '&forum='.$my_forum.$origin_string.'">' |
|
378 | 378 | . Display::return_icon('new_thread.png', get_lang('NewTopic'), '', ICON_SIZE_MEDIUM) |
379 | 379 | . '</a>'; |
380 | 380 | } |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | if ($origin != 'learnpath') { |
402 | 402 | $html .= Display::tag( |
403 | 403 | 'h3', |
404 | - $iconForum .' '. $titleForum, |
|
404 | + $iconForum.' '.$titleForum, |
|
405 | 405 | array( |
406 | 406 | 'class' => 'title-forum') |
407 | 407 | ); |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | } |
444 | 444 | |
445 | 445 | if (is_array($my_whatsnew_post_info) && !empty($my_whatsnew_post_info)) { |
446 | - $newPost = ' ' . Display::return_icon('alert.png', get_lang('Forum'), null, ICON_SIZE_SMALL); |
|
446 | + $newPost = ' '.Display::return_icon('alert.png', get_lang('Forum'), null, ICON_SIZE_SMALL); |
|
447 | 447 | } else { |
448 | 448 | $newPost = ''; |
449 | 449 | } |
@@ -453,12 +453,12 @@ discard block |
||
453 | 453 | } |
454 | 454 | |
455 | 455 | $name = api_get_person_name($row['firstname'], $row['lastname']); |
456 | - $linkPostForum = '<a href="viewthread.php?' . api_get_cidreq() . '&forum=' . Security::remove_XSS($my_forum) |
|
456 | + $linkPostForum = '<a href="viewthread.php?'.api_get_cidreq().'&forum='.Security::remove_XSS($my_forum) |
|
457 | 457 | . "&origin=$origin&thread={$row['thread_id']}$origin_string&search=" |
458 | - . Security::remove_XSS(urlencode($my_search)) . '">' |
|
459 | - . $row['thread_title'] . '</a>'; |
|
458 | + . Security::remove_XSS(urlencode($my_search)).'">' |
|
459 | + . $row['thread_title'].'</a>'; |
|
460 | 460 | $html = ''; |
461 | - $html .= '<div class="panel panel-default forum '.($row['thread_sticky']?'sticky':'').'">'; |
|
461 | + $html .= '<div class="panel panel-default forum '.($row['thread_sticky'] ? 'sticky' : '').'">'; |
|
462 | 462 | $html .= '<div class="panel-body">'; |
463 | 463 | $html .= '<div class="row">'; |
464 | 464 | $html .= '<div class="col-md-6">'; |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | ); |
491 | 491 | } |
492 | 492 | |
493 | - $html .= '<div class="thumbnail">' . display_user_image($row['user_id'], $name, $origin) . '</div>'; |
|
493 | + $html .= '<div class="thumbnail">'.display_user_image($row['user_id'], $name, $origin).'</div>'; |
|
494 | 494 | $html .= '</div>'; |
495 | 495 | $html .= '<div class="col-md-10">'; |
496 | 496 | $html .= Display::tag( |
@@ -500,8 +500,8 @@ discard block |
||
500 | 500 | 'class' => 'title' |
501 | 501 | ) |
502 | 502 | ); |
503 | - $html .= '<p>'. get_lang('By') .' ' .$authorName.'</p>'; |
|
504 | - $html .= '<p>' . api_convert_and_format_date($row['insert_date']) . '</p>'; |
|
503 | + $html .= '<p>'.get_lang('By').' '.$authorName.'</p>'; |
|
504 | + $html .= '<p>'.api_convert_and_format_date($row['insert_date']).'</p>'; |
|
505 | 505 | $html .= '</div>'; |
506 | 506 | $html .= '</div>'; |
507 | 507 | |
@@ -510,13 +510,13 @@ discard block |
||
510 | 510 | $html .= '<div class="row">'; |
511 | 511 | $html .= '<div class="col-md-4">' |
512 | 512 | . Display::return_icon('post-forum.png', null, null, ICON_SIZE_SMALL) |
513 | - . " {$row['thread_replies']} " . get_lang('Replies') . '<br>'; |
|
514 | - $html .= Display::return_icon( |
|
513 | + . " {$row['thread_replies']} ".get_lang('Replies').'<br>'; |
|
514 | + $html .= Display::return_icon( |
|
515 | 515 | 'post-forum.png', |
516 | 516 | null, |
517 | 517 | null, |
518 | 518 | ICON_SIZE_SMALL |
519 | - ) . ' ' . $row['thread_views'] . ' ' . get_lang('Views') . '<br>' . $newPost; |
|
519 | + ).' '.$row['thread_views'].' '.get_lang('Views').'<br>'.$newPost; |
|
520 | 520 | $html .= '</div>'; |
521 | 521 | |
522 | 522 | $last_post_info = get_last_post_by_thread( |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | if ($last_post_info) { |
531 | 531 | $poster_info = api_get_user_info($last_post_info['poster_id']); |
532 | 532 | $post_date = api_convert_and_format_date($last_post_info['post_date']); |
533 | - $last_post = $post_date . '<br>' . get_lang('By') . ' ' . display_user_link( |
|
533 | + $last_post = $post_date.'<br>'.get_lang('By').' '.display_user_link( |
|
534 | 534 | $last_post_info['poster_id'], |
535 | 535 | $poster_info['complete_name'], |
536 | 536 | '', |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | |
541 | 541 | $html .= '<div class="col-md-5">' |
542 | 542 | . Display::return_icon('post-item.png', null, null, ICON_SIZE_TINY) |
543 | - . ' ' . $last_post; |
|
543 | + . ' '.$last_post; |
|
544 | 544 | $html .= '</div>'; |
545 | 545 | $html .= '<div class="col-md-3">'; |
546 | 546 | $cidreq = api_get_cidreq(); |
@@ -555,11 +555,11 @@ discard block |
||
555 | 555 | if (api_is_allowed_to_edit(false, true) && |
556 | 556 | !(api_is_course_coach() && $current_forum['session_id'] != $sessionId) |
557 | 557 | ) { |
558 | - $iconsEdit .= '<a href="' . $forumUrl . 'editthread.php?' . $cidreq |
|
559 | - . '&forum=' . intval($my_forum) . '&thread=' |
|
558 | + $iconsEdit .= '<a href="'.$forumUrl.'editthread.php?'.$cidreq |
|
559 | + . '&forum='.intval($my_forum).'&thread=' |
|
560 | 560 | . intval($row['thread_id']) |
561 | - . '&id_attach=' . $id_attach . '">' |
|
562 | - . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
561 | + . '&id_attach='.$id_attach.'">' |
|
562 | + . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>'; |
|
563 | 563 | if (api_resource_is_locked_by_gradebook($row['thread_id'], LINK_FORUM_THREAD)) { |
564 | 564 | $iconsEdit .= Display::return_icon( |
565 | 565 | 'delete_na.png', |
@@ -568,13 +568,13 @@ discard block |
||
568 | 568 | ICON_SIZE_SMALL |
569 | 569 | ); |
570 | 570 | } else { |
571 | - $iconsEdit.= '<a href="' . api_get_self() . '?' . $cidreq . '&forum=' |
|
572 | - . intval($my_forum) . '&action=delete&content=thread&id=' |
|
573 | - . $row['thread_id'] . $origin_string |
|
571 | + $iconsEdit .= '<a href="'.api_get_self().'?'.$cidreq.'&forum=' |
|
572 | + . intval($my_forum).'&action=delete&content=thread&id=' |
|
573 | + . $row['thread_id'].$origin_string |
|
574 | 574 | . "\" onclick=\"javascript:if(!confirm('" |
575 | 575 | . addslashes(api_htmlentities(get_lang('DeleteCompleteThread'), ENT_QUOTES)) |
576 | 576 | . "')) return false;\">" |
577 | - . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
577 | + . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>'; |
|
578 | 578 | } |
579 | 579 | |
580 | 580 | $iconsEdit .= return_visible_invisible_icon( |
@@ -597,9 +597,9 @@ discard block |
||
597 | 597 | 'gidReq' => api_get_group_id() |
598 | 598 | ) |
599 | 599 | ); |
600 | - $iconsEdit .= '<a href="viewforum.php?' . $cidreq . '&forum=' |
|
600 | + $iconsEdit .= '<a href="viewforum.php?'.$cidreq.'&forum=' |
|
601 | 601 | . intval($my_forum) |
602 | - . '&action=move&thread=' . $row['thread_id'] . $origin_string . '">' |
|
602 | + . '&action=move&thread='.$row['thread_id'].$origin_string.'">' |
|
603 | 603 | . Display::return_icon('move.png', get_lang('MoveThread'), array(), ICON_SIZE_SMALL) |
604 | 604 | . '</a>'; |
605 | 605 | } |
@@ -616,17 +616,17 @@ discard block |
||
616 | 616 | } |
617 | 617 | $icon_liststd = 'user.png'; |
618 | 618 | if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) { |
619 | - $iconsEdit .= '<a href="' . api_get_self() . '?' . $cidreq . '&forum=' |
|
619 | + $iconsEdit .= '<a href="'.api_get_self().'?'.$cidreq.'&forum=' |
|
620 | 620 | . Security::remove_XSS($my_forum) |
621 | 621 | . "&origin=$origin&action=notify&content=thread&id={$row['thread_id']}" |
622 | - . '">' . Display::return_icon($iconnotify, get_lang('NotifyMe')) . '</a>'; |
|
622 | + . '">'.Display::return_icon($iconnotify, get_lang('NotifyMe')).'</a>'; |
|
623 | 623 | } |
624 | 624 | |
625 | 625 | if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath') { |
626 | - $iconsEdit .= '<a href="' . api_get_self() . '?' . $cidreq . '&forum=' |
|
626 | + $iconsEdit .= '<a href="'.api_get_self().'?'.$cidreq.'&forum=' |
|
627 | 627 | . Security::remove_XSS($my_forum) |
628 | 628 | . "&origin=$origin&action=liststd&content=thread&id={$row['thread_id']}" |
629 | - . '">' . Display::return_icon($icon_liststd, get_lang('StudentList'), array(), ICON_SIZE_SMALL) |
|
629 | + . '">'.Display::return_icon($icon_liststd, get_lang('StudentList'), array(), ICON_SIZE_SMALL) |
|
630 | 630 | . '</a>'; |
631 | 631 | } |
632 | 632 | $html .= $iconsEdit; |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | $nParent = 0; // the number of /.. into the url |
41 | 41 | while (substr($cwd, -3, 3) == '/..') { |
42 | 42 | // go to parent directory |
43 | - $cwd= substr($cwd, 0, -3); |
|
44 | - if (strlen($cwd) == 0) { $cwd='/'; } |
|
43 | + $cwd = substr($cwd, 0, -3); |
|
44 | + if (strlen($cwd) == 0) { $cwd = '/'; } |
|
45 | 45 | $nParent++; |
46 | 46 | } |
47 | 47 | for (; $nParent > 0; $nParent--) { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | } |
56 | 56 | if ($action == 'list') { |
57 | 57 | /*==== List files ====*/ |
58 | - if ($debug>0) { error_log("sending file list",0); } |
|
58 | + if ($debug > 0) { error_log("sending file list", 0); } |
|
59 | 59 | |
60 | 60 | // get files list |
61 | 61 | $files = DocumentManager::get_all_document_data($_course, $cwd, 0, NULL, false); |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | $_user = api_get_user_info(); |
51 | 51 | $courseInfo = api_get_course_info(); |
52 | 52 | $courseId = $courseInfo['real_id']; |
53 | -$course_dir = $courseInfo['directory'] . '/document'; |
|
53 | +$course_dir = $courseInfo['directory'].'/document'; |
|
54 | 54 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
55 | -$base_work_dir = $sys_course_path . $course_dir; |
|
56 | -$http_www = api_get_path(WEB_COURSE_PATH).$courseInfo['directory'] . '/document'; |
|
55 | +$base_work_dir = $sys_course_path.$course_dir; |
|
56 | +$http_www = api_get_path(WEB_COURSE_PATH).$courseInfo['directory'].'/document'; |
|
57 | 57 | $document_path = $base_work_dir; |
58 | 58 | $usePpt2lp = api_get_setting('service_ppt2lp', 'active') == 'true'; |
59 | 59 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $certificateId |
239 | 239 | ); |
240 | 240 | Display::addFlash(Display::return_message( |
241 | - get_lang('DocDeleted') . ': ' . $documentInfo['title'], |
|
241 | + get_lang('DocDeleted').': '.$documentInfo['title'], |
|
242 | 242 | 'success' |
243 | 243 | )); |
244 | 244 | } else { |
@@ -426,11 +426,9 @@ discard block |
||
426 | 426 | case 'convertToPdf': |
427 | 427 | // PDF format as target by default |
428 | 428 | $formatTarget = $_REQUEST['formatTarget'] ? |
429 | - strtolower(Security::remove_XSS($_REQUEST['formatTarget'])) : |
|
430 | - 'pdf'; |
|
429 | + strtolower(Security::remove_XSS($_REQUEST['formatTarget'])) : 'pdf'; |
|
431 | 430 | $formatType = $_REQUEST['formatType'] ? |
432 | - strtolower(Security::remove_XSS($_REQUEST['formatType'])) : |
|
433 | - 'text'; |
|
431 | + strtolower(Security::remove_XSS($_REQUEST['formatType'])) : 'text'; |
|
434 | 432 | // Get the document data from the ID |
435 | 433 | $document_info = DocumentManager::get_document_data_by_id( |
436 | 434 | $document_id, |
@@ -438,8 +436,8 @@ discard block |
||
438 | 436 | true, |
439 | 437 | $session_id |
440 | 438 | ); |
441 | - $file = $sys_course_path . $courseInfo['directory'] . |
|
442 | - '/document' . $document_info['path']; |
|
439 | + $file = $sys_course_path.$courseInfo['directory']. |
|
440 | + '/document'.$document_info['path']; |
|
443 | 441 | $fileInfo = pathinfo($file); |
444 | 442 | if ($fileInfo['extension'] == $formatTarget) { |
445 | 443 | Display::addFlash(Display::return_message( |
@@ -470,9 +468,9 @@ discard block |
||
470 | 468 | 'warning' |
471 | 469 | )); |
472 | 470 | } else { |
473 | - $convertedFile = $fileInfo['dirname'] . DIRECTORY_SEPARATOR . |
|
474 | - $fileInfo['filename'] . '_from_' . $fileInfo['extension'] . |
|
475 | - '.' . $formatTarget; |
|
471 | + $convertedFile = $fileInfo['dirname'].DIRECTORY_SEPARATOR. |
|
472 | + $fileInfo['filename'].'_from_'.$fileInfo['extension']. |
|
473 | + '.'.$formatTarget; |
|
476 | 474 | $convertedTitle = $document_info['title']; |
477 | 475 | $obj = new OpenofficePresentation(true); |
478 | 476 | if (file_exists($convertedFile)) { |
@@ -497,11 +495,11 @@ discard block |
||
497 | 495 | $gidReq = Security::remove_XSS($_GET['gidReq']); |
498 | 496 | $file_link = Display::url( |
499 | 497 | get_lang('SeeFile'), |
500 | - api_get_path(WEB_CODE_PATH) . |
|
501 | - 'document/showinframes.php?'.api_get_cidreq_params($cidReq, $id_session, $gidReq).'&id=' . current($result) |
|
498 | + api_get_path(WEB_CODE_PATH). |
|
499 | + 'document/showinframes.php?'.api_get_cidreq_params($cidReq, $id_session, $gidReq).'&id='.current($result) |
|
502 | 500 | ); |
503 | 501 | Display::addFlash(Display::return_message( |
504 | - get_lang('CopyMade') . ' ' . $file_link, |
|
502 | + get_lang('CopyMade').' '.$file_link, |
|
505 | 503 | 'confirmation', |
506 | 504 | false |
507 | 505 | )); |
@@ -658,7 +656,7 @@ discard block |
||
658 | 656 | $new_content_html |
659 | 657 | ); |
660 | 658 | $new_content_html = str_replace( |
661 | - SYS_CODE_PATH . 'img/', |
|
659 | + SYS_CODE_PATH.'img/', |
|
662 | 660 | api_get_path(WEB_IMG_PATH), |
663 | 661 | $new_content_html |
664 | 662 | ); |
@@ -715,11 +713,11 @@ discard block |
||
715 | 713 | $("#convertSelect").change(function() { |
716 | 714 | var formatTarget = $(this).val(); |
717 | 715 | window.location.href = "'. |
718 | - api_get_self() . '?' . api_get_cidreq() . |
|
719 | - '&curdirpath=' . $curdirpath . |
|
720 | - '&action=convertToPdf&formatTarget=' . |
|
721 | - '" + formatTarget + "&id=" + id + "&' . |
|
722 | - api_get_cidreq() . '&formatType=" + format; |
|
716 | + api_get_self().'?'.api_get_cidreq(). |
|
717 | + '&curdirpath='.$curdirpath. |
|
718 | + '&action=convertToPdf&formatTarget='. |
|
719 | + '" + formatTarget + "&id=" + id + "&'. |
|
720 | + api_get_cidreq().'&formatType=" + format; |
|
723 | 721 | }); |
724 | 722 | $("#convertModal").on("hidden", function(){ |
725 | 723 | $("." + format + "FormatType").hide(); |
@@ -1051,7 +1049,7 @@ discard block |
||
1051 | 1049 | update_db_info( |
1052 | 1050 | 'update', |
1053 | 1051 | $document_to_move['path'], |
1054 | - $moveTo . '/' . basename($document_to_move['path']) |
|
1052 | + $moveTo.'/'.basename($document_to_move['path']) |
|
1055 | 1053 | ); |
1056 | 1054 | |
1057 | 1055 | //update database item property |
@@ -1283,7 +1281,7 @@ discard block |
||
1283 | 1281 | |
1284 | 1282 | if (!empty($newFolderData)) { |
1285 | 1283 | $message = Display::return_message( |
1286 | - get_lang('DirCr') . ' ' . $newFolderData['title'], |
|
1284 | + get_lang('DirCr').' '.$newFolderData['title'], |
|
1287 | 1285 | 'confirmation' |
1288 | 1286 | ); |
1289 | 1287 | } else { |
@@ -1368,27 +1366,27 @@ discard block |
||
1368 | 1366 | |
1369 | 1367 | // Create the form that asks for the directory name |
1370 | 1368 | $templateForm .= ' |
1371 | - <form name="set_document_as_new_template" class="form-horizontal" enctype="multipart/form-data" action="' . api_get_self() . '?add_as_template=' . $document_id_for_template . '" method="post"> |
|
1369 | + <form name="set_document_as_new_template" class="form-horizontal" enctype="multipart/form-data" action="' . api_get_self().'?add_as_template='.$document_id_for_template.'" method="post"> |
|
1372 | 1370 | <fieldset> |
1373 | - <legend>' . get_lang('AddAsTemplate') . '</legend> |
|
1371 | + <legend>' . get_lang('AddAsTemplate').'</legend> |
|
1374 | 1372 | <div class="form-group"> |
1375 | - <label for="template_title" class="col-sm-2 control-label">' . get_lang('TemplateName') . '</label> |
|
1373 | + <label for="template_title" class="col-sm-2 control-label">' . get_lang('TemplateName').'</label> |
|
1376 | 1374 | <div class="col-sm-10"> |
1377 | 1375 | <input type="text" class="form-control" id="template_title" name="template_title"> |
1378 | 1376 | </div> |
1379 | 1377 | </div> |
1380 | 1378 | <div class="form-group"> |
1381 | - <label for="template_image" class="col-sm-2 control-label">' . get_lang('TemplateImage') . '</label> |
|
1379 | + <label for="template_image" class="col-sm-2 control-label">' . get_lang('TemplateImage').'</label> |
|
1382 | 1380 | <div class="col-sm-10"> |
1383 | 1381 | <input type="file" name="template_image" id="template_image"> |
1384 | 1382 | </div> |
1385 | 1383 | </div> |
1386 | 1384 | <div class="form-group"> |
1387 | 1385 | <div class="col-sm-offset-2 col-sm-10"> |
1388 | - <button type="submit" name="create_template" class="btn btn-primary">' . get_lang('CreateTemplate') . '</button> |
|
1386 | + <button type="submit" name="create_template" class="btn btn-primary">' . get_lang('CreateTemplate').'</button> |
|
1389 | 1387 | </div> |
1390 | 1388 | </div> |
1391 | - <input type="hidden" name="curdirpath" value="' . $curdirpath . '" /> |
|
1389 | + <input type="hidden" name="curdirpath" value="' . $curdirpath.'" /> |
|
1392 | 1390 | </fieldset> |
1393 | 1391 | </form> |
1394 | 1392 | <hr> |
@@ -1590,7 +1588,7 @@ discard block |
||
1590 | 1588 | if (api_get_setting('enable_record_audio') === 'true') { |
1591 | 1589 | $actionsLeft .= Display::url( |
1592 | 1590 | Display::return_icon('new_recording.png', get_lang('RecordMyVoice'), '', ICON_SIZE_MEDIUM), |
1593 | - api_get_path(WEB_CODE_PATH) . 'document/record_audio.php?' . api_get_cidreq() . '&id=' . $document_id |
|
1591 | + api_get_path(WEB_CODE_PATH).'document/record_audio.php?'.api_get_cidreq().'&id='.$document_id |
|
1594 | 1592 | ); |
1595 | 1593 | } |
1596 | 1594 | |
@@ -2028,18 +2026,18 @@ discard block |
||
2028 | 2026 | <div class="modal-dialog"> |
2029 | 2027 | <div class="modal-content"> |
2030 | 2028 | <div class="modal-header" style="text-align: center;"> |
2031 | - <button type="button" class="close" data-dismiss="modal" aria-label="' . get_lang('Close') . '"> |
|
2029 | + <button type="button" class="close" data-dismiss="modal" aria-label="' . get_lang('Close').'"> |
|
2032 | 2030 | <span aria-hidden="true">×</span> |
2033 | 2031 | </button> |
2034 | - <h4 class="modal-title">' . get_lang('Convert') . '</h4> |
|
2032 | + <h4 class="modal-title">' . get_lang('Convert').'</h4> |
|
2035 | 2033 | </div> |
2036 | 2034 | <div class="modal-body"> |
2037 | 2035 | <form action="#" class="form-horizontal"> |
2038 | 2036 | <div class="form-group"> |
2039 | - <label class="col-sm-4 control-label" for="convertSelect">' . get_lang('ConvertFormats') . '</label> |
|
2037 | + <label class="col-sm-4 control-label" for="convertSelect">' . get_lang('ConvertFormats').'</label> |
|
2040 | 2038 | <div class="col-sm-8"> |
2041 | 2039 | <select id="convertSelect"> |
2042 | - <option value="">' . get_lang('Select') . '</option> |
|
2040 | + <option value="">' . get_lang('Select').'</option> |
|
2043 | 2041 | <option value="pdf"> |
2044 | 2042 | PDF - Portable Document File |
2045 | 2043 | </option> |
@@ -2058,7 +2056,7 @@ discard block |
||
2058 | 2056 | </form> |
2059 | 2057 | </div> |
2060 | 2058 | <div class="modal-footer"> |
2061 | - <button type="button" class="btn btn-default" data-dismiss="modal">' . get_lang('Close') . '</button> |
|
2059 | + <button type="button" class="btn btn-default" data-dismiss="modal">' . get_lang('Close').'</button> |
|
2062 | 2060 | </div> |
2063 | 2061 | </div> |
2064 | 2062 | </div>'; |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | $course_code = Database::escape_string($course_code); |
78 | 78 | if (!empty($link_id)) { |
79 | 79 | $link_id = intval($link_id); |
80 | - $sql = 'UPDATE ' . Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK) . ' |
|
81 | - SET weight = ' . "'" . Database::escape_string((float) $weight) . "'" . ' |
|
82 | - WHERE course_code = "' . $course_code . '" AND id = ' . $link_id; |
|
80 | + $sql = 'UPDATE '.Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK).' |
|
81 | + SET weight = ' . "'".Database::escape_string((float) $weight)."'".' |
|
82 | + WHERE course_code = "' . $course_code.'" AND id = '.$link_id; |
|
83 | 83 | Database::query($sql); |
84 | 84 | } |
85 | 85 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | // TODO find the corresponding category (the first one for this course, ordered by ID) |
101 | 101 | $l = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK); |
102 | - $sql = "DELETE FROM $l WHERE id = ".(int)$link_id; |
|
102 | + $sql = "DELETE FROM $l WHERE id = ".(int) $link_id; |
|
103 | 103 | Database::query($sql); |
104 | 104 | |
105 | 105 | return true; |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | $visibility_icon = ($cat->is_visible() == 0) ? 'invisible' : 'visible'; |
196 | 196 | $visibility_command = ($cat->is_visible() == 0) ? 'set_visible' : 'set_invisible'; |
197 | 197 | |
198 | - $modify_icons .= '<a class="view_children" data-cat-id="' . $cat->get_id() . '" href="javascript:void(0);">' . |
|
199 | - Display::return_icon('view_more_stats.gif', get_lang('Show'), '', ICON_SIZE_SMALL) . '</a>'; |
|
198 | + $modify_icons .= '<a class="view_children" data-cat-id="'.$cat->get_id().'" href="javascript:void(0);">'. |
|
199 | + Display::return_icon('view_more_stats.gif', get_lang('Show'), '', ICON_SIZE_SMALL).'</a>'; |
|
200 | 200 | |
201 | 201 | if (!api_is_allowed_to_edit(null, true)) { |
202 | 202 | $modify_icons .= Display::url( |
@@ -206,9 +206,9 @@ discard block |
||
206 | 206 | '', |
207 | 207 | ICON_SIZE_SMALL |
208 | 208 | ), |
209 | - 'personal_stats.php?' . http_build_query([ |
|
209 | + 'personal_stats.php?'.http_build_query([ |
|
210 | 210 | 'selectcat' => $cat->get_id() |
211 | - ]) . '&' . api_get_cidreq(), |
|
211 | + ]).'&'.api_get_cidreq(), |
|
212 | 212 | [ |
213 | 213 | 'class' => 'ajax', |
214 | 214 | 'data-title' => get_lang('FlatView') |
@@ -224,16 +224,16 @@ discard block |
||
224 | 224 | if (api_get_setting('gradebook_locking_enabled') == 'true') { |
225 | 225 | if ($cat->is_locked()) { |
226 | 226 | if (api_is_platform_admin()) { |
227 | - $modify_icons .= ' <a onclick="javascript:if (!confirm(\'' . addslashes(get_lang('ConfirmToUnlockElement')) . '\')) return false;" href="' . api_get_self() . '?' . api_get_cidreq() . '&category_id=' . $cat->get_id() . '&action=unlock">' . |
|
228 | - Display::return_icon('lock.png', get_lang('UnLockEvaluation'), '', ICON_SIZE_SMALL) . '</a>'; |
|
227 | + $modify_icons .= ' <a onclick="javascript:if (!confirm(\''.addslashes(get_lang('ConfirmToUnlockElement')).'\')) return false;" href="'.api_get_self().'?'.api_get_cidreq().'&category_id='.$cat->get_id().'&action=unlock">'. |
|
228 | + Display::return_icon('lock.png', get_lang('UnLockEvaluation'), '', ICON_SIZE_SMALL).'</a>'; |
|
229 | 229 | } else { |
230 | - $modify_icons .= ' <a href="#">' . Display::return_icon('lock_na.png', get_lang('GradebookLockedAlert'), '', ICON_SIZE_SMALL) . '</a>'; |
|
230 | + $modify_icons .= ' <a href="#">'.Display::return_icon('lock_na.png', get_lang('GradebookLockedAlert'), '', ICON_SIZE_SMALL).'</a>'; |
|
231 | 231 | } |
232 | - $modify_icons .= ' <a href="gradebook_flatview.php?export_pdf=category&selectcat=' . $cat->get_id() . '" >' . Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL) . '</a>'; |
|
232 | + $modify_icons .= ' <a href="gradebook_flatview.php?export_pdf=category&selectcat='.$cat->get_id().'" >'.Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL).'</a>'; |
|
233 | 233 | } else { |
234 | - $modify_icons .= ' <a onclick="javascript:if (!confirm(\'' . addslashes(get_lang('ConfirmToLockElement')) . '\')) return false;" href="' . api_get_self() . '?' . api_get_cidreq() . '&category_id=' . $cat->get_id() . '&action=lock">' . |
|
235 | - Display::return_icon('unlock.png', get_lang('LockEvaluation'), '', ICON_SIZE_SMALL) . '</a>'; |
|
236 | - $modify_icons .= ' <a href="#" >' . Display::return_icon('pdf_na.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL) . '</a>'; |
|
234 | + $modify_icons .= ' <a onclick="javascript:if (!confirm(\''.addslashes(get_lang('ConfirmToLockElement')).'\')) return false;" href="'.api_get_self().'?'.api_get_cidreq().'&category_id='.$cat->get_id().'&action=lock">'. |
|
235 | + Display::return_icon('unlock.png', get_lang('LockEvaluation'), '', ICON_SIZE_SMALL).'</a>'; |
|
236 | + $modify_icons .= ' <a href="#" >'.Display::return_icon('pdf_na.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL).'</a>'; |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
@@ -241,44 +241,44 @@ discard block |
||
241 | 241 | if ($cat->is_locked() && !api_is_platform_admin()) { |
242 | 242 | $modify_icons .= Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL); |
243 | 243 | } else { |
244 | - $modify_icons .= '<a href="gradebook_edit_cat.php?editcat=' . $cat->get_id() . '&'.$courseParams.'">' . |
|
244 | + $modify_icons .= '<a href="gradebook_edit_cat.php?editcat='.$cat->get_id().'&'.$courseParams.'">'. |
|
245 | 245 | Display::return_icon( |
246 | 246 | 'edit.png', |
247 | 247 | get_lang('Modify'), |
248 | 248 | '', |
249 | 249 | ICON_SIZE_SMALL |
250 | - ) . '</a>'; |
|
250 | + ).'</a>'; |
|
251 | 251 | } |
252 | 252 | } |
253 | 253 | |
254 | - $modify_icons .= '<a href="gradebook_edit_all.php?selectcat=' .$cat->get_id() . '&' . $courseParams.'">' . |
|
254 | + $modify_icons .= '<a href="gradebook_edit_all.php?selectcat='.$cat->get_id().'&'.$courseParams.'">'. |
|
255 | 255 | Display::return_icon( |
256 | 256 | 'percentage.png', |
257 | 257 | get_lang('EditAllWeights'), |
258 | 258 | '', |
259 | 259 | ICON_SIZE_SMALL |
260 | - ) . '</a>'; |
|
260 | + ).'</a>'; |
|
261 | 261 | |
262 | - $modify_icons .= '<a href="gradebook_flatview.php?selectcat=' .$cat->get_id() . '&' . $courseParams. '">' . |
|
262 | + $modify_icons .= '<a href="gradebook_flatview.php?selectcat='.$cat->get_id().'&'.$courseParams.'">'. |
|
263 | 263 | Display::return_icon( |
264 | 264 | 'stats.png', |
265 | 265 | get_lang('FlatView'), |
266 | 266 | '', |
267 | 267 | ICON_SIZE_SMALL |
268 | - ) . '</a>'; |
|
269 | - $modify_icons .= ' <a href="' . api_get_self() .'?visiblecat=' . $cat->get_id() . '&' .$visibility_command . '=&selectcat=' . $selectcat .'&' . $courseParams. '">' . |
|
268 | + ).'</a>'; |
|
269 | + $modify_icons .= ' <a href="'.api_get_self().'?visiblecat='.$cat->get_id().'&'.$visibility_command.'=&selectcat='.$selectcat.'&'.$courseParams.'">'. |
|
270 | 270 | Display::return_icon( |
271 | - $visibility_icon . '.png', |
|
271 | + $visibility_icon.'.png', |
|
272 | 272 | get_lang('Visible'), |
273 | 273 | '', |
274 | 274 | ICON_SIZE_SMALL |
275 | - ) . '</a>'; |
|
275 | + ).'</a>'; |
|
276 | 276 | |
277 | 277 | if ($cat->is_locked() && !api_is_platform_admin()) { |
278 | 278 | $modify_icons .= Display::return_icon('delete_na.png', get_lang('DeleteAll'), '', ICON_SIZE_SMALL); |
279 | 279 | } else { |
280 | - $modify_icons .= ' <a href="' . api_get_self() . '?deletecat=' . $cat->get_id() . '&selectcat=' . $selectcat . '&' . $courseParams. '" onclick="return confirmation();">' . |
|
281 | - Display::return_icon('delete.png', get_lang('DeleteAll'), '', ICON_SIZE_SMALL) . '</a>'; |
|
280 | + $modify_icons .= ' <a href="'.api_get_self().'?deletecat='.$cat->get_id().'&selectcat='.$selectcat.'&'.$courseParams.'" onclick="return confirmation();">'. |
|
281 | + Display::return_icon('delete.png', get_lang('DeleteAll'), '', ICON_SIZE_SMALL).'</a>'; |
|
282 | 282 | } |
283 | 283 | } |
284 | 284 | |
@@ -307,22 +307,22 @@ discard block |
||
307 | 307 | if ($is_locked && !api_is_platform_admin()) { |
308 | 308 | $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL); |
309 | 309 | } else { |
310 | - $modify_icons = '<a href="gradebook_edit_eval.php?editeval=' . $eval->get_id() . '&' . $courseParams. '">' . |
|
311 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
310 | + $modify_icons = '<a href="gradebook_edit_eval.php?editeval='.$eval->get_id().'&'.$courseParams.'">'. |
|
311 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
312 | 312 | } |
313 | 313 | |
314 | - $modify_icons .= ' <a href="' . api_get_self() . '?visibleeval=' . $eval->get_id() . '&' . $visibility_command . '=&selectcat=' . $selectcat . '&'.$courseParams. ' ">' . |
|
315 | - Display::return_icon($visibility_icon . '.png', get_lang('Visible'), '', ICON_SIZE_SMALL) . '</a>'; |
|
314 | + $modify_icons .= ' <a href="'.api_get_self().'?visibleeval='.$eval->get_id().'&'.$visibility_command.'=&selectcat='.$selectcat.'&'.$courseParams.' ">'. |
|
315 | + Display::return_icon($visibility_icon.'.png', get_lang('Visible'), '', ICON_SIZE_SMALL).'</a>'; |
|
316 | 316 | if (api_is_allowed_to_edit(null, true)) { |
317 | - $modify_icons .= ' <a href="gradebook_showlog_eval.php?visiblelog=' . $eval->get_id() . '&selectcat=' . $selectcat . ' &' . $courseParams. '">' . |
|
318 | - Display::return_icon('history.png', get_lang('GradebookQualifyLog'), '', ICON_SIZE_SMALL) . '</a>'; |
|
317 | + $modify_icons .= ' <a href="gradebook_showlog_eval.php?visiblelog='.$eval->get_id().'&selectcat='.$selectcat.' &'.$courseParams.'">'. |
|
318 | + Display::return_icon('history.png', get_lang('GradebookQualifyLog'), '', ICON_SIZE_SMALL).'</a>'; |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | if ($is_locked && !api_is_platform_admin()) { |
322 | - $modify_icons .= ' ' . Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL); |
|
322 | + $modify_icons .= ' '.Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL); |
|
323 | 323 | } else { |
324 | - $modify_icons .= ' <a href="' . api_get_self() . '?deleteeval=' . $eval->get_id() . '&selectcat=' . $selectcat . ' &' . $courseParams. '" onclick="return confirmation();">' . |
|
325 | - Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>'; |
|
324 | + $modify_icons .= ' <a href="'.api_get_self().'?deleteeval='.$eval->get_id().'&selectcat='.$selectcat.' &'.$courseParams.'" onclick="return confirmation();">'. |
|
325 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
326 | 326 | } |
327 | 327 | return $modify_icons; |
328 | 328 | } |
@@ -354,21 +354,21 @@ discard block |
||
354 | 354 | if ($is_locked && !api_is_platform_admin()) { |
355 | 355 | $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL); |
356 | 356 | } else { |
357 | - $modify_icons = '<a href="gradebook_edit_link.php?editlink=' . $link->get_id() . '&' . $courseParams.'">' . |
|
358 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
357 | + $modify_icons = '<a href="gradebook_edit_link.php?editlink='.$link->get_id().'&'.$courseParams.'">'. |
|
358 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
359 | 359 | } |
360 | - $modify_icons .= ' <a href="' . api_get_self() . '?visiblelink=' . $link->get_id() . '&' . $visibility_command . '=&selectcat=' . $selectcat . '&'.$courseParams. ' ">' . |
|
361 | - Display::return_icon($visibility_icon . '.png', get_lang('Visible'), '', ICON_SIZE_SMALL) . '</a>'; |
|
362 | - $modify_icons .= ' <a href="gradebook_showlog_link.php?visiblelink=' . $link->get_id() . '&selectcat=' . $selectcat . '&' . $courseParams. '">' . |
|
363 | - Display::return_icon('history.png', get_lang('GradebookQualifyLog'), '', ICON_SIZE_SMALL) . '</a>'; |
|
360 | + $modify_icons .= ' <a href="'.api_get_self().'?visiblelink='.$link->get_id().'&'.$visibility_command.'=&selectcat='.$selectcat.'&'.$courseParams.' ">'. |
|
361 | + Display::return_icon($visibility_icon.'.png', get_lang('Visible'), '', ICON_SIZE_SMALL).'</a>'; |
|
362 | + $modify_icons .= ' <a href="gradebook_showlog_link.php?visiblelink='.$link->get_id().'&selectcat='.$selectcat.'&'.$courseParams.'">'. |
|
363 | + Display::return_icon('history.png', get_lang('GradebookQualifyLog'), '', ICON_SIZE_SMALL).'</a>'; |
|
364 | 364 | |
365 | 365 | //If a work is added in a gradebook you can only delete the link in the work tool |
366 | 366 | |
367 | 367 | if ($is_locked && !api_is_platform_admin()) { |
368 | - $modify_icons .= ' ' . Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL); |
|
368 | + $modify_icons .= ' '.Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL); |
|
369 | 369 | } else { |
370 | - $modify_icons .= ' <a href="' . api_get_self() . '?deletelink=' . $link->get_id() . '&selectcat=' . $selectcat . ' &' . $courseParams. '" onclick="return confirmation();">' . |
|
371 | - Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>'; |
|
370 | + $modify_icons .= ' <a href="'.api_get_self().'?deletelink='.$link->get_id().'&selectcat='.$selectcat.' &'.$courseParams.'" onclick="return confirmation();">'. |
|
371 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | return $modify_icons; |
@@ -391,8 +391,8 @@ discard block |
||
391 | 391 | $sql = "SELECT * FROM $table l |
392 | 392 | WHERE |
393 | 393 | course_code = '$course_code' AND |
394 | - type = ".(int)$resource_type . " AND |
|
395 | - ref_id = " . (int)$resource_id; |
|
394 | + type = ".(int) $resource_type." AND |
|
395 | + ref_id = " . (int) $resource_id; |
|
396 | 396 | $res = Database::query($sql); |
397 | 397 | |
398 | 398 | if (Database::num_rows($res) < 1) { |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | } |
416 | 416 | // TODO find the corresponding category (the first one for this course, ordered by ID) |
417 | 417 | $l = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK); |
418 | - $sql = "SELECT * FROM $l WHERE id = " . (int) $link_id; |
|
418 | + $sql = "SELECT * FROM $l WHERE id = ".(int) $link_id; |
|
419 | 419 | $res = Database::query($sql); |
420 | 420 | $row = array(); |
421 | 421 | if (Database::num_rows($res) > 0) { |
@@ -433,10 +433,10 @@ discard block |
||
433 | 433 | { |
434 | 434 | $course_table = Database::get_main_table(TABLE_MAIN_COURSE); |
435 | 435 | $tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK); |
436 | - $sql = 'SELECT c.id FROM ' . $course_table . ' c |
|
437 | - INNER JOIN ' . $tbl_grade_links . ' l |
|
436 | + $sql = 'SELECT c.id FROM '.$course_table.' c |
|
437 | + INNER JOIN ' . $tbl_grade_links.' l |
|
438 | 438 | ON c.code = l.course_code |
439 | - WHERE l.id=' . intval($id_link) . ' OR l.category_id=' . intval($id_link); |
|
439 | + WHERE l.id=' . intval($id_link).' OR l.category_id='.intval($id_link); |
|
440 | 440 | $res = Database::query($sql); |
441 | 441 | $array = Database::fetch_array($res, 'ASSOC'); |
442 | 442 | return $array['id']; |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | { |
546 | 546 | $result = Result :: load($resid); |
547 | 547 | if ($importscore > $eval_max) { |
548 | - header('Location: gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']) . '&overwritemax='); |
|
548 | + header('Location: gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'&overwritemax='); |
|
549 | 549 | exit; |
550 | 550 | } |
551 | 551 | $result[0]->set_score($importscore); |
@@ -586,8 +586,8 @@ discard block |
||
586 | 586 | { |
587 | 587 | $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE); |
588 | 588 | $sql = 'SELECT COUNT(*) as count |
589 | - FROM ' . $table . ' gc |
|
590 | - WHERE gc.cat_id="' . intval($cat_id) . '" AND user_id="' . intval($user_id) . '" '; |
|
589 | + FROM ' . $table.' gc |
|
590 | + WHERE gc.cat_id="' . intval($cat_id).'" AND user_id="'.intval($user_id).'" '; |
|
591 | 591 | $rs_exist = Database::query($sql); |
592 | 592 | $row = Database::fetch_array($rs_exist); |
593 | 593 | if ($row['count'] == 0) { |
@@ -610,8 +610,8 @@ discard block |
||
610 | 610 | public static function get_certificate_by_user_id($cat_id, $user_id) |
611 | 611 | { |
612 | 612 | $table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE); |
613 | - $sql = 'SELECT * FROM ' . $table_certificate . ' |
|
614 | - WHERE cat_id="' . intval($cat_id) . '" AND user_id="' . intval($user_id) . '"'; |
|
613 | + $sql = 'SELECT * FROM '.$table_certificate.' |
|
614 | + WHERE cat_id="' . intval($cat_id).'" AND user_id="'.intval($user_id).'"'; |
|
615 | 615 | |
616 | 616 | $result = Database::query($sql); |
617 | 617 | $row = Database::fetch_array($result, 'ASSOC'); |
@@ -630,18 +630,18 @@ discard block |
||
630 | 630 | $table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE); |
631 | 631 | $table_user = Database::get_main_table(TABLE_MAIN_USER); |
632 | 632 | $sql = 'SELECT DISTINCT u.user_id, u.lastname, u.firstname, u.username |
633 | - FROM ' . $table_user . ' u |
|
634 | - INNER JOIN ' . $table_certificate . ' gc |
|
633 | + FROM ' . $table_user.' u |
|
634 | + INNER JOIN ' . $table_certificate.' gc |
|
635 | 635 | ON u.user_id=gc.user_id '; |
636 | 636 | if (!is_null($cat_id) && $cat_id > 0) { |
637 | - $sql.=' WHERE cat_id=' . intval($cat_id); |
|
637 | + $sql .= ' WHERE cat_id='.intval($cat_id); |
|
638 | 638 | } |
639 | 639 | if (!empty($userList)) { |
640 | 640 | $userList = array_map('intval', $userList); |
641 | 641 | $userListCondition = implode("','", $userList); |
642 | 642 | $sql .= " AND u.user_id IN ('$userListCondition')"; |
643 | 643 | } |
644 | - $sql.=' ORDER BY u.firstname'; |
|
644 | + $sql .= ' ORDER BY u.firstname'; |
|
645 | 645 | $rs = Database::query($sql); |
646 | 646 | |
647 | 647 | $list_users = array(); |
@@ -662,10 +662,10 @@ discard block |
||
662 | 662 | { |
663 | 663 | $table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE); |
664 | 664 | $sql = 'SELECT gc.score_certificate, gc.created_at, gc.path_certificate, gc.cat_id, gc.user_id, gc.id |
665 | - FROM ' . $table_certificate . ' gc |
|
666 | - WHERE gc.user_id="' . intval($user_id) . '" '; |
|
665 | + FROM ' . $table_certificate.' gc |
|
666 | + WHERE gc.user_id="' . intval($user_id).'" '; |
|
667 | 667 | if (!is_null($cat_id) && $cat_id > 0) { |
668 | - $sql.=' AND cat_id=' . intval($cat_id); |
|
668 | + $sql .= ' AND cat_id='.intval($cat_id); |
|
669 | 669 | } |
670 | 670 | |
671 | 671 | $rs = Database::query($sql); |
@@ -703,12 +703,12 @@ discard block |
||
703 | 703 | $variables = $content_html['variables']; |
704 | 704 | } |
705 | 705 | |
706 | - $path_image = api_get_path(WEB_COURSE_PATH) . api_get_course_path($course_code) . '/document/images/gallery'; |
|
706 | + $path_image = api_get_path(WEB_COURSE_PATH).api_get_course_path($course_code).'/document/images/gallery'; |
|
707 | 707 | $new_content_html = str_replace('../images/gallery', $path_image, $new_content_html); |
708 | 708 | |
709 | - $path_image_in_default_course = api_get_path(WEB_CODE_PATH) . 'default_course_document'; |
|
709 | + $path_image_in_default_course = api_get_path(WEB_CODE_PATH).'default_course_document'; |
|
710 | 710 | $new_content_html = str_replace('/main/default_course_document', $path_image_in_default_course, $new_content_html); |
711 | - $new_content_html = str_replace(SYS_CODE_PATH . 'img/', api_get_path(WEB_IMG_PATH), $new_content_html); |
|
711 | + $new_content_html = str_replace(SYS_CODE_PATH.'img/', api_get_path(WEB_IMG_PATH), $new_content_html); |
|
712 | 712 | $print = ''; |
713 | 713 | |
714 | 714 | //add print header |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | } |
721 | 721 | |
722 | 722 | // Add header |
723 | - $new_content_html = $contentHead. $print . '</head>' . $new_content_html; |
|
723 | + $new_content_html = $contentHead.$print.'</head>'.$new_content_html; |
|
724 | 724 | |
725 | 725 | return array( |
726 | 726 | 'content' => $new_content_html, |
@@ -742,9 +742,9 @@ discard block |
||
742 | 742 | $session_id = api_get_session_id(); |
743 | 743 | |
744 | 744 | $t = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY); |
745 | - $sql = "SELECT * FROM $t WHERE course_code = '" . Database::escape_string($course_code) . "' "; |
|
745 | + $sql = "SELECT * FROM $t WHERE course_code = '".Database::escape_string($course_code)."' "; |
|
746 | 746 | if (!empty($session_id)) { |
747 | - $sql .= " AND session_id = " . (int) $session_id; |
|
747 | + $sql .= " AND session_id = ".(int) $session_id; |
|
748 | 748 | } else { |
749 | 749 | $sql .= " AND (session_id IS NULL OR session_id = 0) "; |
750 | 750 | } |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | if (!empty($session_id)) { |
757 | 757 | $my_session_id = api_get_session_id(); |
758 | 758 | $s_name = api_get_session_name($my_session_id); |
759 | - $cat->set_name($course_code . ' - ' . get_lang('Session') . ' ' . $s_name); |
|
759 | + $cat->set_name($course_code.' - '.get_lang('Session').' '.$s_name); |
|
760 | 760 | $cat->set_session_id($session_id); |
761 | 761 | } else { |
762 | 762 | $cat->set_name($course_code); |
@@ -878,13 +878,13 @@ discard block |
||
878 | 878 | |
879 | 879 | if ($use_grade_model) { |
880 | 880 | if ($parent_id == 0) { |
881 | - $title = api_strtoupper(get_lang('Average')) . '<br />' . get_lang('Detailed'); |
|
881 | + $title = api_strtoupper(get_lang('Average')).'<br />'.get_lang('Detailed'); |
|
882 | 882 | } else { |
883 | - $title = api_strtoupper(get_lang('Average')) . '<br />' . $cat[0]->get_description() . ' - (' . $cat[0]->get_name() . ')'; |
|
883 | + $title = api_strtoupper(get_lang('Average')).'<br />'.$cat[0]->get_description().' - ('.$cat[0]->get_name().')'; |
|
884 | 884 | } |
885 | 885 | } else { |
886 | 886 | if ($parent_id == 0) { |
887 | - $title = api_strtoupper(get_lang('Average')) . '<br />' . get_lang('Detailed'); |
|
887 | + $title = api_strtoupper(get_lang('Average')).'<br />'.get_lang('Detailed'); |
|
888 | 888 | } else { |
889 | 889 | $title = api_strtoupper(get_lang('Average')); |
890 | 890 | } |
@@ -938,11 +938,11 @@ discard block |
||
938 | 938 | } else { |
939 | 939 | $column = 0; |
940 | 940 | $table->setCellContents($row, $column, get_lang('NoResults')); |
941 | - $table->updateCellAttributes($row, $column, 'colspan="' . $columns . '" align="center" class="row_odd"'); |
|
941 | + $table->updateCellAttributes($row, $column, 'colspan="'.$columns.'" align="center" class="row_odd"'); |
|
942 | 942 | } |
943 | 943 | |
944 | 944 | $pdfParams = array( |
945 | - 'filename' => get_lang('FlatView') . '_' . api_get_utc_datetime(), |
|
945 | + 'filename' => get_lang('FlatView').'_'.api_get_utc_datetime(), |
|
946 | 946 | 'pdf_title' => $title, |
947 | 947 | 'course_code' => $course_code, |
948 | 948 | 'add_signatures' => true |
@@ -1027,7 +1027,7 @@ discard block |
||
1027 | 1027 | $a_students = array(); |
1028 | 1028 | while ($user = Database::fetch_array($result)) { |
1029 | 1029 | if (!array_key_exists($user['user_id'], $a_students)) { |
1030 | - $a_current_student = array (); |
|
1030 | + $a_current_student = array(); |
|
1031 | 1031 | $a_current_student[] = $user['user_id']; |
1032 | 1032 | $a_current_student[] = $user['username']; |
1033 | 1033 | $a_current_student[] = $user['lastname']; |
@@ -1085,7 +1085,7 @@ discard block |
||
1085 | 1085 | foreach ($links as $link) { |
1086 | 1086 | // links are always in a course |
1087 | 1087 | $coursecode = $link->get_course_code(); |
1088 | - if (!array_key_exists($coursecode,$coursecodes)) { |
|
1088 | + if (!array_key_exists($coursecode, $coursecodes)) { |
|
1089 | 1089 | $coursecodes[$coursecode] = '1'; |
1090 | 1090 | $users = array_merge($users, GradebookUtils::get_users_in_course($coursecode)); |
1091 | 1091 | } |
@@ -1098,7 +1098,7 @@ discard block |
||
1098 | 1098 | * Search students matching a given last name and/or first name |
1099 | 1099 | * @author Bert Steppé |
1100 | 1100 | */ |
1101 | - public static function find_students($mask= '') |
|
1101 | + public static function find_students($mask = '') |
|
1102 | 1102 | { |
1103 | 1103 | // students shouldn't be here // don't search if mask empty |
1104 | 1104 | if (!api_is_allowed_to_edit() || empty ($mask)) { |
@@ -1109,23 +1109,23 @@ discard block |
||
1109 | 1109 | $tbl_user = Database :: get_main_table(TABLE_MAIN_USER); |
1110 | 1110 | $tbl_cru = Database :: get_main_table(TABLE_MAIN_COURSE_USER); |
1111 | 1111 | $sql = 'SELECT DISTINCT user.user_id, user.lastname, user.firstname, user.email, user.official_code |
1112 | - FROM ' . $tbl_user . ' user'; |
|
1112 | + FROM ' . $tbl_user.' user'; |
|
1113 | 1113 | if (!api_is_platform_admin()) { |
1114 | - $sql .= ', ' . $tbl_cru . ' cru'; |
|
1114 | + $sql .= ', '.$tbl_cru.' cru'; |
|
1115 | 1115 | } |
1116 | 1116 | |
1117 | - $sql .= ' WHERE user.status = ' . STUDENT; |
|
1118 | - $sql .= ' AND (user.lastname LIKE '."'%" . $mask . "%'"; |
|
1119 | - $sql .= ' OR user.firstname LIKE '."'%" . $mask . "%')"; |
|
1117 | + $sql .= ' WHERE user.status = '.STUDENT; |
|
1118 | + $sql .= ' AND (user.lastname LIKE '."'%".$mask."%'"; |
|
1119 | + $sql .= ' OR user.firstname LIKE '."'%".$mask."%')"; |
|
1120 | 1120 | |
1121 | 1121 | if (!api_is_platform_admin()) { |
1122 | 1122 | $sql .= ' AND user.user_id = cru.user_id AND |
1123 | 1123 | cru.relation_type <> '.COURSE_RELATION_TYPE_RRHH.' AND |
1124 | 1124 | cru.c_id in ( |
1125 | - SELECT c_id FROM '.$tbl_cru . ' |
|
1125 | + SELECT c_id FROM '.$tbl_cru.' |
|
1126 | 1126 | WHERE |
1127 | - user_id = ' . api_get_user_id() . ' AND |
|
1128 | - status = ' . COURSEMANAGER . ' |
|
1127 | + user_id = ' . api_get_user_id().' AND |
|
1128 | + status = ' . COURSEMANAGER.' |
|
1129 | 1129 | ) |
1130 | 1130 | '; |
1131 | 1131 | } |
@@ -1168,7 +1168,7 @@ discard block |
||
1168 | 1168 | $sql = 'SELECT ref_id FROM '.$table_link.' |
1169 | 1169 | WHERE id = '.$linkId.' AND type='.LINK_ATTENDANCE; |
1170 | 1170 | |
1171 | - $rs_attendance = Database::query($sql); |
|
1171 | + $rs_attendance = Database::query($sql); |
|
1172 | 1172 | if (Database::num_rows($rs_attendance) > 0) { |
1173 | 1173 | $row_attendance = Database::fetch_array($rs_attendance); |
1174 | 1174 | $sql = 'UPDATE '.$tbl_attendance.' SET attendance_weight ='.$weight.' |
@@ -1254,7 +1254,7 @@ discard block |
||
1254 | 1254 | 'course' => $courseInfo['title'], |
1255 | 1255 | 'score' => $certificateInfo['score_certificate'], |
1256 | 1256 | 'date' => api_format_date($certificateInfo['created_at'], DATE_FORMAT_SHORT), |
1257 | - 'link' => api_get_path(WEB_PATH) . "certificates/index.php?id={$certificateInfo['id']}" |
|
1257 | + 'link' => api_get_path(WEB_PATH)."certificates/index.php?id={$certificateInfo['id']}" |
|
1258 | 1258 | ]; |
1259 | 1259 | } |
1260 | 1260 | |
@@ -1318,7 +1318,7 @@ discard block |
||
1318 | 1318 | 'course' => $course['title'], |
1319 | 1319 | 'score' => $certificateInfo['score_certificate'], |
1320 | 1320 | 'date' => api_format_date($certificateInfo['created_at'], DATE_FORMAT_SHORT), |
1321 | - 'link' => api_get_path(WEB_PATH) . "certificates/index.php?id={$certificateInfo['id']}" |
|
1321 | + 'link' => api_get_path(WEB_PATH)."certificates/index.php?id={$certificateInfo['id']}" |
|
1322 | 1322 | ]; |
1323 | 1323 | } |
1324 | 1324 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * constructor of the class |
16 | 16 | */ |
17 | - public function __construct($get_questions=false,$get_answers=false) |
|
17 | + public function __construct($get_questions = false, $get_answers = false) |
|
18 | 18 | { |
19 | 19 | } |
20 | 20 | |
@@ -36,21 +36,21 @@ discard block |
||
36 | 36 | //titles |
37 | 37 | |
38 | 38 | foreach ($dato[0] as $header_col) { |
39 | - if(!empty($header_col)) { |
|
40 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($header_col))).';'; |
|
39 | + if (!empty($header_col)) { |
|
40 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($header_col))).';'; |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | - $data .="\r\n"; |
|
44 | + $data .= "\r\n"; |
|
45 | 45 | $cant_students = count($dato[1]); |
46 | 46 | //print_r($data); exit(); |
47 | 47 | |
48 | - for($i=0;$i<$cant_students;$i++) { |
|
48 | + for ($i = 0; $i < $cant_students; $i++) { |
|
49 | 49 | $column = 0; |
50 | - foreach($dato[1][$i] as $col_name) { |
|
51 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($col_name))).';'; |
|
50 | + foreach ($dato[1][$i] as $col_name) { |
|
51 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($col_name))).';'; |
|
52 | 52 | } |
53 | - $data .="\r\n"; |
|
53 | + $data .= "\r\n"; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | //output the results |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | for ($i = 0; $i < $cant_students; $i++) { |
102 | 102 | $column = 0; |
103 | 103 | foreach ($data[1][$i] as $col_name) { |
104 | - $worksheet->SetCellValueByColumnAndRow($line,$column, html_entity_decode(strip_tags($col_name))); |
|
104 | + $worksheet->SetCellValueByColumnAndRow($line, $column, html_entity_decode(strip_tags($col_name))); |
|
105 | 105 | $column++; |
106 | 106 | } |
107 | 107 | $line++; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function exportCompleteReportDOC($data) |
123 | 123 | { |
124 | - $filename = 'gradebook_results_'.api_get_local_time() . '.docx'; |
|
124 | + $filename = 'gradebook_results_'.api_get_local_time().'.docx'; |
|
125 | 125 | |
126 | 126 | $doc = new \PhpOffice\PhpWord\PhpWord(); |
127 | 127 | $section = $doc->addSection(['orientation' => 'landscape']); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
143 | - $file = api_get_path(SYS_ARCHIVE_PATH) . api_replace_dangerous_char($filename); |
|
143 | + $file = api_get_path(SYS_ARCHIVE_PATH).api_replace_dangerous_char($filename); |
|
144 | 144 | $doc->save($file, 'Word2007'); |
145 | 145 | |
146 | 146 | DocumentManager::file_send_for_download($file, true, $filename); |