@@ -73,16 +73,16 @@ discard block |
||
| 73 | 73 | protected $_lcount = 19; |
| 74 | 74 | protected $_vcount = 21; |
| 75 | 75 | protected $_tcount = 28; |
| 76 | - protected $_ncount = 588; // _vcount * _tcount |
|
| 76 | + protected $_ncount = 588; // _vcount * _tcount |
|
| 77 | 77 | protected $_scount = 11172; // _lcount * _tcount * _vcount |
| 78 | 78 | protected $_error = false; |
| 79 | 79 | protected static $_mb_string_overload = null; |
| 80 | 80 | // See {@link set_paramter()} for details of how to change the following |
| 81 | 81 | // settings from within your script / application |
| 82 | - protected $_api_encoding = 'utf8'; // Default input charset is UTF-8 |
|
| 83 | - protected $_allow_overlong = false; // Overlong UTF-8 encodings are forbidden |
|
| 84 | - protected $_strict_mode = false; // Behave strict or not |
|
| 85 | - protected $_idn_version = 2003; // Can be either 2003 (old, default) or 2008 |
|
| 82 | + protected $_api_encoding = 'utf8'; // Default input charset is UTF-8 |
|
| 83 | + protected $_allow_overlong = false; // Overlong UTF-8 encodings are forbidden |
|
| 84 | + protected $_strict_mode = false; // Behave strict or not |
|
| 85 | + protected $_idn_version = 2003; // Can be either 2003 (old, default) or 2008 |
|
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * the constructor |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $this->_api_encoding = $v; |
| 141 | 141 | break; |
| 142 | 142 | default: |
| 143 | - $this->_error('Set Parameter: Unknown parameter ' . $v . ' for option ' . $k); |
|
| 143 | + $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k); |
|
| 144 | 144 | return false; |
| 145 | 145 | } |
| 146 | 146 | break; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | if (in_array($v, array('2003', '2008'))) { |
| 155 | 155 | $this->_idn_version = $v; |
| 156 | 156 | } else { |
| 157 | - $this->_error('Set Parameter: Unknown parameter ' . $v . ' for option ' . $k); |
|
| 157 | + $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k); |
|
| 158 | 158 | } |
| 159 | 159 | break; |
| 160 | 160 | case 'encode_german_sz': // Deprecated |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | break; |
| 167 | 167 | default: |
| 168 | - $this->_error('Set Parameter: Unknown option ' . $k); |
|
| 168 | + $this->_error('Set Parameter: Unknown option '.$k); |
|
| 169 | 169 | return false; |
| 170 | 170 | } |
| 171 | 171 | } |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | case 'ucs4_array': |
| 189 | 189 | break; |
| 190 | 190 | default: |
| 191 | - $this->_error('Unknown encoding ' . $one_time_encoding); |
|
| 191 | + $this->_error('Unknown encoding '.$one_time_encoding); |
|
| 192 | 192 | return false; |
| 193 | 193 | } |
| 194 | 194 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | list ($email_pref, $input) = explode('@', $input, 2); |
| 207 | 207 | $arr = explode('.', $input); |
| 208 | 208 | foreach ($arr as $k => $v) { |
| 209 | - if (preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $v)) { |
|
| 209 | + if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) { |
|
| 210 | 210 | $conv = $this->_decode($v); |
| 211 | 211 | if ($conv) { |
| 212 | 212 | $arr[$k] = $conv; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $input = join('.', $arr); |
| 217 | 217 | $arr = explode('.', $email_pref); |
| 218 | 218 | foreach ($arr as $k => $v) { |
| 219 | - if (preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $v)) { |
|
| 219 | + if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) { |
|
| 220 | 220 | $conv = $this->_decode($v); |
| 221 | 221 | if ($conv) { |
| 222 | 222 | $arr[$k] = $conv; |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | $email_pref = join('.', $arr); |
| 227 | - $return = $email_pref . '@' . $input; |
|
| 227 | + $return = $email_pref.'@'.$input; |
|
| 228 | 228 | } elseif (preg_match('![:\./]!', $input)) { // Or a complete domain name (with or without paths / parameters) |
| 229 | 229 | // No no in strict mode |
| 230 | 230 | if ($this->_strict_mode) { |
@@ -241,13 +241,13 @@ discard block |
||
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | $parsed['host'] = join('.', $arr); |
| 244 | - $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')). |
|
| 245 | - (empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@'). |
|
| 244 | + $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')). |
|
| 245 | + (empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@'). |
|
| 246 | 246 | $parsed['host']. |
| 247 | - (empty($parsed['port']) ? '' : ':' . $parsed['port']). |
|
| 247 | + (empty($parsed['port']) ? '' : ':'.$parsed['port']). |
|
| 248 | 248 | (empty($parsed['path']) ? '' : $parsed['path']). |
| 249 | - (empty($parsed['query']) ? '' : '?' . $parsed['query']). |
|
| 250 | - (empty($parsed['fragment']) ? '' : '#' . $parsed['fragment']); |
|
| 249 | + (empty($parsed['query']) ? '' : '?'.$parsed['query']). |
|
| 250 | + (empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']); |
|
| 251 | 251 | } else { // parse_url seems to have failed, try without it |
| 252 | 252 | $arr = explode('.', $input); |
| 253 | 253 | foreach ($arr as $k => $v) { |
@@ -265,8 +265,8 @@ discard block |
||
| 265 | 265 | // The output is UTF-8 by default, other output formats need conversion here |
| 266 | 266 | // If one time encoding is given, use this, else the objects property |
| 267 | 267 | switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) { |
| 268 | - case 'utf8': return $return; // break; |
|
| 269 | - case 'ucs4_string': return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); // break; |
|
| 268 | + case 'utf8' : return $return; // break; |
|
| 269 | + case 'ucs4_string': return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); // break; |
|
| 270 | 270 | case 'ucs4_array': return $this->_utf8_to_ucs4($return); // break; |
| 271 | 271 | default: $this->_error('Unsupported output format'); return false; |
| 272 | 272 | } |
@@ -283,15 +283,14 @@ discard block |
||
| 283 | 283 | // Forcing conversion of input to UCS4 array |
| 284 | 284 | // If one time encoding is given, use this, else the objects property |
| 285 | 285 | switch ($one_time_encoding ? $one_time_encoding : $this->_api_encoding) { |
| 286 | - case 'utf8': |
|
| 287 | - $decoded = $this->_utf8_to_ucs4($decoded); |
|
| 286 | + case 'utf8' : $decoded = $this->_utf8_to_ucs4($decoded); |
|
| 288 | 287 | break; |
| 289 | 288 | case 'ucs4_string': |
| 290 | 289 | $decoded = $this->_ucs4_string_to_ucs4($decoded); |
| 291 | 290 | case 'ucs4_array': |
| 292 | 291 | break; |
| 293 | 292 | default: |
| 294 | - $this->_error('Unsupported input format: ' . ($one_time_encoding ? $one_time_encoding : $this->_api_encoding)); |
|
| 293 | + $this->_error('Unsupported input format: '.($one_time_encoding ? $one_time_encoding : $this->_api_encoding)); |
|
| 295 | 294 | return false; |
| 296 | 295 | } |
| 297 | 296 | |
@@ -380,13 +379,13 @@ discard block |
||
| 380 | 379 | } |
| 381 | 380 | } |
| 382 | 381 | $parsed['host'] = join('.', $arr); |
| 383 | - $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')). |
|
| 384 | - (empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@'). |
|
| 382 | + $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://')). |
|
| 383 | + (empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@'). |
|
| 385 | 384 | $parsed['host']. |
| 386 | - (empty($parsed['port']) ? '' : ':' . $parsed['port']). |
|
| 385 | + (empty($parsed['port']) ? '' : ':'.$parsed['port']). |
|
| 387 | 386 | (empty($parsed['path']) ? '' : $parsed['path']). |
| 388 | - (empty($parsed['query']) ? '' : '?' . $parsed['query']). |
|
| 389 | - (empty($parsed['fragment']) ? '' : '#' . $parsed['fragment']); |
|
| 387 | + (empty($parsed['query']) ? '' : '?'.$parsed['query']). |
|
| 388 | + (empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']); |
|
| 390 | 389 | return $return; |
| 391 | 390 | } |
| 392 | 391 | |
@@ -409,11 +408,11 @@ discard block |
||
| 409 | 408 | { |
| 410 | 409 | $decoded = array(); |
| 411 | 410 | // find the Punycode prefix |
| 412 | - if (!preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $encoded)) { |
|
| 411 | + if (!preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $encoded)) { |
|
| 413 | 412 | $this->_error('This is not a punycode string'); |
| 414 | 413 | return false; |
| 415 | 414 | } |
| 416 | - $encode_test = preg_replace('!^' . preg_quote($this->_punycode_prefix, '!') . '!', '', $encoded); |
|
| 415 | + $encode_test = preg_replace('!^'.preg_quote($this->_punycode_prefix, '!').'!', '', $encoded); |
|
| 417 | 416 | // If nothing left after removing the prefix, it is hopeless |
| 418 | 417 | if (!$encode_test) { |
| 419 | 418 | $this->_error('The given encoded string was empty'); |
@@ -439,8 +438,7 @@ discard block |
||
| 439 | 438 | for ($old_idx = $idx, $w = 1, $k = $this->_base; 1; $k += $this->_base) { |
| 440 | 439 | $digit = $this->_decode_digit($encoded{$enco_idx++}); |
| 441 | 440 | $idx += $digit * $w; |
| 442 | - $t = ($k <= $bias) ? $this->_tmin : |
|
| 443 | - (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias)); |
|
| 441 | + $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias)); |
|
| 444 | 442 | if ($digit < $t) { |
| 445 | 443 | break; |
| 446 | 444 | } |
@@ -513,7 +511,7 @@ discard block |
||
| 513 | 511 | return $encoded; // All codepoints were basic ones |
| 514 | 512 | } |
| 515 | 513 | // Start with the prefix; copy it to output |
| 516 | - $encoded = $this->_punycode_prefix . $encoded; |
|
| 514 | + $encoded = $this->_punycode_prefix.$encoded; |
|
| 517 | 515 | // If we have basic code points in output, add an hyphen to the end |
| 518 | 516 | if ($codecount) { |
| 519 | 517 | $encoded .= '-'; |
@@ -540,8 +538,7 @@ discard block |
||
| 540 | 538 | $delta++; |
| 541 | 539 | } elseif ($decoded[$i] == $cur_code) { |
| 542 | 540 | for ($q = $delta, $k = $this->_base; 1; $k += $this->_base) { |
| 543 | - $t = ($k <= $bias) ? $this->_tmin : |
|
| 544 | - (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias); |
|
| 541 | + $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias); |
|
| 545 | 542 | if ($q < $t) { |
| 546 | 543 | break; |
| 547 | 544 | } |
@@ -628,12 +625,12 @@ discard block |
||
| 628 | 625 | } |
| 629 | 626 | // Try to find prohibited input |
| 630 | 627 | if (in_array($v, self::$NP['prohibit']) || in_array($v, self::$NP['general_prohibited'])) { |
| 631 | - $this->_error('NAMEPREP: Prohibited input U+' . sprintf('%08X', $v)); |
|
| 628 | + $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v)); |
|
| 632 | 629 | return false; |
| 633 | 630 | } |
| 634 | 631 | foreach (self::$NP['prohibit_ranges'] as $range) { |
| 635 | 632 | if ($range[0] <= $v && $v <= $range[1]) { |
| 636 | - $this->_error('NAMEPREP: Prohibited input U+' . sprintf('%08X', $v)); |
|
| 633 | + $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v)); |
|
| 637 | 634 | return false; |
| 638 | 635 | } |
| 639 | 636 | } |
@@ -869,7 +866,7 @@ discard block |
||
| 869 | 866 | $output[$out_len] = $v; |
| 870 | 867 | ++$out_len; |
| 871 | 868 | if ('add' == $mode) { |
| 872 | - $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k); |
|
| 869 | + $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); |
|
| 873 | 870 | return false; |
| 874 | 871 | } |
| 875 | 872 | continue; |
@@ -894,7 +891,7 @@ discard block |
||
| 894 | 891 | $next_byte = 4; |
| 895 | 892 | $v = ($v - 252) << 30; |
| 896 | 893 | } else { |
| 897 | - $this->_error('This might be UTF-8, but I don\'t understand it at byte ' . $k); |
|
| 894 | + $this->_error('This might be UTF-8, but I don\'t understand it at byte '.$k); |
|
| 898 | 895 | return false; |
| 899 | 896 | } |
| 900 | 897 | if ('add' == $mode) { |
@@ -907,7 +904,7 @@ discard block |
||
| 907 | 904 | if (!$this->_allow_overlong && $test == 'range') { |
| 908 | 905 | $test = 'none'; |
| 909 | 906 | if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) { |
| 910 | - $this->_error('Bogus UTF-8 character detected (out of legal range) at byte ' . $k); |
|
| 907 | + $this->_error('Bogus UTF-8 character detected (out of legal range) at byte '.$k); |
|
| 911 | 908 | return false; |
| 912 | 909 | } |
| 913 | 910 | } |
@@ -916,7 +913,7 @@ discard block |
||
| 916 | 913 | $output[($out_len - 1)] += $v; |
| 917 | 914 | --$next_byte; |
| 918 | 915 | } else { |
| 919 | - $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k); |
|
| 916 | + $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k); |
|
| 920 | 917 | return false; |
| 921 | 918 | } |
| 922 | 919 | if ($next_byte < 0) { |
@@ -940,13 +937,13 @@ discard block |
||
| 940 | 937 | if ($v < 128) { // 7bit are transferred literally |
| 941 | 938 | $output .= chr($v); |
| 942 | 939 | } elseif ($v < (1 << 11)) { // 2 bytes |
| 943 | - $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63)); |
|
| 940 | + $output .= chr(192 + ($v >> 6)).chr(128 + ($v & 63)); |
|
| 944 | 941 | } elseif ($v < (1 << 16)) { // 3 bytes |
| 945 | - $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
| 942 | + $output .= chr(224 + ($v >> 12)).chr(128 + (($v >> 6) & 63)).chr(128 + ($v & 63)); |
|
| 946 | 943 | } elseif ($v < (1 << 21)) { // 4 bytes |
| 947 | - $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
| 944 | + $output .= chr(240 + ($v >> 18)).chr(128 + (($v >> 12) & 63)).chr(128 + (($v >> 6) & 63)).chr(128 + ($v & 63)); |
|
| 948 | 945 | } else { |
| 949 | - $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte ' . $k); |
|
| 946 | + $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k); |
|
| 950 | 947 | return false; |
| 951 | 948 | } |
| 952 | 949 | } |
@@ -965,7 +962,7 @@ discard block |
||
| 965 | 962 | // Take array values and split output to 4 bytes per value |
| 966 | 963 | // The bit mask is 255, which reads &11111111 |
| 967 | 964 | foreach ($input as $v) { |
| 968 | - $output .= chr(($v >> 24) & 255) . chr(($v >> 16) & 255) . chr(($v >> 8) & 255) . chr($v & 255); |
|
| 965 | + $output .= chr(($v >> 24) & 255).chr(($v >> 16) & 255).chr(($v >> 8) & 255).chr($v & 255); |
|
| 969 | 966 | } |
| 970 | 967 | return $output; |
| 971 | 968 | } |
@@ -995,7 +992,7 @@ discard block |
||
| 995 | 992 | $out_len++; |
| 996 | 993 | $output[$out_len] = 0; |
| 997 | 994 | } |
| 998 | - $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) ); |
|
| 995 | + $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4))); |
|
| 999 | 996 | } |
| 1000 | 997 | return $output; |
| 1001 | 998 | } |
@@ -1,3 +1,3 @@ |
||
| 1 | 1 | <?php |
| 2 | - # appel SPIP |
|
| 3 | - include('spip.php'); |
|
| 2 | + # appel SPIP |
|
| 3 | + include('spip.php'); |
|
@@ -11,24 +11,24 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function lister_traductions($id_trad, $objet) { |
| 18 | - $table_objet_sql = table_objet_sql($objet); |
|
| 19 | - $primary = id_table_objet($objet); |
|
| 18 | + $table_objet_sql = table_objet_sql($objet); |
|
| 19 | + $primary = id_table_objet($objet); |
|
| 20 | 20 | |
| 21 | - $select = "$primary as id,lang"; |
|
| 22 | - $where = 'id_trad=' . intval($id_trad); |
|
| 23 | - $trouver_table = charger_fonction('trouver_table','base'); |
|
| 24 | - $desc = $trouver_table($table_objet_sql); |
|
| 25 | - if (isset($desc['field']['statut'])) { |
|
| 26 | - $select .= ',statut'; |
|
| 27 | - $where .= ' AND statut!='.sql_quote('poubelle'); |
|
| 28 | - } |
|
| 21 | + $select = "$primary as id,lang"; |
|
| 22 | + $where = 'id_trad=' . intval($id_trad); |
|
| 23 | + $trouver_table = charger_fonction('trouver_table','base'); |
|
| 24 | + $desc = $trouver_table($table_objet_sql); |
|
| 25 | + if (isset($desc['field']['statut'])) { |
|
| 26 | + $select .= ',statut'; |
|
| 27 | + $where .= ' AND statut!='.sql_quote('poubelle'); |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - $rows = sql_allfetsel($select, $table_objet_sql, $where); |
|
| 31 | - lang_select(); |
|
| 30 | + $rows = sql_allfetsel($select, $table_objet_sql, $where); |
|
| 31 | + lang_select(); |
|
| 32 | 32 | |
| 33 | - return $rows; |
|
| 33 | + return $rows; |
|
| 34 | 34 | } |
@@ -19,8 +19,8 @@ |
||
| 19 | 19 | $primary = id_table_objet($objet); |
| 20 | 20 | |
| 21 | 21 | $select = "$primary as id,lang"; |
| 22 | - $where = 'id_trad=' . intval($id_trad); |
|
| 23 | - $trouver_table = charger_fonction('trouver_table','base'); |
|
| 22 | + $where = 'id_trad='.intval($id_trad); |
|
| 23 | + $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 24 | 24 | $desc = $trouver_table($table_objet_sql); |
| 25 | 25 | if (isset($desc['field']['statut'])) { |
| 26 | 26 | $select .= ',statut'; |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | include_spip('prive/objets/liste/auteurs_fonctions'); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | include_spip('inc/drapeau_edition'); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * @package SPIP\Core\Fonctions |
| 17 | 17 | **/ |
| 18 | 18 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 19 | - return; |
|
| 19 | + return; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -29,29 +29,29 @@ discard block |
||
| 29 | 29 | * @param <type> $left |
| 30 | 30 | */ |
| 31 | 31 | function critere_compteur_articles_filtres_dist($idb, &$boucles, $crit, $left = false) { |
| 32 | - $boucle = &$boucles[$idb]; |
|
| 32 | + $boucle = &$boucles[$idb]; |
|
| 33 | 33 | |
| 34 | - $_statut = calculer_liste($crit->param[0], array(), $boucles, $boucle->id_parent); |
|
| 34 | + $_statut = calculer_liste($crit->param[0], array(), $boucles, $boucle->id_parent); |
|
| 35 | 35 | |
| 36 | - $not = ''; |
|
| 37 | - if ($crit->not) { |
|
| 38 | - $not = ", 'NOT'"; |
|
| 39 | - } |
|
| 40 | - $boucle->from['LAA'] = 'spip_auteurs_liens'; |
|
| 41 | - $boucle->from_type['LAA'] = 'left'; |
|
| 42 | - $boucle->join['LAA'] = array("'auteurs'", "'id_auteur'", "'id_auteur'", "'LAA.objet=\'article\''"); |
|
| 36 | + $not = ''; |
|
| 37 | + if ($crit->not) { |
|
| 38 | + $not = ", 'NOT'"; |
|
| 39 | + } |
|
| 40 | + $boucle->from['LAA'] = 'spip_auteurs_liens'; |
|
| 41 | + $boucle->from_type['LAA'] = 'left'; |
|
| 42 | + $boucle->join['LAA'] = array("'auteurs'", "'id_auteur'", "'id_auteur'", "'LAA.objet=\'article\''"); |
|
| 43 | 43 | |
| 44 | - $boucle->from['articles'] = 'spip_articles'; |
|
| 45 | - $boucle->from_type['articles'] = 'left'; |
|
| 46 | - $boucle->join['articles'] = array( |
|
| 47 | - "'LAA'", |
|
| 48 | - "'id_article'", |
|
| 49 | - "'id_objet'", |
|
| 50 | - "'(articles.statut IS NULL OR '.sql_in('articles.statut',_q($_statut)$not).')'" |
|
| 51 | - ); |
|
| 44 | + $boucle->from['articles'] = 'spip_articles'; |
|
| 45 | + $boucle->from_type['articles'] = 'left'; |
|
| 46 | + $boucle->join['articles'] = array( |
|
| 47 | + "'LAA'", |
|
| 48 | + "'id_article'", |
|
| 49 | + "'id_objet'", |
|
| 50 | + "'(articles.statut IS NULL OR '.sql_in('articles.statut',_q($_statut)$not).')'" |
|
| 51 | + ); |
|
| 52 | 52 | |
| 53 | - $boucle->select[] = 'COUNT(articles.id_article) AS compteur_articles'; |
|
| 54 | - $boucle->group[] = 'auteurs.id_auteur'; |
|
| 53 | + $boucle->select[] = 'COUNT(articles.id_article) AS compteur_articles'; |
|
| 54 | + $boucle->group[] = 'auteurs.id_auteur'; |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * Pile complétée par le code à générer |
| 70 | 70 | */ |
| 71 | 71 | function balise_COMPTEUR_ARTICLES_dist($p) { |
| 72 | - return rindex_pile($p, 'compteur_articles', 'compteur_articles_filtres'); |
|
| 72 | + return rindex_pile($p, 'compteur_articles', 'compteur_articles_filtres'); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
@@ -85,42 +85,42 @@ discard block |
||
| 85 | 85 | * @return <type> |
| 86 | 86 | */ |
| 87 | 87 | function afficher_initiale($url, $initiale, $compteur, $debut, $pas) { |
| 88 | - static $memo = null; |
|
| 89 | - static $res = array(); |
|
| 90 | - $out = ''; |
|
| 91 | - if (!$memo |
|
| 92 | - or (!$initiale and !$url) |
|
| 93 | - or ($initiale !== $memo['initiale']) |
|
| 94 | - ) { |
|
| 95 | - $newcompt = intval(floor(($compteur - 1) / $pas) * $pas); |
|
| 96 | - // si fin de la pagination et une seule entree, ne pas l'afficher, ca ne sert a rien |
|
| 97 | - if (!$initiale and !$url and !$memo['compteur']) { |
|
| 98 | - $memo = null; |
|
| 99 | - } |
|
| 100 | - if ($memo) { |
|
| 101 | - $on = (($memo['compteur'] <= $debut) |
|
| 102 | - and ( |
|
| 103 | - $newcompt > $debut or ($newcompt == $debut and $newcompt == $memo['compteur']) |
|
| 104 | - )); |
|
| 105 | - $res[] = lien_ou_expose($memo['url'], $memo['initiale'], $on, 'lien_pagination'); |
|
| 106 | - } |
|
| 107 | - if ($initiale) { |
|
| 108 | - $memo = array( |
|
| 109 | - 'entree' => isset($memo['entree']) ? $memo['entree'] + 1 : 0, |
|
| 110 | - 'initiale' => $initiale, |
|
| 111 | - 'url' => parametre_url($url, 'i', $initiale), |
|
| 112 | - 'compteur' => $newcompt |
|
| 113 | - ); |
|
| 114 | - } |
|
| 115 | - } |
|
| 116 | - if (!$initiale and !$url) { |
|
| 117 | - if (count($res) > 1) { |
|
| 118 | - $out = implode(' ', $res); |
|
| 119 | - } |
|
| 120 | - $memo = $res = null; |
|
| 121 | - } |
|
| 88 | + static $memo = null; |
|
| 89 | + static $res = array(); |
|
| 90 | + $out = ''; |
|
| 91 | + if (!$memo |
|
| 92 | + or (!$initiale and !$url) |
|
| 93 | + or ($initiale !== $memo['initiale']) |
|
| 94 | + ) { |
|
| 95 | + $newcompt = intval(floor(($compteur - 1) / $pas) * $pas); |
|
| 96 | + // si fin de la pagination et une seule entree, ne pas l'afficher, ca ne sert a rien |
|
| 97 | + if (!$initiale and !$url and !$memo['compteur']) { |
|
| 98 | + $memo = null; |
|
| 99 | + } |
|
| 100 | + if ($memo) { |
|
| 101 | + $on = (($memo['compteur'] <= $debut) |
|
| 102 | + and ( |
|
| 103 | + $newcompt > $debut or ($newcompt == $debut and $newcompt == $memo['compteur']) |
|
| 104 | + )); |
|
| 105 | + $res[] = lien_ou_expose($memo['url'], $memo['initiale'], $on, 'lien_pagination'); |
|
| 106 | + } |
|
| 107 | + if ($initiale) { |
|
| 108 | + $memo = array( |
|
| 109 | + 'entree' => isset($memo['entree']) ? $memo['entree'] + 1 : 0, |
|
| 110 | + 'initiale' => $initiale, |
|
| 111 | + 'url' => parametre_url($url, 'i', $initiale), |
|
| 112 | + 'compteur' => $newcompt |
|
| 113 | + ); |
|
| 114 | + } |
|
| 115 | + } |
|
| 116 | + if (!$initiale and !$url) { |
|
| 117 | + if (count($res) > 1) { |
|
| 118 | + $out = implode(' ', $res); |
|
| 119 | + } |
|
| 120 | + $memo = $res = null; |
|
| 121 | + } |
|
| 122 | 122 | |
| 123 | - return $out; |
|
| 123 | + return $out; |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -139,23 +139,23 @@ discard block |
||
| 139 | 139 | * @return string |
| 140 | 140 | */ |
| 141 | 141 | function auteur_lien_messagerie($id_auteur, $en_ligne, $statut, $imessage, $email = '') { |
| 142 | - static $time = null; |
|
| 143 | - if (!in_array($statut, array('0minirezo', '1comite'))) { |
|
| 144 | - return ''; |
|
| 145 | - } |
|
| 142 | + static $time = null; |
|
| 143 | + if (!in_array($statut, array('0minirezo', '1comite'))) { |
|
| 144 | + return ''; |
|
| 145 | + } |
|
| 146 | 146 | |
| 147 | - if (is_null($time)) { |
|
| 148 | - $time = time(); |
|
| 149 | - } |
|
| 150 | - $parti = (($time - strtotime($en_ligne)) > 15 * 60); |
|
| 147 | + if (is_null($time)) { |
|
| 148 | + $time = time(); |
|
| 149 | + } |
|
| 150 | + $parti = (($time - strtotime($en_ligne)) > 15 * 60); |
|
| 151 | 151 | |
| 152 | - if ($imessage != 'non' and !$parti // historique : est-ce que ca a encore un sens de limiter vu qu'on a la notification par email ? |
|
| 153 | - and $GLOBALS['meta']['messagerie_agenda'] != 'non' |
|
| 154 | - ) { |
|
| 155 | - return parametre_url(parametre_url(generer_url_ecrire('message_edit', 'new=oui'), 'to', $id_auteur), 'redirect', self()); |
|
| 156 | - } elseif (strlen($email) and autoriser('voir', 'auteur', $id_auteur)) { |
|
| 157 | - return 'mailto:' . $email; |
|
| 158 | - } else { |
|
| 159 | - return ''; |
|
| 160 | - } |
|
| 152 | + if ($imessage != 'non' and !$parti // historique : est-ce que ca a encore un sens de limiter vu qu'on a la notification par email ? |
|
| 153 | + and $GLOBALS['meta']['messagerie_agenda'] != 'non' |
|
| 154 | + ) { |
|
| 155 | + return parametre_url(parametre_url(generer_url_ecrire('message_edit', 'new=oui'), 'to', $id_auteur), 'redirect', self()); |
|
| 156 | + } elseif (strlen($email) and autoriser('voir', 'auteur', $id_auteur)) { |
|
| 157 | + return 'mailto:' . $email; |
|
| 158 | + } else { |
|
| 159 | + return ''; |
|
| 160 | + } |
|
| 161 | 161 | } |
@@ -154,7 +154,7 @@ |
||
| 154 | 154 | ) { |
| 155 | 155 | return parametre_url(parametre_url(generer_url_ecrire('message_edit', 'new=oui'), 'to', $id_auteur), 'redirect', self()); |
| 156 | 156 | } elseif (strlen($email) and autoriser('voir', 'auteur', $id_auteur)) { |
| 157 | - return 'mailto:' . $email; |
|
| 157 | + return 'mailto:'.$email; |
|
| 158 | 158 | } else { |
| 159 | 159 | return ''; |
| 160 | 160 | } |
@@ -11,40 +11,40 @@ |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | function defaut_tri_defined($defaut) { |
| 18 | - if (!defined('_TRI_ARTICLES_RUBRIQUE')) { |
|
| 19 | - return $defaut; |
|
| 20 | - } |
|
| 18 | + if (!defined('_TRI_ARTICLES_RUBRIQUE')) { |
|
| 19 | + return $defaut; |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - $sens = 1; |
|
| 23 | - $tri = trim(_TRI_ARTICLES_RUBRIQUE); |
|
| 24 | - $tri = explode(' ', $tri); |
|
| 25 | - if (strncasecmp(end($tri), 'DESC', 4) == 0) { |
|
| 26 | - $sens = -1; |
|
| 27 | - array_pop($tri); |
|
| 28 | - } elseif (strncasecmp(end($tri), 'ASC', 3) == 0) { |
|
| 29 | - $sens = 1; |
|
| 30 | - array_pop($tri); |
|
| 31 | - } |
|
| 32 | - $tri = implode(' ', $tri); |
|
| 33 | - $tri = array($tri => $sens); |
|
| 34 | - foreach ($defaut as $n => $s) { |
|
| 35 | - if (!isset($tri[$n])) { |
|
| 36 | - $tri[$n] = $s; |
|
| 37 | - } |
|
| 38 | - } |
|
| 22 | + $sens = 1; |
|
| 23 | + $tri = trim(_TRI_ARTICLES_RUBRIQUE); |
|
| 24 | + $tri = explode(' ', $tri); |
|
| 25 | + if (strncasecmp(end($tri), 'DESC', 4) == 0) { |
|
| 26 | + $sens = -1; |
|
| 27 | + array_pop($tri); |
|
| 28 | + } elseif (strncasecmp(end($tri), 'ASC', 3) == 0) { |
|
| 29 | + $sens = 1; |
|
| 30 | + array_pop($tri); |
|
| 31 | + } |
|
| 32 | + $tri = implode(' ', $tri); |
|
| 33 | + $tri = array($tri => $sens); |
|
| 34 | + foreach ($defaut as $n => $s) { |
|
| 35 | + if (!isset($tri[$n])) { |
|
| 36 | + $tri[$n] = $s; |
|
| 37 | + } |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - return $tri; |
|
| 40 | + return $tri; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | function defaut_tri_par($par, $defaut) { |
| 44 | - if (!defined('_TRI_ARTICLES_RUBRIQUE')) { |
|
| 45 | - return $par; |
|
| 46 | - } |
|
| 47 | - $par = array_keys($defaut); |
|
| 44 | + if (!defined('_TRI_ARTICLES_RUBRIQUE')) { |
|
| 45 | + return $par; |
|
| 46 | + } |
|
| 47 | + $par = array_keys($defaut); |
|
| 48 | 48 | |
| 49 | - return reset($par); |
|
| 49 | + return reset($par); |
|
| 50 | 50 | } |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 4 | - return; |
|
| 4 | + return; |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | include_spip('formulaires/selecteur/selecteur_fonctions'); |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * @package SPIP\Core\Formulaires |
| 7 | 7 | **/ |
| 8 | 8 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 9 | - return; |
|
| 9 | + return; |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | /** |
@@ -23,31 +23,31 @@ discard block |
||
| 23 | 23 | * Code HTML et javascript |
| 24 | 24 | */ |
| 25 | 25 | function choisir_rubriques_admin_restreint( |
| 26 | - $id_auteur, |
|
| 27 | - $label = '', |
|
| 28 | - $sel_css = '#liste_rubriques_restreintes', |
|
| 29 | - $img_remove = '' |
|
| 26 | + $id_auteur, |
|
| 27 | + $label = '', |
|
| 28 | + $sel_css = '#liste_rubriques_restreintes', |
|
| 29 | + $img_remove = '' |
|
| 30 | 30 | ) { |
| 31 | - global $spip_lang; |
|
| 32 | - $res = ''; |
|
| 33 | - // Ajouter une rubrique a un administrateur restreint |
|
| 34 | - if ($chercher_rubrique = charger_fonction('chercher_rubrique', 'inc') |
|
| 35 | - and $a = $chercher_rubrique(0, 'auteur', false) |
|
| 36 | - ) { |
|
| 37 | - if ($img_remove) { |
|
| 38 | - $img_remove = addslashes("<a href=\"#\" onclick=\"jQuery(this).parent().remove();return false;\" class=\"removelink\">$img_remove</a>"); |
|
| 39 | - } |
|
| 31 | + global $spip_lang; |
|
| 32 | + $res = ''; |
|
| 33 | + // Ajouter une rubrique a un administrateur restreint |
|
| 34 | + if ($chercher_rubrique = charger_fonction('chercher_rubrique', 'inc') |
|
| 35 | + and $a = $chercher_rubrique(0, 'auteur', false) |
|
| 36 | + ) { |
|
| 37 | + if ($img_remove) { |
|
| 38 | + $img_remove = addslashes("<a href=\"#\" onclick=\"jQuery(this).parent().remove();return false;\" class=\"removelink\">$img_remove</a>"); |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - $res = |
|
| 42 | - "\n<div id='ajax_rubrique'>\n" |
|
| 43 | - . "<label>$label</label>\n" |
|
| 44 | - . "<input name='id_auteur' value='$id_auteur' type='hidden' />\n" |
|
| 45 | - . $a |
|
| 46 | - . "</div>\n" |
|
| 41 | + $res = |
|
| 42 | + "\n<div id='ajax_rubrique'>\n" |
|
| 43 | + . "<label>$label</label>\n" |
|
| 44 | + . "<input name='id_auteur' value='$id_auteur' type='hidden' />\n" |
|
| 45 | + . $a |
|
| 46 | + . "</div>\n" |
|
| 47 | 47 | |
| 48 | - // onchange = pour le menu |
|
| 49 | - // l'evenement doit etre provoque a la main par le selecteur ajax |
|
| 50 | - . "<script type='text/javascript'>/*<![CDATA[*/ |
|
| 48 | + // onchange = pour le menu |
|
| 49 | + // l'evenement doit etre provoque a la main par le selecteur ajax |
|
| 50 | + . "<script type='text/javascript'>/*<![CDATA[*/ |
|
| 51 | 51 | jQuery(function($){ |
| 52 | 52 | $('#id_parent').on('change', function(){ |
| 53 | 53 | var id_parent = parseInt(this.value); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | .attr('name','noname'); |
| 67 | 67 | }); |
| 68 | 68 | /*]]>*/</script>"; |
| 69 | - } |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - return $res; |
|
| 71 | + return $res; |
|
| 72 | 72 | } |