@@ -88,7 +88,7 @@ |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | $timePicker = 'true'; |
91 | - $timePickerValue = $this->getAttribute('timePicker'); |
|
91 | + $timePickerValue = $this->getAttribute('timePicker'); |
|
92 | 92 | if (!empty($timePickerValue)) { |
93 | 93 | $timePicker = $timePickerValue; |
94 | 94 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | return true; |
22 | 22 | } |
23 | 23 | } |
24 | - $result = parent::validate(array($datetime1, $datetime2), $operator); |
|
24 | + $result = parent::validate(array($datetime1, $datetime2), $operator); |
|
25 | 25 | return $result; |
26 | 26 | } |
27 | 27 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | function validate($html, $mode = NO_HTML) |
18 | 18 | { |
19 | - $allowed_tags = self::get_allowed_tags ($mode, $fullpage); |
|
19 | + $allowed_tags = self::get_allowed_tags($mode, $fullpage); |
|
20 | 20 | $cleaned_html = kses($html, $allowed_tags); |
21 | 21 | return $html == $cleaned_html; |
22 | 22 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | // Include the allowed tags. |
34 | 34 | //include(dirname(__FILE__).'/allowed_tags.inc.php'); |
35 | 35 | global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page; |
36 | - switch($mode) |
|
36 | + switch ($mode) |
|
37 | 37 | { |
38 | 38 | case NO_HTML: |
39 | 39 | return array(); |
@@ -27,11 +27,11 @@ |
||
27 | 27 | */ |
28 | 28 | function validate($value, $options = null) |
29 | 29 | { |
30 | - if(is_array($value)) |
|
30 | + if (is_array($value)) |
|
31 | 31 | { |
32 | - $value = implode(null,$value); |
|
32 | + $value = implode(null, $value); |
|
33 | 33 | } |
34 | - if ((string)$value == '') { |
|
34 | + if ((string) $value == '') { |
|
35 | 35 | return false; |
36 | 36 | } |
37 | 37 | return true; |
@@ -109,7 +109,7 @@ |
||
109 | 109 | }*/ |
110 | 110 | // If the session time has expired, refresh the starttime value, |
111 | 111 | // so we're starting to count down from a later time |
112 | - if ( $session->has('starttime') && $session->is_expired()) { |
|
112 | + if ($session->has('starttime') && $session->is_expired()) { |
|
113 | 113 | $session->destroy(); |
114 | 114 | } else { |
115 | 115 | //error_log('Time not expired, extend session for a bit more'); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | // If the mail only need to be send once (we know that thanks to the events.conf), we log it in the table |
126 | 126 | if ($event_config[$event_name]["sending_mail_once"]) { |
127 | - $sql = 'INSERT INTO ' . Database::get_main_table(TABLE_EVENT_SENT) . ' (user_from, user_to, event_type_name) |
|
127 | + $sql = 'INSERT INTO '.Database::get_main_table(TABLE_EVENT_SENT).' (user_from, user_to, event_type_name) |
|
128 | 128 | VALUES ('.$event_data["user_id"].', '.$id.' ,"'.Database::escape_string($event_name).'") |
129 | 129 | '; |
130 | 130 | Database::query($sql); |
@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | // Second, we send to people linked to the event |
136 | 136 | // So, we get everyone |
137 | 137 | $sql = 'SELECT u.user_id, u.language, u.email, u.firstname, u.lastname |
138 | - FROM ' . Database::get_main_table(TABLE_EVENT_TYPE_REL_USER) . ' ue |
|
138 | + FROM ' . Database::get_main_table(TABLE_EVENT_TYPE_REL_USER).' ue |
|
139 | 139 | INNER JOIN '.Database::get_main_table(TABLE_MAIN_USER).' u ON u.user_id = ue.user_id |
140 | - WHERE event_type_name = "' . $event_name . '"'; |
|
140 | + WHERE event_type_name = "' . $event_name.'"'; |
|
141 | 141 | $result = Database::store_result(Database::query($sql), 'ASSOC'); |
142 | 142 | // for each of the linked users |
143 | 143 | foreach ($result as $key => $value) { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | |
178 | 178 | // If the mail only need to be send once (we know that thanks to the events.conf, we log it in the table |
179 | 179 | if ($event_config[$event_name]["sending_mail_once"]) { |
180 | - $sql = 'INSERT INTO ' . Database::get_main_table(TABLE_EVENT_SENT) . ' |
|
180 | + $sql = 'INSERT INTO '.Database::get_main_table(TABLE_EVENT_SENT).' |
|
181 | 181 | (user_from, user_to, event_type_name) |
182 | 182 | VALUES ('.$event_data["user_id"].', '.$value["user_id"].' , "'.Database::escape_string($event_name).'"); |
183 | 183 | '; |
@@ -202,16 +202,16 @@ discard block |
||
202 | 202 | $current_language = api_get_interface_language(); |
203 | 203 | |
204 | 204 | $sql = 'SELECT COUNT(*) as total |
205 | - FROM ' . Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE) . ' em |
|
206 | - INNER JOIN ' . Database::get_main_table(TABLE_MAIN_LANGUAGE) . ' l |
|
205 | + FROM ' . Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE).' em |
|
206 | + INNER JOIN ' . Database::get_main_table(TABLE_MAIN_LANGUAGE).' l |
|
207 | 207 | ON em.language_id = l.id |
208 | 208 | WHERE |
209 | - em.event_type_name = "' . $event_name . '" and |
|
209 | + em.event_type_name = "' . $event_name.'" and |
|
210 | 210 | l.dokeos_folder = "'.$current_language.'" and |
211 | 211 | em.activated = 1'; |
212 | 212 | |
213 | 213 | $exists = Database::store_result(Database::query($sql), 'ASSOC'); |
214 | - if ($exists[0]["total"]) { |
|
214 | + if ($exists[0]["total"]) { |
|
215 | 215 | return true; |
216 | 216 | } else { |
217 | 217 | return false; |
@@ -228,12 +228,12 @@ discard block |
||
228 | 228 | private static function getMessage($event_name, $language) |
229 | 229 | { |
230 | 230 | $sql = 'SELECT message, subject, l.dokeos_folder |
231 | - FROM ' . Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE) . ' em |
|
232 | - INNER JOIN ' . Database::get_main_table(TABLE_MAIN_LANGUAGE) . ' l |
|
231 | + FROM ' . Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE).' em |
|
232 | + INNER JOIN ' . Database::get_main_table(TABLE_MAIN_LANGUAGE).' l |
|
233 | 233 | ON em.language_id = l.id |
234 | 234 | WHERE |
235 | - em.event_type_name = "' . $event_name . '" AND |
|
236 | - (l.dokeos_folder = "' . $language . '" OR l.dokeos_folder = "english") AND |
|
235 | + em.event_type_name = "' . $event_name.'" AND |
|
236 | + (l.dokeos_folder = "' . $language.'" OR l.dokeos_folder = "english") AND |
|
237 | 237 | em.message <> "" |
238 | 238 | '; |
239 | 239 | return Database::store_result(Database::query($sql), 'ASSOC'); |
@@ -274,8 +274,8 @@ discard block |
||
274 | 274 | private static function formatMessage(&$message, &$subject, $event_config, $event_name, &$event_data) |
275 | 275 | { |
276 | 276 | foreach ($event_config[$event_name]["available_keyvars"] as $key => $word) { |
277 | - $message = str_replace('((' . $key . '))', $event_data[$word], $message); |
|
278 | - $subject = str_replace('((' . $key . '))', $event_data[$word], $subject); |
|
277 | + $message = str_replace('(('.$key.'))', $event_data[$word], $message); |
|
278 | + $subject = str_replace('(('.$key.'))', $event_data[$word], $subject); |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $rel_path = '/'.$rel_path; |
92 | 92 | } |
93 | 93 | $abs_path = $current_path.$rel_path; |
94 | - $true_path=str_replace("\\", '/', realpath($abs_path)); |
|
94 | + $true_path = str_replace("\\", '/', realpath($abs_path)); |
|
95 | 95 | $found = strpos($true_path.'/', $checker_path); |
96 | 96 | if ($found === 0) { |
97 | 97 | return true; |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | } |
322 | 322 | |
323 | 323 | if ($user_status == COURSEMANAGERLOWSECURITY) { |
324 | - return $var; // No filtering. |
|
324 | + return $var; // No filtering. |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | static $purifier = array(); |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | } |
345 | 345 | |
346 | 346 | // Shows _target attribute in anchors |
347 | - $config->set('Attr.AllowedFrameTargets', array('_blank','_top','_self', '_parent')); |
|
347 | + $config->set('Attr.AllowedFrameTargets', array('_blank', '_top', '_self', '_parent')); |
|
348 | 348 | |
349 | 349 | if ($user_status == STUDENT) { |
350 | 350 | global $allowed_html_student; |
@@ -43,22 +43,22 @@ |
||
43 | 43 | ' WHERE (username LIKE "'.$needle.'%" '. |
44 | 44 | ' OR firstname LIKE "'.$needle.'%" '. |
45 | 45 | ' OR lastname LIKE "'.$needle.'%") '. |
46 | - $order_clause . |
|
46 | + $order_clause. |
|
47 | 47 | ' LIMIT 11'; |
48 | 48 | |
49 | 49 | $rs = Database::query($sql); |
50 | - $i=0; |
|
50 | + $i = 0; |
|
51 | 51 | |
52 | 52 | while ($user = Database :: fetch_array($rs)) { |
53 | 53 | $i++; |
54 | - if ($i<=10) { |
|
54 | + if ($i <= 10) { |
|
55 | 55 | $return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_url(\''.addslashes($user['user_id']).'\',\''.api_get_person_name(addslashes($user['firstname']), addslashes($user['lastname'])).' ('.addslashes($user['username']).')'.'\')">'.api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')</a><br />'; |
56 | 56 | } else { |
57 | 57 | $return .= '...<br />'; |
58 | 58 | } |
59 | 59 | } |
60 | 60 | } |
61 | - $xajax_response -> addAssign('ajax_list_users','innerHTML',api_utf8_encode($return)); |
|
61 | + $xajax_response -> addAssign('ajax_list_users', 'innerHTML', api_utf8_encode($return)); |
|
62 | 62 | return $xajax_response; |
63 | 63 | } |
64 | 64 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @access public |
87 | 87 | */ |
88 | 88 | function addAttachment($data, $filename = '', $contenttype = 'application/octet-stream', $cid = false) { |
89 | - if (! $cid) { |
|
89 | + if (!$cid) { |
|
90 | 90 | $cid = md5(uniqid(time())); |
91 | 91 | } |
92 | 92 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * @access private |
222 | 222 | */ |
223 | 223 | function parseResponse($headers, $data) { |
224 | - $this->debug('Entering parseResponse() for payload of length ' . strlen($data) . ' and type of ' . $headers['content-type']); |
|
224 | + $this->debug('Entering parseResponse() for payload of length '.strlen($data).' and type of '.$headers['content-type']); |
|
225 | 225 | $this->responseAttachments = array(); |
226 | 226 | if (strstr($headers['content-type'], 'multipart/related')) { |
227 | 227 | $this->debug('Decode multipart/related'); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | foreach ($headers as $k => $v) { |
230 | 230 | $input .= "$k: $v\r\n"; |
231 | 231 | } |
232 | - $params['input'] = $input . "\r\n" . $data; |
|
232 | + $params['input'] = $input."\r\n".$data; |
|
233 | 233 | $params['include_bodies'] = true; |
234 | 234 | $params['decode_bodies'] = true; |
235 | 235 | $params['decode_headers'] = true; |
@@ -238,11 +238,11 @@ discard block |
||
238 | 238 | |
239 | 239 | foreach ($structure->parts as $part) { |
240 | 240 | if (!isset($part->disposition) && (strstr($part->headers['content-type'], 'text/xml'))) { |
241 | - $this->debug('Have root part of type ' . $part->headers['content-type']); |
|
241 | + $this->debug('Have root part of type '.$part->headers['content-type']); |
|
242 | 242 | $root = $part->body; |
243 | 243 | $return = parent::parseResponse($part->headers, $part->body); |
244 | 244 | } else { |
245 | - $this->debug('Have an attachment of type ' . $part->headers['content-type']); |
|
245 | + $this->debug('Have an attachment of type '.$part->headers['content-type']); |
|
246 | 246 | $info['data'] = $part->body; |
247 | 247 | $info['filename'] = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : ''; |
248 | 248 | $info['contenttype'] = $part->headers['content-type']; |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | * @access public |
317 | 317 | */ |
318 | 318 | function addAttachment($data, $filename = '', $contenttype = 'application/octet-stream', $cid = false) { |
319 | - if (! $cid) { |
|
319 | + if (!$cid) { |
|
320 | 320 | $cid = md5(uniqid(time())); |
321 | 321 | } |
322 | 322 | |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | * @access private |
452 | 452 | */ |
453 | 453 | function parseRequest($headers, $data) { |
454 | - $this->debug('Entering parseRequest() for payload of length ' . strlen($data) . ' and type of ' . $headers['content-type']); |
|
454 | + $this->debug('Entering parseRequest() for payload of length '.strlen($data).' and type of '.$headers['content-type']); |
|
455 | 455 | $this->requestAttachments = array(); |
456 | 456 | if (strstr($headers['content-type'], 'multipart/related')) { |
457 | 457 | $this->debug('Decode multipart/related'); |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | foreach ($headers as $k => $v) { |
460 | 460 | $input .= "$k: $v\r\n"; |
461 | 461 | } |
462 | - $params['input'] = $input . "\r\n" . $data; |
|
462 | + $params['input'] = $input."\r\n".$data; |
|
463 | 463 | $params['include_bodies'] = true; |
464 | 464 | $params['decode_bodies'] = true; |
465 | 465 | $params['decode_headers'] = true; |
@@ -468,10 +468,10 @@ discard block |
||
468 | 468 | |
469 | 469 | foreach ($structure->parts as $part) { |
470 | 470 | if (!isset($part->disposition) && (strstr($part->headers['content-type'], 'text/xml'))) { |
471 | - $this->debug('Have root part of type ' . $part->headers['content-type']); |
|
471 | + $this->debug('Have root part of type '.$part->headers['content-type']); |
|
472 | 472 | $return = parent::parseRequest($part->headers, $part->body); |
473 | 473 | } else { |
474 | - $this->debug('Have an attachment of type ' . $part->headers['content-type']); |
|
474 | + $this->debug('Have an attachment of type '.$part->headers['content-type']); |
|
475 | 475 | $info['data'] = $part->body; |
476 | 476 | $info['filename'] = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : ''; |
477 | 477 | $info['contenttype'] = $part->headers['content-type']; |