@@ -48,7 +48,9 @@ discard block |
||
48 | 48 | |
49 | 49 | foreach ($sf_term_array as $raw_term) { |
50 | 50 | $term = substr($raw_term, 1); |
51 | - if (empty($term)) continue; |
|
51 | + if (empty($term)) { |
|
52 | + continue; |
|
53 | + } |
|
52 | 54 | $html_term = htmlspecialchars($term, ENT_QUOTES, $charset); |
53 | 55 | $selected = ''; |
54 | 56 | if (!empty($_REQUEST['sf_'.$prefix]) && is_array($_REQUEST['sf_'.$prefix]) && in_array($term,$_REQUEST['sf_'.$prefix])) { |
@@ -69,7 +71,9 @@ discard block |
||
69 | 71 | $max = count($sf_terms); |
70 | 72 | $multiple_selects .=''; |
71 | 73 | foreach ($sf_terms as $prefix => $sf_term_array) { |
72 | - if ($prefix == $prefilter_prefix) continue; |
|
74 | + if ($prefix == $prefilter_prefix) { |
|
75 | + continue; |
|
76 | + } |
|
73 | 77 | $multiple_select = ''; |
74 | 78 | if ($i>0) { |
75 | 79 | //print "+" image |
@@ -342,9 +346,10 @@ discard block |
||
342 | 346 | |
343 | 347 | // Tool introduction |
344 | 348 | // TODO: Settings for the online editor to be checked (insert an image for example). Probably this is a special case here. |
345 | - if (api_get_course_id() !== -1) |
|
346 | - if (!empty($groupId)) { |
|
349 | + if (api_get_course_id() !== -1) { |
|
350 | + if (!empty($groupId)) { |
|
347 | 351 | Display::display_introduction_section(TOOL_SEARCH.$groupId); |
352 | + } |
|
348 | 353 | } else { |
349 | 354 | Display::display_introduction_section(TOOL_SEARCH); |
350 | 355 | } |
@@ -366,7 +371,9 @@ discard block |
||
366 | 371 | break; |
367 | 372 | } |
368 | 373 | } |
369 | - if ($thesaurus_decided) break; |
|
374 | + if ($thesaurus_decided) { |
|
375 | + break; |
|
376 | + } |
|
370 | 377 | } |
371 | 378 | } |
372 | 379 |
@@ -36,8 +36,9 @@ discard block |
||
36 | 36 | $stored_terms = $this->get_terms_on_db($prefix, $course_code, $tool_id, $ref_id_high_level); |
37 | 37 | |
38 | 38 | // don't do anything if no change, verify only at DB, not the search engine |
39 | - if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) |
|
40 | - return FALSE; |
|
39 | + if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) { |
|
40 | + return FALSE; |
|
41 | + } |
|
41 | 42 | |
42 | 43 | require_once api_get_path(LIBRARY_PATH) . 'search/xapian/XapianQuery.php'; |
43 | 44 | |
@@ -45,8 +46,9 @@ discard block |
||
45 | 46 | $doc = $this->get_document($search_did); |
46 | 47 | $xapian_terms = xapian_get_doc_terms($doc, $prefix); |
47 | 48 | $xterms = array(); |
48 | - foreach ($xapian_terms as $xapian_term) |
|
49 | - $xterms[] = substr($xapian_term['name'], 1); |
|
49 | + foreach ($xapian_terms as $xapian_term) { |
|
50 | + $xterms[] = substr($xapian_term['name'], 1); |
|
51 | + } |
|
50 | 52 | |
51 | 53 | $dterms = $terms; |
52 | 54 |
@@ -94,8 +94,9 @@ discard block |
||
94 | 94 | // Read the magic bytes and verify |
95 | 95 | $retval = substr($png,0,8); |
96 | 96 | $ipos = 8; |
97 | - if ($retval != "\x89PNG\x0d\x0a\x1a\x0a") |
|
98 | - throw new Exception('Is not a valid PNG image'); |
|
97 | + if ($retval != "\x89PNG\x0d\x0a\x1a\x0a") { |
|
98 | + throw new Exception('Is not a valid PNG image'); |
|
99 | + } |
|
99 | 100 | // Loop through the chunks. Byte 0-3 is length, Byte 4-7 is type |
100 | 101 | $chunkHeader = substr($png,$ipos,8); |
101 | 102 | $ipos = $ipos + 8; |
@@ -107,13 +108,17 @@ discard block |
||
107 | 108 | $data = substr($png,$ipos,$chunk['size']); |
108 | 109 | $sections = explode("\0", $data); |
109 | 110 | print_r($sections); |
110 | - if ( $sections[0] == $key ) $skip = true; |
|
111 | + if ( $sections[0] == $key ) { |
|
112 | + $skip = true; |
|
113 | + } |
|
111 | 114 | } |
112 | 115 | // Extract the data and the CRC |
113 | 116 | $data = substr($png,$ipos,$chunk['size']+4); |
114 | 117 | $ipos = $ipos + $chunk['size'] + 4; |
115 | 118 | // Add in the header, data, and CRC |
116 | - if ( ! $skip ) $retval = $retval . $chunkHeader . $data; |
|
119 | + if ( ! $skip ) { |
|
120 | + $retval = $retval . $chunkHeader . $data; |
|
121 | + } |
|
117 | 122 | // Read next chunk header |
118 | 123 | $chunkHeader = substr($png,$ipos,8); |
119 | 124 | $ipos = $ipos + 8; |
@@ -536,8 +536,9 @@ |
||
536 | 536 | } |
537 | 537 | } else { |
538 | 538 | $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; // course path |
539 | - if (file_exists($store_path)) |
|
540 | - $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; |
|
539 | + if (file_exists($store_path)) { |
|
540 | + $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; |
|
541 | + } |
|
541 | 542 | } |
542 | 543 | return $web_path; |
543 | 544 | } |
@@ -2097,7 +2097,9 @@ |
||
2097 | 2097 | FROM $tbl_course course |
2098 | 2098 | WHERE course.code IN (".implode(',',$courses_code).")"; |
2099 | 2099 | |
2100 | - if (!in_array($direction, array('ASC','DESC'))) $direction = 'ASC'; |
|
2100 | + if (!in_array($direction, array('ASC','DESC'))) { |
|
2101 | + $direction = 'ASC'; |
|
2102 | + } |
|
2101 | 2103 | |
2102 | 2104 | $column = intval($column); |
2103 | 2105 | $from = intval($from); |
@@ -173,8 +173,9 @@ discard block |
||
173 | 173 | } |
174 | 174 | if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) { |
175 | 175 | $this->loadWSDL(); |
176 | - if ($this->getError()) |
|
177 | - return false; |
|
176 | + if ($this->getError()) { |
|
177 | + return false; |
|
178 | + } |
|
178 | 179 | } |
179 | 180 | // serialize parameters |
180 | 181 | if($this->endpointType == 'wsdl' && $opData = $this->getOperationData($operation)){ |
@@ -388,8 +389,9 @@ discard block |
||
388 | 389 | function getOperationData($operation){ |
389 | 390 | if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) { |
390 | 391 | $this->loadWSDL(); |
391 | - if ($this->getError()) |
|
392 | - return false; |
|
392 | + if ($this->getError()) { |
|
393 | + return false; |
|
394 | + } |
|
393 | 395 | } |
394 | 396 | if(isset($this->operations[$operation])){ |
395 | 397 | return $this->operations[$operation]; |
@@ -159,10 +159,12 @@ discard block |
||
159 | 159 | * @access private |
160 | 160 | */ |
161 | 161 | function io_method() { |
162 | - if ($this->use_curl || ($this->scheme == 'https') || ($this->scheme == 'http' && $this->authtype == 'ntlm') || ($this->scheme == 'http' && is_array($this->proxy) && $this->proxy['authtype'] == 'ntlm')) |
|
163 | - return 'curl'; |
|
164 | - if (($this->scheme == 'http' || $this->scheme == 'ssl') && $this->authtype != 'ntlm' && (!is_array($this->proxy) || $this->proxy['authtype'] != 'ntlm')) |
|
165 | - return 'socket'; |
|
162 | + if ($this->use_curl || ($this->scheme == 'https') || ($this->scheme == 'http' && $this->authtype == 'ntlm') || ($this->scheme == 'http' && is_array($this->proxy) && $this->proxy['authtype'] == 'ntlm')) { |
|
163 | + return 'curl'; |
|
164 | + } |
|
165 | + if (($this->scheme == 'http' || $this->scheme == 'ssl') && $this->authtype != 'ntlm' && (!is_array($this->proxy) || $this->proxy['authtype'] != 'ntlm')) { |
|
166 | + return 'socket'; |
|
167 | + } |
|
166 | 168 | return 'unknown'; |
167 | 169 | } |
168 | 170 | |
@@ -246,30 +248,36 @@ discard block |
||
246 | 248 | return false; |
247 | 249 | } |
248 | 250 | // Avoid warnings when PHP does not have these options |
249 | - if (defined('CURLOPT_CONNECTIONTIMEOUT')) |
|
250 | - $CURLOPT_CONNECTIONTIMEOUT = CURLOPT_CONNECTIONTIMEOUT; |
|
251 | - else |
|
252 | - $CURLOPT_CONNECTIONTIMEOUT = 78; |
|
253 | - if (defined('CURLOPT_HTTPAUTH')) |
|
254 | - $CURLOPT_HTTPAUTH = CURLOPT_HTTPAUTH; |
|
255 | - else |
|
256 | - $CURLOPT_HTTPAUTH = 107; |
|
257 | - if (defined('CURLOPT_PROXYAUTH')) |
|
258 | - $CURLOPT_PROXYAUTH = CURLOPT_PROXYAUTH; |
|
259 | - else |
|
260 | - $CURLOPT_PROXYAUTH = 111; |
|
261 | - if (defined('CURLAUTH_BASIC')) |
|
262 | - $CURLAUTH_BASIC = CURLAUTH_BASIC; |
|
263 | - else |
|
264 | - $CURLAUTH_BASIC = 1; |
|
265 | - if (defined('CURLAUTH_DIGEST')) |
|
266 | - $CURLAUTH_DIGEST = CURLAUTH_DIGEST; |
|
267 | - else |
|
268 | - $CURLAUTH_DIGEST = 2; |
|
269 | - if (defined('CURLAUTH_NTLM')) |
|
270 | - $CURLAUTH_NTLM = CURLAUTH_NTLM; |
|
271 | - else |
|
272 | - $CURLAUTH_NTLM = 8; |
|
251 | + if (defined('CURLOPT_CONNECTIONTIMEOUT')) { |
|
252 | + $CURLOPT_CONNECTIONTIMEOUT = CURLOPT_CONNECTIONTIMEOUT; |
|
253 | + } else { |
|
254 | + $CURLOPT_CONNECTIONTIMEOUT = 78; |
|
255 | + } |
|
256 | + if (defined('CURLOPT_HTTPAUTH')) { |
|
257 | + $CURLOPT_HTTPAUTH = CURLOPT_HTTPAUTH; |
|
258 | + } else { |
|
259 | + $CURLOPT_HTTPAUTH = 107; |
|
260 | + } |
|
261 | + if (defined('CURLOPT_PROXYAUTH')) { |
|
262 | + $CURLOPT_PROXYAUTH = CURLOPT_PROXYAUTH; |
|
263 | + } else { |
|
264 | + $CURLOPT_PROXYAUTH = 111; |
|
265 | + } |
|
266 | + if (defined('CURLAUTH_BASIC')) { |
|
267 | + $CURLAUTH_BASIC = CURLAUTH_BASIC; |
|
268 | + } else { |
|
269 | + $CURLAUTH_BASIC = 1; |
|
270 | + } |
|
271 | + if (defined('CURLAUTH_DIGEST')) { |
|
272 | + $CURLAUTH_DIGEST = CURLAUTH_DIGEST; |
|
273 | + } else { |
|
274 | + $CURLAUTH_DIGEST = 2; |
|
275 | + } |
|
276 | + if (defined('CURLAUTH_NTLM')) { |
|
277 | + $CURLAUTH_NTLM = CURLAUTH_NTLM; |
|
278 | + } else { |
|
279 | + $CURLAUTH_NTLM = 8; |
|
280 | + } |
|
273 | 281 | |
274 | 282 | $this->debug('connect using cURL'); |
275 | 283 | // init CURL |
@@ -612,7 +620,9 @@ discard block |
||
612 | 620 | 'HTTP/1.0 200 Connection established'); |
613 | 621 | foreach ($skipHeaders as $hd) { |
614 | 622 | $prefix = substr($data, 0, strlen($hd)); |
615 | - if ($prefix == $hd) return true; |
|
623 | + if ($prefix == $hd) { |
|
624 | + return true; |
|
625 | + } |
|
616 | 626 | } |
617 | 627 | |
618 | 628 | return false; |
@@ -78,8 +78,9 @@ |
||
78 | 78 | $this->proxypassword = $proxypassword; |
79 | 79 | $this->timeout = $timeout; |
80 | 80 | $this->response_timeout = $response_timeout; |
81 | - if (is_array($curl_options)) |
|
82 | - $this->curl_options = $curl_options; |
|
81 | + if (is_array($curl_options)) { |
|
82 | + $this->curl_options = $curl_options; |
|
83 | + } |
|
83 | 84 | $this->use_curl = $use_curl; |
84 | 85 | $this->fetchWSDL($wsdl); |
85 | 86 | } |
@@ -18,9 +18,11 @@ |
||
18 | 18 | |
19 | 19 | foreach ($event_config[$event_name]["actions"] as $func) { |
20 | 20 | $execute = true; |
21 | - if (!function_exists($func)) // if the function doesn't exist, we log |
|
21 | + if (!function_exists($func)) { |
|
22 | + // if the function doesn't exist, we log |
|
22 | 23 | { |
23 | 24 | error_log("EventsDispatcher warning : ".$func." does not exist."); |
25 | + } |
|
24 | 26 | $execute = false; |
25 | 27 | } |
26 | 28 |