@@ -157,8 +157,7 @@ |
||
| 157 | 157 | ) { |
| 158 | 158 | $dest = substr($dest, 0, -strlen($m[0])) . '_' . $m[1]; |
| 159 | 159 | break; |
| 160 | - } |
|
| 161 | - else { |
|
| 160 | + } else { |
|
| 162 | 161 | $dest = substr($dest, 0, -strlen($m[0])); |
| 163 | 162 | $ext = $m[1] . '.' . $ext; |
| 164 | 163 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -30,12 +30,12 @@ discard block |
||
| 30 | 30 | * @return string |
| 31 | 31 | */ |
| 32 | 32 | function set_spip_doc(?string $fichier): string { |
| 33 | - if ($fichier and strpos($fichier, (string) _DIR_IMG) === 0) { |
|
| 34 | - return substr($fichier, strlen(_DIR_IMG)); |
|
| 35 | - } else { |
|
| 36 | - // ex: fichier distant |
|
| 37 | - return $fichier ?? ''; |
|
| 38 | - } |
|
| 33 | + if ($fichier and strpos($fichier, (string) _DIR_IMG) === 0) { |
|
| 34 | + return substr($fichier, strlen(_DIR_IMG)); |
|
| 35 | + } else { |
|
| 36 | + // ex: fichier distant |
|
| 37 | + return $fichier ?? ''; |
|
| 38 | + } |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -47,26 +47,26 @@ discard block |
||
| 47 | 47 | * @return bool|string |
| 48 | 48 | */ |
| 49 | 49 | function get_spip_doc(?string $fichier) { |
| 50 | - if ($fichier === null) { |
|
| 51 | - return false; |
|
| 52 | - } |
|
| 53 | - |
|
| 54 | - // fichier distant |
|
| 55 | - if (tester_url_absolue($fichier)) { |
|
| 56 | - return $fichier; |
|
| 57 | - } |
|
| 58 | - |
|
| 59 | - // gestion d'erreurs, fichier='' |
|
| 60 | - if (!strlen($fichier)) { |
|
| 61 | - return false; |
|
| 62 | - } |
|
| 63 | - |
|
| 64 | - if (strncmp($fichier, _DIR_IMG, strlen(_DIR_IMG)) !== 0) { |
|
| 65 | - $fichier = _DIR_IMG . $fichier; |
|
| 66 | - } |
|
| 67 | - |
|
| 68 | - // fichier normal |
|
| 69 | - return $fichier; |
|
| 50 | + if ($fichier === null) { |
|
| 51 | + return false; |
|
| 52 | + } |
|
| 53 | + |
|
| 54 | + // fichier distant |
|
| 55 | + if (tester_url_absolue($fichier)) { |
|
| 56 | + return $fichier; |
|
| 57 | + } |
|
| 58 | + |
|
| 59 | + // gestion d'erreurs, fichier='' |
|
| 60 | + if (!strlen($fichier)) { |
|
| 61 | + return false; |
|
| 62 | + } |
|
| 63 | + |
|
| 64 | + if (strncmp($fichier, _DIR_IMG, strlen(_DIR_IMG)) !== 0) { |
|
| 65 | + $fichier = _DIR_IMG . $fichier; |
|
| 66 | + } |
|
| 67 | + |
|
| 68 | + // fichier normal |
|
| 69 | + return $fichier; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -80,26 +80,26 @@ discard block |
||
| 80 | 80 | * @return string |
| 81 | 81 | */ |
| 82 | 82 | function creer_repertoire_documents($ext) { |
| 83 | - $rep = sous_repertoire(_DIR_IMG, $ext); |
|
| 84 | - |
|
| 85 | - if (!$ext or !$rep) { |
|
| 86 | - spip_log("creer_repertoire_documents '$rep' interdit"); |
|
| 87 | - exit; |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - // Cette variable de configuration peut etre posee par un plugin |
|
| 91 | - // par exemple acces_restreint |
|
| 92 | - // sauf pour logo/ utilise pour stocker les logoon et logooff |
|
| 93 | - if ( |
|
| 94 | - isset($GLOBALS['meta']['creer_htaccess']) |
|
| 95 | - and $GLOBALS['meta']['creer_htaccess'] == 'oui' |
|
| 96 | - and $ext !== 'logo' |
|
| 97 | - ) { |
|
| 98 | - include_spip('inc/acces'); |
|
| 99 | - verifier_htaccess($rep); |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - return $rep; |
|
| 83 | + $rep = sous_repertoire(_DIR_IMG, $ext); |
|
| 84 | + |
|
| 85 | + if (!$ext or !$rep) { |
|
| 86 | + spip_log("creer_repertoire_documents '$rep' interdit"); |
|
| 87 | + exit; |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + // Cette variable de configuration peut etre posee par un plugin |
|
| 91 | + // par exemple acces_restreint |
|
| 92 | + // sauf pour logo/ utilise pour stocker les logoon et logooff |
|
| 93 | + if ( |
|
| 94 | + isset($GLOBALS['meta']['creer_htaccess']) |
|
| 95 | + and $GLOBALS['meta']['creer_htaccess'] == 'oui' |
|
| 96 | + and $ext !== 'logo' |
|
| 97 | + ) { |
|
| 98 | + include_spip('inc/acces'); |
|
| 99 | + verifier_htaccess($rep); |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + return $rep; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -108,22 +108,22 @@ discard block |
||
| 108 | 108 | * @param string $nom |
| 109 | 109 | */ |
| 110 | 110 | function effacer_repertoire_temporaire($nom) { |
| 111 | - if ($d = opendir($nom)) { |
|
| 112 | - while (($f = readdir($d)) !== false) { |
|
| 113 | - if (is_file("$nom/$f")) { |
|
| 114 | - spip_unlink("$nom/$f"); |
|
| 115 | - } else { |
|
| 116 | - if ( |
|
| 117 | - $f <> '.' and $f <> '..' |
|
| 118 | - and is_dir("$nom/$f") |
|
| 119 | - ) { |
|
| 120 | - effacer_repertoire_temporaire("$nom/$f"); |
|
| 121 | - } |
|
| 122 | - } |
|
| 123 | - } |
|
| 124 | - } |
|
| 125 | - closedir($d); |
|
| 126 | - @rmdir($nom); |
|
| 111 | + if ($d = opendir($nom)) { |
|
| 112 | + while (($f = readdir($d)) !== false) { |
|
| 113 | + if (is_file("$nom/$f")) { |
|
| 114 | + spip_unlink("$nom/$f"); |
|
| 115 | + } else { |
|
| 116 | + if ( |
|
| 117 | + $f <> '.' and $f <> '..' |
|
| 118 | + and is_dir("$nom/$f") |
|
| 119 | + ) { |
|
| 120 | + effacer_repertoire_temporaire("$nom/$f"); |
|
| 121 | + } |
|
| 122 | + } |
|
| 123 | + } |
|
| 124 | + } |
|
| 125 | + closedir($d); |
|
| 126 | + @rmdir($nom); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | // |
@@ -140,45 +140,45 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | function copier_document($ext, $orig, $source, $subdir = null) { |
| 142 | 142 | |
| 143 | - $orig = preg_replace(',\.\.+,', '.', $orig); // pas de .. dans le nom du doc |
|
| 144 | - $dir = creer_repertoire_documents($subdir ?: $ext); |
|
| 145 | - |
|
| 146 | - $dest = preg_replace('/<[^>]*>/', '', basename($orig)); |
|
| 147 | - $dest = preg_replace('/\.([^.]+)$/', '', $dest); |
|
| 148 | - $dest = translitteration($dest); |
|
| 149 | - $dest = preg_replace('/[^.=\w-]+/', '_', $dest); |
|
| 150 | - |
|
| 151 | - // ne pas accepter de noms de la forme -r90.jpg qui sont reserves |
|
| 152 | - // pour les images transformees par rotation (action/documenter) |
|
| 153 | - $dest = preg_replace(',-r(90|180|270)$,', '', $dest); |
|
| 154 | - |
|
| 155 | - while (preg_match(',\.(\w+)$,', $dest, $m)) { |
|
| 156 | - if ( |
|
| 157 | - !function_exists('verifier_upload_autorise') |
|
| 158 | - or !$r = verifier_upload_autorise($dest) |
|
| 159 | - or (!empty($r['autozip'])) |
|
| 160 | - ) { |
|
| 161 | - $dest = substr($dest, 0, -strlen($m[0])) . '_' . $m[1]; |
|
| 162 | - break; |
|
| 163 | - } |
|
| 164 | - else { |
|
| 165 | - $dest = substr($dest, 0, -strlen($m[0])); |
|
| 166 | - $ext = $m[1] . '.' . $ext; |
|
| 167 | - } |
|
| 168 | - } |
|
| 169 | - |
|
| 170 | - // Si le document "source" est deja au bon endroit, ne rien faire |
|
| 171 | - if ($source == ($dir . $dest . '.' . $ext)) { |
|
| 172 | - return $source; |
|
| 173 | - } |
|
| 174 | - |
|
| 175 | - // sinon tourner jusqu'a trouver un numero correct |
|
| 176 | - $n = 0; |
|
| 177 | - while (@file_exists($newFile = $dir . $dest . ($n++ ? ('-' . $n) : '') . '.' . $ext)) { |
|
| 178 | - ; |
|
| 179 | - } |
|
| 180 | - |
|
| 181 | - return deplacer_fichier_upload($source, $newFile); |
|
| 143 | + $orig = preg_replace(',\.\.+,', '.', $orig); // pas de .. dans le nom du doc |
|
| 144 | + $dir = creer_repertoire_documents($subdir ?: $ext); |
|
| 145 | + |
|
| 146 | + $dest = preg_replace('/<[^>]*>/', '', basename($orig)); |
|
| 147 | + $dest = preg_replace('/\.([^.]+)$/', '', $dest); |
|
| 148 | + $dest = translitteration($dest); |
|
| 149 | + $dest = preg_replace('/[^.=\w-]+/', '_', $dest); |
|
| 150 | + |
|
| 151 | + // ne pas accepter de noms de la forme -r90.jpg qui sont reserves |
|
| 152 | + // pour les images transformees par rotation (action/documenter) |
|
| 153 | + $dest = preg_replace(',-r(90|180|270)$,', '', $dest); |
|
| 154 | + |
|
| 155 | + while (preg_match(',\.(\w+)$,', $dest, $m)) { |
|
| 156 | + if ( |
|
| 157 | + !function_exists('verifier_upload_autorise') |
|
| 158 | + or !$r = verifier_upload_autorise($dest) |
|
| 159 | + or (!empty($r['autozip'])) |
|
| 160 | + ) { |
|
| 161 | + $dest = substr($dest, 0, -strlen($m[0])) . '_' . $m[1]; |
|
| 162 | + break; |
|
| 163 | + } |
|
| 164 | + else { |
|
| 165 | + $dest = substr($dest, 0, -strlen($m[0])); |
|
| 166 | + $ext = $m[1] . '.' . $ext; |
|
| 167 | + } |
|
| 168 | + } |
|
| 169 | + |
|
| 170 | + // Si le document "source" est deja au bon endroit, ne rien faire |
|
| 171 | + if ($source == ($dir . $dest . '.' . $ext)) { |
|
| 172 | + return $source; |
|
| 173 | + } |
|
| 174 | + |
|
| 175 | + // sinon tourner jusqu'a trouver un numero correct |
|
| 176 | + $n = 0; |
|
| 177 | + while (@file_exists($newFile = $dir . $dest . ($n++ ? ('-' . $n) : '') . '.' . $ext)) { |
|
| 178 | + ; |
|
| 179 | + } |
|
| 180 | + |
|
| 181 | + return deplacer_fichier_upload($source, $newFile); |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /** |
@@ -193,28 +193,28 @@ discard block |
||
| 193 | 193 | * @return bool|string |
| 194 | 194 | */ |
| 195 | 195 | function determine_upload($type = '') { |
| 196 | - if (!function_exists('autoriser')) { |
|
| 197 | - include_spip('inc/autoriser'); |
|
| 198 | - } |
|
| 199 | - |
|
| 200 | - if ( |
|
| 201 | - !autoriser('chargerftp') |
|
| 202 | - or $type == 'logos' |
|
| 203 | - ) { # on ne le permet pas pour les logos |
|
| 204 | - return false; |
|
| 205 | - } |
|
| 206 | - |
|
| 207 | - $repertoire = _DIR_TRANSFERT; |
|
| 208 | - if (!@is_dir($repertoire)) { |
|
| 209 | - $repertoire = str_replace(_DIR_TMP, '', $repertoire); |
|
| 210 | - $repertoire = sous_repertoire(_DIR_TMP, $repertoire); |
|
| 211 | - } |
|
| 212 | - |
|
| 213 | - if (!$GLOBALS['visiteur_session']['restreint']) { |
|
| 214 | - return $repertoire; |
|
| 215 | - } else { |
|
| 216 | - return sous_repertoire($repertoire, $GLOBALS['visiteur_session']['login']); |
|
| 217 | - } |
|
| 196 | + if (!function_exists('autoriser')) { |
|
| 197 | + include_spip('inc/autoriser'); |
|
| 198 | + } |
|
| 199 | + |
|
| 200 | + if ( |
|
| 201 | + !autoriser('chargerftp') |
|
| 202 | + or $type == 'logos' |
|
| 203 | + ) { # on ne le permet pas pour les logos |
|
| 204 | + return false; |
|
| 205 | + } |
|
| 206 | + |
|
| 207 | + $repertoire = _DIR_TRANSFERT; |
|
| 208 | + if (!@is_dir($repertoire)) { |
|
| 209 | + $repertoire = str_replace(_DIR_TMP, '', $repertoire); |
|
| 210 | + $repertoire = sous_repertoire(_DIR_TMP, $repertoire); |
|
| 211 | + } |
|
| 212 | + |
|
| 213 | + if (!$GLOBALS['visiteur_session']['restreint']) { |
|
| 214 | + return $repertoire; |
|
| 215 | + } else { |
|
| 216 | + return sous_repertoire($repertoire, $GLOBALS['visiteur_session']['login']); |
|
| 217 | + } |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /** |
@@ -233,35 +233,35 @@ discard block |
||
| 233 | 233 | * @return bool|mixed|string |
| 234 | 234 | */ |
| 235 | 235 | function deplacer_fichier_upload($source, $dest, $move = false) { |
| 236 | - // Securite |
|
| 237 | - if (substr($dest, 0, strlen(_DIR_RACINE)) == _DIR_RACINE) { |
|
| 238 | - $dest = _DIR_RACINE . preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE))); |
|
| 239 | - } else { |
|
| 240 | - $dest = preg_replace(',\.\.+,', '.', $dest); |
|
| 241 | - } |
|
| 242 | - |
|
| 243 | - if ($move) { |
|
| 244 | - $ok = @rename($source, $dest); |
|
| 245 | - } else { |
|
| 246 | - $ok = @copy($source, $dest); |
|
| 247 | - } |
|
| 248 | - if (!$ok) { |
|
| 249 | - $ok = @move_uploaded_file($source, $dest); |
|
| 250 | - } |
|
| 251 | - if ($ok) { |
|
| 252 | - @chmod($dest, _SPIP_CHMOD & ~0111); |
|
| 253 | - } else { |
|
| 254 | - $f = @fopen($dest, 'w'); |
|
| 255 | - if ($f) { |
|
| 256 | - fclose($f); |
|
| 257 | - } else { |
|
| 258 | - include_spip('inc/flock'); |
|
| 259 | - raler_fichier($dest); |
|
| 260 | - } |
|
| 261 | - spip_unlink($dest); |
|
| 262 | - } |
|
| 263 | - |
|
| 264 | - return $ok ? $dest : false; |
|
| 236 | + // Securite |
|
| 237 | + if (substr($dest, 0, strlen(_DIR_RACINE)) == _DIR_RACINE) { |
|
| 238 | + $dest = _DIR_RACINE . preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE))); |
|
| 239 | + } else { |
|
| 240 | + $dest = preg_replace(',\.\.+,', '.', $dest); |
|
| 241 | + } |
|
| 242 | + |
|
| 243 | + if ($move) { |
|
| 244 | + $ok = @rename($source, $dest); |
|
| 245 | + } else { |
|
| 246 | + $ok = @copy($source, $dest); |
|
| 247 | + } |
|
| 248 | + if (!$ok) { |
|
| 249 | + $ok = @move_uploaded_file($source, $dest); |
|
| 250 | + } |
|
| 251 | + if ($ok) { |
|
| 252 | + @chmod($dest, _SPIP_CHMOD & ~0111); |
|
| 253 | + } else { |
|
| 254 | + $f = @fopen($dest, 'w'); |
|
| 255 | + if ($f) { |
|
| 256 | + fclose($f); |
|
| 257 | + } else { |
|
| 258 | + include_spip('inc/flock'); |
|
| 259 | + raler_fichier($dest); |
|
| 260 | + } |
|
| 261 | + spip_unlink($dest); |
|
| 262 | + } |
|
| 263 | + |
|
| 264 | + return $ok ? $dest : false; |
|
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | |
@@ -285,60 +285,60 @@ discard block |
||
| 285 | 285 | */ |
| 286 | 286 | function check_upload_error($error, $msg = '', $return = false) { |
| 287 | 287 | |
| 288 | - if (!$error) { |
|
| 289 | - return false; |
|
| 290 | - } |
|
| 291 | - |
|
| 292 | - spip_log("Erreur upload $error -- cf. http://php.net/manual/fr/features.file-upload.errors.php"); |
|
| 293 | - |
|
| 294 | - switch ($error) { |
|
| 295 | - case 4: /* UPLOAD_ERR_NO_FILE */ |
|
| 296 | - return true; |
|
| 297 | - |
|
| 298 | - # on peut affiner les differents messages d'erreur |
|
| 299 | - case 1: /* UPLOAD_ERR_INI_SIZE */ |
|
| 300 | - $msg = _T( |
|
| 301 | - 'upload_limit', |
|
| 302 | - ['max' => ini_get('upload_max_filesize')] |
|
| 303 | - ); |
|
| 304 | - break; |
|
| 305 | - case 2: /* UPLOAD_ERR_FORM_SIZE */ |
|
| 306 | - $msg = _T( |
|
| 307 | - 'upload_limit', |
|
| 308 | - ['max' => ini_get('upload_max_filesize')] |
|
| 309 | - ); |
|
| 310 | - break; |
|
| 311 | - case 3: /* UPLOAD_ERR_PARTIAL */ |
|
| 312 | - $msg = _T( |
|
| 313 | - 'upload_limit', |
|
| 314 | - ['max' => ini_get('upload_max_filesize')] |
|
| 315 | - ); |
|
| 316 | - break; |
|
| 317 | - |
|
| 318 | - default: /* autre */ |
|
| 319 | - if (!$msg) { |
|
| 320 | - $msg = _T('pass_erreur') . ' ' . $error |
|
| 321 | - . '<br />' . propre('[->http://php.net/manual/fr/features.file-upload.errors.php]'); |
|
| 322 | - } |
|
| 323 | - break; |
|
| 324 | - } |
|
| 325 | - |
|
| 326 | - spip_log("erreur upload $error"); |
|
| 327 | - if ($return) { |
|
| 328 | - return $msg; |
|
| 329 | - } |
|
| 330 | - |
|
| 331 | - if (_request('iframe') == 'iframe') { |
|
| 332 | - echo "<div class='upload_answer upload_error'>$msg</div>"; |
|
| 333 | - exit; |
|
| 334 | - } |
|
| 335 | - |
|
| 336 | - include_spip('inc/minipres'); |
|
| 337 | - echo minipres( |
|
| 338 | - $msg, |
|
| 339 | - "<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><a href='" . rawurldecode($GLOBALS['redirect']) . "'><button type='button'>" . _T('ecrire:bouton_suivant') . '</button></a></div>' |
|
| 340 | - ); |
|
| 341 | - exit; |
|
| 288 | + if (!$error) { |
|
| 289 | + return false; |
|
| 290 | + } |
|
| 291 | + |
|
| 292 | + spip_log("Erreur upload $error -- cf. http://php.net/manual/fr/features.file-upload.errors.php"); |
|
| 293 | + |
|
| 294 | + switch ($error) { |
|
| 295 | + case 4: /* UPLOAD_ERR_NO_FILE */ |
|
| 296 | + return true; |
|
| 297 | + |
|
| 298 | + # on peut affiner les differents messages d'erreur |
|
| 299 | + case 1: /* UPLOAD_ERR_INI_SIZE */ |
|
| 300 | + $msg = _T( |
|
| 301 | + 'upload_limit', |
|
| 302 | + ['max' => ini_get('upload_max_filesize')] |
|
| 303 | + ); |
|
| 304 | + break; |
|
| 305 | + case 2: /* UPLOAD_ERR_FORM_SIZE */ |
|
| 306 | + $msg = _T( |
|
| 307 | + 'upload_limit', |
|
| 308 | + ['max' => ini_get('upload_max_filesize')] |
|
| 309 | + ); |
|
| 310 | + break; |
|
| 311 | + case 3: /* UPLOAD_ERR_PARTIAL */ |
|
| 312 | + $msg = _T( |
|
| 313 | + 'upload_limit', |
|
| 314 | + ['max' => ini_get('upload_max_filesize')] |
|
| 315 | + ); |
|
| 316 | + break; |
|
| 317 | + |
|
| 318 | + default: /* autre */ |
|
| 319 | + if (!$msg) { |
|
| 320 | + $msg = _T('pass_erreur') . ' ' . $error |
|
| 321 | + . '<br />' . propre('[->http://php.net/manual/fr/features.file-upload.errors.php]'); |
|
| 322 | + } |
|
| 323 | + break; |
|
| 324 | + } |
|
| 325 | + |
|
| 326 | + spip_log("erreur upload $error"); |
|
| 327 | + if ($return) { |
|
| 328 | + return $msg; |
|
| 329 | + } |
|
| 330 | + |
|
| 331 | + if (_request('iframe') == 'iframe') { |
|
| 332 | + echo "<div class='upload_answer upload_error'>$msg</div>"; |
|
| 333 | + exit; |
|
| 334 | + } |
|
| 335 | + |
|
| 336 | + include_spip('inc/minipres'); |
|
| 337 | + echo minipres( |
|
| 338 | + $msg, |
|
| 339 | + "<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><a href='" . rawurldecode($GLOBALS['redirect']) . "'><button type='button'>" . _T('ecrire:bouton_suivant') . '</button></a></div>' |
|
| 340 | + ); |
|
| 341 | + exit; |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | /** |
@@ -355,24 +355,24 @@ discard block |
||
| 355 | 355 | * @return string |
| 356 | 356 | */ |
| 357 | 357 | function corriger_extension($ext) { |
| 358 | - $ext = preg_replace(',[^a-z0-9],i', '', $ext); |
|
| 359 | - switch ($ext) { |
|
| 360 | - case 'htm': |
|
| 361 | - $ext = 'html'; |
|
| 362 | - break; |
|
| 363 | - case 'jpeg': |
|
| 364 | - $ext = 'jpg'; |
|
| 365 | - break; |
|
| 366 | - case 'tiff': |
|
| 367 | - $ext = 'tif'; |
|
| 368 | - break; |
|
| 369 | - case 'aif': |
|
| 370 | - $ext = 'aiff'; |
|
| 371 | - break; |
|
| 372 | - case 'mpeg': |
|
| 373 | - $ext = 'mpg'; |
|
| 374 | - break; |
|
| 375 | - } |
|
| 376 | - |
|
| 377 | - return $ext; |
|
| 358 | + $ext = preg_replace(',[^a-z0-9],i', '', $ext); |
|
| 359 | + switch ($ext) { |
|
| 360 | + case 'htm': |
|
| 361 | + $ext = 'html'; |
|
| 362 | + break; |
|
| 363 | + case 'jpeg': |
|
| 364 | + $ext = 'jpg'; |
|
| 365 | + break; |
|
| 366 | + case 'tiff': |
|
| 367 | + $ext = 'tif'; |
|
| 368 | + break; |
|
| 369 | + case 'aif': |
|
| 370 | + $ext = 'aiff'; |
|
| 371 | + break; |
|
| 372 | + case 'mpeg': |
|
| 373 | + $ext = 'mpg'; |
|
| 374 | + break; |
|
| 375 | + } |
|
| 376 | + |
|
| 377 | + return $ext; |
|
| 378 | 378 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | if (strncmp($fichier, _DIR_IMG, strlen(_DIR_IMG)) !== 0) { |
| 65 | - $fichier = _DIR_IMG . $fichier; |
|
| 65 | + $fichier = _DIR_IMG.$fichier; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // fichier normal |
@@ -158,23 +158,23 @@ discard block |
||
| 158 | 158 | or !$r = verifier_upload_autorise($dest) |
| 159 | 159 | or (!empty($r['autozip'])) |
| 160 | 160 | ) { |
| 161 | - $dest = substr($dest, 0, -strlen($m[0])) . '_' . $m[1]; |
|
| 161 | + $dest = substr($dest, 0, -strlen($m[0])).'_'.$m[1]; |
|
| 162 | 162 | break; |
| 163 | 163 | } |
| 164 | 164 | else { |
| 165 | 165 | $dest = substr($dest, 0, -strlen($m[0])); |
| 166 | - $ext = $m[1] . '.' . $ext; |
|
| 166 | + $ext = $m[1].'.'.$ext; |
|
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | // Si le document "source" est deja au bon endroit, ne rien faire |
| 171 | - if ($source == ($dir . $dest . '.' . $ext)) { |
|
| 171 | + if ($source == ($dir.$dest.'.'.$ext)) { |
|
| 172 | 172 | return $source; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | // sinon tourner jusqu'a trouver un numero correct |
| 176 | 176 | $n = 0; |
| 177 | - while (@file_exists($newFile = $dir . $dest . ($n++ ? ('-' . $n) : '') . '.' . $ext)) { |
|
| 177 | + while (@file_exists($newFile = $dir.$dest.($n++ ? ('-'.$n) : '').'.'.$ext)) { |
|
| 178 | 178 | ; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | function deplacer_fichier_upload($source, $dest, $move = false) { |
| 236 | 236 | // Securite |
| 237 | 237 | if (substr($dest, 0, strlen(_DIR_RACINE)) == _DIR_RACINE) { |
| 238 | - $dest = _DIR_RACINE . preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE))); |
|
| 238 | + $dest = _DIR_RACINE.preg_replace(',\.\.+,', '.', substr($dest, strlen(_DIR_RACINE))); |
|
| 239 | 239 | } else { |
| 240 | 240 | $dest = preg_replace(',\.\.+,', '.', $dest); |
| 241 | 241 | } |
@@ -317,8 +317,8 @@ discard block |
||
| 317 | 317 | |
| 318 | 318 | default: /* autre */ |
| 319 | 319 | if (!$msg) { |
| 320 | - $msg = _T('pass_erreur') . ' ' . $error |
|
| 321 | - . '<br />' . propre('[->http://php.net/manual/fr/features.file-upload.errors.php]'); |
|
| 320 | + $msg = _T('pass_erreur').' '.$error |
|
| 321 | + . '<br />'.propre('[->http://php.net/manual/fr/features.file-upload.errors.php]'); |
|
| 322 | 322 | } |
| 323 | 323 | break; |
| 324 | 324 | } |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | include_spip('inc/minipres'); |
| 337 | 337 | echo minipres( |
| 338 | 338 | $msg, |
| 339 | - "<div style='text-align: " . $GLOBALS['spip_lang_right'] . "'><a href='" . rawurldecode($GLOBALS['redirect']) . "'><button type='button'>" . _T('ecrire:bouton_suivant') . '</button></a></div>' |
|
| 339 | + "<div style='text-align: ".$GLOBALS['spip_lang_right']."'><a href='".rawurldecode($GLOBALS['redirect'])."'><button type='button'>"._T('ecrire:bouton_suivant').'</button></a></div>' |
|
| 340 | 340 | ); |
| 341 | 341 | exit; |
| 342 | 342 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | function surligner_mots($page, $surcharge_surligne = '') { |
| 38 | 38 | $surlignejs_engines = [ |
| 39 | 39 | [ |
| 40 | - ',' . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']) . ',i', |
|
| 40 | + ','.str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']).',i', |
|
| 41 | 41 | ',recherche=([^&]+),i' |
| 42 | 42 | ], //SPIP |
| 43 | 43 | [',^http://(www\.)?google\.,i', ',q=([^&]+),i'], // Google |
@@ -72,19 +72,19 @@ discard block |
||
| 72 | 72 | //good referrer found or var_recherche is not null |
| 73 | 73 | include_spip('inc/filtres'); |
| 74 | 74 | $script = " |
| 75 | - <script type='text/javascript' src='" . url_absolue(find_in_path('javascript/SearchHighlight.js')) . "'></script> |
|
| 75 | + <script type='text/javascript' src='" . url_absolue(find_in_path('javascript/SearchHighlight.js'))."'></script> |
|
| 76 | 76 | <script type='text/javascript'> |
| 77 | 77 | var highlighter = function() { |
| 78 | 78 | jQuery(this).SearchHighlight({ |
| 79 | - tag_name:'" . (html5_permis() ? 'mark' : 'span') . "', |
|
| 79 | + tag_name:'" . (html5_permis() ? 'mark' : 'span')."', |
|
| 80 | 80 | style_name:'spip_surligne', |
| 81 | 81 | exact:'whole', |
| 82 | 82 | style_name_suffix:false, |
| 83 | - engines:[/^" . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']) . "/i,/recherche=([^&]+)/i], |
|
| 83 | + engines:[/^" . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site'])."/i,/recherche=([^&]+)/i], |
|
| 84 | 84 | highlight:'.surlignable', |
| 85 | 85 | nohighlight:'.pas_surlignable'" . |
| 86 | 86 | ($surcharge_surligne ? ", |
| 87 | - keys:'$surcharge_surligne'" : '') . ', |
|
| 87 | + keys:'$surcharge_surligne'" : '').', |
|
| 88 | 88 | min_length: 3 |
| 89 | 89 | }); |
| 90 | 90 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | * @package SPIP\Core\Surligne |
| 16 | 16 | **/ |
| 17 | 17 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 18 | - return; |
|
| 18 | + return; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -34,43 +34,43 @@ discard block |
||
| 34 | 34 | * Page HTML |
| 35 | 35 | **/ |
| 36 | 36 | function surligner_mots($page, $surcharge_surligne = '') { |
| 37 | - $surlignejs_engines = [ |
|
| 38 | - [ |
|
| 39 | - ',' . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']) . ',i', |
|
| 40 | - ',recherche=([^&]+),i' |
|
| 41 | - ], //SPIP |
|
| 42 | - [',^http://(www\.)?google\.,i', ',q=([^&]+),i'], // Google |
|
| 43 | - [',^http://(www\.)?search\.yahoo\.,i', ',p=([^&]+),i'], // Yahoo |
|
| 44 | - [',^http://(www\.)?search\.msn\.,i', ',q=([^&]+),i'], // MSN |
|
| 45 | - [',^http://(www\.)?search\.live\.,i', ',query=([^&]+),i'], // MSN Live |
|
| 46 | - [',^http://(www\.)?search\.aol\.,i', ',userQuery=([^&]+),i'], // AOL |
|
| 47 | - [',^http://(www\.)?ask\.com,i', ',q=([^&]+),i'], // Ask.com |
|
| 48 | - [',^http://(www\.)?altavista\.,i', ',q=([^&]+),i'], // AltaVista |
|
| 49 | - [',^http://(www\.)?feedster\.,i', ',q=([^&]+),i'], // Feedster |
|
| 50 | - [',^http://(www\.)?search\.lycos\.,i', ',q=([^&]+),i'], // Lycos |
|
| 51 | - [',^http://(www\.)?alltheweb\.,i', ',q=([^&]+),i'], // AllTheWeb |
|
| 52 | - [',^http://(www\.)?technorati\.com,i', ',([^\?\/]+)(?:\?.*)$,i'], // Technorati |
|
| 53 | - ]; |
|
| 37 | + $surlignejs_engines = [ |
|
| 38 | + [ |
|
| 39 | + ',' . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']) . ',i', |
|
| 40 | + ',recherche=([^&]+),i' |
|
| 41 | + ], //SPIP |
|
| 42 | + [',^http://(www\.)?google\.,i', ',q=([^&]+),i'], // Google |
|
| 43 | + [',^http://(www\.)?search\.yahoo\.,i', ',p=([^&]+),i'], // Yahoo |
|
| 44 | + [',^http://(www\.)?search\.msn\.,i', ',q=([^&]+),i'], // MSN |
|
| 45 | + [',^http://(www\.)?search\.live\.,i', ',query=([^&]+),i'], // MSN Live |
|
| 46 | + [',^http://(www\.)?search\.aol\.,i', ',userQuery=([^&]+),i'], // AOL |
|
| 47 | + [',^http://(www\.)?ask\.com,i', ',q=([^&]+),i'], // Ask.com |
|
| 48 | + [',^http://(www\.)?altavista\.,i', ',q=([^&]+),i'], // AltaVista |
|
| 49 | + [',^http://(www\.)?feedster\.,i', ',q=([^&]+),i'], // Feedster |
|
| 50 | + [',^http://(www\.)?search\.lycos\.,i', ',q=([^&]+),i'], // Lycos |
|
| 51 | + [',^http://(www\.)?alltheweb\.,i', ',q=([^&]+),i'], // AllTheWeb |
|
| 52 | + [',^http://(www\.)?technorati\.com,i', ',([^\?\/]+)(?:\?.*)$,i'], // Technorati |
|
| 53 | + ]; |
|
| 54 | 54 | |
| 55 | 55 | |
| 56 | - $ref = $_SERVER['HTTP_REFERER'] ?? null; |
|
| 57 | - //avoid a js injection |
|
| 58 | - if ($surcharge_surligne) { |
|
| 59 | - $surcharge_surligne = preg_replace(",(?<!\\\\)((?:(?>\\\\){2})*)('),", '$1\\\$2', $surcharge_surligne); |
|
| 60 | - $surcharge_surligne = str_replace('\\', '\\\\', $surcharge_surligne); |
|
| 61 | - if ($GLOBALS['meta']['charset'] == 'utf-8') { |
|
| 62 | - include_spip('inc/charsets'); |
|
| 63 | - if (!is_utf8($surcharge_surligne)) { |
|
| 64 | - $surcharge_surligne = mb_convert_encoding($surcharge_surligne, 'UTF-8', 'ISO-8859-1'); |
|
| 65 | - } |
|
| 66 | - } |
|
| 67 | - $surcharge_surligne = preg_replace(',\*$,', '', trim($surcharge_surligne)); # supprimer un * final |
|
| 68 | - } |
|
| 69 | - foreach ($surlignejs_engines as $engine) { |
|
| 70 | - if ($surcharge_surligne || (preg_match($engine[0], $ref) && preg_match($engine[1], $ref))) { |
|
| 71 | - //good referrer found or var_recherche is not null |
|
| 72 | - include_spip('inc/filtres'); |
|
| 73 | - $script = " |
|
| 56 | + $ref = $_SERVER['HTTP_REFERER'] ?? null; |
|
| 57 | + //avoid a js injection |
|
| 58 | + if ($surcharge_surligne) { |
|
| 59 | + $surcharge_surligne = preg_replace(",(?<!\\\\)((?:(?>\\\\){2})*)('),", '$1\\\$2', $surcharge_surligne); |
|
| 60 | + $surcharge_surligne = str_replace('\\', '\\\\', $surcharge_surligne); |
|
| 61 | + if ($GLOBALS['meta']['charset'] == 'utf-8') { |
|
| 62 | + include_spip('inc/charsets'); |
|
| 63 | + if (!is_utf8($surcharge_surligne)) { |
|
| 64 | + $surcharge_surligne = mb_convert_encoding($surcharge_surligne, 'UTF-8', 'ISO-8859-1'); |
|
| 65 | + } |
|
| 66 | + } |
|
| 67 | + $surcharge_surligne = preg_replace(',\*$,', '', trim($surcharge_surligne)); # supprimer un * final |
|
| 68 | + } |
|
| 69 | + foreach ($surlignejs_engines as $engine) { |
|
| 70 | + if ($surcharge_surligne || (preg_match($engine[0], $ref) && preg_match($engine[1], $ref))) { |
|
| 71 | + //good referrer found or var_recherche is not null |
|
| 72 | + include_spip('inc/filtres'); |
|
| 73 | + $script = " |
|
| 74 | 74 | <script type='text/javascript' src='" . url_absolue(find_in_path('javascript/SearchHighlight.js')) . "'></script> |
| 75 | 75 | <script type='text/javascript'> |
| 76 | 76 | var highlighter = function() { |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | engines:[/^" . str_replace(['/', '.'], ['\/', '\.'], $GLOBALS['meta']['adresse_site']) . "/i,/recherche=([^&]+)/i], |
| 83 | 83 | highlight:'.surlignable', |
| 84 | 84 | nohighlight:'.pas_surlignable'" . |
| 85 | - ($surcharge_surligne ? ", |
|
| 85 | + ($surcharge_surligne ? ", |
|
| 86 | 86 | keys:'$surcharge_surligne'" : '') . ', |
| 87 | 87 | min_length: 3 |
| 88 | 88 | }); |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | }; |
| 94 | 94 | </script> |
| 95 | 95 | '; |
| 96 | - // on l'insere juste avant </head>, sinon tout en bas |
|
| 97 | - if (is_null($l = strpos($page, '</head>'))) { |
|
| 98 | - $l = strlen($page); |
|
| 99 | - } |
|
| 100 | - $page = substr_replace($page, $script, $l, 0); |
|
| 101 | - break; |
|
| 102 | - } |
|
| 103 | - } |
|
| 96 | + // on l'insere juste avant </head>, sinon tout en bas |
|
| 97 | + if (is_null($l = strpos($page, '</head>'))) { |
|
| 98 | + $l = strlen($page); |
|
| 99 | + } |
|
| 100 | + $page = substr_replace($page, $script, $l, 0); |
|
| 101 | + break; |
|
| 102 | + } |
|
| 103 | + } |
|
| 104 | 104 | |
| 105 | - return $page; |
|
| 105 | + return $page; |
|
| 106 | 106 | } |
@@ -4,123 +4,123 @@ |
||
| 4 | 4 | // ** ne pas modifier le fichier ** |
| 5 | 5 | |
| 6 | 6 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 7 | - return; |
|
| 7 | + return; |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | $GLOBALS[$GLOBALS['idx_lang']] = array( |
| 11 | 11 | |
| 12 | - // A |
|
| 13 | - 'accueil_site' => 'Accueil', |
|
| 14 | - 'article' => 'Article', |
|
| 15 | - 'articles' => 'Articles', |
|
| 16 | - 'articles_auteur' => 'Articles de cet auteur', |
|
| 17 | - 'articles_populaires' => 'Articles les plus populaires', |
|
| 18 | - 'articles_rubrique' => 'Articles de cette rubrique', |
|
| 19 | - 'aucun_article' => 'Il n’y a pas d’article à cette adresse', |
|
| 20 | - 'aucun_auteur' => 'Il n’y a pas d’auteur à cette adresse', |
|
| 21 | - 'aucun_site' => 'Il n’y a pas de site à cette adresse', |
|
| 22 | - 'aucune_breve' => 'Il n’y a pas de brève à cette adresse', |
|
| 23 | - 'aucune_rubrique' => 'Il n’y a pas de rubrique à cette adresse', |
|
| 24 | - 'auteur' => 'Auteur', |
|
| 25 | - 'autres' => 'Autres', |
|
| 26 | - 'autres_breves' => 'Autres brèves', |
|
| 27 | - 'autres_groupes_mots_clefs' => 'Autres groupes de mots-clés', |
|
| 28 | - 'autres_sites' => 'Autres sites', |
|
| 29 | - |
|
| 30 | - // B |
|
| 31 | - 'bonjour' => 'Salut', |
|
| 32 | - |
|
| 33 | - // C |
|
| 34 | - 'commenter_site' => 'Commenter ce site', |
|
| 35 | - 'contact' => 'Contact', |
|
| 36 | - 'copie_document_impossible' => 'Impossible de copier le document', |
|
| 37 | - |
|
| 38 | - // D |
|
| 39 | - 'date' => 'Date', |
|
| 40 | - 'dernier_ajout' => 'Dernier ajout', |
|
| 41 | - 'dernieres_breves' => 'Dernières brèves', |
|
| 42 | - 'derniers_articles' => 'Derniers articles', |
|
| 43 | - 'derniers_commentaires' => 'Derniers commentaires', |
|
| 44 | - 'derniers_messages_forum' => 'Derniers messages publiés dans les forums', |
|
| 45 | - |
|
| 46 | - // E |
|
| 47 | - 'edition_mode_texte' => 'Édition en mode texte de', |
|
| 48 | - 'en_reponse' => 'En réponse à :', |
|
| 49 | - 'en_resume' => 'En résumé', |
|
| 50 | - 'envoyer_message' => 'Envoyer un message', |
|
| 51 | - 'espace_prive' => 'Espace privé', |
|
| 52 | - |
|
| 53 | - // F |
|
| 54 | - 'formats_acceptes' => 'Formats acceptés : @formats@.', |
|
| 55 | - |
|
| 56 | - // H |
|
| 57 | - 'hierarchie_site' => 'Hiérarchie du site', |
|
| 58 | - |
|
| 59 | - // J |
|
| 60 | - 'jours' => 'jours', |
|
| 61 | - |
|
| 62 | - // L |
|
| 63 | - 'lien_connecter' => 'Se connecter', |
|
| 64 | - |
|
| 65 | - // M |
|
| 66 | - 'meme_auteur' => 'Du même auteur', |
|
| 67 | - 'meme_rubrique' => 'Dans la même rubrique', |
|
| 68 | - 'memes_auteurs' => 'Des mêmes auteurs', |
|
| 69 | - 'message' => 'Message', |
|
| 70 | - 'messages_forum' => 'Messages', |
|
| 71 | - 'messages_recents' => 'Messages de forums les plus récents', |
|
| 72 | - 'mots_clef' => 'Mot-clé', |
|
| 73 | - 'mots_clefs' => 'Mots-clés', |
|
| 74 | - 'mots_clefs_meme_groupe' => 'Mots-clés dans le même groupe', |
|
| 75 | - |
|
| 76 | - // N |
|
| 77 | - 'navigation' => 'Navigation', |
|
| 78 | - 'nom' => 'Nom', |
|
| 79 | - 'nouveautes' => 'Les nouveautés', |
|
| 80 | - 'nouveautes_web' => 'Nouveautés sur le Web', |
|
| 81 | - 'nouveaux_articles' => 'Nouveaux articles', |
|
| 82 | - 'nouvelles_breves' => 'Nouvelles brèves', |
|
| 83 | - |
|
| 84 | - // P |
|
| 85 | - 'page_precedente' => 'page précédente', |
|
| 86 | - 'page_suivante' => 'page suivante', |
|
| 87 | - 'par_auteur' => 'par ', |
|
| 88 | - 'participer_site' => 'Tu peux participer à la vie de ce site et proposer tes propres articles en t’inscrivant ci-dessous. Tu recevras immédiatement un email t’indiquant tes codes d’accès à l’espace privé du site.', |
|
| 89 | - 'plan_site' => 'Plan du site', |
|
| 90 | - 'popularite' => 'Popularité', |
|
| 91 | - 'poster_message' => 'Poster un message', |
|
| 92 | - 'proposer_site' => 'Tu peux proposer un site à ajouter dans cette rubrique :', |
|
| 93 | - |
|
| 94 | - // R |
|
| 95 | - 'repondre_article' => 'Répondre à cet article', |
|
| 96 | - 'repondre_breve' => 'Répondre à cette brève', |
|
| 97 | - 'resultats_recherche' => 'Résultats de la recherche', |
|
| 98 | - 'retour_debut_forums' => 'Retour au début des forums', |
|
| 99 | - 'rss_abonnement' => 'Copie l’URL suivante dans ton agrégateur :', |
|
| 100 | - 'rss_abonnement_titre' => 'S’abonner', |
|
| 101 | - 'rss_abonnement_titre_page' => 'S’abonner à', |
|
| 102 | - 'rss_explication' => 'Un fil RSS recueille les informations de mise à jour d’un site. Il fournit le contenu des billets ou des commentaires ou un extrait de ceux-ci, ainsi qu’un lien vers les versions complètes et quelques autres informations. Ce fil a pour vocation d’être lu par un agrégateur RSS.', |
|
| 103 | - 'rss_explication_titre' => 'Qu’est-ce qu’un flux RSS ?', |
|
| 104 | - 'rubrique' => 'Rubrique', |
|
| 105 | - 'rubriques' => 'Rubriques', |
|
| 106 | - |
|
| 107 | - // S |
|
| 108 | - 'signatures_petition' => 'Signatures', |
|
| 109 | - 'site_realise_avec_spip' => 'Site réalisé avec SPIP', |
|
| 110 | - 'sites_web' => 'Sites Web', |
|
| 111 | - 'sous_rubriques' => 'Sous-rubriques', |
|
| 112 | - 'spam' => 'Spam', |
|
| 113 | - 'suite' => 'suite', |
|
| 114 | - 'sur_web' => 'Sur le Web', |
|
| 115 | - 'syndiquer_rubrique' => 'Syndiquer cette rubrique', |
|
| 116 | - 'syndiquer_site' => 'Syndiquer tout le site', |
|
| 117 | - |
|
| 118 | - // T |
|
| 119 | - 'texte_lettre_information' => 'Voici la lettre d’information du site', |
|
| 120 | - 'texte_lettre_information_2' => 'Cette lettre recense les articles et les brèves publiés depuis', |
|
| 121 | - |
|
| 122 | - // V |
|
| 123 | - 'ver_imprimer' => 'Version à imprimer', |
|
| 124 | - 'voir_en_ligne' => 'Voir en ligne', |
|
| 125 | - 'voir_squelette' => 'voir le squelette de cette page' |
|
| 12 | + // A |
|
| 13 | + 'accueil_site' => 'Accueil', |
|
| 14 | + 'article' => 'Article', |
|
| 15 | + 'articles' => 'Articles', |
|
| 16 | + 'articles_auteur' => 'Articles de cet auteur', |
|
| 17 | + 'articles_populaires' => 'Articles les plus populaires', |
|
| 18 | + 'articles_rubrique' => 'Articles de cette rubrique', |
|
| 19 | + 'aucun_article' => 'Il n’y a pas d’article à cette adresse', |
|
| 20 | + 'aucun_auteur' => 'Il n’y a pas d’auteur à cette adresse', |
|
| 21 | + 'aucun_site' => 'Il n’y a pas de site à cette adresse', |
|
| 22 | + 'aucune_breve' => 'Il n’y a pas de brève à cette adresse', |
|
| 23 | + 'aucune_rubrique' => 'Il n’y a pas de rubrique à cette adresse', |
|
| 24 | + 'auteur' => 'Auteur', |
|
| 25 | + 'autres' => 'Autres', |
|
| 26 | + 'autres_breves' => 'Autres brèves', |
|
| 27 | + 'autres_groupes_mots_clefs' => 'Autres groupes de mots-clés', |
|
| 28 | + 'autres_sites' => 'Autres sites', |
|
| 29 | + |
|
| 30 | + // B |
|
| 31 | + 'bonjour' => 'Salut', |
|
| 32 | + |
|
| 33 | + // C |
|
| 34 | + 'commenter_site' => 'Commenter ce site', |
|
| 35 | + 'contact' => 'Contact', |
|
| 36 | + 'copie_document_impossible' => 'Impossible de copier le document', |
|
| 37 | + |
|
| 38 | + // D |
|
| 39 | + 'date' => 'Date', |
|
| 40 | + 'dernier_ajout' => 'Dernier ajout', |
|
| 41 | + 'dernieres_breves' => 'Dernières brèves', |
|
| 42 | + 'derniers_articles' => 'Derniers articles', |
|
| 43 | + 'derniers_commentaires' => 'Derniers commentaires', |
|
| 44 | + 'derniers_messages_forum' => 'Derniers messages publiés dans les forums', |
|
| 45 | + |
|
| 46 | + // E |
|
| 47 | + 'edition_mode_texte' => 'Édition en mode texte de', |
|
| 48 | + 'en_reponse' => 'En réponse à :', |
|
| 49 | + 'en_resume' => 'En résumé', |
|
| 50 | + 'envoyer_message' => 'Envoyer un message', |
|
| 51 | + 'espace_prive' => 'Espace privé', |
|
| 52 | + |
|
| 53 | + // F |
|
| 54 | + 'formats_acceptes' => 'Formats acceptés : @formats@.', |
|
| 55 | + |
|
| 56 | + // H |
|
| 57 | + 'hierarchie_site' => 'Hiérarchie du site', |
|
| 58 | + |
|
| 59 | + // J |
|
| 60 | + 'jours' => 'jours', |
|
| 61 | + |
|
| 62 | + // L |
|
| 63 | + 'lien_connecter' => 'Se connecter', |
|
| 64 | + |
|
| 65 | + // M |
|
| 66 | + 'meme_auteur' => 'Du même auteur', |
|
| 67 | + 'meme_rubrique' => 'Dans la même rubrique', |
|
| 68 | + 'memes_auteurs' => 'Des mêmes auteurs', |
|
| 69 | + 'message' => 'Message', |
|
| 70 | + 'messages_forum' => 'Messages', |
|
| 71 | + 'messages_recents' => 'Messages de forums les plus récents', |
|
| 72 | + 'mots_clef' => 'Mot-clé', |
|
| 73 | + 'mots_clefs' => 'Mots-clés', |
|
| 74 | + 'mots_clefs_meme_groupe' => 'Mots-clés dans le même groupe', |
|
| 75 | + |
|
| 76 | + // N |
|
| 77 | + 'navigation' => 'Navigation', |
|
| 78 | + 'nom' => 'Nom', |
|
| 79 | + 'nouveautes' => 'Les nouveautés', |
|
| 80 | + 'nouveautes_web' => 'Nouveautés sur le Web', |
|
| 81 | + 'nouveaux_articles' => 'Nouveaux articles', |
|
| 82 | + 'nouvelles_breves' => 'Nouvelles brèves', |
|
| 83 | + |
|
| 84 | + // P |
|
| 85 | + 'page_precedente' => 'page précédente', |
|
| 86 | + 'page_suivante' => 'page suivante', |
|
| 87 | + 'par_auteur' => 'par ', |
|
| 88 | + 'participer_site' => 'Tu peux participer à la vie de ce site et proposer tes propres articles en t’inscrivant ci-dessous. Tu recevras immédiatement un email t’indiquant tes codes d’accès à l’espace privé du site.', |
|
| 89 | + 'plan_site' => 'Plan du site', |
|
| 90 | + 'popularite' => 'Popularité', |
|
| 91 | + 'poster_message' => 'Poster un message', |
|
| 92 | + 'proposer_site' => 'Tu peux proposer un site à ajouter dans cette rubrique :', |
|
| 93 | + |
|
| 94 | + // R |
|
| 95 | + 'repondre_article' => 'Répondre à cet article', |
|
| 96 | + 'repondre_breve' => 'Répondre à cette brève', |
|
| 97 | + 'resultats_recherche' => 'Résultats de la recherche', |
|
| 98 | + 'retour_debut_forums' => 'Retour au début des forums', |
|
| 99 | + 'rss_abonnement' => 'Copie l’URL suivante dans ton agrégateur :', |
|
| 100 | + 'rss_abonnement_titre' => 'S’abonner', |
|
| 101 | + 'rss_abonnement_titre_page' => 'S’abonner à', |
|
| 102 | + 'rss_explication' => 'Un fil RSS recueille les informations de mise à jour d’un site. Il fournit le contenu des billets ou des commentaires ou un extrait de ceux-ci, ainsi qu’un lien vers les versions complètes et quelques autres informations. Ce fil a pour vocation d’être lu par un agrégateur RSS.', |
|
| 103 | + 'rss_explication_titre' => 'Qu’est-ce qu’un flux RSS ?', |
|
| 104 | + 'rubrique' => 'Rubrique', |
|
| 105 | + 'rubriques' => 'Rubriques', |
|
| 106 | + |
|
| 107 | + // S |
|
| 108 | + 'signatures_petition' => 'Signatures', |
|
| 109 | + 'site_realise_avec_spip' => 'Site réalisé avec SPIP', |
|
| 110 | + 'sites_web' => 'Sites Web', |
|
| 111 | + 'sous_rubriques' => 'Sous-rubriques', |
|
| 112 | + 'spam' => 'Spam', |
|
| 113 | + 'suite' => 'suite', |
|
| 114 | + 'sur_web' => 'Sur le Web', |
|
| 115 | + 'syndiquer_rubrique' => 'Syndiquer cette rubrique', |
|
| 116 | + 'syndiquer_site' => 'Syndiquer tout le site', |
|
| 117 | + |
|
| 118 | + // T |
|
| 119 | + 'texte_lettre_information' => 'Voici la lettre d’information du site', |
|
| 120 | + 'texte_lettre_information_2' => 'Cette lettre recense les articles et les brèves publiés depuis', |
|
| 121 | + |
|
| 122 | + // V |
|
| 123 | + 'ver_imprimer' => 'Version à imprimer', |
|
| 124 | + 'voir_en_ligne' => 'Voir en ligne', |
|
| 125 | + 'voir_squelette' => 'voir le squelette de cette page' |
|
| 126 | 126 | ); |
@@ -4,123 +4,123 @@ |
||
| 4 | 4 | // ** ne pas modifier le fichier ** |
| 5 | 5 | |
| 6 | 6 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 7 | - return; |
|
| 7 | + return; |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | $GLOBALS[$GLOBALS['idx_lang']] = array( |
| 11 | 11 | |
| 12 | - // A |
|
| 13 | - 'accueil_site' => 'Home', |
|
| 14 | - 'article' => 'Articolo', |
|
| 15 | - 'articles' => 'Articoli', |
|
| 16 | - 'articles_auteur' => 'Articoli di questo autore', |
|
| 17 | - 'articles_populaires' => 'Articoli più letti', |
|
| 18 | - 'articles_rubrique' => 'Articoli di questa rubrica', |
|
| 19 | - 'aucun_article' => 'Non ci sono articoli a questo indirizzo', |
|
| 20 | - 'aucun_auteur' => 'Non ci sono autori a questo indirizzo', |
|
| 21 | - 'aucun_site' => 'Non ci sono siti a questo indirizzo', |
|
| 22 | - 'aucune_breve' => 'Non ci sono brevi a questo indirizzo', |
|
| 23 | - 'aucune_rubrique' => 'Non ci sono rubriche a questo indirizzo', |
|
| 24 | - 'auteur' => 'Autore', |
|
| 25 | - 'autres' => 'Altri', |
|
| 26 | - 'autres_breves' => 'Altre brevi', |
|
| 27 | - 'autres_groupes_mots_clefs' => 'Altri gruppi di parole chiave', |
|
| 28 | - 'autres_sites' => 'Altri siti', |
|
| 29 | - |
|
| 30 | - // B |
|
| 31 | - 'bonjour' => 'Salve', |
|
| 32 | - |
|
| 33 | - // C |
|
| 34 | - 'commenter_site' => 'Commenta questo sito', |
|
| 35 | - 'contact' => 'Contatti', |
|
| 36 | - 'copie_document_impossible' => 'Impossibile copiare il documento', |
|
| 37 | - |
|
| 38 | - // D |
|
| 39 | - 'date' => 'Data', |
|
| 40 | - 'dernier_ajout' => 'Ultimo aggiornamento', |
|
| 41 | - 'dernieres_breves' => 'Ultime brevi', |
|
| 42 | - 'derniers_articles' => 'Ultimi articoli', |
|
| 43 | - 'derniers_commentaires' => 'Ultimi commenti', |
|
| 44 | - 'derniers_messages_forum' => 'Ultimi messaggi pubblicati nei forum', |
|
| 45 | - |
|
| 46 | - // E |
|
| 47 | - 'edition_mode_texte' => 'Versione solo testo di', |
|
| 48 | - 'en_reponse' => 'In risposta a:', |
|
| 49 | - 'en_resume' => 'Riassunto', |
|
| 50 | - 'envoyer_message' => 'Invia un messaggio', |
|
| 51 | - 'espace_prive' => 'Area riservata', |
|
| 52 | - |
|
| 53 | - // F |
|
| 54 | - 'formats_acceptes' => 'Formati accettati: @formats@.', |
|
| 55 | - |
|
| 56 | - // H |
|
| 57 | - 'hierarchie_site' => 'Mappa del sito', |
|
| 58 | - |
|
| 59 | - // J |
|
| 60 | - 'jours' => 'giorni', |
|
| 61 | - |
|
| 62 | - // L |
|
| 63 | - 'lien_connecter' => 'Connettersi', |
|
| 64 | - |
|
| 65 | - // M |
|
| 66 | - 'meme_auteur' => 'Dello stesso autore', |
|
| 67 | - 'meme_rubrique' => 'Nella stessa rubrica', |
|
| 68 | - 'memes_auteurs' => 'Degli stessi autori', |
|
| 69 | - 'message' => 'Messaggio', |
|
| 70 | - 'messages_forum' => 'Messaggi', |
|
| 71 | - 'messages_recents' => 'Messaggi più recenti del forum', |
|
| 72 | - 'mots_clef' => 'Parola chiave', |
|
| 73 | - 'mots_clefs' => 'Parole chiave', |
|
| 74 | - 'mots_clefs_meme_groupe' => 'Parole chiave nello stesso gruppo', |
|
| 75 | - |
|
| 76 | - // N |
|
| 77 | - 'navigation' => 'Navigazione', |
|
| 78 | - 'nom' => 'Cognome', |
|
| 79 | - 'nouveautes' => 'Le novità', |
|
| 80 | - 'nouveautes_web' => 'Novità sul Web', |
|
| 81 | - 'nouveaux_articles' => 'Nuovi articoli', |
|
| 82 | - 'nouvelles_breves' => 'Nuove brevi', |
|
| 83 | - |
|
| 84 | - // P |
|
| 85 | - 'page_precedente' => 'pagina precedente', |
|
| 86 | - 'page_suivante' => 'pagina successiva', |
|
| 87 | - 'par_auteur' => 'di ', |
|
| 88 | - 'participer_site' => 'È possibile partecipare alla vita di questo sito e proporre degli articoli iscrivendosi qui sotto. Verrà spedito immediatamente un email con il codice di accesso all’area riservata del sito.', |
|
| 89 | - 'plan_site' => 'Mappa del sito', |
|
| 90 | - 'popularite' => 'Popolarità', |
|
| 91 | - 'poster_message' => 'Inviare un messaggio', |
|
| 92 | - 'proposer_site' => 'È possibile proporre un sito da aggiungere a questa rubrica:', |
|
| 93 | - |
|
| 94 | - // R |
|
| 95 | - 'repondre_article' => 'Rispondere all’articolo', |
|
| 96 | - 'repondre_breve' => 'Rispondere a questa breve', |
|
| 97 | - 'resultats_recherche' => 'Risultati della ricerca', |
|
| 98 | - 'retour_debut_forums' => 'Tornare all’inizio dei forum', |
|
| 99 | - 'rss_abonnement' => 'Copia il seguente URL nel tuo aggregatore RSS:', |
|
| 100 | - 'rss_abonnement_titre' => 'Sottoscrivi', |
|
| 101 | - 'rss_abonnement_titre_page' => 'Per sottoscrivere', |
|
| 102 | - 'rss_explication' => 'Un feed RSS raccoglie informazioni di aggiornamento per un sito. Fornisce il contenuto dei post o dei commenti o un estratto da essi, nonché un collegamento alle versioni complete e alcune altre informazioni. Questo feed deve essere letto da un aggregatore RSS.', |
|
| 103 | - 'rss_explication_titre' => 'Cos’è un flusso RSS?', |
|
| 104 | - 'rubrique' => 'Rubrica', |
|
| 105 | - 'rubriques' => 'Rubriche', |
|
| 106 | - |
|
| 107 | - // S |
|
| 108 | - 'signatures_petition' => 'Firme', |
|
| 109 | - 'site_realise_avec_spip' => 'Sito realizzato con SPIP', |
|
| 110 | - 'sites_web' => 'Siti Web', |
|
| 111 | - 'sous_rubriques' => 'Sottorubriche', |
|
| 112 | - 'spam' => 'Spam', |
|
| 113 | - 'suite' => 'segue', |
|
| 114 | - 'sur_web' => 'Sul Web', |
|
| 115 | - 'syndiquer_rubrique' => 'Mettere in syndication questa rubrica', |
|
| 116 | - 'syndiquer_site' => 'Mettere in syndication tutto il sito', |
|
| 117 | - |
|
| 118 | - // T |
|
| 119 | - 'texte_lettre_information' => 'Newsletter del sito', |
|
| 120 | - 'texte_lettre_information_2' => 'Questo sito contiene articoli pubblicati a partire dal ', |
|
| 121 | - |
|
| 122 | - // V |
|
| 123 | - 'ver_imprimer' => 'Versione per la stampa', |
|
| 124 | - 'voir_en_ligne' => 'Vedi on line', |
|
| 125 | - 'voir_squelette' => 'visualizza il modello di questa pagina' |
|
| 12 | + // A |
|
| 13 | + 'accueil_site' => 'Home', |
|
| 14 | + 'article' => 'Articolo', |
|
| 15 | + 'articles' => 'Articoli', |
|
| 16 | + 'articles_auteur' => 'Articoli di questo autore', |
|
| 17 | + 'articles_populaires' => 'Articoli più letti', |
|
| 18 | + 'articles_rubrique' => 'Articoli di questa rubrica', |
|
| 19 | + 'aucun_article' => 'Non ci sono articoli a questo indirizzo', |
|
| 20 | + 'aucun_auteur' => 'Non ci sono autori a questo indirizzo', |
|
| 21 | + 'aucun_site' => 'Non ci sono siti a questo indirizzo', |
|
| 22 | + 'aucune_breve' => 'Non ci sono brevi a questo indirizzo', |
|
| 23 | + 'aucune_rubrique' => 'Non ci sono rubriche a questo indirizzo', |
|
| 24 | + 'auteur' => 'Autore', |
|
| 25 | + 'autres' => 'Altri', |
|
| 26 | + 'autres_breves' => 'Altre brevi', |
|
| 27 | + 'autres_groupes_mots_clefs' => 'Altri gruppi di parole chiave', |
|
| 28 | + 'autres_sites' => 'Altri siti', |
|
| 29 | + |
|
| 30 | + // B |
|
| 31 | + 'bonjour' => 'Salve', |
|
| 32 | + |
|
| 33 | + // C |
|
| 34 | + 'commenter_site' => 'Commenta questo sito', |
|
| 35 | + 'contact' => 'Contatti', |
|
| 36 | + 'copie_document_impossible' => 'Impossibile copiare il documento', |
|
| 37 | + |
|
| 38 | + // D |
|
| 39 | + 'date' => 'Data', |
|
| 40 | + 'dernier_ajout' => 'Ultimo aggiornamento', |
|
| 41 | + 'dernieres_breves' => 'Ultime brevi', |
|
| 42 | + 'derniers_articles' => 'Ultimi articoli', |
|
| 43 | + 'derniers_commentaires' => 'Ultimi commenti', |
|
| 44 | + 'derniers_messages_forum' => 'Ultimi messaggi pubblicati nei forum', |
|
| 45 | + |
|
| 46 | + // E |
|
| 47 | + 'edition_mode_texte' => 'Versione solo testo di', |
|
| 48 | + 'en_reponse' => 'In risposta a:', |
|
| 49 | + 'en_resume' => 'Riassunto', |
|
| 50 | + 'envoyer_message' => 'Invia un messaggio', |
|
| 51 | + 'espace_prive' => 'Area riservata', |
|
| 52 | + |
|
| 53 | + // F |
|
| 54 | + 'formats_acceptes' => 'Formati accettati: @formats@.', |
|
| 55 | + |
|
| 56 | + // H |
|
| 57 | + 'hierarchie_site' => 'Mappa del sito', |
|
| 58 | + |
|
| 59 | + // J |
|
| 60 | + 'jours' => 'giorni', |
|
| 61 | + |
|
| 62 | + // L |
|
| 63 | + 'lien_connecter' => 'Connettersi', |
|
| 64 | + |
|
| 65 | + // M |
|
| 66 | + 'meme_auteur' => 'Dello stesso autore', |
|
| 67 | + 'meme_rubrique' => 'Nella stessa rubrica', |
|
| 68 | + 'memes_auteurs' => 'Degli stessi autori', |
|
| 69 | + 'message' => 'Messaggio', |
|
| 70 | + 'messages_forum' => 'Messaggi', |
|
| 71 | + 'messages_recents' => 'Messaggi più recenti del forum', |
|
| 72 | + 'mots_clef' => 'Parola chiave', |
|
| 73 | + 'mots_clefs' => 'Parole chiave', |
|
| 74 | + 'mots_clefs_meme_groupe' => 'Parole chiave nello stesso gruppo', |
|
| 75 | + |
|
| 76 | + // N |
|
| 77 | + 'navigation' => 'Navigazione', |
|
| 78 | + 'nom' => 'Cognome', |
|
| 79 | + 'nouveautes' => 'Le novità', |
|
| 80 | + 'nouveautes_web' => 'Novità sul Web', |
|
| 81 | + 'nouveaux_articles' => 'Nuovi articoli', |
|
| 82 | + 'nouvelles_breves' => 'Nuove brevi', |
|
| 83 | + |
|
| 84 | + // P |
|
| 85 | + 'page_precedente' => 'pagina precedente', |
|
| 86 | + 'page_suivante' => 'pagina successiva', |
|
| 87 | + 'par_auteur' => 'di ', |
|
| 88 | + 'participer_site' => 'È possibile partecipare alla vita di questo sito e proporre degli articoli iscrivendosi qui sotto. Verrà spedito immediatamente un email con il codice di accesso all’area riservata del sito.', |
|
| 89 | + 'plan_site' => 'Mappa del sito', |
|
| 90 | + 'popularite' => 'Popolarità', |
|
| 91 | + 'poster_message' => 'Inviare un messaggio', |
|
| 92 | + 'proposer_site' => 'È possibile proporre un sito da aggiungere a questa rubrica:', |
|
| 93 | + |
|
| 94 | + // R |
|
| 95 | + 'repondre_article' => 'Rispondere all’articolo', |
|
| 96 | + 'repondre_breve' => 'Rispondere a questa breve', |
|
| 97 | + 'resultats_recherche' => 'Risultati della ricerca', |
|
| 98 | + 'retour_debut_forums' => 'Tornare all’inizio dei forum', |
|
| 99 | + 'rss_abonnement' => 'Copia il seguente URL nel tuo aggregatore RSS:', |
|
| 100 | + 'rss_abonnement_titre' => 'Sottoscrivi', |
|
| 101 | + 'rss_abonnement_titre_page' => 'Per sottoscrivere', |
|
| 102 | + 'rss_explication' => 'Un feed RSS raccoglie informazioni di aggiornamento per un sito. Fornisce il contenuto dei post o dei commenti o un estratto da essi, nonché un collegamento alle versioni complete e alcune altre informazioni. Questo feed deve essere letto da un aggregatore RSS.', |
|
| 103 | + 'rss_explication_titre' => 'Cos’è un flusso RSS?', |
|
| 104 | + 'rubrique' => 'Rubrica', |
|
| 105 | + 'rubriques' => 'Rubriche', |
|
| 106 | + |
|
| 107 | + // S |
|
| 108 | + 'signatures_petition' => 'Firme', |
|
| 109 | + 'site_realise_avec_spip' => 'Sito realizzato con SPIP', |
|
| 110 | + 'sites_web' => 'Siti Web', |
|
| 111 | + 'sous_rubriques' => 'Sottorubriche', |
|
| 112 | + 'spam' => 'Spam', |
|
| 113 | + 'suite' => 'segue', |
|
| 114 | + 'sur_web' => 'Sul Web', |
|
| 115 | + 'syndiquer_rubrique' => 'Mettere in syndication questa rubrica', |
|
| 116 | + 'syndiquer_site' => 'Mettere in syndication tutto il sito', |
|
| 117 | + |
|
| 118 | + // T |
|
| 119 | + 'texte_lettre_information' => 'Newsletter del sito', |
|
| 120 | + 'texte_lettre_information_2' => 'Questo sito contiene articoli pubblicati a partire dal ', |
|
| 121 | + |
|
| 122 | + // V |
|
| 123 | + 'ver_imprimer' => 'Versione per la stampa', |
|
| 124 | + 'voir_en_ligne' => 'Vedi on line', |
|
| 125 | + 'voir_squelette' => 'visualizza il modello di questa pagina' |
|
| 126 | 126 | ); |
@@ -4,123 +4,123 @@ |
||
| 4 | 4 | // ** ne pas modifier le fichier ** |
| 5 | 5 | |
| 6 | 6 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 7 | - return; |
|
| 7 | + return; |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | $GLOBALS[$GLOBALS['idx_lang']] = array( |
| 11 | 11 | |
| 12 | - // A |
|
| 13 | - 'accueil_site' => 'Accueil', |
|
| 14 | - 'article' => 'Article', |
|
| 15 | - 'articles' => 'Articles', |
|
| 16 | - 'articles_auteur' => 'Articles de cette autrice', |
|
| 17 | - 'articles_populaires' => 'Articles les plus populaires', |
|
| 18 | - 'articles_rubrique' => 'Articles de cette rubrique', |
|
| 19 | - 'aucun_article' => 'Il n’y a pas d’article à cette adresse', |
|
| 20 | - 'aucun_auteur' => 'Il n’y a pas d’autrice à cette adresse', |
|
| 21 | - 'aucun_site' => 'Il n’y a pas de site à cette adresse', |
|
| 22 | - 'aucune_breve' => 'Il n’y a pas de brève à cette adresse', |
|
| 23 | - 'aucune_rubrique' => 'Il n’y a pas de rubrique à cette adresse', |
|
| 24 | - 'auteur' => 'Autrice', |
|
| 25 | - 'autres' => 'Autres', |
|
| 26 | - 'autres_breves' => 'Autres brèves', |
|
| 27 | - 'autres_groupes_mots_clefs' => 'Autres groupes de mots-clés', |
|
| 28 | - 'autres_sites' => 'Autres sites', |
|
| 29 | - |
|
| 30 | - // B |
|
| 31 | - 'bonjour' => 'Bonjour', |
|
| 32 | - |
|
| 33 | - // C |
|
| 34 | - 'commenter_site' => 'Commenter ce site', |
|
| 35 | - 'contact' => 'Contact', |
|
| 36 | - 'copie_document_impossible' => 'Impossible de copier le document', |
|
| 37 | - |
|
| 38 | - // D |
|
| 39 | - 'date' => 'Date', |
|
| 40 | - 'dernier_ajout' => 'Dernier ajout', |
|
| 41 | - 'dernieres_breves' => 'Dernières brèves', |
|
| 42 | - 'derniers_articles' => 'Derniers articles', |
|
| 43 | - 'derniers_commentaires' => 'Derniers commentaires', |
|
| 44 | - 'derniers_messages_forum' => 'Derniers messages publiés dans les forums', |
|
| 45 | - |
|
| 46 | - // E |
|
| 47 | - 'edition_mode_texte' => 'Édition en mode texte de', |
|
| 48 | - 'en_reponse' => 'En réponse à :', |
|
| 49 | - 'en_resume' => 'En résumé', |
|
| 50 | - 'envoyer_message' => 'Envoyer un message', |
|
| 51 | - 'espace_prive' => 'Espace privé', |
|
| 52 | - |
|
| 53 | - // F |
|
| 54 | - 'formats_acceptes' => 'Formats acceptés : @formats@.', |
|
| 55 | - |
|
| 56 | - // H |
|
| 57 | - 'hierarchie_site' => 'Hiérarchie du site', |
|
| 58 | - |
|
| 59 | - // J |
|
| 60 | - 'jours' => 'jours', |
|
| 61 | - |
|
| 62 | - // L |
|
| 63 | - 'lien_connecter' => 'Se connecter', |
|
| 64 | - |
|
| 65 | - // M |
|
| 66 | - 'meme_auteur' => 'De la même autrice', |
|
| 67 | - 'meme_rubrique' => 'Dans la même rubrique', |
|
| 68 | - 'memes_auteurs' => 'Des mêmes autrices', |
|
| 69 | - 'message' => 'Message', |
|
| 70 | - 'messages_forum' => 'Messages', |
|
| 71 | - 'messages_recents' => 'Messages de forums les plus récents', |
|
| 72 | - 'mots_clef' => 'Mot-clé', |
|
| 73 | - 'mots_clefs' => 'Mots-clés', |
|
| 74 | - 'mots_clefs_meme_groupe' => 'Mots-clés dans le même groupe', |
|
| 75 | - |
|
| 76 | - // N |
|
| 77 | - 'navigation' => 'Navigation', |
|
| 78 | - 'nom' => 'Nom', |
|
| 79 | - 'nouveautes' => 'Les nouveautés', |
|
| 80 | - 'nouveautes_web' => 'Nouveautés sur le Web', |
|
| 81 | - 'nouveaux_articles' => 'Nouveaux articles', |
|
| 82 | - 'nouvelles_breves' => 'Nouvelles brèves', |
|
| 83 | - |
|
| 84 | - // P |
|
| 85 | - 'page_precedente' => 'page précédente', |
|
| 86 | - 'page_suivante' => 'page suivante', |
|
| 87 | - 'par_auteur' => 'par ', |
|
| 88 | - 'participer_site' => 'Vous pouvez participer à la vie de ce site et proposer vos propres articles en vous inscrivant ci-dessous. Vous recevrez immédiatement un email vous indiquant vos codes d’accès à l’espace privé du site.', |
|
| 89 | - 'plan_site' => 'Plan du site', |
|
| 90 | - 'popularite' => 'Popularité', |
|
| 91 | - 'poster_message' => 'Poster un message', |
|
| 92 | - 'proposer_site' => 'Vous pouvez proposer un site à ajouter dans cette rubrique :', |
|
| 93 | - |
|
| 94 | - // R |
|
| 95 | - 'repondre_article' => 'Répondre à cet article', |
|
| 96 | - 'repondre_breve' => 'Répondre à cette brève', |
|
| 97 | - 'resultats_recherche' => 'Résultats de la recherche', |
|
| 98 | - 'retour_debut_forums' => 'Retour au début des forums', |
|
| 99 | - 'rss_abonnement' => 'Copiez l’URL suivante dans votre agrégateur :', |
|
| 100 | - 'rss_abonnement_titre' => 'S’abonner', |
|
| 101 | - 'rss_abonnement_titre_page' => 'S’abonner à', |
|
| 102 | - 'rss_explication' => 'Un fil RSS recueille les informations de mise à jour d’un site. Il fournit le contenu des billets ou des commentaires ou un extrait de ceux-ci, ainsi qu’un lien vers les versions complètes et quelques autres informations. Ce fil a pour vocation d’être lu par un agrégateur RSS.', |
|
| 103 | - 'rss_explication_titre' => 'Qu’est-ce qu’un flux RSS ?', |
|
| 104 | - 'rubrique' => 'Rubrique', |
|
| 105 | - 'rubriques' => 'Rubriques', |
|
| 106 | - |
|
| 107 | - // S |
|
| 108 | - 'signatures_petition' => 'Signatures', |
|
| 109 | - 'site_realise_avec_spip' => 'Site réalisé avec SPIP', |
|
| 110 | - 'sites_web' => 'Sites Web', |
|
| 111 | - 'sous_rubriques' => 'Sous-rubriques', |
|
| 112 | - 'spam' => 'Spam', |
|
| 113 | - 'suite' => 'suite', |
|
| 114 | - 'sur_web' => 'Sur le Web', |
|
| 115 | - 'syndiquer_rubrique' => 'Syndiquer cette rubrique', |
|
| 116 | - 'syndiquer_site' => 'Syndiquer tout le site', |
|
| 117 | - |
|
| 118 | - // T |
|
| 119 | - 'texte_lettre_information' => 'Voici la lettre d’information du site', |
|
| 120 | - 'texte_lettre_information_2' => 'Cette lettre recense les nouveautés publiées depuis', |
|
| 121 | - |
|
| 122 | - // V |
|
| 123 | - 'ver_imprimer' => 'Version à imprimer', |
|
| 124 | - 'voir_en_ligne' => 'Voir en ligne', |
|
| 125 | - 'voir_squelette' => 'voir le squelette de cette page' |
|
| 12 | + // A |
|
| 13 | + 'accueil_site' => 'Accueil', |
|
| 14 | + 'article' => 'Article', |
|
| 15 | + 'articles' => 'Articles', |
|
| 16 | + 'articles_auteur' => 'Articles de cette autrice', |
|
| 17 | + 'articles_populaires' => 'Articles les plus populaires', |
|
| 18 | + 'articles_rubrique' => 'Articles de cette rubrique', |
|
| 19 | + 'aucun_article' => 'Il n’y a pas d’article à cette adresse', |
|
| 20 | + 'aucun_auteur' => 'Il n’y a pas d’autrice à cette adresse', |
|
| 21 | + 'aucun_site' => 'Il n’y a pas de site à cette adresse', |
|
| 22 | + 'aucune_breve' => 'Il n’y a pas de brève à cette adresse', |
|
| 23 | + 'aucune_rubrique' => 'Il n’y a pas de rubrique à cette adresse', |
|
| 24 | + 'auteur' => 'Autrice', |
|
| 25 | + 'autres' => 'Autres', |
|
| 26 | + 'autres_breves' => 'Autres brèves', |
|
| 27 | + 'autres_groupes_mots_clefs' => 'Autres groupes de mots-clés', |
|
| 28 | + 'autres_sites' => 'Autres sites', |
|
| 29 | + |
|
| 30 | + // B |
|
| 31 | + 'bonjour' => 'Bonjour', |
|
| 32 | + |
|
| 33 | + // C |
|
| 34 | + 'commenter_site' => 'Commenter ce site', |
|
| 35 | + 'contact' => 'Contact', |
|
| 36 | + 'copie_document_impossible' => 'Impossible de copier le document', |
|
| 37 | + |
|
| 38 | + // D |
|
| 39 | + 'date' => 'Date', |
|
| 40 | + 'dernier_ajout' => 'Dernier ajout', |
|
| 41 | + 'dernieres_breves' => 'Dernières brèves', |
|
| 42 | + 'derniers_articles' => 'Derniers articles', |
|
| 43 | + 'derniers_commentaires' => 'Derniers commentaires', |
|
| 44 | + 'derniers_messages_forum' => 'Derniers messages publiés dans les forums', |
|
| 45 | + |
|
| 46 | + // E |
|
| 47 | + 'edition_mode_texte' => 'Édition en mode texte de', |
|
| 48 | + 'en_reponse' => 'En réponse à :', |
|
| 49 | + 'en_resume' => 'En résumé', |
|
| 50 | + 'envoyer_message' => 'Envoyer un message', |
|
| 51 | + 'espace_prive' => 'Espace privé', |
|
| 52 | + |
|
| 53 | + // F |
|
| 54 | + 'formats_acceptes' => 'Formats acceptés : @formats@.', |
|
| 55 | + |
|
| 56 | + // H |
|
| 57 | + 'hierarchie_site' => 'Hiérarchie du site', |
|
| 58 | + |
|
| 59 | + // J |
|
| 60 | + 'jours' => 'jours', |
|
| 61 | + |
|
| 62 | + // L |
|
| 63 | + 'lien_connecter' => 'Se connecter', |
|
| 64 | + |
|
| 65 | + // M |
|
| 66 | + 'meme_auteur' => 'De la même autrice', |
|
| 67 | + 'meme_rubrique' => 'Dans la même rubrique', |
|
| 68 | + 'memes_auteurs' => 'Des mêmes autrices', |
|
| 69 | + 'message' => 'Message', |
|
| 70 | + 'messages_forum' => 'Messages', |
|
| 71 | + 'messages_recents' => 'Messages de forums les plus récents', |
|
| 72 | + 'mots_clef' => 'Mot-clé', |
|
| 73 | + 'mots_clefs' => 'Mots-clés', |
|
| 74 | + 'mots_clefs_meme_groupe' => 'Mots-clés dans le même groupe', |
|
| 75 | + |
|
| 76 | + // N |
|
| 77 | + 'navigation' => 'Navigation', |
|
| 78 | + 'nom' => 'Nom', |
|
| 79 | + 'nouveautes' => 'Les nouveautés', |
|
| 80 | + 'nouveautes_web' => 'Nouveautés sur le Web', |
|
| 81 | + 'nouveaux_articles' => 'Nouveaux articles', |
|
| 82 | + 'nouvelles_breves' => 'Nouvelles brèves', |
|
| 83 | + |
|
| 84 | + // P |
|
| 85 | + 'page_precedente' => 'page précédente', |
|
| 86 | + 'page_suivante' => 'page suivante', |
|
| 87 | + 'par_auteur' => 'par ', |
|
| 88 | + 'participer_site' => 'Vous pouvez participer à la vie de ce site et proposer vos propres articles en vous inscrivant ci-dessous. Vous recevrez immédiatement un email vous indiquant vos codes d’accès à l’espace privé du site.', |
|
| 89 | + 'plan_site' => 'Plan du site', |
|
| 90 | + 'popularite' => 'Popularité', |
|
| 91 | + 'poster_message' => 'Poster un message', |
|
| 92 | + 'proposer_site' => 'Vous pouvez proposer un site à ajouter dans cette rubrique :', |
|
| 93 | + |
|
| 94 | + // R |
|
| 95 | + 'repondre_article' => 'Répondre à cet article', |
|
| 96 | + 'repondre_breve' => 'Répondre à cette brève', |
|
| 97 | + 'resultats_recherche' => 'Résultats de la recherche', |
|
| 98 | + 'retour_debut_forums' => 'Retour au début des forums', |
|
| 99 | + 'rss_abonnement' => 'Copiez l’URL suivante dans votre agrégateur :', |
|
| 100 | + 'rss_abonnement_titre' => 'S’abonner', |
|
| 101 | + 'rss_abonnement_titre_page' => 'S’abonner à', |
|
| 102 | + 'rss_explication' => 'Un fil RSS recueille les informations de mise à jour d’un site. Il fournit le contenu des billets ou des commentaires ou un extrait de ceux-ci, ainsi qu’un lien vers les versions complètes et quelques autres informations. Ce fil a pour vocation d’être lu par un agrégateur RSS.', |
|
| 103 | + 'rss_explication_titre' => 'Qu’est-ce qu’un flux RSS ?', |
|
| 104 | + 'rubrique' => 'Rubrique', |
|
| 105 | + 'rubriques' => 'Rubriques', |
|
| 106 | + |
|
| 107 | + // S |
|
| 108 | + 'signatures_petition' => 'Signatures', |
|
| 109 | + 'site_realise_avec_spip' => 'Site réalisé avec SPIP', |
|
| 110 | + 'sites_web' => 'Sites Web', |
|
| 111 | + 'sous_rubriques' => 'Sous-rubriques', |
|
| 112 | + 'spam' => 'Spam', |
|
| 113 | + 'suite' => 'suite', |
|
| 114 | + 'sur_web' => 'Sur le Web', |
|
| 115 | + 'syndiquer_rubrique' => 'Syndiquer cette rubrique', |
|
| 116 | + 'syndiquer_site' => 'Syndiquer tout le site', |
|
| 117 | + |
|
| 118 | + // T |
|
| 119 | + 'texte_lettre_information' => 'Voici la lettre d’information du site', |
|
| 120 | + 'texte_lettre_information_2' => 'Cette lettre recense les nouveautés publiées depuis', |
|
| 121 | + |
|
| 122 | + // V |
|
| 123 | + 'ver_imprimer' => 'Version à imprimer', |
|
| 124 | + 'voir_en_ligne' => 'Voir en ligne', |
|
| 125 | + 'voir_squelette' => 'voir le squelette de cette page' |
|
| 126 | 126 | ); |
@@ -4,123 +4,123 @@ |
||
| 4 | 4 | // ** ne pas modifier le fichier ** |
| 5 | 5 | |
| 6 | 6 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 7 | - return; |
|
| 7 | + return; |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | $GLOBALS[$GLOBALS['idx_lang']] = array( |
| 11 | 11 | |
| 12 | - // A |
|
| 13 | - 'accueil_site' => 'Página inicial do sítio', |
|
| 14 | - 'article' => 'Artigo', |
|
| 15 | - 'articles' => 'Artigos', |
|
| 16 | - 'articles_auteur' => 'Artigos deste autor', |
|
| 17 | - 'articles_populaires' => 'Artigos mais populares', |
|
| 18 | - 'articles_rubrique' => 'Artigos desta rubrica', |
|
| 19 | - 'aucun_article' => 'Nenhum artigo neste endereço', |
|
| 20 | - 'aucun_auteur' => 'Nenhum autor neste endereço', |
|
| 21 | - 'aucun_site' => 'Nenhum sítio neste endereço', |
|
| 22 | - 'aucune_breve' => 'Nenhuma notícia neste endereço', |
|
| 23 | - 'aucune_rubrique' => 'Nenhuma rubrica neste endereço', |
|
| 24 | - 'auteur' => 'Autor', |
|
| 25 | - 'autres' => 'Outros', |
|
| 26 | - 'autres_breves' => 'Outras notícias', |
|
| 27 | - 'autres_groupes_mots_clefs' => 'Outros grupos de palavras-chave', |
|
| 28 | - 'autres_sites' => 'Outros sítios', |
|
| 29 | - |
|
| 30 | - // B |
|
| 31 | - 'bonjour' => 'Bom dia', |
|
| 32 | - |
|
| 33 | - // C |
|
| 34 | - 'commenter_site' => 'Comentar este sítio', |
|
| 35 | - 'contact' => 'Contacto', |
|
| 36 | - 'copie_document_impossible' => 'Impossível copiar este documento', |
|
| 37 | - |
|
| 38 | - // D |
|
| 39 | - 'date' => 'Data', |
|
| 40 | - 'dernier_ajout' => 'Última actualização', |
|
| 41 | - 'dernieres_breves' => 'Últimas notícias', |
|
| 42 | - 'derniers_articles' => 'Últimos artigos', |
|
| 43 | - 'derniers_commentaires' => 'Últimos comentários', |
|
| 44 | - 'derniers_messages_forum' => 'Últimas mensagens publicadas nos fóruns', |
|
| 45 | - |
|
| 46 | - // E |
|
| 47 | - 'edition_mode_texte' => 'Edição apenas em modo de texto', |
|
| 48 | - 'en_reponse' => 'Em resposta a :', |
|
| 49 | - 'en_resume' => 'Em resumo', |
|
| 50 | - 'envoyer_message' => 'Enviar uma mensagem', |
|
| 51 | - 'espace_prive' => 'Área privada', |
|
| 52 | - |
|
| 53 | - // F |
|
| 54 | - 'formats_acceptes' => 'Formatos válidos : @formats@.', |
|
| 55 | - |
|
| 56 | - // H |
|
| 57 | - 'hierarchie_site' => 'Mapa do sítio', |
|
| 58 | - |
|
| 59 | - // J |
|
| 60 | - 'jours' => 'dias', |
|
| 61 | - |
|
| 62 | - // L |
|
| 63 | - 'lien_connecter' => 'Entrar', |
|
| 64 | - |
|
| 65 | - // M |
|
| 66 | - 'meme_auteur' => 'Do mesmo autor', |
|
| 67 | - 'meme_rubrique' => 'Na mesma rubrica', |
|
| 68 | - 'memes_auteurs' => 'Dos mesmos autores', |
|
| 69 | - 'message' => 'Mensagem', |
|
| 70 | - 'messages_forum' => 'Mensagens de fórum', |
|
| 71 | - 'messages_recents' => 'Mensagens de fóruns mais recentes', |
|
| 72 | - 'mots_clef' => 'Palavra-chave', |
|
| 73 | - 'mots_clefs' => 'Palavras-chave', |
|
| 74 | - 'mots_clefs_meme_groupe' => 'Palavras-chave no mesmo grupo', |
|
| 75 | - |
|
| 76 | - // N |
|
| 77 | - 'navigation' => 'Navegação', |
|
| 78 | - 'nom' => 'Nome', |
|
| 79 | - 'nouveautes' => 'As novidades', |
|
| 80 | - 'nouveautes_web' => 'Novidades na Web', |
|
| 81 | - 'nouveaux_articles' => 'Novos artigos', |
|
| 82 | - 'nouvelles_breves' => 'Novas notícias', |
|
| 83 | - |
|
| 84 | - // P |
|
| 85 | - 'page_precedente' => 'página anterior', |
|
| 86 | - 'page_suivante' => 'página seguinte', |
|
| 87 | - 'par_auteur' => 'por', |
|
| 88 | - 'participer_site' => 'Pode participar na vida deste sítio e propor os seus próprios artigos, inscrevendo-se mais abaixo. Receberá imediatamente um email com os seus códigos de acesso ao espaço privado do sítio.', |
|
| 89 | - 'plan_site' => 'Mapa do sítio', |
|
| 90 | - 'popularite' => 'Popularidade', |
|
| 91 | - 'poster_message' => 'Enviar uma mensagem', |
|
| 92 | - 'proposer_site' => 'Você pode propor um sítio a adicionar a esta rubrica :', |
|
| 93 | - |
|
| 94 | - // R |
|
| 95 | - 'repondre_article' => 'Comentar este artigo', |
|
| 96 | - 'repondre_breve' => 'Comentar esta notícia', |
|
| 97 | - 'resultats_recherche' => 'Resultados da pesquisa', |
|
| 98 | - 'retour_debut_forums' => 'Regresso ao início dos fóruns', |
|
| 99 | - 'rss_abonnement' => 'Copie o seguinte URL para o seu agregador de conteúdos:', |
|
| 100 | - 'rss_abonnement_titre' => 'Subscrever', |
|
| 101 | - 'rss_abonnement_titre_page' => 'Subscrever', |
|
| 102 | - 'rss_explication' => 'Um "feed" RSS recolhe informação actualizada a partir de um sítio. Fornece o conteúdo das publicações ou comentários ou um extracto dos mesmos, bem como um link para as versões completas e outras informações. Este "feed" destina-se a ser lido por um agregador RSS.', |
|
| 103 | - 'rss_explication_titre' => 'O que é um "feed RSS"?', |
|
| 104 | - 'rubrique' => 'Rubrica', |
|
| 105 | - 'rubriques' => 'Rubricas', |
|
| 106 | - |
|
| 107 | - // S |
|
| 108 | - 'signatures_petition' => 'Assinaturas', |
|
| 109 | - 'site_realise_avec_spip' => 'Sítio realizado com SPIP', |
|
| 110 | - 'sites_web' => 'Sítios Web', |
|
| 111 | - 'sous_rubriques' => 'Sub-rubricas', |
|
| 112 | - 'spam' => 'Spam', |
|
| 113 | - 'suite' => 'continuação', |
|
| 114 | - 'sur_web' => 'Na Web', |
|
| 115 | - 'syndiquer_rubrique' => 'Subscrever esta rubrica', |
|
| 116 | - 'syndiquer_site' => 'Subscrever todo o sítio', |
|
| 117 | - |
|
| 118 | - // T |
|
| 119 | - 'texte_lettre_information' => 'Eis a carta de informação do sítio', |
|
| 120 | - 'texte_lettre_information_2' => 'Este sítio contém novos itens publicados desde', |
|
| 121 | - |
|
| 122 | - // V |
|
| 123 | - 'ver_imprimer' => 'Versão para imprimir', |
|
| 124 | - 'voir_en_ligne' => 'Ver online', |
|
| 125 | - 'voir_squelette' => 'exibir o modelo desta página' |
|
| 12 | + // A |
|
| 13 | + 'accueil_site' => 'Página inicial do sítio', |
|
| 14 | + 'article' => 'Artigo', |
|
| 15 | + 'articles' => 'Artigos', |
|
| 16 | + 'articles_auteur' => 'Artigos deste autor', |
|
| 17 | + 'articles_populaires' => 'Artigos mais populares', |
|
| 18 | + 'articles_rubrique' => 'Artigos desta rubrica', |
|
| 19 | + 'aucun_article' => 'Nenhum artigo neste endereço', |
|
| 20 | + 'aucun_auteur' => 'Nenhum autor neste endereço', |
|
| 21 | + 'aucun_site' => 'Nenhum sítio neste endereço', |
|
| 22 | + 'aucune_breve' => 'Nenhuma notícia neste endereço', |
|
| 23 | + 'aucune_rubrique' => 'Nenhuma rubrica neste endereço', |
|
| 24 | + 'auteur' => 'Autor', |
|
| 25 | + 'autres' => 'Outros', |
|
| 26 | + 'autres_breves' => 'Outras notícias', |
|
| 27 | + 'autres_groupes_mots_clefs' => 'Outros grupos de palavras-chave', |
|
| 28 | + 'autres_sites' => 'Outros sítios', |
|
| 29 | + |
|
| 30 | + // B |
|
| 31 | + 'bonjour' => 'Bom dia', |
|
| 32 | + |
|
| 33 | + // C |
|
| 34 | + 'commenter_site' => 'Comentar este sítio', |
|
| 35 | + 'contact' => 'Contacto', |
|
| 36 | + 'copie_document_impossible' => 'Impossível copiar este documento', |
|
| 37 | + |
|
| 38 | + // D |
|
| 39 | + 'date' => 'Data', |
|
| 40 | + 'dernier_ajout' => 'Última actualização', |
|
| 41 | + 'dernieres_breves' => 'Últimas notícias', |
|
| 42 | + 'derniers_articles' => 'Últimos artigos', |
|
| 43 | + 'derniers_commentaires' => 'Últimos comentários', |
|
| 44 | + 'derniers_messages_forum' => 'Últimas mensagens publicadas nos fóruns', |
|
| 45 | + |
|
| 46 | + // E |
|
| 47 | + 'edition_mode_texte' => 'Edição apenas em modo de texto', |
|
| 48 | + 'en_reponse' => 'Em resposta a :', |
|
| 49 | + 'en_resume' => 'Em resumo', |
|
| 50 | + 'envoyer_message' => 'Enviar uma mensagem', |
|
| 51 | + 'espace_prive' => 'Área privada', |
|
| 52 | + |
|
| 53 | + // F |
|
| 54 | + 'formats_acceptes' => 'Formatos válidos : @formats@.', |
|
| 55 | + |
|
| 56 | + // H |
|
| 57 | + 'hierarchie_site' => 'Mapa do sítio', |
|
| 58 | + |
|
| 59 | + // J |
|
| 60 | + 'jours' => 'dias', |
|
| 61 | + |
|
| 62 | + // L |
|
| 63 | + 'lien_connecter' => 'Entrar', |
|
| 64 | + |
|
| 65 | + // M |
|
| 66 | + 'meme_auteur' => 'Do mesmo autor', |
|
| 67 | + 'meme_rubrique' => 'Na mesma rubrica', |
|
| 68 | + 'memes_auteurs' => 'Dos mesmos autores', |
|
| 69 | + 'message' => 'Mensagem', |
|
| 70 | + 'messages_forum' => 'Mensagens de fórum', |
|
| 71 | + 'messages_recents' => 'Mensagens de fóruns mais recentes', |
|
| 72 | + 'mots_clef' => 'Palavra-chave', |
|
| 73 | + 'mots_clefs' => 'Palavras-chave', |
|
| 74 | + 'mots_clefs_meme_groupe' => 'Palavras-chave no mesmo grupo', |
|
| 75 | + |
|
| 76 | + // N |
|
| 77 | + 'navigation' => 'Navegação', |
|
| 78 | + 'nom' => 'Nome', |
|
| 79 | + 'nouveautes' => 'As novidades', |
|
| 80 | + 'nouveautes_web' => 'Novidades na Web', |
|
| 81 | + 'nouveaux_articles' => 'Novos artigos', |
|
| 82 | + 'nouvelles_breves' => 'Novas notícias', |
|
| 83 | + |
|
| 84 | + // P |
|
| 85 | + 'page_precedente' => 'página anterior', |
|
| 86 | + 'page_suivante' => 'página seguinte', |
|
| 87 | + 'par_auteur' => 'por', |
|
| 88 | + 'participer_site' => 'Pode participar na vida deste sítio e propor os seus próprios artigos, inscrevendo-se mais abaixo. Receberá imediatamente um email com os seus códigos de acesso ao espaço privado do sítio.', |
|
| 89 | + 'plan_site' => 'Mapa do sítio', |
|
| 90 | + 'popularite' => 'Popularidade', |
|
| 91 | + 'poster_message' => 'Enviar uma mensagem', |
|
| 92 | + 'proposer_site' => 'Você pode propor um sítio a adicionar a esta rubrica :', |
|
| 93 | + |
|
| 94 | + // R |
|
| 95 | + 'repondre_article' => 'Comentar este artigo', |
|
| 96 | + 'repondre_breve' => 'Comentar esta notícia', |
|
| 97 | + 'resultats_recherche' => 'Resultados da pesquisa', |
|
| 98 | + 'retour_debut_forums' => 'Regresso ao início dos fóruns', |
|
| 99 | + 'rss_abonnement' => 'Copie o seguinte URL para o seu agregador de conteúdos:', |
|
| 100 | + 'rss_abonnement_titre' => 'Subscrever', |
|
| 101 | + 'rss_abonnement_titre_page' => 'Subscrever', |
|
| 102 | + 'rss_explication' => 'Um "feed" RSS recolhe informação actualizada a partir de um sítio. Fornece o conteúdo das publicações ou comentários ou um extracto dos mesmos, bem como um link para as versões completas e outras informações. Este "feed" destina-se a ser lido por um agregador RSS.', |
|
| 103 | + 'rss_explication_titre' => 'O que é um "feed RSS"?', |
|
| 104 | + 'rubrique' => 'Rubrica', |
|
| 105 | + 'rubriques' => 'Rubricas', |
|
| 106 | + |
|
| 107 | + // S |
|
| 108 | + 'signatures_petition' => 'Assinaturas', |
|
| 109 | + 'site_realise_avec_spip' => 'Sítio realizado com SPIP', |
|
| 110 | + 'sites_web' => 'Sítios Web', |
|
| 111 | + 'sous_rubriques' => 'Sub-rubricas', |
|
| 112 | + 'spam' => 'Spam', |
|
| 113 | + 'suite' => 'continuação', |
|
| 114 | + 'sur_web' => 'Na Web', |
|
| 115 | + 'syndiquer_rubrique' => 'Subscrever esta rubrica', |
|
| 116 | + 'syndiquer_site' => 'Subscrever todo o sítio', |
|
| 117 | + |
|
| 118 | + // T |
|
| 119 | + 'texte_lettre_information' => 'Eis a carta de informação do sítio', |
|
| 120 | + 'texte_lettre_information_2' => 'Este sítio contém novos itens publicados desde', |
|
| 121 | + |
|
| 122 | + // V |
|
| 123 | + 'ver_imprimer' => 'Versão para imprimir', |
|
| 124 | + 'voir_en_ligne' => 'Ver online', |
|
| 125 | + 'voir_squelette' => 'exibir o modelo desta página' |
|
| 126 | 126 | ); |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | // de connexion, et tout risque d'ambiguite |
| 91 | 91 | if (!isset($nom_cache_desc_sql[$serveur][$objets_sql])) { |
| 92 | 92 | $nom_cache_desc_sql[$serveur][$objets_sql] = |
| 93 | - _DIR_CACHE . 'sql_desc_' |
|
| 93 | + _DIR_CACHE.'sql_desc_' |
|
| 94 | 94 | . ($serveur ? "{$serveur}_" : '') |
| 95 | - . substr(md5($connexion['db'] . ':' . $connexion['prefixe'] . ":$objets_sql"), 0, 8) |
|
| 95 | + . substr(md5($connexion['db'].':'.$connexion['prefixe'].":$objets_sql"), 0, 8) |
|
| 96 | 96 | . '.txt'; |
| 97 | 97 | // nouveau nom de cache = nouvelle version en memoire |
| 98 | 98 | unset($connexion['tables']); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | if ($connexion['spip_connect_version']) { |
| 121 | 121 | if ($table_spip and isset($GLOBALS['table_des_tables'][$nom])) { |
| 122 | 122 | $nom = $GLOBALS['table_des_tables'][$nom]; |
| 123 | - $nom_sql = 'spip_' . $nom; |
|
| 123 | + $nom_sql = 'spip_'.$nom; |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
@@ -147,12 +147,12 @@ discard block |
||
| 147 | 147 | // meme si pas d'abreviation declaree, trouver la table spip_$nom |
| 148 | 148 | // si c'est une table principale, |
| 149 | 149 | // puisqu'on le fait aussi pour les tables auxiliaires |
| 150 | - elseif ($nom_sql == $nom and isset($GLOBALS['tables_principales']['spip_' . $nom])) { |
|
| 151 | - $nom_sql = 'spip_' . $nom; |
|
| 150 | + elseif ($nom_sql == $nom and isset($GLOBALS['tables_principales']['spip_'.$nom])) { |
|
| 151 | + $nom_sql = 'spip_'.$nom; |
|
| 152 | 152 | $fdesc = &$GLOBALS['tables_principales'][$nom_sql]; |
| 153 | 153 | } elseif ( |
| 154 | 154 | isset($GLOBALS['tables_auxiliaires'][$n = $nom]) |
| 155 | - or isset($GLOBALS['tables_auxiliaires'][$n = 'spip_' . $nom]) |
|
| 155 | + or isset($GLOBALS['tables_auxiliaires'][$n = 'spip_'.$nom]) |
|
| 156 | 156 | ) { |
| 157 | 157 | $nom_sql = $n; |
| 158 | 158 | $fdesc = &$GLOBALS['tables_auxiliaires'][$n]; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | ) { |
| 169 | 169 | if (!$fdesc) { |
| 170 | 170 | $log_level = $options['log_missing'] ? _LOG_INFO_IMPORTANTE : _LOG_DEBUG; |
| 171 | - spip_log("trouver_table: table inconnue '$serveur' '$nom'", 'base' . $log_level); |
|
| 171 | + spip_log("trouver_table: table inconnue '$serveur' '$nom'", 'base'.$log_level); |
|
| 172 | 172 | |
| 173 | 173 | return null; |
| 174 | 174 | } |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $desc['exist'] = true; |
| 181 | 181 | // gerer le cas des cles vides (echec de l'analyse sur une vue par exemple) |
| 182 | 182 | // pour recuperer la declaration de lister_tables_objets_sql() si il y en a une |
| 183 | - if (! $desc['key']) { |
|
| 183 | + if (!$desc['key']) { |
|
| 184 | 184 | spip_log("trouver_table: table sans cle '$serveur' '$nom'", 'base'); |
| 185 | 185 | unset($desc['key']); |
| 186 | 186 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | if (!isset($desc['key']) && !empty($fdesc['key'])) { |
| 198 | 198 | $desc['key'] = $fdesc['key']; |
| 199 | 199 | } |
| 200 | - if (! isset($desc['key'])) { |
|
| 200 | + if (!isset($desc['key'])) { |
|
| 201 | 201 | $desc['key'] = []; |
| 202 | 202 | } |
| 203 | 203 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * @package SPIP\Core\SQL\Tables |
| 17 | 17 | **/ |
| 18 | 18 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 19 | - return; |
|
| 19 | + return; |
|
| 20 | 20 | } |
| 21 | 21 | include_spip('base/objets'); |
| 22 | 22 | |
@@ -68,154 +68,154 @@ discard block |
||
| 68 | 68 | * |
| 69 | 69 | **/ |
| 70 | 70 | function base_trouver_table_dist($nom, $serveur = '', $table_spip = true, array $options = []) { |
| 71 | - $desc_cache = null; |
|
| 72 | - static $nom_cache_desc_sql = []; |
|
| 73 | - |
|
| 74 | - if ( |
|
| 75 | - !spip_connect($serveur) |
|
| 76 | - or !preg_match('/^[a-zA-Z0-9._-]*/', $nom) |
|
| 77 | - ) { |
|
| 78 | - return null; |
|
| 79 | - } |
|
| 80 | - |
|
| 81 | - $options = $options + [ |
|
| 82 | - // si false, baissera le niveau de log si une table demandée n’existe pas |
|
| 83 | - 'log_missing' => true, |
|
| 84 | - ]; |
|
| 85 | - |
|
| 86 | - $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
|
| 87 | - $objets_sql = lister_tables_objets_sql('::md5'); |
|
| 88 | - |
|
| 89 | - // le nom du cache depend du serveur mais aussi du nom de la db et du prefixe |
|
| 90 | - // ce qui permet une auto invalidation en cas de modif manuelle du fichier |
|
| 91 | - // de connexion, et tout risque d'ambiguite |
|
| 92 | - if (!isset($nom_cache_desc_sql[$serveur][$objets_sql])) { |
|
| 93 | - $nom_cache_desc_sql[$serveur][$objets_sql] = |
|
| 94 | - _DIR_CACHE . 'sql_desc_' |
|
| 95 | - . ($serveur ? "{$serveur}_" : '') |
|
| 96 | - . substr(md5($connexion['db'] . ':' . $connexion['prefixe'] . ":$objets_sql"), 0, 8) |
|
| 97 | - . '.txt'; |
|
| 98 | - // nouveau nom de cache = nouvelle version en memoire |
|
| 99 | - unset($connexion['tables']); |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - // un appel avec $nom vide est une demande explicite de vidange du cache des descriptions |
|
| 103 | - if (!$nom) { |
|
| 104 | - spip_unlink($nom_cache_desc_sql[$serveur][$objets_sql]); |
|
| 105 | - $connexion['tables'] = []; |
|
| 106 | - |
|
| 107 | - return null; |
|
| 108 | - } |
|
| 109 | - |
|
| 110 | - $nom_sql = $nom; |
|
| 111 | - if (preg_match('/\.(.*)$/', $nom, $s)) { |
|
| 112 | - $nom_sql = $s[1]; |
|
| 113 | - } else { |
|
| 114 | - $nom_sql = $nom; |
|
| 115 | - } |
|
| 116 | - |
|
| 117 | - $fdesc = $desc = ''; |
|
| 118 | - $connexion = &$GLOBALS['connexions'][$serveur ?: 0]; |
|
| 119 | - |
|
| 120 | - // base sous SPIP: gerer les abreviations explicites des noms de table |
|
| 121 | - if ($connexion['spip_connect_version']) { |
|
| 122 | - if ($table_spip and isset($GLOBALS['table_des_tables'][$nom])) { |
|
| 123 | - $nom = $GLOBALS['table_des_tables'][$nom]; |
|
| 124 | - $nom_sql = 'spip_' . $nom; |
|
| 125 | - } |
|
| 126 | - } |
|
| 127 | - |
|
| 128 | - // si c'est la premiere table qu'on cherche |
|
| 129 | - // et si on est pas explicitement en recalcul |
|
| 130 | - // on essaye de recharger le cache des decriptions de ce serveur |
|
| 131 | - // dans le fichier cache |
|
| 132 | - if ( |
|
| 133 | - !isset($connexion['tables'][$nom_sql]) |
|
| 134 | - and defined('_VAR_MODE') and _VAR_MODE !== 'recalcul' |
|
| 135 | - and (!isset($connexion['tables']) or !$connexion['tables']) |
|
| 136 | - ) { |
|
| 137 | - if ( |
|
| 138 | - lire_fichier($nom_cache_desc_sql[$serveur][$objets_sql], $desc_cache) |
|
| 139 | - and $desc_cache = unserialize($desc_cache) |
|
| 140 | - ) { |
|
| 141 | - $connexion['tables'] = $desc_cache; |
|
| 142 | - } |
|
| 143 | - } |
|
| 144 | - if ($table_spip and !isset($connexion['tables'][$nom_sql])) { |
|
| 145 | - if (isset($GLOBALS['tables_principales'][$nom_sql])) { |
|
| 146 | - $fdesc = $GLOBALS['tables_principales'][$nom_sql]; |
|
| 147 | - } |
|
| 148 | - // meme si pas d'abreviation declaree, trouver la table spip_$nom |
|
| 149 | - // si c'est une table principale, |
|
| 150 | - // puisqu'on le fait aussi pour les tables auxiliaires |
|
| 151 | - elseif ($nom_sql == $nom and isset($GLOBALS['tables_principales']['spip_' . $nom])) { |
|
| 152 | - $nom_sql = 'spip_' . $nom; |
|
| 153 | - $fdesc = &$GLOBALS['tables_principales'][$nom_sql]; |
|
| 154 | - } elseif ( |
|
| 155 | - isset($GLOBALS['tables_auxiliaires'][$n = $nom]) |
|
| 156 | - or isset($GLOBALS['tables_auxiliaires'][$n = 'spip_' . $nom]) |
|
| 157 | - ) { |
|
| 158 | - $nom_sql = $n; |
|
| 159 | - $fdesc = &$GLOBALS['tables_auxiliaires'][$n]; |
|
| 160 | - } # table locale a cote de SPIP, comme non SPIP: |
|
| 161 | - } |
|
| 162 | - if (!isset($connexion['tables'][$nom_sql])) { |
|
| 163 | - // La *vraie* base a la priorite |
|
| 164 | - $exists = sql_table_exists($nom_sql, $table_spip, $serveur); |
|
| 165 | - if ( |
|
| 166 | - !$exists |
|
| 167 | - or !$desc = sql_showtable($nom_sql, $table_spip, $serveur) |
|
| 168 | - or !$desc['field'] |
|
| 169 | - ) { |
|
| 170 | - if (!$fdesc) { |
|
| 171 | - $log_level = $options['log_missing'] ? _LOG_INFO_IMPORTANTE : _LOG_DEBUG; |
|
| 172 | - spip_log("trouver_table: table inconnue '$serveur' '$nom'", 'base' . $log_level); |
|
| 173 | - |
|
| 174 | - return null; |
|
| 175 | - } |
|
| 176 | - // on ne sait pas lire la structure de la table : |
|
| 177 | - // on retombe sur la description donnee dans les fichiers spip |
|
| 178 | - $desc = $fdesc; |
|
| 179 | - $desc['exist'] = false; |
|
| 180 | - } else { |
|
| 181 | - $desc['exist'] = true; |
|
| 182 | - // gerer le cas des cles vides (echec de l'analyse sur une vue par exemple) |
|
| 183 | - // pour recuperer la declaration de lister_tables_objets_sql() si il y en a une |
|
| 184 | - if (! $desc['key']) { |
|
| 185 | - spip_log("trouver_table: table sans cle '$serveur' '$nom'", 'base'); |
|
| 186 | - unset($desc['key']); |
|
| 187 | - } |
|
| 188 | - } |
|
| 189 | - |
|
| 190 | - $desc['table'] = $desc['table_sql'] = $nom_sql; |
|
| 191 | - $desc['connexion'] = $serveur; |
|
| 192 | - |
|
| 193 | - // charger les infos declarees pour cette table |
|
| 194 | - // en lui passant les infos connues |
|
| 195 | - // $desc est prioritaire pour la description de la table |
|
| 196 | - $desc = array_merge(lister_tables_objets_sql($nom_sql, $desc), $desc); |
|
| 197 | - // s'assurer qu'on a toujours un 'key' |
|
| 198 | - if (!isset($desc['key']) && !empty($fdesc['key'])) { |
|
| 199 | - $desc['key'] = $fdesc['key']; |
|
| 200 | - } |
|
| 201 | - if (! isset($desc['key'])) { |
|
| 202 | - $desc['key'] = []; |
|
| 203 | - } |
|
| 204 | - |
|
| 205 | - // si tables_objets_sql est bien fini d'init, on peut cacher |
|
| 206 | - $connexion['tables'][$nom_sql] = $desc; |
|
| 207 | - $res = &$connexion['tables'][$nom_sql]; |
|
| 208 | - // une nouvelle table a ete decrite |
|
| 209 | - // mettons donc a jour le cache des descriptions de ce serveur |
|
| 210 | - if (is_writeable(_DIR_CACHE)) { |
|
| 211 | - ecrire_fichier($nom_cache_desc_sql[$serveur][$objets_sql], serialize($connexion['tables']), true); |
|
| 212 | - } |
|
| 213 | - } else { |
|
| 214 | - $res = &$connexion['tables'][$nom_sql]; |
|
| 215 | - } |
|
| 216 | - |
|
| 217 | - // toujours retourner $nom dans id_table |
|
| 218 | - $res['id_table'] = $nom; |
|
| 219 | - |
|
| 220 | - return $res; |
|
| 71 | + $desc_cache = null; |
|
| 72 | + static $nom_cache_desc_sql = []; |
|
| 73 | + |
|
| 74 | + if ( |
|
| 75 | + !spip_connect($serveur) |
|
| 76 | + or !preg_match('/^[a-zA-Z0-9._-]*/', $nom) |
|
| 77 | + ) { |
|
| 78 | + return null; |
|
| 79 | + } |
|
| 80 | + |
|
| 81 | + $options = $options + [ |
|
| 82 | + // si false, baissera le niveau de log si une table demandée n’existe pas |
|
| 83 | + 'log_missing' => true, |
|
| 84 | + ]; |
|
| 85 | + |
|
| 86 | + $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
|
| 87 | + $objets_sql = lister_tables_objets_sql('::md5'); |
|
| 88 | + |
|
| 89 | + // le nom du cache depend du serveur mais aussi du nom de la db et du prefixe |
|
| 90 | + // ce qui permet une auto invalidation en cas de modif manuelle du fichier |
|
| 91 | + // de connexion, et tout risque d'ambiguite |
|
| 92 | + if (!isset($nom_cache_desc_sql[$serveur][$objets_sql])) { |
|
| 93 | + $nom_cache_desc_sql[$serveur][$objets_sql] = |
|
| 94 | + _DIR_CACHE . 'sql_desc_' |
|
| 95 | + . ($serveur ? "{$serveur}_" : '') |
|
| 96 | + . substr(md5($connexion['db'] . ':' . $connexion['prefixe'] . ":$objets_sql"), 0, 8) |
|
| 97 | + . '.txt'; |
|
| 98 | + // nouveau nom de cache = nouvelle version en memoire |
|
| 99 | + unset($connexion['tables']); |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + // un appel avec $nom vide est une demande explicite de vidange du cache des descriptions |
|
| 103 | + if (!$nom) { |
|
| 104 | + spip_unlink($nom_cache_desc_sql[$serveur][$objets_sql]); |
|
| 105 | + $connexion['tables'] = []; |
|
| 106 | + |
|
| 107 | + return null; |
|
| 108 | + } |
|
| 109 | + |
|
| 110 | + $nom_sql = $nom; |
|
| 111 | + if (preg_match('/\.(.*)$/', $nom, $s)) { |
|
| 112 | + $nom_sql = $s[1]; |
|
| 113 | + } else { |
|
| 114 | + $nom_sql = $nom; |
|
| 115 | + } |
|
| 116 | + |
|
| 117 | + $fdesc = $desc = ''; |
|
| 118 | + $connexion = &$GLOBALS['connexions'][$serveur ?: 0]; |
|
| 119 | + |
|
| 120 | + // base sous SPIP: gerer les abreviations explicites des noms de table |
|
| 121 | + if ($connexion['spip_connect_version']) { |
|
| 122 | + if ($table_spip and isset($GLOBALS['table_des_tables'][$nom])) { |
|
| 123 | + $nom = $GLOBALS['table_des_tables'][$nom]; |
|
| 124 | + $nom_sql = 'spip_' . $nom; |
|
| 125 | + } |
|
| 126 | + } |
|
| 127 | + |
|
| 128 | + // si c'est la premiere table qu'on cherche |
|
| 129 | + // et si on est pas explicitement en recalcul |
|
| 130 | + // on essaye de recharger le cache des decriptions de ce serveur |
|
| 131 | + // dans le fichier cache |
|
| 132 | + if ( |
|
| 133 | + !isset($connexion['tables'][$nom_sql]) |
|
| 134 | + and defined('_VAR_MODE') and _VAR_MODE !== 'recalcul' |
|
| 135 | + and (!isset($connexion['tables']) or !$connexion['tables']) |
|
| 136 | + ) { |
|
| 137 | + if ( |
|
| 138 | + lire_fichier($nom_cache_desc_sql[$serveur][$objets_sql], $desc_cache) |
|
| 139 | + and $desc_cache = unserialize($desc_cache) |
|
| 140 | + ) { |
|
| 141 | + $connexion['tables'] = $desc_cache; |
|
| 142 | + } |
|
| 143 | + } |
|
| 144 | + if ($table_spip and !isset($connexion['tables'][$nom_sql])) { |
|
| 145 | + if (isset($GLOBALS['tables_principales'][$nom_sql])) { |
|
| 146 | + $fdesc = $GLOBALS['tables_principales'][$nom_sql]; |
|
| 147 | + } |
|
| 148 | + // meme si pas d'abreviation declaree, trouver la table spip_$nom |
|
| 149 | + // si c'est une table principale, |
|
| 150 | + // puisqu'on le fait aussi pour les tables auxiliaires |
|
| 151 | + elseif ($nom_sql == $nom and isset($GLOBALS['tables_principales']['spip_' . $nom])) { |
|
| 152 | + $nom_sql = 'spip_' . $nom; |
|
| 153 | + $fdesc = &$GLOBALS['tables_principales'][$nom_sql]; |
|
| 154 | + } elseif ( |
|
| 155 | + isset($GLOBALS['tables_auxiliaires'][$n = $nom]) |
|
| 156 | + or isset($GLOBALS['tables_auxiliaires'][$n = 'spip_' . $nom]) |
|
| 157 | + ) { |
|
| 158 | + $nom_sql = $n; |
|
| 159 | + $fdesc = &$GLOBALS['tables_auxiliaires'][$n]; |
|
| 160 | + } # table locale a cote de SPIP, comme non SPIP: |
|
| 161 | + } |
|
| 162 | + if (!isset($connexion['tables'][$nom_sql])) { |
|
| 163 | + // La *vraie* base a la priorite |
|
| 164 | + $exists = sql_table_exists($nom_sql, $table_spip, $serveur); |
|
| 165 | + if ( |
|
| 166 | + !$exists |
|
| 167 | + or !$desc = sql_showtable($nom_sql, $table_spip, $serveur) |
|
| 168 | + or !$desc['field'] |
|
| 169 | + ) { |
|
| 170 | + if (!$fdesc) { |
|
| 171 | + $log_level = $options['log_missing'] ? _LOG_INFO_IMPORTANTE : _LOG_DEBUG; |
|
| 172 | + spip_log("trouver_table: table inconnue '$serveur' '$nom'", 'base' . $log_level); |
|
| 173 | + |
|
| 174 | + return null; |
|
| 175 | + } |
|
| 176 | + // on ne sait pas lire la structure de la table : |
|
| 177 | + // on retombe sur la description donnee dans les fichiers spip |
|
| 178 | + $desc = $fdesc; |
|
| 179 | + $desc['exist'] = false; |
|
| 180 | + } else { |
|
| 181 | + $desc['exist'] = true; |
|
| 182 | + // gerer le cas des cles vides (echec de l'analyse sur une vue par exemple) |
|
| 183 | + // pour recuperer la declaration de lister_tables_objets_sql() si il y en a une |
|
| 184 | + if (! $desc['key']) { |
|
| 185 | + spip_log("trouver_table: table sans cle '$serveur' '$nom'", 'base'); |
|
| 186 | + unset($desc['key']); |
|
| 187 | + } |
|
| 188 | + } |
|
| 189 | + |
|
| 190 | + $desc['table'] = $desc['table_sql'] = $nom_sql; |
|
| 191 | + $desc['connexion'] = $serveur; |
|
| 192 | + |
|
| 193 | + // charger les infos declarees pour cette table |
|
| 194 | + // en lui passant les infos connues |
|
| 195 | + // $desc est prioritaire pour la description de la table |
|
| 196 | + $desc = array_merge(lister_tables_objets_sql($nom_sql, $desc), $desc); |
|
| 197 | + // s'assurer qu'on a toujours un 'key' |
|
| 198 | + if (!isset($desc['key']) && !empty($fdesc['key'])) { |
|
| 199 | + $desc['key'] = $fdesc['key']; |
|
| 200 | + } |
|
| 201 | + if (! isset($desc['key'])) { |
|
| 202 | + $desc['key'] = []; |
|
| 203 | + } |
|
| 204 | + |
|
| 205 | + // si tables_objets_sql est bien fini d'init, on peut cacher |
|
| 206 | + $connexion['tables'][$nom_sql] = $desc; |
|
| 207 | + $res = &$connexion['tables'][$nom_sql]; |
|
| 208 | + // une nouvelle table a ete decrite |
|
| 209 | + // mettons donc a jour le cache des descriptions de ce serveur |
|
| 210 | + if (is_writeable(_DIR_CACHE)) { |
|
| 211 | + ecrire_fichier($nom_cache_desc_sql[$serveur][$objets_sql], serialize($connexion['tables']), true); |
|
| 212 | + } |
|
| 213 | + } else { |
|
| 214 | + $res = &$connexion['tables'][$nom_sql]; |
|
| 215 | + } |
|
| 216 | + |
|
| 217 | + // toujours retourner $nom dans id_table |
|
| 218 | + $res['id_table'] = $nom; |
|
| 219 | + |
|
| 220 | + return $res; |
|
| 221 | 221 | } |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | if (!is_null($options['range'])) { |
| 56 | 56 | spip_livrer_fichier_partie($fichier, $options['range']); |
| 57 | - } |
|
| 58 | - else { |
|
| 57 | + } else { |
|
| 59 | 58 | spip_livrer_fichier_entier($fichier); |
| 60 | 59 | } |
| 61 | 60 | } |
@@ -86,8 +85,7 @@ discard block |
||
| 86 | 85 | header('Expires: 0'); // set expiration time |
| 87 | 86 | header('Pragma: public'); |
| 88 | 87 | header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
| 89 | - } |
|
| 90 | - else { |
|
| 88 | + } else { |
|
| 91 | 89 | $f = basename($fichier); |
| 92 | 90 | header("Content-Disposition: inline; filename=\"$f\";"); |
| 93 | 91 | header('Expires: ' . $expires); // set expiration time |
@@ -154,8 +152,7 @@ discard block |
||
| 154 | 152 | } |
| 155 | 153 | |
| 156 | 154 | $cr_header = sprintf('Content-Range: bytes %d-%d/%d', $byteOffset, $finishBytes, $fileSize); |
| 157 | - } |
|
| 158 | - else { |
|
| 155 | + } else { |
|
| 159 | 156 | // si pas de range valide, on delegue a la methode d'envoi complet |
| 160 | 157 | spip_livrer_fichier_entier($fichier); |
| 161 | 158 | // redondant, mais facilite la comprehension du code |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * @package SPIP\Core\Fichier |
| 17 | 17 | **/ |
| 18 | 18 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 19 | - return; |
|
| 19 | + return; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -36,28 +36,28 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | function spip_livrer_fichier($fichier, $content_type = 'application/octet-stream', $options = []) { |
| 38 | 38 | |
| 39 | - $defaut = [ |
|
| 40 | - 'attachment' => false, |
|
| 41 | - 'expires' => 3600, |
|
| 42 | - 'range' => null |
|
| 43 | - ]; |
|
| 44 | - $options = array_merge($defaut, $options); |
|
| 45 | - if (is_numeric($options['expires']) and $options['expires'] > 0) { |
|
| 46 | - $options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']) . ' GMT'; |
|
| 47 | - } |
|
| 48 | - |
|
| 49 | - if (is_null($options) and isset($_SERVER['HTTP_RANGE'])) { |
|
| 50 | - $options['range'] = $_SERVER['HTTP_RANGE']; |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - spip_livrer_fichier_entetes($fichier, $content_type, $options['attachment'] && !$options['range'], $options['expires']); |
|
| 54 | - |
|
| 55 | - if (!is_null($options['range'])) { |
|
| 56 | - spip_livrer_fichier_partie($fichier, $options['range']); |
|
| 57 | - } |
|
| 58 | - else { |
|
| 59 | - spip_livrer_fichier_entier($fichier); |
|
| 60 | - } |
|
| 39 | + $defaut = [ |
|
| 40 | + 'attachment' => false, |
|
| 41 | + 'expires' => 3600, |
|
| 42 | + 'range' => null |
|
| 43 | + ]; |
|
| 44 | + $options = array_merge($defaut, $options); |
|
| 45 | + if (is_numeric($options['expires']) and $options['expires'] > 0) { |
|
| 46 | + $options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']) . ' GMT'; |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + if (is_null($options) and isset($_SERVER['HTTP_RANGE'])) { |
|
| 50 | + $options['range'] = $_SERVER['HTTP_RANGE']; |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + spip_livrer_fichier_entetes($fichier, $content_type, $options['attachment'] && !$options['range'], $options['expires']); |
|
| 54 | + |
|
| 55 | + if (!is_null($options['range'])) { |
|
| 56 | + spip_livrer_fichier_partie($fichier, $options['range']); |
|
| 57 | + } |
|
| 58 | + else { |
|
| 59 | + spip_livrer_fichier_entier($fichier); |
|
| 60 | + } |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -70,35 +70,35 @@ discard block |
||
| 70 | 70 | * @param int|string $expires |
| 71 | 71 | */ |
| 72 | 72 | function spip_livrer_fichier_entetes($fichier, $content_type = 'application/octet-stream', $attachment = false, $expires = 0) { |
| 73 | - // toujours envoyer un content type, meme vide ! |
|
| 74 | - header('Accept-Ranges: bytes'); |
|
| 75 | - header('Content-Type: ' . $content_type); |
|
| 76 | - |
|
| 77 | - if ($fs = stat($fichier) |
|
| 78 | - and !empty($fs['size']) |
|
| 79 | - and !empty($fs['mtime'])) { |
|
| 80 | - header("Last-Modified: " . gmdate("D, d M Y H:i:s", $fs['mtime']) . " GMT"); |
|
| 81 | - header(sprintf('Etag: "%x-%x"', $fs['size'], str_pad($fs['mtime'], 16, "0"))); |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - if ($attachment) { |
|
| 85 | - $f = basename($fichier); |
|
| 86 | - // ce content-type est necessaire pour eviter des corruptions de zip dans ie6 |
|
| 87 | - header('Content-Type: application/octet-stream'); |
|
| 88 | - |
|
| 89 | - header("Content-Disposition: attachment; filename=\"$f\";"); |
|
| 90 | - header('Content-Transfer-Encoding: binary'); |
|
| 91 | - |
|
| 92 | - // fix for IE caching or PHP bug issue |
|
| 93 | - header('Expires: 0'); // set expiration time |
|
| 94 | - header('Pragma: public'); |
|
| 95 | - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
|
| 96 | - } |
|
| 97 | - else { |
|
| 98 | - $f = basename($fichier); |
|
| 99 | - header("Content-Disposition: inline; filename=\"$f\";"); |
|
| 100 | - header('Expires: ' . $expires); // set expiration time |
|
| 101 | - } |
|
| 73 | + // toujours envoyer un content type, meme vide ! |
|
| 74 | + header('Accept-Ranges: bytes'); |
|
| 75 | + header('Content-Type: ' . $content_type); |
|
| 76 | + |
|
| 77 | + if ($fs = stat($fichier) |
|
| 78 | + and !empty($fs['size']) |
|
| 79 | + and !empty($fs['mtime'])) { |
|
| 80 | + header("Last-Modified: " . gmdate("D, d M Y H:i:s", $fs['mtime']) . " GMT"); |
|
| 81 | + header(sprintf('Etag: "%x-%x"', $fs['size'], str_pad($fs['mtime'], 16, "0"))); |
|
| 82 | + } |
|
| 83 | + |
|
| 84 | + if ($attachment) { |
|
| 85 | + $f = basename($fichier); |
|
| 86 | + // ce content-type est necessaire pour eviter des corruptions de zip dans ie6 |
|
| 87 | + header('Content-Type: application/octet-stream'); |
|
| 88 | + |
|
| 89 | + header("Content-Disposition: attachment; filename=\"$f\";"); |
|
| 90 | + header('Content-Transfer-Encoding: binary'); |
|
| 91 | + |
|
| 92 | + // fix for IE caching or PHP bug issue |
|
| 93 | + header('Expires: 0'); // set expiration time |
|
| 94 | + header('Pragma: public'); |
|
| 95 | + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
|
| 96 | + } |
|
| 97 | + else { |
|
| 98 | + $f = basename($fichier); |
|
| 99 | + header("Content-Disposition: inline; filename=\"$f\";"); |
|
| 100 | + header('Expires: ' . $expires); // set expiration time |
|
| 101 | + } |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -106,20 +106,20 @@ discard block |
||
| 106 | 106 | * @param string $fichier |
| 107 | 107 | */ |
| 108 | 108 | function spip_livrer_fichier_entier($fichier) { |
| 109 | - if (!file_exists($fichier)) { |
|
| 110 | - throw new \Exception(sprintf('File not found: %s', $fichier)); |
|
| 111 | - } |
|
| 109 | + if (!file_exists($fichier)) { |
|
| 110 | + throw new \Exception(sprintf('File not found: %s', $fichier)); |
|
| 111 | + } |
|
| 112 | 112 | |
| 113 | - if (!is_readable($fichier)) { |
|
| 114 | - throw new \Exception(sprintf('File not readable: %s', $fichier)); |
|
| 115 | - } |
|
| 113 | + if (!is_readable($fichier)) { |
|
| 114 | + throw new \Exception(sprintf('File not readable: %s', $fichier)); |
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | - if ($size = filesize($fichier)) { |
|
| 118 | - header(sprintf('Content-Length: %d', $size)); |
|
| 119 | - } |
|
| 117 | + if ($size = filesize($fichier)) { |
|
| 118 | + header(sprintf('Content-Length: %d', $size)); |
|
| 119 | + } |
|
| 120 | 120 | |
| 121 | - readfile($fichier); |
|
| 122 | - exit(); |
|
| 121 | + readfile($fichier); |
|
| 122 | + exit(); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
@@ -132,98 +132,98 @@ discard block |
||
| 132 | 132 | * @throws Exception |
| 133 | 133 | */ |
| 134 | 134 | function spip_livrer_fichier_partie($fichier, $range = null) { |
| 135 | - if (!file_exists($fichier)) { |
|
| 136 | - throw new \Exception(sprintf('File not found: %s', $fichier)); |
|
| 137 | - } |
|
| 135 | + if (!file_exists($fichier)) { |
|
| 136 | + throw new \Exception(sprintf('File not found: %s', $fichier)); |
|
| 137 | + } |
|
| 138 | 138 | |
| 139 | - if (!is_readable($fichier)) { |
|
| 140 | - throw new \Exception(sprintf('File not readable: %s', $fichier)); |
|
| 141 | - } |
|
| 139 | + if (!is_readable($fichier)) { |
|
| 140 | + throw new \Exception(sprintf('File not readable: %s', $fichier)); |
|
| 141 | + } |
|
| 142 | 142 | |
| 143 | 143 | |
| 144 | - // Par defaut on envoie tout |
|
| 145 | - $byteOffset = 0; |
|
| 146 | - $byteLength = $fileSize = filesize($fichier); |
|
| 144 | + // Par defaut on envoie tout |
|
| 145 | + $byteOffset = 0; |
|
| 146 | + $byteLength = $fileSize = filesize($fichier); |
|
| 147 | 147 | |
| 148 | 148 | |
| 149 | - // Parse Content-Range header for byte offsets, looks like "bytes=11525-" OR "bytes=11525-12451" |
|
| 150 | - if ($range and preg_match('%bytes=(\d+)-(\d+)?%i', $range, $match)) { |
|
| 151 | - ### Offset signifies where we should begin to read the file |
|
| 152 | - $byteOffset = (int)$match[1]; |
|
| 149 | + // Parse Content-Range header for byte offsets, looks like "bytes=11525-" OR "bytes=11525-12451" |
|
| 150 | + if ($range and preg_match('%bytes=(\d+)-(\d+)?%i', $range, $match)) { |
|
| 151 | + ### Offset signifies where we should begin to read the file |
|
| 152 | + $byteOffset = (int)$match[1]; |
|
| 153 | 153 | |
| 154 | 154 | |
| 155 | - ### Length is for how long we should read the file according to the browser, and can never go beyond the file size |
|
| 156 | - if (isset($match[2])) { |
|
| 157 | - $finishBytes = (int)$match[2]; |
|
| 158 | - $byteLength = $finishBytes + 1; |
|
| 159 | - } else { |
|
| 160 | - $finishBytes = $fileSize - 1; |
|
| 161 | - } |
|
| 155 | + ### Length is for how long we should read the file according to the browser, and can never go beyond the file size |
|
| 156 | + if (isset($match[2])) { |
|
| 157 | + $finishBytes = (int)$match[2]; |
|
| 158 | + $byteLength = $finishBytes + 1; |
|
| 159 | + } else { |
|
| 160 | + $finishBytes = $fileSize - 1; |
|
| 161 | + } |
|
| 162 | 162 | |
| 163 | - $cr_header = sprintf('Content-Range: bytes %d-%d/%d', $byteOffset, $finishBytes, $fileSize); |
|
| 164 | - } |
|
| 165 | - else { |
|
| 166 | - // si pas de range valide, on delegue a la methode d'envoi complet |
|
| 167 | - spip_livrer_fichier_entier($fichier); |
|
| 168 | - // redondant, mais facilite la comprehension du code |
|
| 169 | - exit(); |
|
| 170 | - } |
|
| 163 | + $cr_header = sprintf('Content-Range: bytes %d-%d/%d', $byteOffset, $finishBytes, $fileSize); |
|
| 164 | + } |
|
| 165 | + else { |
|
| 166 | + // si pas de range valide, on delegue a la methode d'envoi complet |
|
| 167 | + spip_livrer_fichier_entier($fichier); |
|
| 168 | + // redondant, mais facilite la comprehension du code |
|
| 169 | + exit(); |
|
| 170 | + } |
|
| 171 | 171 | |
| 172 | - // Remove headers that might unnecessarily clutter up the output |
|
| 173 | - header_remove('Cache-Control'); |
|
| 174 | - header_remove('Pragma'); |
|
| 172 | + // Remove headers that might unnecessarily clutter up the output |
|
| 173 | + header_remove('Cache-Control'); |
|
| 174 | + header_remove('Pragma'); |
|
| 175 | 175 | |
| 176 | - // partial content |
|
| 177 | - header('HTTP/1.1 206 Partial content'); |
|
| 178 | - header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent |
|
| 176 | + // partial content |
|
| 177 | + header('HTTP/1.1 206 Partial content'); |
|
| 178 | + header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent |
|
| 179 | 179 | |
| 180 | 180 | |
| 181 | - $byteRange = $byteLength - $byteOffset; |
|
| 181 | + $byteRange = $byteLength - $byteOffset; |
|
| 182 | 182 | |
| 183 | - header(sprintf('Content-Length: %d', $byteRange)); |
|
| 183 | + header(sprintf('Content-Length: %d', $byteRange)); |
|
| 184 | 184 | |
| 185 | - // Variable containing the buffer |
|
| 186 | - $buffer = ''; |
|
| 187 | - // Just a reasonable buffer size |
|
| 188 | - $bufferSize = 512 * 16; |
|
| 189 | - // Contains how much is left to read of the byteRange |
|
| 190 | - $bytePool = $byteRange; |
|
| 185 | + // Variable containing the buffer |
|
| 186 | + $buffer = ''; |
|
| 187 | + // Just a reasonable buffer size |
|
| 188 | + $bufferSize = 512 * 16; |
|
| 189 | + // Contains how much is left to read of the byteRange |
|
| 190 | + $bytePool = $byteRange; |
|
| 191 | 191 | |
| 192 | - if (!$handle = fopen($fichier, 'r')) { |
|
| 193 | - throw new \Exception(sprintf('Could not get handle for file %s', $fichier)); |
|
| 194 | - } |
|
| 192 | + if (!$handle = fopen($fichier, 'r')) { |
|
| 193 | + throw new \Exception(sprintf('Could not get handle for file %s', $fichier)); |
|
| 194 | + } |
|
| 195 | 195 | |
| 196 | - if (fseek($handle, $byteOffset, SEEK_SET) == -1) { |
|
| 197 | - throw new \Exception(sprintf('Could not seek to byte offset %d', $byteOffset)); |
|
| 198 | - } |
|
| 196 | + if (fseek($handle, $byteOffset, SEEK_SET) == -1) { |
|
| 197 | + throw new \Exception(sprintf('Could not seek to byte offset %d', $byteOffset)); |
|
| 198 | + } |
|
| 199 | 199 | |
| 200 | 200 | |
| 201 | - while ($bytePool > 0) { |
|
| 202 | - // How many bytes we request on this iteration |
|
| 203 | - $chunkSizeRequested = min($bufferSize, $bytePool); |
|
| 201 | + while ($bytePool > 0) { |
|
| 202 | + // How many bytes we request on this iteration |
|
| 203 | + $chunkSizeRequested = min($bufferSize, $bytePool); |
|
| 204 | 204 | |
| 205 | - // Try readin $chunkSizeRequested bytes from $handle and put data in $buffer |
|
| 206 | - $buffer = fread($handle, $chunkSizeRequested); |
|
| 205 | + // Try readin $chunkSizeRequested bytes from $handle and put data in $buffer |
|
| 206 | + $buffer = fread($handle, $chunkSizeRequested); |
|
| 207 | 207 | |
| 208 | - // Store how many bytes were actually read |
|
| 209 | - $chunkSizeActual = strlen($buffer); |
|
| 208 | + // Store how many bytes were actually read |
|
| 209 | + $chunkSizeActual = strlen($buffer); |
|
| 210 | 210 | |
| 211 | - // If we didn't get any bytes that means something unexpected has happened since $bytePool should be zero already |
|
| 212 | - if ($chunkSizeActual == 0) { |
|
| 213 | - // For production servers this should go in your php error log, since it will break the output |
|
| 214 | - trigger_error('Chunksize became 0', E_USER_WARNING); |
|
| 215 | - break; |
|
| 216 | - } |
|
| 211 | + // If we didn't get any bytes that means something unexpected has happened since $bytePool should be zero already |
|
| 212 | + if ($chunkSizeActual == 0) { |
|
| 213 | + // For production servers this should go in your php error log, since it will break the output |
|
| 214 | + trigger_error('Chunksize became 0', E_USER_WARNING); |
|
| 215 | + break; |
|
| 216 | + } |
|
| 217 | 217 | |
| 218 | - // Decrease byte pool with amount of bytes that were read during this iteration |
|
| 219 | - $bytePool -= $chunkSizeActual; |
|
| 218 | + // Decrease byte pool with amount of bytes that were read during this iteration |
|
| 219 | + $bytePool -= $chunkSizeActual; |
|
| 220 | 220 | |
| 221 | - // Write the buffer to output |
|
| 222 | - print $buffer; |
|
| 221 | + // Write the buffer to output |
|
| 222 | + print $buffer; |
|
| 223 | 223 | |
| 224 | - // Try to output the data to the client immediately |
|
| 225 | - flush(); |
|
| 226 | - } |
|
| 224 | + // Try to output the data to the client immediately |
|
| 225 | + flush(); |
|
| 226 | + } |
|
| 227 | 227 | |
| 228 | - exit(); |
|
| 228 | + exit(); |
|
| 229 | 229 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | ]; |
| 44 | 44 | $options = array_merge($defaut, $options); |
| 45 | 45 | if (is_numeric($options['expires']) and $options['expires'] > 0) { |
| 46 | - $options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']) . ' GMT'; |
|
| 46 | + $options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']).' GMT'; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | if (is_null($options) and isset($_SERVER['HTTP_RANGE'])) { |
@@ -72,12 +72,12 @@ discard block |
||
| 72 | 72 | function spip_livrer_fichier_entetes($fichier, $content_type = 'application/octet-stream', $attachment = false, $expires = 0) { |
| 73 | 73 | // toujours envoyer un content type, meme vide ! |
| 74 | 74 | header('Accept-Ranges: bytes'); |
| 75 | - header('Content-Type: ' . $content_type); |
|
| 75 | + header('Content-Type: '.$content_type); |
|
| 76 | 76 | |
| 77 | 77 | if ($fs = stat($fichier) |
| 78 | 78 | and !empty($fs['size']) |
| 79 | 79 | and !empty($fs['mtime'])) { |
| 80 | - header("Last-Modified: " . gmdate("D, d M Y H:i:s", $fs['mtime']) . " GMT"); |
|
| 80 | + header("Last-Modified: ".gmdate("D, d M Y H:i:s", $fs['mtime'])." GMT"); |
|
| 81 | 81 | header(sprintf('Etag: "%x-%x"', $fs['size'], str_pad($fs['mtime'], 16, "0"))); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | else { |
| 98 | 98 | $f = basename($fichier); |
| 99 | 99 | header("Content-Disposition: inline; filename=\"$f\";"); |
| 100 | - header('Expires: ' . $expires); // set expiration time |
|
| 100 | + header('Expires: '.$expires); // set expiration time |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
@@ -149,12 +149,12 @@ discard block |
||
| 149 | 149 | // Parse Content-Range header for byte offsets, looks like "bytes=11525-" OR "bytes=11525-12451" |
| 150 | 150 | if ($range and preg_match('%bytes=(\d+)-(\d+)?%i', $range, $match)) { |
| 151 | 151 | ### Offset signifies where we should begin to read the file |
| 152 | - $byteOffset = (int)$match[1]; |
|
| 152 | + $byteOffset = (int) $match[1]; |
|
| 153 | 153 | |
| 154 | 154 | |
| 155 | 155 | ### Length is for how long we should read the file according to the browser, and can never go beyond the file size |
| 156 | 156 | if (isset($match[2])) { |
| 157 | - $finishBytes = (int)$match[2]; |
|
| 157 | + $finishBytes = (int) $match[2]; |
|
| 158 | 158 | $byteLength = $finishBytes + 1; |
| 159 | 159 | } else { |
| 160 | 160 | $finishBytes = $fileSize - 1; |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | // partial content |
| 177 | 177 | header('HTTP/1.1 206 Partial content'); |
| 178 | - header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent |
|
| 178 | + header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent |
|
| 179 | 179 | |
| 180 | 180 | |
| 181 | 181 | $byteRange = $byteLength - $byteOffset; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | ); |
| 107 | 107 | |
| 108 | 108 | // Si l'article est publie, invalider les caches et demander sa reindexation |
| 109 | - $t = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id_article)); |
|
| 109 | + $t = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id_article)); |
|
| 110 | 110 | $invalideur = $indexation = false; |
| 111 | 111 | if ($t == 'publie') { |
| 112 | 112 | $invalideur = "id='article/$id_article'"; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $id_article, |
| 120 | 120 | [ |
| 121 | 121 | 'data' => $set, |
| 122 | - 'nonvide' => ['titre' => _T('info_nouvel_article') . ' ' . _T('info_numero_abbreviation') . $id_article], |
|
| 122 | + 'nonvide' => ['titre' => _T('info_nouvel_article').' '._T('info_numero_abbreviation').$id_article], |
|
| 123 | 123 | 'invalideur' => $invalideur, |
| 124 | 124 | 'indexation' => $indexation, |
| 125 | 125 | 'date_modif' => 'date_modif' // champ a mettre a date('Y-m-d H:i:s') s'il y a modif |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | } elseif (autoriser('modifier', 'article', $id_article) and $s != 'publie') { |
| 310 | 310 | $statut = $champs['statut'] = $s; |
| 311 | 311 | } else { |
| 312 | - spip_log("editer_article $id_article refus " . join(' ', $c)); |
|
| 312 | + spip_log("editer_article $id_article refus ".join(' ', $c)); |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | // En cas de publication, fixer la date a "maintenant" |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | isset($c['id_parent']) |
| 335 | 335 | and $id_parent = $c['id_parent'] |
| 336 | 336 | and $id_parent != $id_rubrique |
| 337 | - and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique=' . intval($id_parent))) |
|
| 337 | + and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique='.intval($id_parent))) |
|
| 338 | 338 | ) { |
| 339 | 339 | $champs['id_rubrique'] = $id_parent; |
| 340 | 340 | |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | // Si on deplace l'article |
| 436 | 436 | // changer aussi son secteur et sa langue (si heritee) |
| 437 | 437 | if (isset($champs['id_rubrique'])) { |
| 438 | - $row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique=' . sql_quote($champs['id_rubrique'])); |
|
| 438 | + $row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique='.sql_quote($champs['id_rubrique'])); |
|
| 439 | 439 | |
| 440 | 440 | $langue = $row_rub['lang']; |
| 441 | 441 | $champs['id_secteur'] = $row_rub['id_secteur']; |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | sql_fetsel( |
| 444 | 444 | '1', |
| 445 | 445 | 'spip_articles', |
| 446 | - 'id_article=' . intval($id_article) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue) |
|
| 446 | + 'id_article='.intval($id_article)." AND langue_choisie<>'oui' AND lang<>".sql_quote($langue) |
|
| 447 | 447 | ) |
| 448 | 448 | ) { |
| 449 | 449 | $champs['lang'] = $langue; |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | return; |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | - sql_updateq('spip_articles', $champs, 'id_article=' . intval($id_article)); |
|
| 457 | + sql_updateq('spip_articles', $champs, 'id_article='.intval($id_article)); |
|
| 458 | 458 | |
| 459 | 459 | // Changer le statut des rubriques concernees |
| 460 | 460 | |
@@ -475,6 +475,6 @@ discard block |
||
| 475 | 475 | foreach ($plus as $n => $t) { |
| 476 | 476 | $plus[$n] = preg_replace(",<!--SPIP-->[\n\r]*,", '', $t); |
| 477 | 477 | } |
| 478 | - set_request('texte', join('', $plus) . _request('texte')); |
|
| 478 | + set_request('texte', join('', $plus)._request('texte')); |
|
| 479 | 479 | } |
| 480 | 480 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -39,36 +39,36 @@ discard block |
||
| 39 | 39 | * Liste (identifiant de l'article, texte d'erreur éventuel) |
| 40 | 40 | */ |
| 41 | 41 | function action_editer_article_dist($arg = null) { |
| 42 | - include_spip('inc/autoriser'); |
|
| 43 | - $err = ''; |
|
| 44 | - if (is_null($arg)) { |
|
| 45 | - $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 46 | - $arg = $securiser_action(); |
|
| 47 | - } |
|
| 48 | - |
|
| 49 | - // si id_article n'est pas un nombre, c'est une creation |
|
| 50 | - // mais on verifie qu'on a toutes les donnees qu'il faut. |
|
| 51 | - if (!$id_article = intval($arg)) { |
|
| 52 | - $id_parent = _request('id_parent'); |
|
| 53 | - if (!$id_parent) { |
|
| 54 | - $err = _L("creation interdite d'un article sans rubrique"); |
|
| 55 | - } elseif (!autoriser('creerarticledans', 'rubrique', $id_parent)) { |
|
| 56 | - $err = _T('info_creerdansrubrique_non_autorise'); |
|
| 57 | - } else { |
|
| 58 | - $id_article = article_inserer($id_parent); |
|
| 59 | - } |
|
| 60 | - } |
|
| 61 | - |
|
| 62 | - // Enregistre l'envoi dans la BD |
|
| 63 | - if ($id_article > 0) { |
|
| 64 | - $err = article_modifier($id_article); |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - if ($err) { |
|
| 68 | - spip_log("echec editeur article: $err", _LOG_ERREUR); |
|
| 69 | - } |
|
| 70 | - |
|
| 71 | - return [$id_article, $err]; |
|
| 42 | + include_spip('inc/autoriser'); |
|
| 43 | + $err = ''; |
|
| 44 | + if (is_null($arg)) { |
|
| 45 | + $securiser_action = charger_fonction('securiser_action', 'inc'); |
|
| 46 | + $arg = $securiser_action(); |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + // si id_article n'est pas un nombre, c'est une creation |
|
| 50 | + // mais on verifie qu'on a toutes les donnees qu'il faut. |
|
| 51 | + if (!$id_article = intval($arg)) { |
|
| 52 | + $id_parent = _request('id_parent'); |
|
| 53 | + if (!$id_parent) { |
|
| 54 | + $err = _L("creation interdite d'un article sans rubrique"); |
|
| 55 | + } elseif (!autoriser('creerarticledans', 'rubrique', $id_parent)) { |
|
| 56 | + $err = _T('info_creerdansrubrique_non_autorise'); |
|
| 57 | + } else { |
|
| 58 | + $id_article = article_inserer($id_parent); |
|
| 59 | + } |
|
| 60 | + } |
|
| 61 | + |
|
| 62 | + // Enregistre l'envoi dans la BD |
|
| 63 | + if ($id_article > 0) { |
|
| 64 | + $err = article_modifier($id_article); |
|
| 65 | + } |
|
| 66 | + |
|
| 67 | + if ($err) { |
|
| 68 | + spip_log("echec editeur article: $err", _LOG_ERREUR); |
|
| 69 | + } |
|
| 70 | + |
|
| 71 | + return [$id_article, $err]; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -90,50 +90,50 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | function article_modifier($id_article, $set = null) { |
| 92 | 92 | |
| 93 | - // unifier $texte en cas de texte trop long |
|
| 94 | - trop_longs_articles(); |
|
| 95 | - |
|
| 96 | - include_spip('inc/modifier'); |
|
| 97 | - include_spip('inc/filtres'); |
|
| 98 | - $c = collecter_requests( |
|
| 99 | - // include list |
|
| 100 | - objet_info('article', 'champs_editables'), |
|
| 101 | - // exclude list |
|
| 102 | - ['date', 'statut', 'id_parent'], |
|
| 103 | - // donnees eventuellement fournies |
|
| 104 | - $set |
|
| 105 | - ); |
|
| 106 | - |
|
| 107 | - // Si l'article est publie, invalider les caches et demander sa reindexation |
|
| 108 | - $t = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id_article)); |
|
| 109 | - $invalideur = $indexation = false; |
|
| 110 | - if ($t == 'publie') { |
|
| 111 | - $invalideur = "id='article/$id_article'"; |
|
| 112 | - $indexation = true; |
|
| 113 | - } |
|
| 114 | - |
|
| 115 | - if ( |
|
| 116 | - $err = objet_modifier_champs( |
|
| 117 | - 'article', |
|
| 118 | - $id_article, |
|
| 119 | - [ |
|
| 120 | - 'data' => $set, |
|
| 121 | - 'nonvide' => ['titre' => _T('info_nouvel_article') . ' ' . _T('info_numero_abbreviation') . $id_article], |
|
| 122 | - 'invalideur' => $invalideur, |
|
| 123 | - 'indexation' => $indexation, |
|
| 124 | - 'date_modif' => 'date_modif' // champ a mettre a date('Y-m-d H:i:s') s'il y a modif |
|
| 125 | - ], |
|
| 126 | - $c |
|
| 127 | - ) |
|
| 128 | - ) { |
|
| 129 | - return $err; |
|
| 130 | - } |
|
| 131 | - |
|
| 132 | - // Modification de statut, changement de rubrique ? |
|
| 133 | - $c = collecter_requests(['date', 'statut', 'id_parent'], [], $set); |
|
| 134 | - $err = article_instituer($id_article, $c); |
|
| 135 | - |
|
| 136 | - return $err; |
|
| 93 | + // unifier $texte en cas de texte trop long |
|
| 94 | + trop_longs_articles(); |
|
| 95 | + |
|
| 96 | + include_spip('inc/modifier'); |
|
| 97 | + include_spip('inc/filtres'); |
|
| 98 | + $c = collecter_requests( |
|
| 99 | + // include list |
|
| 100 | + objet_info('article', 'champs_editables'), |
|
| 101 | + // exclude list |
|
| 102 | + ['date', 'statut', 'id_parent'], |
|
| 103 | + // donnees eventuellement fournies |
|
| 104 | + $set |
|
| 105 | + ); |
|
| 106 | + |
|
| 107 | + // Si l'article est publie, invalider les caches et demander sa reindexation |
|
| 108 | + $t = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id_article)); |
|
| 109 | + $invalideur = $indexation = false; |
|
| 110 | + if ($t == 'publie') { |
|
| 111 | + $invalideur = "id='article/$id_article'"; |
|
| 112 | + $indexation = true; |
|
| 113 | + } |
|
| 114 | + |
|
| 115 | + if ( |
|
| 116 | + $err = objet_modifier_champs( |
|
| 117 | + 'article', |
|
| 118 | + $id_article, |
|
| 119 | + [ |
|
| 120 | + 'data' => $set, |
|
| 121 | + 'nonvide' => ['titre' => _T('info_nouvel_article') . ' ' . _T('info_numero_abbreviation') . $id_article], |
|
| 122 | + 'invalideur' => $invalideur, |
|
| 123 | + 'indexation' => $indexation, |
|
| 124 | + 'date_modif' => 'date_modif' // champ a mettre a date('Y-m-d H:i:s') s'il y a modif |
|
| 125 | + ], |
|
| 126 | + $c |
|
| 127 | + ) |
|
| 128 | + ) { |
|
| 129 | + return $err; |
|
| 130 | + } |
|
| 131 | + |
|
| 132 | + // Modification de statut, changement de rubrique ? |
|
| 133 | + $c = collecter_requests(['date', 'statut', 'id_parent'], [], $set); |
|
| 134 | + $err = article_instituer($id_article, $c); |
|
| 135 | + |
|
| 136 | + return $err; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -169,120 +169,120 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | function article_inserer($id_rubrique, $set = null) { |
| 171 | 171 | |
| 172 | - // Si id_rubrique vaut 0 ou n'est pas definie, creer l'article |
|
| 173 | - // dans la premiere rubrique racine |
|
| 174 | - if (!$id_rubrique = intval($id_rubrique)) { |
|
| 175 | - $row = sql_fetsel('id_rubrique, id_secteur, lang', 'spip_rubriques', 'id_parent=0', '', '0+titre,titre', '1'); |
|
| 176 | - $id_rubrique = $row['id_rubrique']; |
|
| 177 | - } else { |
|
| 178 | - $row = sql_fetsel('lang, id_secteur', 'spip_rubriques', "id_rubrique=$id_rubrique"); |
|
| 179 | - } |
|
| 180 | - |
|
| 181 | - // eviter $id_secteur = NULL (erreur sqlite) si la requete precedente echoue |
|
| 182 | - // cas de id_rubrique = -1 par exemple avec plugin "pages" |
|
| 183 | - $id_secteur = $row['id_secteur'] ?? 0; |
|
| 184 | - $lang_rub = $row['lang'] ?? ''; |
|
| 185 | - |
|
| 186 | - $lang = ''; |
|
| 187 | - $choisie = 'non'; |
|
| 188 | - // La langue a la creation : si les liens de traduction sont autorises |
|
| 189 | - // dans les rubriques, on essaie avec la langue de l'auteur, |
|
| 190 | - // ou a defaut celle de la rubrique |
|
| 191 | - // Sinon c'est la langue de la rubrique qui est choisie + heritee |
|
| 192 | - if ( |
|
| 193 | - !empty($GLOBALS['meta']['multi_objets']) and in_array( |
|
| 194 | - 'spip_articles', |
|
| 195 | - explode(',', $GLOBALS['meta']['multi_objets']) |
|
| 196 | - ) |
|
| 197 | - ) { |
|
| 198 | - lang_select($GLOBALS['visiteur_session']['lang']); |
|
| 199 | - if ( |
|
| 200 | - in_array( |
|
| 201 | - $GLOBALS['spip_lang'], |
|
| 202 | - explode(',', $GLOBALS['meta']['langues_multilingue']) |
|
| 203 | - ) |
|
| 204 | - ) { |
|
| 205 | - $lang = $GLOBALS['spip_lang']; |
|
| 206 | - $choisie = 'oui'; |
|
| 207 | - } |
|
| 208 | - } |
|
| 209 | - |
|
| 210 | - if (!$lang) { |
|
| 211 | - $choisie = 'non'; |
|
| 212 | - $lang = $lang_rub ?: $GLOBALS['meta']['langue_site']; |
|
| 213 | - } |
|
| 214 | - |
|
| 215 | - $champs = [ |
|
| 216 | - 'id_rubrique' => $id_rubrique, |
|
| 217 | - 'id_secteur' => $id_secteur, |
|
| 218 | - 'statut' => 'prepa', |
|
| 219 | - 'date' => date('Y-m-d H:i:s'), |
|
| 220 | - 'lang' => $lang, |
|
| 221 | - 'langue_choisie' => $choisie |
|
| 222 | - ]; |
|
| 223 | - |
|
| 224 | - if ($set) { |
|
| 225 | - $champs = array_merge($champs, $set); |
|
| 226 | - } |
|
| 227 | - |
|
| 228 | - // Envoyer aux plugins |
|
| 229 | - $champs = pipeline( |
|
| 230 | - 'pre_insertion', |
|
| 231 | - [ |
|
| 232 | - 'args' => [ |
|
| 233 | - 'table' => 'spip_articles', |
|
| 234 | - ], |
|
| 235 | - 'data' => $champs |
|
| 236 | - ] |
|
| 237 | - ); |
|
| 238 | - |
|
| 239 | - $id_article = sql_insertq('spip_articles', $champs); |
|
| 240 | - |
|
| 241 | - // controler si le serveur n'a pas renvoye une erreur |
|
| 242 | - if ($id_article > 0) { |
|
| 243 | - $id_auteur = ((is_null(_request('id_auteur')) and isset($GLOBALS['visiteur_session']['id_auteur'])) ? |
|
| 244 | - $GLOBALS['visiteur_session']['id_auteur'] |
|
| 245 | - : _request('id_auteur')); |
|
| 246 | - if ($id_auteur) { |
|
| 247 | - include_spip('action/editer_auteur'); |
|
| 248 | - auteur_associer($id_auteur, ['article' => $id_article]); |
|
| 249 | - } |
|
| 250 | - } |
|
| 251 | - |
|
| 252 | - pipeline( |
|
| 253 | - 'post_insertion', |
|
| 254 | - [ |
|
| 255 | - 'args' => [ |
|
| 256 | - 'table' => 'spip_articles', |
|
| 257 | - 'id_objet' => $id_article |
|
| 258 | - ], |
|
| 259 | - 'data' => $champs |
|
| 260 | - ] |
|
| 261 | - ); |
|
| 172 | + // Si id_rubrique vaut 0 ou n'est pas definie, creer l'article |
|
| 173 | + // dans la premiere rubrique racine |
|
| 174 | + if (!$id_rubrique = intval($id_rubrique)) { |
|
| 175 | + $row = sql_fetsel('id_rubrique, id_secteur, lang', 'spip_rubriques', 'id_parent=0', '', '0+titre,titre', '1'); |
|
| 176 | + $id_rubrique = $row['id_rubrique']; |
|
| 177 | + } else { |
|
| 178 | + $row = sql_fetsel('lang, id_secteur', 'spip_rubriques', "id_rubrique=$id_rubrique"); |
|
| 179 | + } |
|
| 180 | + |
|
| 181 | + // eviter $id_secteur = NULL (erreur sqlite) si la requete precedente echoue |
|
| 182 | + // cas de id_rubrique = -1 par exemple avec plugin "pages" |
|
| 183 | + $id_secteur = $row['id_secteur'] ?? 0; |
|
| 184 | + $lang_rub = $row['lang'] ?? ''; |
|
| 185 | + |
|
| 186 | + $lang = ''; |
|
| 187 | + $choisie = 'non'; |
|
| 188 | + // La langue a la creation : si les liens de traduction sont autorises |
|
| 189 | + // dans les rubriques, on essaie avec la langue de l'auteur, |
|
| 190 | + // ou a defaut celle de la rubrique |
|
| 191 | + // Sinon c'est la langue de la rubrique qui est choisie + heritee |
|
| 192 | + if ( |
|
| 193 | + !empty($GLOBALS['meta']['multi_objets']) and in_array( |
|
| 194 | + 'spip_articles', |
|
| 195 | + explode(',', $GLOBALS['meta']['multi_objets']) |
|
| 196 | + ) |
|
| 197 | + ) { |
|
| 198 | + lang_select($GLOBALS['visiteur_session']['lang']); |
|
| 199 | + if ( |
|
| 200 | + in_array( |
|
| 201 | + $GLOBALS['spip_lang'], |
|
| 202 | + explode(',', $GLOBALS['meta']['langues_multilingue']) |
|
| 203 | + ) |
|
| 204 | + ) { |
|
| 205 | + $lang = $GLOBALS['spip_lang']; |
|
| 206 | + $choisie = 'oui'; |
|
| 207 | + } |
|
| 208 | + } |
|
| 209 | + |
|
| 210 | + if (!$lang) { |
|
| 211 | + $choisie = 'non'; |
|
| 212 | + $lang = $lang_rub ?: $GLOBALS['meta']['langue_site']; |
|
| 213 | + } |
|
| 214 | + |
|
| 215 | + $champs = [ |
|
| 216 | + 'id_rubrique' => $id_rubrique, |
|
| 217 | + 'id_secteur' => $id_secteur, |
|
| 218 | + 'statut' => 'prepa', |
|
| 219 | + 'date' => date('Y-m-d H:i:s'), |
|
| 220 | + 'lang' => $lang, |
|
| 221 | + 'langue_choisie' => $choisie |
|
| 222 | + ]; |
|
| 223 | + |
|
| 224 | + if ($set) { |
|
| 225 | + $champs = array_merge($champs, $set); |
|
| 226 | + } |
|
| 227 | + |
|
| 228 | + // Envoyer aux plugins |
|
| 229 | + $champs = pipeline( |
|
| 230 | + 'pre_insertion', |
|
| 231 | + [ |
|
| 232 | + 'args' => [ |
|
| 233 | + 'table' => 'spip_articles', |
|
| 234 | + ], |
|
| 235 | + 'data' => $champs |
|
| 236 | + ] |
|
| 237 | + ); |
|
| 238 | + |
|
| 239 | + $id_article = sql_insertq('spip_articles', $champs); |
|
| 240 | + |
|
| 241 | + // controler si le serveur n'a pas renvoye une erreur |
|
| 242 | + if ($id_article > 0) { |
|
| 243 | + $id_auteur = ((is_null(_request('id_auteur')) and isset($GLOBALS['visiteur_session']['id_auteur'])) ? |
|
| 244 | + $GLOBALS['visiteur_session']['id_auteur'] |
|
| 245 | + : _request('id_auteur')); |
|
| 246 | + if ($id_auteur) { |
|
| 247 | + include_spip('action/editer_auteur'); |
|
| 248 | + auteur_associer($id_auteur, ['article' => $id_article]); |
|
| 249 | + } |
|
| 250 | + } |
|
| 251 | + |
|
| 252 | + pipeline( |
|
| 253 | + 'post_insertion', |
|
| 254 | + [ |
|
| 255 | + 'args' => [ |
|
| 256 | + 'table' => 'spip_articles', |
|
| 257 | + 'id_objet' => $id_article |
|
| 258 | + ], |
|
| 259 | + 'data' => $champs |
|
| 260 | + ] |
|
| 261 | + ); |
|
| 262 | 262 | |
| 263 | - // Appeler une notification |
|
| 264 | - if ($notifications = charger_fonction('notifications', 'inc')) { |
|
| 265 | - $notifications( |
|
| 266 | - 'article_inserer', |
|
| 267 | - $id_article, |
|
| 268 | - [ |
|
| 269 | - 'id_parent' => $id_rubrique, |
|
| 270 | - 'champs' => $champs, |
|
| 271 | - ] |
|
| 272 | - ); |
|
| 273 | - $notifications( |
|
| 274 | - 'objet_inserer', |
|
| 275 | - $id_article, |
|
| 276 | - [ |
|
| 277 | - 'objet' => 'article', |
|
| 278 | - 'id_objet' => $id_article, |
|
| 279 | - 'id_parent' => $id_rubrique, |
|
| 280 | - 'champs' => $champs, |
|
| 281 | - ] |
|
| 282 | - ); |
|
| 283 | - } |
|
| 284 | - |
|
| 285 | - return $id_article; |
|
| 263 | + // Appeler une notification |
|
| 264 | + if ($notifications = charger_fonction('notifications', 'inc')) { |
|
| 265 | + $notifications( |
|
| 266 | + 'article_inserer', |
|
| 267 | + $id_article, |
|
| 268 | + [ |
|
| 269 | + 'id_parent' => $id_rubrique, |
|
| 270 | + 'champs' => $champs, |
|
| 271 | + ] |
|
| 272 | + ); |
|
| 273 | + $notifications( |
|
| 274 | + 'objet_inserer', |
|
| 275 | + $id_article, |
|
| 276 | + [ |
|
| 277 | + 'objet' => 'article', |
|
| 278 | + 'id_objet' => $id_article, |
|
| 279 | + 'id_parent' => $id_rubrique, |
|
| 280 | + 'champs' => $champs, |
|
| 281 | + ] |
|
| 282 | + ); |
|
| 283 | + } |
|
| 284 | + |
|
| 285 | + return $id_article; |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | |
@@ -310,153 +310,153 @@ discard block |
||
| 310 | 310 | */ |
| 311 | 311 | function article_instituer($id_article, $c, $calcul_rub = true) { |
| 312 | 312 | |
| 313 | - include_spip('inc/autoriser'); |
|
| 314 | - include_spip('inc/rubriques'); |
|
| 315 | - include_spip('inc/modifier'); |
|
| 316 | - |
|
| 317 | - $row = sql_fetsel('statut, date, id_rubrique', 'spip_articles', "id_article=$id_article"); |
|
| 318 | - $id_rubrique = $row['id_rubrique']; |
|
| 319 | - $statut_ancien = $statut = $row['statut']; |
|
| 320 | - $date_ancienne = $date = $row['date']; |
|
| 321 | - $champs = []; |
|
| 322 | - |
|
| 323 | - $d = $c['date'] ?? null; |
|
| 324 | - $s = $c['statut'] ?? $statut; |
|
| 325 | - |
|
| 326 | - // cf autorisations dans inc/instituer_article |
|
| 327 | - if ($s != $statut or ($d and $d != $date)) { |
|
| 328 | - if (autoriser('publierdans', 'rubrique', $id_rubrique)) { |
|
| 329 | - $statut = $champs['statut'] = $s; |
|
| 330 | - } elseif (autoriser('modifier', 'article', $id_article) and $s != 'publie') { |
|
| 331 | - $statut = $champs['statut'] = $s; |
|
| 332 | - } else { |
|
| 333 | - spip_log("editer_article $id_article refus " . join(' ', $c)); |
|
| 334 | - } |
|
| 335 | - |
|
| 336 | - // En cas de publication, fixer la date a "maintenant" |
|
| 337 | - // sauf si $c commande autre chose |
|
| 338 | - // ou si l'article est deja date dans le futur |
|
| 339 | - // En cas de proposition d'un article (mais pas depublication), idem |
|
| 340 | - if ( |
|
| 341 | - $champs['statut'] == 'publie' |
|
| 342 | - or ($champs['statut'] == 'prop' and ($d or !in_array($statut_ancien, ['publie', 'prop']))) |
|
| 343 | - ) { |
|
| 344 | - if ($d or strtotime($d = $date) > time()) { |
|
| 345 | - $champs['date'] = $date = $d; |
|
| 346 | - } else { |
|
| 347 | - $champs['date'] = $date = date('Y-m-d H:i:s'); |
|
| 348 | - } |
|
| 349 | - } |
|
| 350 | - } |
|
| 351 | - |
|
| 352 | - // Verifier que la rubrique demandee existe et est differente |
|
| 353 | - // de la rubrique actuelle |
|
| 354 | - if ( |
|
| 355 | - isset($c['id_parent']) |
|
| 356 | - and $id_parent = $c['id_parent'] |
|
| 357 | - and $id_parent != $id_rubrique |
|
| 358 | - and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique=' . intval($id_parent))) |
|
| 359 | - ) { |
|
| 360 | - $champs['id_rubrique'] = $id_parent; |
|
| 361 | - |
|
| 362 | - // si l'article etait publie |
|
| 363 | - // et que le demandeur n'est pas admin de la rubrique de destination |
|
| 364 | - // repasser l'article en statut 'propose'. |
|
| 365 | - if ( |
|
| 366 | - $statut == 'publie' |
|
| 367 | - and !autoriser('publierdans', 'rubrique', $id_parent) |
|
| 368 | - ) { |
|
| 369 | - $champs['statut'] = 'prop'; |
|
| 370 | - } |
|
| 371 | - } |
|
| 372 | - |
|
| 373 | - // Envoyer aux plugins |
|
| 374 | - $champs = pipeline( |
|
| 375 | - 'pre_edition', |
|
| 376 | - [ |
|
| 377 | - 'args' => [ |
|
| 378 | - 'table' => 'spip_articles', |
|
| 379 | - 'id_objet' => $id_article, |
|
| 380 | - 'action' => 'instituer', |
|
| 381 | - 'statut_ancien' => $statut_ancien, |
|
| 382 | - 'date_ancienne' => $date_ancienne, |
|
| 383 | - ], |
|
| 384 | - 'data' => $champs |
|
| 385 | - ] |
|
| 386 | - ); |
|
| 387 | - |
|
| 388 | - if (!(is_countable($champs) ? count($champs) : 0)) { |
|
| 389 | - return ''; |
|
| 390 | - } |
|
| 391 | - |
|
| 392 | - // Envoyer les modifs. |
|
| 393 | - editer_article_heritage($id_article, $id_rubrique, $statut_ancien, $champs, $calcul_rub); |
|
| 394 | - |
|
| 395 | - // Invalider les caches |
|
| 396 | - include_spip('inc/invalideur'); |
|
| 397 | - suivre_invalideur("id='article/$id_article'"); |
|
| 398 | - |
|
| 399 | - if ($date) { |
|
| 400 | - $t = strtotime($date); |
|
| 401 | - $p = @$GLOBALS['meta']['date_prochain_postdate']; |
|
| 402 | - if ($t > time() and (!$p or ($t < $p))) { |
|
| 403 | - ecrire_meta('date_prochain_postdate', $t); |
|
| 404 | - } |
|
| 405 | - } |
|
| 406 | - |
|
| 407 | - // Pipeline |
|
| 408 | - pipeline( |
|
| 409 | - 'post_edition', |
|
| 410 | - [ |
|
| 411 | - 'args' => [ |
|
| 412 | - 'table' => 'spip_articles', |
|
| 413 | - 'id_objet' => $id_article, |
|
| 414 | - 'action' => 'instituer', |
|
| 415 | - 'statut_ancien' => $statut_ancien, |
|
| 416 | - 'date_ancienne' => $date_ancienne, |
|
| 417 | - ], |
|
| 418 | - 'data' => $champs |
|
| 419 | - ] |
|
| 420 | - ); |
|
| 421 | - |
|
| 422 | - // Notifications |
|
| 423 | - if ($notifications = charger_fonction('notifications', 'inc')) { |
|
| 424 | - $notifications( |
|
| 425 | - 'article_instituer', |
|
| 426 | - $id_article, |
|
| 427 | - [ |
|
| 428 | - 'statut' => $statut, |
|
| 429 | - 'statut_ancien' => $statut_ancien, |
|
| 430 | - 'date' => $date, |
|
| 431 | - 'date_ancienne' => $date_ancienne, |
|
| 432 | - 'id_parent_ancien' => $id_rubrique, |
|
| 433 | - 'champs' => $champs, |
|
| 434 | - ] |
|
| 435 | - ); |
|
| 436 | - $notifications( |
|
| 437 | - 'objet_instituer', |
|
| 438 | - $id_article, |
|
| 439 | - [ |
|
| 440 | - 'objet' => 'article', |
|
| 441 | - 'id_objet' => $id_article, |
|
| 442 | - 'statut' => $statut, |
|
| 443 | - 'statut_ancien' => $statut_ancien, |
|
| 444 | - 'date' => $date, |
|
| 445 | - 'date_ancienne' => $date_ancienne, |
|
| 446 | - 'id_parent_ancien' => $id_rubrique, |
|
| 447 | - 'champs' => $champs, |
|
| 448 | - ] |
|
| 449 | - ); |
|
| 313 | + include_spip('inc/autoriser'); |
|
| 314 | + include_spip('inc/rubriques'); |
|
| 315 | + include_spip('inc/modifier'); |
|
| 316 | + |
|
| 317 | + $row = sql_fetsel('statut, date, id_rubrique', 'spip_articles', "id_article=$id_article"); |
|
| 318 | + $id_rubrique = $row['id_rubrique']; |
|
| 319 | + $statut_ancien = $statut = $row['statut']; |
|
| 320 | + $date_ancienne = $date = $row['date']; |
|
| 321 | + $champs = []; |
|
| 322 | + |
|
| 323 | + $d = $c['date'] ?? null; |
|
| 324 | + $s = $c['statut'] ?? $statut; |
|
| 325 | + |
|
| 326 | + // cf autorisations dans inc/instituer_article |
|
| 327 | + if ($s != $statut or ($d and $d != $date)) { |
|
| 328 | + if (autoriser('publierdans', 'rubrique', $id_rubrique)) { |
|
| 329 | + $statut = $champs['statut'] = $s; |
|
| 330 | + } elseif (autoriser('modifier', 'article', $id_article) and $s != 'publie') { |
|
| 331 | + $statut = $champs['statut'] = $s; |
|
| 332 | + } else { |
|
| 333 | + spip_log("editer_article $id_article refus " . join(' ', $c)); |
|
| 334 | + } |
|
| 335 | + |
|
| 336 | + // En cas de publication, fixer la date a "maintenant" |
|
| 337 | + // sauf si $c commande autre chose |
|
| 338 | + // ou si l'article est deja date dans le futur |
|
| 339 | + // En cas de proposition d'un article (mais pas depublication), idem |
|
| 340 | + if ( |
|
| 341 | + $champs['statut'] == 'publie' |
|
| 342 | + or ($champs['statut'] == 'prop' and ($d or !in_array($statut_ancien, ['publie', 'prop']))) |
|
| 343 | + ) { |
|
| 344 | + if ($d or strtotime($d = $date) > time()) { |
|
| 345 | + $champs['date'] = $date = $d; |
|
| 346 | + } else { |
|
| 347 | + $champs['date'] = $date = date('Y-m-d H:i:s'); |
|
| 348 | + } |
|
| 349 | + } |
|
| 350 | + } |
|
| 351 | + |
|
| 352 | + // Verifier que la rubrique demandee existe et est differente |
|
| 353 | + // de la rubrique actuelle |
|
| 354 | + if ( |
|
| 355 | + isset($c['id_parent']) |
|
| 356 | + and $id_parent = $c['id_parent'] |
|
| 357 | + and $id_parent != $id_rubrique |
|
| 358 | + and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique=' . intval($id_parent))) |
|
| 359 | + ) { |
|
| 360 | + $champs['id_rubrique'] = $id_parent; |
|
| 361 | + |
|
| 362 | + // si l'article etait publie |
|
| 363 | + // et que le demandeur n'est pas admin de la rubrique de destination |
|
| 364 | + // repasser l'article en statut 'propose'. |
|
| 365 | + if ( |
|
| 366 | + $statut == 'publie' |
|
| 367 | + and !autoriser('publierdans', 'rubrique', $id_parent) |
|
| 368 | + ) { |
|
| 369 | + $champs['statut'] = 'prop'; |
|
| 370 | + } |
|
| 371 | + } |
|
| 372 | + |
|
| 373 | + // Envoyer aux plugins |
|
| 374 | + $champs = pipeline( |
|
| 375 | + 'pre_edition', |
|
| 376 | + [ |
|
| 377 | + 'args' => [ |
|
| 378 | + 'table' => 'spip_articles', |
|
| 379 | + 'id_objet' => $id_article, |
|
| 380 | + 'action' => 'instituer', |
|
| 381 | + 'statut_ancien' => $statut_ancien, |
|
| 382 | + 'date_ancienne' => $date_ancienne, |
|
| 383 | + ], |
|
| 384 | + 'data' => $champs |
|
| 385 | + ] |
|
| 386 | + ); |
|
| 387 | + |
|
| 388 | + if (!(is_countable($champs) ? count($champs) : 0)) { |
|
| 389 | + return ''; |
|
| 390 | + } |
|
| 391 | + |
|
| 392 | + // Envoyer les modifs. |
|
| 393 | + editer_article_heritage($id_article, $id_rubrique, $statut_ancien, $champs, $calcul_rub); |
|
| 394 | + |
|
| 395 | + // Invalider les caches |
|
| 396 | + include_spip('inc/invalideur'); |
|
| 397 | + suivre_invalideur("id='article/$id_article'"); |
|
| 398 | + |
|
| 399 | + if ($date) { |
|
| 400 | + $t = strtotime($date); |
|
| 401 | + $p = @$GLOBALS['meta']['date_prochain_postdate']; |
|
| 402 | + if ($t > time() and (!$p or ($t < $p))) { |
|
| 403 | + ecrire_meta('date_prochain_postdate', $t); |
|
| 404 | + } |
|
| 405 | + } |
|
| 406 | + |
|
| 407 | + // Pipeline |
|
| 408 | + pipeline( |
|
| 409 | + 'post_edition', |
|
| 410 | + [ |
|
| 411 | + 'args' => [ |
|
| 412 | + 'table' => 'spip_articles', |
|
| 413 | + 'id_objet' => $id_article, |
|
| 414 | + 'action' => 'instituer', |
|
| 415 | + 'statut_ancien' => $statut_ancien, |
|
| 416 | + 'date_ancienne' => $date_ancienne, |
|
| 417 | + ], |
|
| 418 | + 'data' => $champs |
|
| 419 | + ] |
|
| 420 | + ); |
|
| 421 | + |
|
| 422 | + // Notifications |
|
| 423 | + if ($notifications = charger_fonction('notifications', 'inc')) { |
|
| 424 | + $notifications( |
|
| 425 | + 'article_instituer', |
|
| 426 | + $id_article, |
|
| 427 | + [ |
|
| 428 | + 'statut' => $statut, |
|
| 429 | + 'statut_ancien' => $statut_ancien, |
|
| 430 | + 'date' => $date, |
|
| 431 | + 'date_ancienne' => $date_ancienne, |
|
| 432 | + 'id_parent_ancien' => $id_rubrique, |
|
| 433 | + 'champs' => $champs, |
|
| 434 | + ] |
|
| 435 | + ); |
|
| 436 | + $notifications( |
|
| 437 | + 'objet_instituer', |
|
| 438 | + $id_article, |
|
| 439 | + [ |
|
| 440 | + 'objet' => 'article', |
|
| 441 | + 'id_objet' => $id_article, |
|
| 442 | + 'statut' => $statut, |
|
| 443 | + 'statut_ancien' => $statut_ancien, |
|
| 444 | + 'date' => $date, |
|
| 445 | + 'date_ancienne' => $date_ancienne, |
|
| 446 | + 'id_parent_ancien' => $id_rubrique, |
|
| 447 | + 'champs' => $champs, |
|
| 448 | + ] |
|
| 449 | + ); |
|
| 450 | 450 | |
| 451 | - // Rétro-compat |
|
| 452 | - $notifications( |
|
| 453 | - 'instituerarticle', |
|
| 454 | - $id_article, |
|
| 455 | - ['statut' => $statut, 'statut_ancien' => $statut_ancien, 'date' => $date, 'date_ancienne' => $date_ancienne] |
|
| 456 | - ); |
|
| 457 | - } |
|
| 458 | - |
|
| 459 | - return ''; // pas d'erreur |
|
| 451 | + // Rétro-compat |
|
| 452 | + $notifications( |
|
| 453 | + 'instituerarticle', |
|
| 454 | + $id_article, |
|
| 455 | + ['statut' => $statut, 'statut_ancien' => $statut_ancien, 'date' => $date, 'date_ancienne' => $date_ancienne] |
|
| 456 | + ); |
|
| 457 | + } |
|
| 458 | + |
|
| 459 | + return ''; // pas d'erreur |
|
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | /** |
@@ -481,37 +481,37 @@ discard block |
||
| 481 | 481 | */ |
| 482 | 482 | function editer_article_heritage($id_article, $id_rubrique, $statut, $champs, $cond = true) { |
| 483 | 483 | |
| 484 | - // Si on deplace l'article |
|
| 485 | - // changer aussi son secteur et sa langue (si heritee) |
|
| 486 | - if (isset($champs['id_rubrique'])) { |
|
| 487 | - $row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique=' . sql_quote($champs['id_rubrique'])); |
|
| 488 | - |
|
| 489 | - $langue = $row_rub['lang']; |
|
| 490 | - $champs['id_secteur'] = $row_rub['id_secteur']; |
|
| 491 | - if ( |
|
| 492 | - sql_fetsel( |
|
| 493 | - '1', |
|
| 494 | - 'spip_articles', |
|
| 495 | - 'id_article=' . intval($id_article) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue) |
|
| 496 | - ) |
|
| 497 | - ) { |
|
| 498 | - $champs['lang'] = $langue; |
|
| 499 | - } |
|
| 500 | - } |
|
| 501 | - |
|
| 502 | - if (!$champs) { |
|
| 503 | - return; |
|
| 504 | - } |
|
| 505 | - |
|
| 506 | - sql_updateq('spip_articles', $champs, 'id_article=' . intval($id_article)); |
|
| 507 | - |
|
| 508 | - // Changer le statut des rubriques concernees |
|
| 509 | - |
|
| 510 | - if ($cond) { |
|
| 511 | - include_spip('inc/rubriques'); |
|
| 512 | - $postdate = ($GLOBALS['meta']['post_dates'] == 'non' and isset($champs['date']) and (strtotime($champs['date']) < time())) ? $champs['date'] : false; |
|
| 513 | - calculer_rubriques_if($id_rubrique, $champs, ['statut_ancien' => $statut], $postdate); |
|
| 514 | - } |
|
| 484 | + // Si on deplace l'article |
|
| 485 | + // changer aussi son secteur et sa langue (si heritee) |
|
| 486 | + if (isset($champs['id_rubrique'])) { |
|
| 487 | + $row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique=' . sql_quote($champs['id_rubrique'])); |
|
| 488 | + |
|
| 489 | + $langue = $row_rub['lang']; |
|
| 490 | + $champs['id_secteur'] = $row_rub['id_secteur']; |
|
| 491 | + if ( |
|
| 492 | + sql_fetsel( |
|
| 493 | + '1', |
|
| 494 | + 'spip_articles', |
|
| 495 | + 'id_article=' . intval($id_article) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue) |
|
| 496 | + ) |
|
| 497 | + ) { |
|
| 498 | + $champs['lang'] = $langue; |
|
| 499 | + } |
|
| 500 | + } |
|
| 501 | + |
|
| 502 | + if (!$champs) { |
|
| 503 | + return; |
|
| 504 | + } |
|
| 505 | + |
|
| 506 | + sql_updateq('spip_articles', $champs, 'id_article=' . intval($id_article)); |
|
| 507 | + |
|
| 508 | + // Changer le statut des rubriques concernees |
|
| 509 | + |
|
| 510 | + if ($cond) { |
|
| 511 | + include_spip('inc/rubriques'); |
|
| 512 | + $postdate = ($GLOBALS['meta']['post_dates'] == 'non' and isset($champs['date']) and (strtotime($champs['date']) < time())) ? $champs['date'] : false; |
|
| 513 | + calculer_rubriques_if($id_rubrique, $champs, ['statut_ancien' => $statut], $postdate); |
|
| 514 | + } |
|
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | /** |
@@ -520,10 +520,10 @@ discard block |
||
| 520 | 520 | * @return void |
| 521 | 521 | */ |
| 522 | 522 | function trop_longs_articles() { |
| 523 | - if (is_array($plus = _request('texte_plus'))) { |
|
| 524 | - foreach ($plus as $n => $t) { |
|
| 525 | - $plus[$n] = preg_replace(",<!--SPIP-->[\n\r]*,", '', $t); |
|
| 526 | - } |
|
| 527 | - set_request('texte', join('', $plus) . _request('texte')); |
|
| 528 | - } |
|
| 523 | + if (is_array($plus = _request('texte_plus'))) { |
|
| 524 | + foreach ($plus as $n => $t) { |
|
| 525 | + $plus[$n] = preg_replace(",<!--SPIP-->[\n\r]*,", '', $t); |
|
| 526 | + } |
|
| 527 | + set_request('texte', join('', $plus) . _request('texte')); |
|
| 528 | + } |
|
| 529 | 529 | } |