@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | 13 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 14 | - return; |
|
| 14 | + return; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | defined('URLS_PAGE_EXEMPLE') || define('URLS_PAGE_EXEMPLE', 'spip.php?article12'); |
@@ -37,23 +37,23 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | function urls_page_generer_url_objet_dist(int $id, string $objet, string $args = '', string $ancre = ''): string { |
| 39 | 39 | |
| 40 | - if ($generer_url_externe = charger_fonction_url($objet, 'defaut')) { |
|
| 41 | - $url = $generer_url_externe($id, $args, $ancre); |
|
| 42 | - // une url === null indique "je ne traite pas cette url, appliquez le calcul standard" |
|
| 43 | - // une url vide est une url vide, ne rien faire de plus |
|
| 44 | - if (!is_null($url)) { |
|
| 45 | - return $url; |
|
| 46 | - } |
|
| 47 | - } |
|
| 40 | + if ($generer_url_externe = charger_fonction_url($objet, 'defaut')) { |
|
| 41 | + $url = $generer_url_externe($id, $args, $ancre); |
|
| 42 | + // une url === null indique "je ne traite pas cette url, appliquez le calcul standard" |
|
| 43 | + // une url vide est une url vide, ne rien faire de plus |
|
| 44 | + if (!is_null($url)) { |
|
| 45 | + return $url; |
|
| 46 | + } |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - $url = \_debut_urls_page . $objet . \_separateur_urls_page |
|
| 50 | - . $id . \_terminaison_urls_page; |
|
| 49 | + $url = \_debut_urls_page . $objet . \_separateur_urls_page |
|
| 50 | + . $id . \_terminaison_urls_page; |
|
| 51 | 51 | |
| 52 | - if ($args) { |
|
| 53 | - $args = strpos($url, '?') ? "&$args" : "?$args"; |
|
| 54 | - } |
|
| 52 | + if ($args) { |
|
| 53 | + $args = strpos($url, '?') ? "&$args" : "?$args"; |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - return _DIR_RACINE . $url . $args . ($ancre ? "#$ancre" : ''); |
|
| 56 | + return _DIR_RACINE . $url . $args . ($ancre ? "#$ancre" : ''); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -69,27 +69,27 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | function urls_page_decoder_url_dist(string $url, string $entite, array $contexte = []): array { |
| 71 | 71 | |
| 72 | - // traiter les injections du type domaine.org/spip.php/cestnimportequoi/ou/encore/plus/rubrique23 |
|
| 73 | - if ($GLOBALS['profondeur_url'] > 0 and $entite == 'sommaire') { |
|
| 74 | - return [[], '404']; |
|
| 75 | - } |
|
| 72 | + // traiter les injections du type domaine.org/spip.php/cestnimportequoi/ou/encore/plus/rubrique23 |
|
| 73 | + if ($GLOBALS['profondeur_url'] > 0 and $entite == 'sommaire') { |
|
| 74 | + return [[], '404']; |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - include_spip('inc/urls'); |
|
| 78 | - $r = nettoyer_url_page($url, $contexte); |
|
| 79 | - if ($r) { |
|
| 80 | - array_pop($r); // nettoyer_url_page renvoie un argument de plus inutile ici |
|
| 81 | - return $r; |
|
| 82 | - } |
|
| 77 | + include_spip('inc/urls'); |
|
| 78 | + $r = nettoyer_url_page($url, $contexte); |
|
| 79 | + if ($r) { |
|
| 80 | + array_pop($r); // nettoyer_url_page renvoie un argument de plus inutile ici |
|
| 81 | + return $r; |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - /* |
|
| 84 | + /* |
|
| 85 | 85 | * Le bloc qui suit sert a faciliter les transitions depuis |
| 86 | 86 | * le mode 'urls-propres' vers les modes 'urls-standard' et 'url-html' |
| 87 | 87 | * Il est inutile de le recopier si vous personnalisez vos URLs |
| 88 | 88 | * et votre .htaccess |
| 89 | 89 | */ |
| 90 | - // Si on est revenu en mode html, mais c'est une ancienne url_propre |
|
| 91 | - // on ne redirige pas, on assume le nouveau contexte (si possible) |
|
| 92 | - $url_propre = $url ?? $_SERVER['REDIRECT_url_propre'] ?? $_ENV['url_propre'] ?? ''; |
|
| 93 | - return urls_transition_retrouver_anciennes_url_propres($url_propre, $entite, $contexte); |
|
| 94 | - /* Fin du bloc compatibilite url-propres */ |
|
| 90 | + // Si on est revenu en mode html, mais c'est une ancienne url_propre |
|
| 91 | + // on ne redirige pas, on assume le nouveau contexte (si possible) |
|
| 92 | + $url_propre = $url ?? $_SERVER['REDIRECT_url_propre'] ?? $_ENV['url_propre'] ?? ''; |
|
| 93 | + return urls_transition_retrouver_anciennes_url_propres($url_propre, $entite, $contexte); |
|
| 94 | + /* Fin du bloc compatibilite url-propres */ |
|
| 95 | 95 | } |
@@ -17,13 +17,13 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | if (!defined('IMG_SVG')) { |
| 24 | - // complete IMG_BMP | IMG_GIF | IMG_JPG | IMG_PNG | IMG_WBMP | IMG_XPM | IMG_WEBP |
|
| 25 | - define('IMG_SVG', 128); |
|
| 26 | - define('IMAGETYPE_SVG', 19); |
|
| 24 | + // complete IMG_BMP | IMG_GIF | IMG_JPG | IMG_PNG | IMG_WBMP | IMG_XPM | IMG_WEBP |
|
| 25 | + define('IMG_SVG', 128); |
|
| 26 | + define('IMAGETYPE_SVG', 19); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -39,39 +39,39 @@ discard block |
||
| 39 | 39 | * false si on a pas pu charger l'image |
| 40 | 40 | */ |
| 41 | 41 | function svg_charger($fichier, $maxlen = null) { |
| 42 | - if (strpos($fichier, 'data:image/svg+xml') === 0) { |
|
| 43 | - $image = explode(';', $fichier, 2); |
|
| 44 | - $image = end($image); |
|
| 45 | - if (strpos($image, 'base64,') === 0) { |
|
| 46 | - $image = base64_decode(substr($image, 7)); |
|
| 47 | - } |
|
| 48 | - if (strpos($image, '<svg') !== false) { |
|
| 49 | - return $image; |
|
| 50 | - } |
|
| 51 | - // encodage inconnu ou autre format d'image ? |
|
| 52 | - return false; |
|
| 53 | - } |
|
| 54 | - // c'est peut etre deja une image svg ? |
|
| 55 | - if (strpos($fichier, '<svg') !== false) { |
|
| 56 | - return $fichier; |
|
| 57 | - } |
|
| 58 | - if (!file_exists($fichier)) { |
|
| 59 | - $fichier = supprimer_timestamp($fichier); |
|
| 60 | - if (!file_exists($fichier)) { |
|
| 61 | - return false; |
|
| 62 | - } |
|
| 63 | - } |
|
| 64 | - if (is_null($maxlen)) { |
|
| 65 | - $image = file_get_contents($fichier); |
|
| 66 | - } |
|
| 67 | - else { |
|
| 68 | - $image = file_get_contents($fichier, false, null, 0, $maxlen); |
|
| 69 | - } |
|
| 70 | - // est-ce bien une image svg ? |
|
| 71 | - if (strpos($image, '<svg') !== false) { |
|
| 72 | - return $image; |
|
| 73 | - } |
|
| 74 | - return false; |
|
| 42 | + if (strpos($fichier, 'data:image/svg+xml') === 0) { |
|
| 43 | + $image = explode(';', $fichier, 2); |
|
| 44 | + $image = end($image); |
|
| 45 | + if (strpos($image, 'base64,') === 0) { |
|
| 46 | + $image = base64_decode(substr($image, 7)); |
|
| 47 | + } |
|
| 48 | + if (strpos($image, '<svg') !== false) { |
|
| 49 | + return $image; |
|
| 50 | + } |
|
| 51 | + // encodage inconnu ou autre format d'image ? |
|
| 52 | + return false; |
|
| 53 | + } |
|
| 54 | + // c'est peut etre deja une image svg ? |
|
| 55 | + if (strpos($fichier, '<svg') !== false) { |
|
| 56 | + return $fichier; |
|
| 57 | + } |
|
| 58 | + if (!file_exists($fichier)) { |
|
| 59 | + $fichier = supprimer_timestamp($fichier); |
|
| 60 | + if (!file_exists($fichier)) { |
|
| 61 | + return false; |
|
| 62 | + } |
|
| 63 | + } |
|
| 64 | + if (is_null($maxlen)) { |
|
| 65 | + $image = file_get_contents($fichier); |
|
| 66 | + } |
|
| 67 | + else { |
|
| 68 | + $image = file_get_contents($fichier, false, null, 0, $maxlen); |
|
| 69 | + } |
|
| 70 | + // est-ce bien une image svg ? |
|
| 71 | + if (strpos($image, '<svg') !== false) { |
|
| 72 | + return $image; |
|
| 73 | + } |
|
| 74 | + return false; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -80,28 +80,28 @@ discard block |
||
| 80 | 80 | * @return array|bool |
| 81 | 81 | */ |
| 82 | 82 | function svg_lire_balise_svg($fichier) { |
| 83 | - if (!$debut_fichier = svg_charger($fichier, 4096)) { |
|
| 84 | - return false; |
|
| 85 | - } |
|
| 86 | - |
|
| 87 | - if (($ps = stripos($debut_fichier, '<svg')) !== false) { |
|
| 88 | - $pe = stripos($debut_fichier, '>', $ps); |
|
| 89 | - $balise_svg = substr($debut_fichier, $ps, $pe - $ps + 1); |
|
| 90 | - |
|
| 91 | - if (preg_match_all(',([\w:\-]+)=,Uims', $balise_svg, $matches)) { |
|
| 92 | - if (!function_exists('extraire_attribut')) { |
|
| 93 | - include_spip('inc/filtres'); |
|
| 94 | - } |
|
| 95 | - $attributs = []; |
|
| 96 | - foreach ($matches[1] as $att) { |
|
| 97 | - $attributs[$att] = extraire_attribut($balise_svg, $att); |
|
| 98 | - } |
|
| 99 | - |
|
| 100 | - return [$balise_svg, $attributs]; |
|
| 101 | - } |
|
| 102 | - } |
|
| 103 | - |
|
| 104 | - return false; |
|
| 83 | + if (!$debut_fichier = svg_charger($fichier, 4096)) { |
|
| 84 | + return false; |
|
| 85 | + } |
|
| 86 | + |
|
| 87 | + if (($ps = stripos($debut_fichier, '<svg')) !== false) { |
|
| 88 | + $pe = stripos($debut_fichier, '>', $ps); |
|
| 89 | + $balise_svg = substr($debut_fichier, $ps, $pe - $ps + 1); |
|
| 90 | + |
|
| 91 | + if (preg_match_all(',([\w:\-]+)=,Uims', $balise_svg, $matches)) { |
|
| 92 | + if (!function_exists('extraire_attribut')) { |
|
| 93 | + include_spip('inc/filtres'); |
|
| 94 | + } |
|
| 95 | + $attributs = []; |
|
| 96 | + foreach ($matches[1] as $att) { |
|
| 97 | + $attributs[$att] = extraire_attribut($balise_svg, $att); |
|
| 98 | + } |
|
| 99 | + |
|
| 100 | + return [$balise_svg, $attributs]; |
|
| 101 | + } |
|
| 102 | + } |
|
| 103 | + |
|
| 104 | + return false; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -111,12 +111,12 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | function svg_lire_attributs($img) { |
| 113 | 113 | |
| 114 | - if ($svg_infos = svg_lire_balise_svg($img)) { |
|
| 115 | - [$balise_svg, $attributs] = $svg_infos; |
|
| 116 | - return $attributs; |
|
| 117 | - } |
|
| 114 | + if ($svg_infos = svg_lire_balise_svg($img)) { |
|
| 115 | + [$balise_svg, $attributs] = $svg_infos; |
|
| 116 | + return $attributs; |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | - return false; |
|
| 119 | + return false; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -126,38 +126,38 @@ discard block |
||
| 126 | 126 | * @return bool|float|int |
| 127 | 127 | */ |
| 128 | 128 | function svg_dimension_to_pixels($dimension, $precision = 2) { |
| 129 | - if (preg_match(',^(-?\d+(\.\d+)?)([^\d]*),i', trim($dimension), $m)) { |
|
| 130 | - switch (strtolower($m[2])) { |
|
| 131 | - case '%': |
|
| 132 | - // on ne sait pas faire :( |
|
| 133 | - return false; |
|
| 134 | - break; |
|
| 135 | - case 'em': |
|
| 136 | - return round($m[1] * 16, $precision); // 16px font-size par defaut |
|
| 137 | - break; |
|
| 138 | - case 'ex': |
|
| 139 | - return round($m[1] * 16, $precision); // 16px font-size par defaut |
|
| 140 | - break; |
|
| 141 | - case 'pc': |
|
| 142 | - return round($m[1] * 16, $precision); // 1/6 inch = 96px/6 in CSS |
|
| 143 | - break; |
|
| 144 | - case 'cm': |
|
| 145 | - return round($m[1] * 96 / 2.54, $precision); // 96px / 2.54cm; |
|
| 146 | - break; |
|
| 147 | - case 'mm': |
|
| 148 | - return round($m[1] * 96 / 25.4, $precision); // 96px / 25.4mm; |
|
| 149 | - break; |
|
| 150 | - case 'in': |
|
| 151 | - return round($m[1] * 96, $precision); // 1 inch = 96px in CSS |
|
| 152 | - break; |
|
| 153 | - case 'px': |
|
| 154 | - case 'pt': |
|
| 155 | - default: |
|
| 156 | - return $m[1]; |
|
| 157 | - break; |
|
| 158 | - } |
|
| 159 | - } |
|
| 160 | - return false; |
|
| 129 | + if (preg_match(',^(-?\d+(\.\d+)?)([^\d]*),i', trim($dimension), $m)) { |
|
| 130 | + switch (strtolower($m[2])) { |
|
| 131 | + case '%': |
|
| 132 | + // on ne sait pas faire :( |
|
| 133 | + return false; |
|
| 134 | + break; |
|
| 135 | + case 'em': |
|
| 136 | + return round($m[1] * 16, $precision); // 16px font-size par defaut |
|
| 137 | + break; |
|
| 138 | + case 'ex': |
|
| 139 | + return round($m[1] * 16, $precision); // 16px font-size par defaut |
|
| 140 | + break; |
|
| 141 | + case 'pc': |
|
| 142 | + return round($m[1] * 16, $precision); // 1/6 inch = 96px/6 in CSS |
|
| 143 | + break; |
|
| 144 | + case 'cm': |
|
| 145 | + return round($m[1] * 96 / 2.54, $precision); // 96px / 2.54cm; |
|
| 146 | + break; |
|
| 147 | + case 'mm': |
|
| 148 | + return round($m[1] * 96 / 25.4, $precision); // 96px / 25.4mm; |
|
| 149 | + break; |
|
| 150 | + case 'in': |
|
| 151 | + return round($m[1] * 96, $precision); // 1 inch = 96px in CSS |
|
| 152 | + break; |
|
| 153 | + case 'px': |
|
| 154 | + case 'pt': |
|
| 155 | + default: |
|
| 156 | + return $m[1]; |
|
| 157 | + break; |
|
| 158 | + } |
|
| 159 | + } |
|
| 160 | + return false; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -168,15 +168,15 @@ discard block |
||
| 168 | 168 | * @return string |
| 169 | 169 | */ |
| 170 | 170 | function svg_change_balise_svg($svg, $old_balise_svg, $attributs) { |
| 171 | - $new_balise_svg = '<svg'; |
|
| 172 | - foreach ($attributs as $k => $v) { |
|
| 173 | - $new_balise_svg .= " $k=\"" . entites_html($v) . '"'; |
|
| 174 | - } |
|
| 175 | - $new_balise_svg .= '>'; |
|
| 176 | - |
|
| 177 | - $p = strpos($svg, $old_balise_svg); |
|
| 178 | - $svg = substr_replace($svg, $new_balise_svg, $p, strlen($old_balise_svg)); |
|
| 179 | - return $svg; |
|
| 171 | + $new_balise_svg = '<svg'; |
|
| 172 | + foreach ($attributs as $k => $v) { |
|
| 173 | + $new_balise_svg .= " $k=\"" . entites_html($v) . '"'; |
|
| 174 | + } |
|
| 175 | + $new_balise_svg .= '>'; |
|
| 176 | + |
|
| 177 | + $p = strpos($svg, $old_balise_svg); |
|
| 178 | + $svg = substr_replace($svg, $new_balise_svg, $p, strlen($old_balise_svg)); |
|
| 179 | + return $svg; |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | /** |
@@ -188,15 +188,15 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | function svg_insert_shapes($svg, $shapes, $start = true) { |
| 190 | 190 | |
| 191 | - if ($start === false or $start === 'end') { |
|
| 192 | - $svg = str_replace('</svg>', $shapes . '</svg>', $svg); |
|
| 193 | - } |
|
| 194 | - else { |
|
| 195 | - $p = stripos($svg, '<svg'); |
|
| 196 | - $p = strpos($svg, '>', $p); |
|
| 197 | - $svg = substr_replace($svg, $shapes, $p + 1, 0); |
|
| 198 | - } |
|
| 199 | - return $svg; |
|
| 191 | + if ($start === false or $start === 'end') { |
|
| 192 | + $svg = str_replace('</svg>', $shapes . '</svg>', $svg); |
|
| 193 | + } |
|
| 194 | + else { |
|
| 195 | + $p = stripos($svg, '<svg'); |
|
| 196 | + $p = strpos($svg, '>', $p); |
|
| 197 | + $svg = substr_replace($svg, $shapes, $p + 1, 0); |
|
| 198 | + } |
|
| 199 | + return $svg; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | /** |
@@ -209,13 +209,13 @@ discard block |
||
| 209 | 209 | * @return string |
| 210 | 210 | */ |
| 211 | 211 | function svg_clip_in_box($svg, $x, $y, $width, $height) { |
| 212 | - $rect = "<rect x=\"$x\" y=\"$y\" width=\"$width\" height=\"$height\" />"; |
|
| 213 | - $id = 'clip-' . substr(md5($rect . strlen($svg)), 0, 8); |
|
| 214 | - $clippath = "<clipPath id=\"$id\">$rect</clipPath>"; |
|
| 215 | - $g = "<g clip-path=\"url(#$id)\">"; |
|
| 216 | - $svg = svg_insert_shapes($svg, $clippath . $g); |
|
| 217 | - $svg = svg_insert_shapes($svg, '</g>', false); |
|
| 218 | - return $svg; |
|
| 212 | + $rect = "<rect x=\"$x\" y=\"$y\" width=\"$width\" height=\"$height\" />"; |
|
| 213 | + $id = 'clip-' . substr(md5($rect . strlen($svg)), 0, 8); |
|
| 214 | + $clippath = "<clipPath id=\"$id\">$rect</clipPath>"; |
|
| 215 | + $g = "<g clip-path=\"url(#$id)\">"; |
|
| 216 | + $svg = svg_insert_shapes($svg, $clippath . $g); |
|
| 217 | + $svg = svg_insert_shapes($svg, '</g>', false); |
|
| 218 | + return $svg; |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | /** |
@@ -226,22 +226,22 @@ discard block |
||
| 226 | 226 | * @return bool|string |
| 227 | 227 | */ |
| 228 | 228 | function svg_redimensionner($img, $new_width, $new_height) { |
| 229 | - if ( |
|
| 230 | - $svg = svg_charger($img) |
|
| 231 | - and $svg_infos = svg_lire_balise_svg($svg) |
|
| 232 | - ) { |
|
| 233 | - [$balise_svg, $attributs] = $svg_infos; |
|
| 234 | - if (!isset($attributs['viewBox'])) { |
|
| 235 | - $attributs['viewBox'] = '0 0 ' . $attributs['width'] . ' ' . $attributs['height']; |
|
| 236 | - } |
|
| 237 | - $attributs['width'] = strval($new_width); |
|
| 238 | - $attributs['height'] = strval($new_height); |
|
| 239 | - |
|
| 240 | - $svg = svg_change_balise_svg($svg, $balise_svg, $attributs); |
|
| 241 | - return $svg; |
|
| 242 | - } |
|
| 243 | - |
|
| 244 | - return $img; |
|
| 229 | + if ( |
|
| 230 | + $svg = svg_charger($img) |
|
| 231 | + and $svg_infos = svg_lire_balise_svg($svg) |
|
| 232 | + ) { |
|
| 233 | + [$balise_svg, $attributs] = $svg_infos; |
|
| 234 | + if (!isset($attributs['viewBox'])) { |
|
| 235 | + $attributs['viewBox'] = '0 0 ' . $attributs['width'] . ' ' . $attributs['height']; |
|
| 236 | + } |
|
| 237 | + $attributs['width'] = strval($new_width); |
|
| 238 | + $attributs['height'] = strval($new_height); |
|
| 239 | + |
|
| 240 | + $svg = svg_change_balise_svg($svg, $balise_svg, $attributs); |
|
| 241 | + return $svg; |
|
| 242 | + } |
|
| 243 | + |
|
| 244 | + return $img; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /** |
@@ -250,15 +250,15 @@ discard block |
||
| 250 | 250 | * @return string |
| 251 | 251 | */ |
| 252 | 252 | function svg_couleur_to_hexa($couleur) { |
| 253 | - if (strpos($couleur, 'rgb(') === 0) { |
|
| 254 | - $c = explode(',', substr($couleur, 4)); |
|
| 255 | - $couleur = _couleur_dec_to_hex(intval($c[0]), intval($c[1]), intval($c[2])); |
|
| 256 | - } |
|
| 257 | - else { |
|
| 258 | - $couleur = couleur_html_to_hex($couleur); |
|
| 259 | - } |
|
| 260 | - $couleur = '#' . ltrim($couleur, '#'); |
|
| 261 | - return $couleur; |
|
| 253 | + if (strpos($couleur, 'rgb(') === 0) { |
|
| 254 | + $c = explode(',', substr($couleur, 4)); |
|
| 255 | + $couleur = _couleur_dec_to_hex(intval($c[0]), intval($c[1]), intval($c[2])); |
|
| 256 | + } |
|
| 257 | + else { |
|
| 258 | + $couleur = couleur_html_to_hex($couleur); |
|
| 259 | + } |
|
| 260 | + $couleur = '#' . ltrim($couleur, '#'); |
|
| 261 | + return $couleur; |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | /** |
@@ -267,11 +267,11 @@ discard block |
||
| 267 | 267 | * @return array |
| 268 | 268 | */ |
| 269 | 269 | function svg_couleur_to_rgb($couleur) { |
| 270 | - if (strpos($couleur, 'rgb(') === 0) { |
|
| 271 | - $c = explode(',', substr($couleur, 4)); |
|
| 272 | - return ['red' => intval($c[0]),'green' => intval($c[1]),'blue' => intval($c[2])]; |
|
| 273 | - } |
|
| 274 | - return _couleur_hex_to_dec($couleur); |
|
| 270 | + if (strpos($couleur, 'rgb(') === 0) { |
|
| 271 | + $c = explode(',', substr($couleur, 4)); |
|
| 272 | + return ['red' => intval($c[0]),'green' => intval($c[1]),'blue' => intval($c[2])]; |
|
| 273 | + } |
|
| 274 | + return _couleur_hex_to_dec($couleur); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
@@ -281,80 +281,80 @@ discard block |
||
| 281 | 281 | * @return array |
| 282 | 282 | */ |
| 283 | 283 | function svg_getimagesize_from_attr($attributs) { |
| 284 | - $width = 350; // default width |
|
| 285 | - $height = 150; // default height |
|
| 286 | - |
|
| 287 | - $viewBox = "0 0 $width $height"; |
|
| 288 | - if (isset($attributs['viewBox'])) { |
|
| 289 | - $viewBox = $attributs['viewBox']; |
|
| 290 | - $viewBox = preg_replace(',\s+,', ' ', $viewBox); |
|
| 291 | - } |
|
| 292 | - // et on la convertit en px |
|
| 293 | - $viewBox = explode(' ', $viewBox); |
|
| 294 | - $viewBox = array_map('svg_dimension_to_pixels', $viewBox); |
|
| 295 | - if (!$viewBox[2]) { |
|
| 296 | - $viewBox[2] = $width; |
|
| 297 | - } |
|
| 298 | - if (!$viewBox[3]) { |
|
| 299 | - $viewBox[3] = $height; |
|
| 300 | - } |
|
| 301 | - |
|
| 302 | - $coeff = 1; |
|
| 303 | - if ( |
|
| 304 | - isset($attributs['width']) |
|
| 305 | - and $w = svg_dimension_to_pixels($attributs['width']) |
|
| 306 | - ) { |
|
| 307 | - $width = $w; |
|
| 308 | - // si on avait pas de viewBox, la construire a partir de ce width |
|
| 309 | - if (empty($attributs['viewBox'])) { |
|
| 310 | - $viewBox[2] = $width; |
|
| 311 | - // si pas de height valide, on suppose l'image carree |
|
| 312 | - $viewBox[3] = $width; |
|
| 313 | - } |
|
| 314 | - } |
|
| 315 | - else { |
|
| 316 | - // si on recupere la taille de la viewbox mais si la viewbox est petite on met un multiplicateur pour la taille finale |
|
| 317 | - $width = $viewBox[2]; |
|
| 318 | - if ($width < 1) { |
|
| 319 | - $coeff = max($coeff, 1000); |
|
| 320 | - } |
|
| 321 | - elseif ($width < 10) { |
|
| 322 | - $coeff = max($coeff, 100); |
|
| 323 | - } |
|
| 324 | - elseif ($width < 100) { |
|
| 325 | - $coeff = max($coeff, 10); |
|
| 326 | - } |
|
| 327 | - } |
|
| 328 | - if ( |
|
| 329 | - isset($attributs['height']) |
|
| 330 | - and $h = svg_dimension_to_pixels($attributs['height']) |
|
| 331 | - ) { |
|
| 332 | - $height = $h; |
|
| 333 | - // si on avait pas de viewBox, la construire a partir de ce height |
|
| 334 | - if (empty($attributs['viewBox'])) { |
|
| 335 | - $viewBox[3] = $height; |
|
| 336 | - } |
|
| 337 | - } |
|
| 338 | - else { |
|
| 339 | - $height = $viewBox[3]; |
|
| 340 | - if ($height < 1) { |
|
| 341 | - $coeff = max($coeff, 1000); |
|
| 342 | - } |
|
| 343 | - elseif ($height < 10) { |
|
| 344 | - $coeff = max($coeff, 100); |
|
| 345 | - } |
|
| 346 | - elseif ($height < 100) { |
|
| 347 | - $coeff = max($coeff, 10); |
|
| 348 | - } |
|
| 349 | - } |
|
| 350 | - |
|
| 351 | - // arrondir le width et height en pixel in fine |
|
| 352 | - $width = round($coeff * $width); |
|
| 353 | - $height = round($coeff * $height); |
|
| 354 | - |
|
| 355 | - $viewBox = implode(' ', $viewBox); |
|
| 356 | - |
|
| 357 | - return [$width, $height, $viewBox]; |
|
| 284 | + $width = 350; // default width |
|
| 285 | + $height = 150; // default height |
|
| 286 | + |
|
| 287 | + $viewBox = "0 0 $width $height"; |
|
| 288 | + if (isset($attributs['viewBox'])) { |
|
| 289 | + $viewBox = $attributs['viewBox']; |
|
| 290 | + $viewBox = preg_replace(',\s+,', ' ', $viewBox); |
|
| 291 | + } |
|
| 292 | + // et on la convertit en px |
|
| 293 | + $viewBox = explode(' ', $viewBox); |
|
| 294 | + $viewBox = array_map('svg_dimension_to_pixels', $viewBox); |
|
| 295 | + if (!$viewBox[2]) { |
|
| 296 | + $viewBox[2] = $width; |
|
| 297 | + } |
|
| 298 | + if (!$viewBox[3]) { |
|
| 299 | + $viewBox[3] = $height; |
|
| 300 | + } |
|
| 301 | + |
|
| 302 | + $coeff = 1; |
|
| 303 | + if ( |
|
| 304 | + isset($attributs['width']) |
|
| 305 | + and $w = svg_dimension_to_pixels($attributs['width']) |
|
| 306 | + ) { |
|
| 307 | + $width = $w; |
|
| 308 | + // si on avait pas de viewBox, la construire a partir de ce width |
|
| 309 | + if (empty($attributs['viewBox'])) { |
|
| 310 | + $viewBox[2] = $width; |
|
| 311 | + // si pas de height valide, on suppose l'image carree |
|
| 312 | + $viewBox[3] = $width; |
|
| 313 | + } |
|
| 314 | + } |
|
| 315 | + else { |
|
| 316 | + // si on recupere la taille de la viewbox mais si la viewbox est petite on met un multiplicateur pour la taille finale |
|
| 317 | + $width = $viewBox[2]; |
|
| 318 | + if ($width < 1) { |
|
| 319 | + $coeff = max($coeff, 1000); |
|
| 320 | + } |
|
| 321 | + elseif ($width < 10) { |
|
| 322 | + $coeff = max($coeff, 100); |
|
| 323 | + } |
|
| 324 | + elseif ($width < 100) { |
|
| 325 | + $coeff = max($coeff, 10); |
|
| 326 | + } |
|
| 327 | + } |
|
| 328 | + if ( |
|
| 329 | + isset($attributs['height']) |
|
| 330 | + and $h = svg_dimension_to_pixels($attributs['height']) |
|
| 331 | + ) { |
|
| 332 | + $height = $h; |
|
| 333 | + // si on avait pas de viewBox, la construire a partir de ce height |
|
| 334 | + if (empty($attributs['viewBox'])) { |
|
| 335 | + $viewBox[3] = $height; |
|
| 336 | + } |
|
| 337 | + } |
|
| 338 | + else { |
|
| 339 | + $height = $viewBox[3]; |
|
| 340 | + if ($height < 1) { |
|
| 341 | + $coeff = max($coeff, 1000); |
|
| 342 | + } |
|
| 343 | + elseif ($height < 10) { |
|
| 344 | + $coeff = max($coeff, 100); |
|
| 345 | + } |
|
| 346 | + elseif ($height < 100) { |
|
| 347 | + $coeff = max($coeff, 10); |
|
| 348 | + } |
|
| 349 | + } |
|
| 350 | + |
|
| 351 | + // arrondir le width et height en pixel in fine |
|
| 352 | + $width = round($coeff * $width); |
|
| 353 | + $height = round($coeff * $height); |
|
| 354 | + |
|
| 355 | + $viewBox = implode(' ', $viewBox); |
|
| 356 | + |
|
| 357 | + return [$width, $height, $viewBox]; |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | /** |
@@ -370,25 +370,25 @@ discard block |
||
| 370 | 370 | * @return string |
| 371 | 371 | */ |
| 372 | 372 | function svg_force_viewBox_px($img, $force_width_and_height = false) { |
| 373 | - if ( |
|
| 374 | - $svg = svg_charger($img) |
|
| 375 | - and $svg_infos = svg_lire_balise_svg($svg) |
|
| 376 | - ) { |
|
| 377 | - [$balise_svg, $attributs] = $svg_infos; |
|
| 373 | + if ( |
|
| 374 | + $svg = svg_charger($img) |
|
| 375 | + and $svg_infos = svg_lire_balise_svg($svg) |
|
| 376 | + ) { |
|
| 377 | + [$balise_svg, $attributs] = $svg_infos; |
|
| 378 | 378 | |
| 379 | - [$width, $height, $viewBox] = svg_getimagesize_from_attr($attributs); |
|
| 379 | + [$width, $height, $viewBox] = svg_getimagesize_from_attr($attributs); |
|
| 380 | 380 | |
| 381 | - if ($force_width_and_height) { |
|
| 382 | - $attributs['width'] = $width; |
|
| 383 | - $attributs['height'] = $height; |
|
| 384 | - } |
|
| 381 | + if ($force_width_and_height) { |
|
| 382 | + $attributs['width'] = $width; |
|
| 383 | + $attributs['height'] = $height; |
|
| 384 | + } |
|
| 385 | 385 | |
| 386 | - $attributs['viewBox'] = $viewBox; |
|
| 386 | + $attributs['viewBox'] = $viewBox; |
|
| 387 | 387 | |
| 388 | - $svg = svg_change_balise_svg($svg, $balise_svg, $attributs); |
|
| 389 | - return $svg; |
|
| 390 | - } |
|
| 391 | - return $img; |
|
| 388 | + $svg = svg_change_balise_svg($svg, $balise_svg, $attributs); |
|
| 389 | + return $svg; |
|
| 390 | + } |
|
| 391 | + return $img; |
|
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | /** |
@@ -397,12 +397,12 @@ discard block |
||
| 397 | 397 | * @return array|mixed |
| 398 | 398 | */ |
| 399 | 399 | function svg_extract_couleurs($img) { |
| 400 | - if ($svg = svg_charger($img)) { |
|
| 401 | - if (preg_match_all('/(#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f])|(rgb\([\s\d]+,[\s\d]+,[\s\d]+\))|(#[0-9a-f][0-9a-f][0-9a-f])/imS', $svg, $matches)) { |
|
| 402 | - return $matches[0]; |
|
| 403 | - } |
|
| 404 | - } |
|
| 405 | - return []; |
|
| 400 | + if ($svg = svg_charger($img)) { |
|
| 401 | + if (preg_match_all('/(#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f])|(rgb\([\s\d]+,[\s\d]+,[\s\d]+\))|(#[0-9a-f][0-9a-f][0-9a-f])/imS', $svg, $matches)) { |
|
| 402 | + return $matches[0]; |
|
| 403 | + } |
|
| 404 | + } |
|
| 405 | + return []; |
|
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | /** |
@@ -413,58 +413,58 @@ discard block |
||
| 413 | 413 | * @return bool|string |
| 414 | 414 | */ |
| 415 | 415 | function svg_recadrer($img, $new_width, $new_height, $offset_width, $offset_height, $background_color = '') { |
| 416 | - if ( |
|
| 417 | - $svg = svg_force_viewBox_px($img) |
|
| 418 | - and $svg_infos = svg_lire_balise_svg($svg) |
|
| 419 | - ) { |
|
| 420 | - [$balise_svg, $attributs] = $svg_infos; |
|
| 421 | - $viewBox = explode(' ', $attributs['viewBox']); |
|
| 422 | - |
|
| 423 | - $viewport_w = $new_width; |
|
| 424 | - $viewport_h = $new_height; |
|
| 425 | - $viewport_ox = $offset_width; |
|
| 426 | - $viewport_oy = $offset_height; |
|
| 427 | - |
|
| 428 | - // si on a un width/height qui rescale, il faut rescaler |
|
| 429 | - if ( |
|
| 430 | - isset($attributs['width']) |
|
| 431 | - and $w = svg_dimension_to_pixels($attributs['width']) |
|
| 432 | - and isset($attributs['height']) |
|
| 433 | - and $h = svg_dimension_to_pixels($attributs['height']) |
|
| 434 | - ) { |
|
| 435 | - $xscale = $viewBox[2] / $w; |
|
| 436 | - $viewport_w = round($viewport_w * $xscale, 2); |
|
| 437 | - $viewport_ox = round($viewport_ox * $xscale, 2); |
|
| 438 | - $yscale = $viewBox[3] / $h; |
|
| 439 | - $viewport_h = round($viewport_h * $yscale, 2); |
|
| 440 | - $viewport_oy = round($viewport_oy * $yscale, 2); |
|
| 441 | - } |
|
| 442 | - |
|
| 443 | - if ($viewport_w > $viewBox[2] or $viewport_h > $viewBox[3]) { |
|
| 444 | - $svg = svg_clip_in_box($svg, $viewBox[0], $viewBox[1], $viewBox[2], $viewBox[3]); |
|
| 445 | - } |
|
| 446 | - |
|
| 447 | - // maintenant on redefinit la viewBox |
|
| 448 | - $viewBox[0] += $viewport_ox; |
|
| 449 | - $viewBox[1] += $viewport_oy; |
|
| 450 | - $viewBox[2] = $viewport_w; |
|
| 451 | - $viewBox[3] = $viewport_h; |
|
| 452 | - |
|
| 453 | - $attributs['viewBox'] = implode(' ', $viewBox); |
|
| 454 | - $attributs['width'] = strval($new_width); |
|
| 455 | - $attributs['height'] = strval($new_height); |
|
| 456 | - |
|
| 457 | - $svg = svg_change_balise_svg($svg, $balise_svg, $attributs); |
|
| 458 | - |
|
| 459 | - // ajouter un background |
|
| 460 | - if ($background_color and $background_color !== 'transparent') { |
|
| 461 | - $svg = svg_ajouter_background($svg, $background_color); |
|
| 462 | - } |
|
| 463 | - |
|
| 464 | - return $svg; |
|
| 465 | - } |
|
| 466 | - |
|
| 467 | - return $img; |
|
| 416 | + if ( |
|
| 417 | + $svg = svg_force_viewBox_px($img) |
|
| 418 | + and $svg_infos = svg_lire_balise_svg($svg) |
|
| 419 | + ) { |
|
| 420 | + [$balise_svg, $attributs] = $svg_infos; |
|
| 421 | + $viewBox = explode(' ', $attributs['viewBox']); |
|
| 422 | + |
|
| 423 | + $viewport_w = $new_width; |
|
| 424 | + $viewport_h = $new_height; |
|
| 425 | + $viewport_ox = $offset_width; |
|
| 426 | + $viewport_oy = $offset_height; |
|
| 427 | + |
|
| 428 | + // si on a un width/height qui rescale, il faut rescaler |
|
| 429 | + if ( |
|
| 430 | + isset($attributs['width']) |
|
| 431 | + and $w = svg_dimension_to_pixels($attributs['width']) |
|
| 432 | + and isset($attributs['height']) |
|
| 433 | + and $h = svg_dimension_to_pixels($attributs['height']) |
|
| 434 | + ) { |
|
| 435 | + $xscale = $viewBox[2] / $w; |
|
| 436 | + $viewport_w = round($viewport_w * $xscale, 2); |
|
| 437 | + $viewport_ox = round($viewport_ox * $xscale, 2); |
|
| 438 | + $yscale = $viewBox[3] / $h; |
|
| 439 | + $viewport_h = round($viewport_h * $yscale, 2); |
|
| 440 | + $viewport_oy = round($viewport_oy * $yscale, 2); |
|
| 441 | + } |
|
| 442 | + |
|
| 443 | + if ($viewport_w > $viewBox[2] or $viewport_h > $viewBox[3]) { |
|
| 444 | + $svg = svg_clip_in_box($svg, $viewBox[0], $viewBox[1], $viewBox[2], $viewBox[3]); |
|
| 445 | + } |
|
| 446 | + |
|
| 447 | + // maintenant on redefinit la viewBox |
|
| 448 | + $viewBox[0] += $viewport_ox; |
|
| 449 | + $viewBox[1] += $viewport_oy; |
|
| 450 | + $viewBox[2] = $viewport_w; |
|
| 451 | + $viewBox[3] = $viewport_h; |
|
| 452 | + |
|
| 453 | + $attributs['viewBox'] = implode(' ', $viewBox); |
|
| 454 | + $attributs['width'] = strval($new_width); |
|
| 455 | + $attributs['height'] = strval($new_height); |
|
| 456 | + |
|
| 457 | + $svg = svg_change_balise_svg($svg, $balise_svg, $attributs); |
|
| 458 | + |
|
| 459 | + // ajouter un background |
|
| 460 | + if ($background_color and $background_color !== 'transparent') { |
|
| 461 | + $svg = svg_ajouter_background($svg, $background_color); |
|
| 462 | + } |
|
| 463 | + |
|
| 464 | + return $svg; |
|
| 465 | + } |
|
| 466 | + |
|
| 467 | + return $img; |
|
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | /** |
@@ -474,26 +474,26 @@ discard block |
||
| 474 | 474 | * @return bool|string |
| 475 | 475 | */ |
| 476 | 476 | function svg_ajouter_background($img, $background_color) { |
| 477 | - if ( |
|
| 478 | - $svg = svg_charger($img) |
|
| 479 | - and $svg_infos = svg_lire_balise_svg($svg) |
|
| 480 | - ) { |
|
| 481 | - if ($background_color and $background_color !== 'transparent') { |
|
| 482 | - [$balise_svg, $attributs] = $svg_infos; |
|
| 483 | - |
|
| 484 | - $background_color = svg_couleur_to_hexa($background_color); |
|
| 485 | - if (isset($attributs['viewBox'])) { |
|
| 486 | - $viewBox = explode(' ', $attributs['viewBox']); |
|
| 487 | - $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\"/>"; |
|
| 488 | - } |
|
| 489 | - else { |
|
| 490 | - $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
|
| 491 | - } |
|
| 492 | - $svg = svg_insert_shapes($svg, $rect); |
|
| 493 | - } |
|
| 494 | - return $svg; |
|
| 495 | - } |
|
| 496 | - return $img; |
|
| 477 | + if ( |
|
| 478 | + $svg = svg_charger($img) |
|
| 479 | + and $svg_infos = svg_lire_balise_svg($svg) |
|
| 480 | + ) { |
|
| 481 | + if ($background_color and $background_color !== 'transparent') { |
|
| 482 | + [$balise_svg, $attributs] = $svg_infos; |
|
| 483 | + |
|
| 484 | + $background_color = svg_couleur_to_hexa($background_color); |
|
| 485 | + if (isset($attributs['viewBox'])) { |
|
| 486 | + $viewBox = explode(' ', $attributs['viewBox']); |
|
| 487 | + $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\"/>"; |
|
| 488 | + } |
|
| 489 | + else { |
|
| 490 | + $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
|
| 491 | + } |
|
| 492 | + $svg = svg_insert_shapes($svg, $rect); |
|
| 493 | + } |
|
| 494 | + return $svg; |
|
| 495 | + } |
|
| 496 | + return $img; |
|
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | |
@@ -504,26 +504,26 @@ discard block |
||
| 504 | 504 | * @return bool|string |
| 505 | 505 | */ |
| 506 | 506 | function svg_ajouter_voile($img, $background_color, $opacity) { |
| 507 | - if ( |
|
| 508 | - $svg = svg_charger($img) |
|
| 509 | - and $svg_infos = svg_lire_balise_svg($svg) |
|
| 510 | - ) { |
|
| 511 | - if ($background_color and $background_color !== 'transparent') { |
|
| 512 | - [$balise_svg, $attributs] = $svg_infos; |
|
| 513 | - |
|
| 514 | - $background_color = svg_couleur_to_hexa($background_color); |
|
| 515 | - if (isset($attributs['viewBox'])) { |
|
| 516 | - $viewBox = explode(' ', $attributs['viewBox']); |
|
| 517 | - $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\" opacity=\"$opacity\"/>"; |
|
| 518 | - } |
|
| 519 | - else { |
|
| 520 | - $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
|
| 521 | - } |
|
| 522 | - $svg = svg_insert_shapes($svg, $rect, false); |
|
| 523 | - } |
|
| 524 | - return $svg; |
|
| 525 | - } |
|
| 526 | - return $img; |
|
| 507 | + if ( |
|
| 508 | + $svg = svg_charger($img) |
|
| 509 | + and $svg_infos = svg_lire_balise_svg($svg) |
|
| 510 | + ) { |
|
| 511 | + if ($background_color and $background_color !== 'transparent') { |
|
| 512 | + [$balise_svg, $attributs] = $svg_infos; |
|
| 513 | + |
|
| 514 | + $background_color = svg_couleur_to_hexa($background_color); |
|
| 515 | + if (isset($attributs['viewBox'])) { |
|
| 516 | + $viewBox = explode(' ', $attributs['viewBox']); |
|
| 517 | + $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\" opacity=\"$opacity\"/>"; |
|
| 518 | + } |
|
| 519 | + else { |
|
| 520 | + $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
|
| 521 | + } |
|
| 522 | + $svg = svg_insert_shapes($svg, $rect, false); |
|
| 523 | + } |
|
| 524 | + return $svg; |
|
| 525 | + } |
|
| 526 | + return $img; |
|
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | |
@@ -534,27 +534,27 @@ discard block |
||
| 534 | 534 | * @return bool|string |
| 535 | 535 | */ |
| 536 | 536 | function svg_transformer($img, $attributs) { |
| 537 | - if ( |
|
| 538 | - $svg = svg_charger($img) |
|
| 539 | - and $svg_infos = svg_lire_balise_svg($svg) |
|
| 540 | - ) { |
|
| 541 | - if ($attributs) { |
|
| 542 | - [$balise_svg, ] = $svg_infos; |
|
| 543 | - $g = '<g'; |
|
| 544 | - foreach ($attributs as $k => $v) { |
|
| 545 | - if (strlen($v)) { |
|
| 546 | - $g .= " $k=\"" . attribut_html($v) . '"'; |
|
| 547 | - } |
|
| 548 | - } |
|
| 549 | - if (strlen($g) > 2) { |
|
| 550 | - $g .= '>'; |
|
| 551 | - $svg = svg_insert_shapes($svg, $g); |
|
| 552 | - $svg = svg_insert_shapes($svg, '</g>', false); |
|
| 553 | - } |
|
| 554 | - } |
|
| 555 | - return $svg; |
|
| 556 | - } |
|
| 557 | - return $img; |
|
| 537 | + if ( |
|
| 538 | + $svg = svg_charger($img) |
|
| 539 | + and $svg_infos = svg_lire_balise_svg($svg) |
|
| 540 | + ) { |
|
| 541 | + if ($attributs) { |
|
| 542 | + [$balise_svg, ] = $svg_infos; |
|
| 543 | + $g = '<g'; |
|
| 544 | + foreach ($attributs as $k => $v) { |
|
| 545 | + if (strlen($v)) { |
|
| 546 | + $g .= " $k=\"" . attribut_html($v) . '"'; |
|
| 547 | + } |
|
| 548 | + } |
|
| 549 | + if (strlen($g) > 2) { |
|
| 550 | + $g .= '>'; |
|
| 551 | + $svg = svg_insert_shapes($svg, $g); |
|
| 552 | + $svg = svg_insert_shapes($svg, '</g>', false); |
|
| 553 | + } |
|
| 554 | + } |
|
| 555 | + return $svg; |
|
| 556 | + } |
|
| 557 | + return $img; |
|
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | /** |
@@ -565,21 +565,21 @@ discard block |
||
| 565 | 565 | * @return bool|string |
| 566 | 566 | */ |
| 567 | 567 | function svg_apply_filter($img, $filter_def) { |
| 568 | - if ( |
|
| 569 | - $svg = svg_charger($img) |
|
| 570 | - and $svg_infos = svg_lire_balise_svg($svg) |
|
| 571 | - ) { |
|
| 572 | - if ($filter_def) { |
|
| 573 | - [$balise_svg, ] = $svg_infos; |
|
| 574 | - $filter_id = 'filter-' . substr(md5($filter_def . strlen($svg)), 0, 8); |
|
| 575 | - $filter = "<defs><filter id=\"$filter_id\">$filter_def</filter></defs>"; |
|
| 576 | - $g = "<g filter=\"url(#$filter_id)\">"; |
|
| 577 | - $svg = svg_insert_shapes($svg, $filter . $g); |
|
| 578 | - $svg = svg_insert_shapes($svg, '</g>', false); |
|
| 579 | - } |
|
| 580 | - return $svg; |
|
| 581 | - } |
|
| 582 | - return $img; |
|
| 568 | + if ( |
|
| 569 | + $svg = svg_charger($img) |
|
| 570 | + and $svg_infos = svg_lire_balise_svg($svg) |
|
| 571 | + ) { |
|
| 572 | + if ($filter_def) { |
|
| 573 | + [$balise_svg, ] = $svg_infos; |
|
| 574 | + $filter_id = 'filter-' . substr(md5($filter_def . strlen($svg)), 0, 8); |
|
| 575 | + $filter = "<defs><filter id=\"$filter_id\">$filter_def</filter></defs>"; |
|
| 576 | + $g = "<g filter=\"url(#$filter_id)\">"; |
|
| 577 | + $svg = svg_insert_shapes($svg, $filter . $g); |
|
| 578 | + $svg = svg_insert_shapes($svg, '</g>', false); |
|
| 579 | + } |
|
| 580 | + return $svg; |
|
| 581 | + } |
|
| 582 | + return $img; |
|
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | /** |
@@ -589,8 +589,8 @@ discard block |
||
| 589 | 589 | * @return string |
| 590 | 590 | */ |
| 591 | 591 | function svg_filter_blur($img, $blur_width) { |
| 592 | - $blur_width = intval($blur_width); |
|
| 593 | - return svg_apply_filter($img, "<feGaussianBlur stdDeviation=\"$blur_width\"/>"); |
|
| 592 | + $blur_width = intval($blur_width); |
|
| 593 | + return svg_apply_filter($img, "<feGaussianBlur stdDeviation=\"$blur_width\"/>"); |
|
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | /** |
@@ -600,10 +600,10 @@ discard block |
||
| 600 | 600 | * @return bool|string |
| 601 | 601 | */ |
| 602 | 602 | function svg_filter_grayscale($img, $intensity) { |
| 603 | - $value = round(1.0 - $intensity, 2); |
|
| 604 | - //$filter = "<feColorMatrix type=\"matrix\" values=\"0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\"/>"; |
|
| 605 | - $filter = "<feColorMatrix type=\"saturate\" values=\"$value\"/>"; |
|
| 606 | - return svg_apply_filter($img, $filter); |
|
| 603 | + $value = round(1.0 - $intensity, 2); |
|
| 604 | + //$filter = "<feColorMatrix type=\"matrix\" values=\"0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\"/>"; |
|
| 605 | + $filter = "<feColorMatrix type=\"saturate\" values=\"$value\"/>"; |
|
| 606 | + return svg_apply_filter($img, $filter); |
|
| 607 | 607 | } |
| 608 | 608 | |
| 609 | 609 | /** |
@@ -613,8 +613,8 @@ discard block |
||
| 613 | 613 | * @return bool|string |
| 614 | 614 | */ |
| 615 | 615 | function svg_filter_sepia($img, $intensity) { |
| 616 | - $filter = '<feColorMatrix type="matrix" values="0.30 0.30 0.30 0.0 0 0.25 0.25 0.25 0.0 0 0.20 0.20 0.20 0.0 0 0.00 0.00 0.00 1 0"/>'; |
|
| 617 | - return svg_apply_filter($img, $filter); |
|
| 616 | + $filter = '<feColorMatrix type="matrix" values="0.30 0.30 0.30 0.0 0 0.25 0.25 0.25 0.0 0 0.20 0.20 0.20 0.0 0 0.00 0.00 0.00 1 0"/>'; |
|
| 617 | + return svg_apply_filter($img, $filter); |
|
| 618 | 618 | } |
| 619 | 619 | |
| 620 | 620 | /** |
@@ -624,31 +624,31 @@ discard block |
||
| 624 | 624 | * @return bool|string |
| 625 | 625 | */ |
| 626 | 626 | function svg_flip($img, $HorV) { |
| 627 | - if ( |
|
| 628 | - $svg = svg_force_viewBox_px($img) |
|
| 629 | - and $svg_infos = svg_lire_balise_svg($svg) |
|
| 630 | - ) { |
|
| 631 | - [$balise_svg, $atts] = $svg_infos; |
|
| 632 | - $viewBox = explode(' ', $atts['viewBox']); |
|
| 633 | - |
|
| 634 | - if (!in_array($HorV, ['h', 'H'])) { |
|
| 635 | - $transform = 'scale(-1,1)'; |
|
| 636 | - |
|
| 637 | - $x = intval($viewBox[0]) + intval($viewBox[2] / 2); |
|
| 638 | - $mx = -$x; |
|
| 639 | - $transform = "translate($x, 0) $transform translate($mx, 0)"; |
|
| 640 | - } |
|
| 641 | - else { |
|
| 642 | - $transform = 'scale(1,-1)'; |
|
| 643 | - |
|
| 644 | - $y = intval($viewBox[1]) + intval($viewBox[3] / 2); |
|
| 645 | - $my = -$y; |
|
| 646 | - $transform = "translate(0, $y) $transform translate(0, $my)"; |
|
| 647 | - } |
|
| 648 | - $svg = svg_transformer($svg, ['transform' => $transform]); |
|
| 649 | - return $svg; |
|
| 650 | - } |
|
| 651 | - return $img; |
|
| 627 | + if ( |
|
| 628 | + $svg = svg_force_viewBox_px($img) |
|
| 629 | + and $svg_infos = svg_lire_balise_svg($svg) |
|
| 630 | + ) { |
|
| 631 | + [$balise_svg, $atts] = $svg_infos; |
|
| 632 | + $viewBox = explode(' ', $atts['viewBox']); |
|
| 633 | + |
|
| 634 | + if (!in_array($HorV, ['h', 'H'])) { |
|
| 635 | + $transform = 'scale(-1,1)'; |
|
| 636 | + |
|
| 637 | + $x = intval($viewBox[0]) + intval($viewBox[2] / 2); |
|
| 638 | + $mx = -$x; |
|
| 639 | + $transform = "translate($x, 0) $transform translate($mx, 0)"; |
|
| 640 | + } |
|
| 641 | + else { |
|
| 642 | + $transform = 'scale(1,-1)'; |
|
| 643 | + |
|
| 644 | + $y = intval($viewBox[1]) + intval($viewBox[3] / 2); |
|
| 645 | + $my = -$y; |
|
| 646 | + $transform = "translate(0, $y) $transform translate(0, $my)"; |
|
| 647 | + } |
|
| 648 | + $svg = svg_transformer($svg, ['transform' => $transform]); |
|
| 649 | + return $svg; |
|
| 650 | + } |
|
| 651 | + return $img; |
|
| 652 | 652 | } |
| 653 | 653 | |
| 654 | 654 | /** |
@@ -662,20 +662,20 @@ discard block |
||
| 662 | 662 | * @return bool|string |
| 663 | 663 | */ |
| 664 | 664 | function svg_rotate($img, $angle, $center_x, $center_y) { |
| 665 | - if ( |
|
| 666 | - $svg = svg_force_viewBox_px($img) |
|
| 667 | - and $svg_infos = svg_lire_balise_svg($svg) |
|
| 668 | - ) { |
|
| 669 | - [$balise_svg, $atts] = $svg_infos; |
|
| 670 | - $viewBox = explode(' ', $atts['viewBox']); |
|
| 671 | - |
|
| 672 | - $center_x = round($viewBox[0] + $center_x * $viewBox[2]); |
|
| 673 | - $center_y = round($viewBox[1] + $center_y * $viewBox[3]); |
|
| 674 | - $svg = svg_transformer($svg, ['transform' => "rotate($angle $center_x $center_y)"]); |
|
| 675 | - |
|
| 676 | - return $svg; |
|
| 677 | - } |
|
| 678 | - return $img; |
|
| 665 | + if ( |
|
| 666 | + $svg = svg_force_viewBox_px($img) |
|
| 667 | + and $svg_infos = svg_lire_balise_svg($svg) |
|
| 668 | + ) { |
|
| 669 | + [$balise_svg, $atts] = $svg_infos; |
|
| 670 | + $viewBox = explode(' ', $atts['viewBox']); |
|
| 671 | + |
|
| 672 | + $center_x = round($viewBox[0] + $center_x * $viewBox[2]); |
|
| 673 | + $center_y = round($viewBox[1] + $center_y * $viewBox[3]); |
|
| 674 | + $svg = svg_transformer($svg, ['transform' => "rotate($angle $center_x $center_y)"]); |
|
| 675 | + |
|
| 676 | + return $svg; |
|
| 677 | + } |
|
| 678 | + return $img; |
|
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | /** |
@@ -687,41 +687,41 @@ discard block |
||
| 687 | 687 | * @return bool|mixed|string |
| 688 | 688 | */ |
| 689 | 689 | function svg_filtrer_couleurs($img, $callback_filter) { |
| 690 | - if ( |
|
| 691 | - $svg = svg_force_viewBox_px($img) |
|
| 692 | - and $colors = svg_extract_couleurs($svg) |
|
| 693 | - ) { |
|
| 694 | - $colors = array_unique($colors); |
|
| 695 | - |
|
| 696 | - $short = []; |
|
| 697 | - $long = []; |
|
| 698 | - while (count($colors)) { |
|
| 699 | - $c = array_shift($colors); |
|
| 700 | - if (strlen($c) == 4) { |
|
| 701 | - $short[] = $c; |
|
| 702 | - } |
|
| 703 | - else { |
|
| 704 | - $long[] = $c; |
|
| 705 | - } |
|
| 706 | - } |
|
| 707 | - |
|
| 708 | - $colors = [...$long, ...$short]; |
|
| 709 | - $new_colors = []; |
|
| 710 | - $colors = array_flip($colors); |
|
| 711 | - foreach ($colors as $c => $k) { |
|
| 712 | - $colors[$c] = "@@@COLOR$$k$@@@"; |
|
| 713 | - } |
|
| 714 | - |
|
| 715 | - |
|
| 716 | - foreach ($colors as $original => $replace) { |
|
| 717 | - $new = svg_couleur_to_hexa($original); |
|
| 718 | - $new_colors[$replace] = $callback_filter($new); |
|
| 719 | - } |
|
| 720 | - |
|
| 721 | - $svg = str_replace(array_keys($colors), array_values($colors), $svg); |
|
| 722 | - $svg = str_replace(array_keys($new_colors), array_values($new_colors), $svg); |
|
| 723 | - |
|
| 724 | - return $svg; |
|
| 725 | - } |
|
| 726 | - return $img; |
|
| 690 | + if ( |
|
| 691 | + $svg = svg_force_viewBox_px($img) |
|
| 692 | + and $colors = svg_extract_couleurs($svg) |
|
| 693 | + ) { |
|
| 694 | + $colors = array_unique($colors); |
|
| 695 | + |
|
| 696 | + $short = []; |
|
| 697 | + $long = []; |
|
| 698 | + while (count($colors)) { |
|
| 699 | + $c = array_shift($colors); |
|
| 700 | + if (strlen($c) == 4) { |
|
| 701 | + $short[] = $c; |
|
| 702 | + } |
|
| 703 | + else { |
|
| 704 | + $long[] = $c; |
|
| 705 | + } |
|
| 706 | + } |
|
| 707 | + |
|
| 708 | + $colors = [...$long, ...$short]; |
|
| 709 | + $new_colors = []; |
|
| 710 | + $colors = array_flip($colors); |
|
| 711 | + foreach ($colors as $c => $k) { |
|
| 712 | + $colors[$c] = "@@@COLOR$$k$@@@"; |
|
| 713 | + } |
|
| 714 | + |
|
| 715 | + |
|
| 716 | + foreach ($colors as $original => $replace) { |
|
| 717 | + $new = svg_couleur_to_hexa($original); |
|
| 718 | + $new_colors[$replace] = $callback_filter($new); |
|
| 719 | + } |
|
| 720 | + |
|
| 721 | + $svg = str_replace(array_keys($colors), array_values($colors), $svg); |
|
| 722 | + $svg = str_replace(array_keys($new_colors), array_values($new_colors), $svg); |
|
| 723 | + |
|
| 724 | + return $svg; |
|
| 725 | + } |
|
| 726 | + return $img; |
|
| 727 | 727 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * @package SPIP\Core\Mail |
| 17 | 17 | **/ |
| 18 | 18 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 19 | - return; |
|
| 19 | + return; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | include_spip('inc/charsets'); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * @return string |
| 33 | 33 | */ |
| 34 | 34 | function nettoyer_titre_email($titre) { |
| 35 | - return str_replace("\n", ' ', nettoyer_caracteres_mail(textebrut(corriger_typo($titre)))); |
|
| 35 | + return str_replace("\n", ' ', nettoyer_caracteres_mail(textebrut(corriger_typo($titre)))); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -48,23 +48,23 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | function nettoyer_caracteres_mail($t) { |
| 50 | 50 | |
| 51 | - $t = filtrer_entites($t); |
|
| 51 | + $t = filtrer_entites($t); |
|
| 52 | 52 | |
| 53 | - if ($GLOBALS['meta']['charset'] <> 'utf-8') { |
|
| 54 | - $t = str_replace( |
|
| 55 | - ['’', '“', '”'], |
|
| 56 | - ["'", '"', '"'], |
|
| 57 | - $t |
|
| 58 | - ); |
|
| 59 | - } |
|
| 53 | + if ($GLOBALS['meta']['charset'] <> 'utf-8') { |
|
| 54 | + $t = str_replace( |
|
| 55 | + ['’', '“', '”'], |
|
| 56 | + ["'", '"', '"'], |
|
| 57 | + $t |
|
| 58 | + ); |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - $t = str_replace( |
|
| 62 | - ['—', '&endash;'], |
|
| 63 | - ['--', '-'], |
|
| 64 | - $t |
|
| 65 | - ); |
|
| 61 | + $t = str_replace( |
|
| 62 | + ['—', '&endash;'], |
|
| 63 | + ['--', '-'], |
|
| 64 | + $t |
|
| 65 | + ); |
|
| 66 | 66 | |
| 67 | - return $t; |
|
| 67 | + return $t; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -97,87 +97,87 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | function inc_envoyer_mail_dist($destinataire, $sujet, $corps, $from = '', $headers = '') { |
| 99 | 99 | |
| 100 | - if (!email_valide($destinataire)) { |
|
| 101 | - return false; |
|
| 102 | - } |
|
| 103 | - if ($destinataire == _T('info_mail_fournisseur')) { |
|
| 104 | - return false; |
|
| 105 | - } // tres fort |
|
| 106 | - |
|
| 107 | - // Fournir si possible un Message-Id: conforme au RFC1036, |
|
| 108 | - // sinon SpamAssassin denoncera un MSGID_FROM_MTA_HEADER |
|
| 109 | - |
|
| 110 | - $email_envoi = $GLOBALS['meta']['email_envoi']; |
|
| 111 | - if (!email_valide($email_envoi)) { |
|
| 112 | - spip_log('Meta email_envoi invalide. Le mail sera probablement vu comme spam.'); |
|
| 113 | - $email_envoi = $destinataire; |
|
| 114 | - } |
|
| 115 | - |
|
| 116 | - $parts = ''; |
|
| 117 | - if (is_array($corps)) { |
|
| 118 | - $texte = $corps['texte']; |
|
| 119 | - $from = ($corps['from'] ?? $from); |
|
| 120 | - $headers = ($corps['headers'] ?? $headers); |
|
| 121 | - if (is_array($headers)) { |
|
| 122 | - $headers = implode("\n", $headers); |
|
| 123 | - } |
|
| 124 | - if (isset($corps['pieces_jointes']) and function_exists('mail_embarquer_pieces_jointes')) { |
|
| 125 | - $parts = mail_embarquer_pieces_jointes($corps['pieces_jointes']); |
|
| 126 | - } |
|
| 127 | - } else { |
|
| 128 | - $texte = $corps; |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - if (!$from) { |
|
| 132 | - $from = $email_envoi; |
|
| 133 | - } |
|
| 134 | - |
|
| 135 | - // ceci est la RegExp NO_REAL_NAME faisant hurler SpamAssassin |
|
| 136 | - if (preg_match('/^["\s]*\<?\S+\@\S+\>?\s*$/', $from)) { |
|
| 137 | - $from .= ' (' . str_replace(')', '', translitteration(str_replace('@', ' at ', $from))) . ')'; |
|
| 138 | - } |
|
| 139 | - |
|
| 140 | - // nettoyer les é ’, &emdash; etc... |
|
| 141 | - // les 'cliquer ici' etc sont a eviter; voir: |
|
| 142 | - // http://mta.org.ua/spamassassin-2.55/stuff/wiki.CustomRulesets/20050914/rules/french_rules.cf |
|
| 143 | - $texte = nettoyer_caracteres_mail($texte); |
|
| 144 | - $sujet = nettoyer_caracteres_mail($sujet); |
|
| 145 | - |
|
| 146 | - // encoder le sujet si possible selon la RFC |
|
| 147 | - if (init_mb_string()) { |
|
| 148 | - # un bug de mb_string casse mb_encode_mimeheader si l'encoding interne |
|
| 149 | - # est UTF-8 et le charset iso-8859-1 (constate php5-mac ; php4.3-debian) |
|
| 150 | - $charset = $GLOBALS['meta']['charset']; |
|
| 151 | - mb_internal_encoding($charset); |
|
| 152 | - $sujet = mb_encode_mimeheader($sujet, $charset, 'Q', "\n"); |
|
| 153 | - mb_internal_encoding('utf-8'); |
|
| 154 | - } |
|
| 155 | - |
|
| 156 | - $headers = $headers ?? ''; |
|
| 157 | - if (function_exists('wordwrap') && (preg_match(',multipart/mixed,', $headers) == 0)) { |
|
| 158 | - $texte = wordwrap($texte); |
|
| 159 | - } |
|
| 160 | - |
|
| 161 | - [$headers, $texte] = mail_normaliser_headers($headers, $from, $destinataire, $texte, $parts); |
|
| 162 | - |
|
| 163 | - if (_OS_SERVEUR == 'windows') { |
|
| 164 | - $texte = preg_replace("@\r*\n@", "\r\n", $texte); |
|
| 165 | - $headers = preg_replace("@\r*\n@", "\r\n", $headers); |
|
| 166 | - $sujet = preg_replace("@\r*\n@", "\r\n", $sujet); |
|
| 167 | - } |
|
| 168 | - |
|
| 169 | - spip_log("mail $destinataire\n$sujet\n$headers", 'mails'); |
|
| 170 | - // mode TEST : forcer l'email |
|
| 171 | - if (defined('_TEST_EMAIL_DEST')) { |
|
| 172 | - if (!_TEST_EMAIL_DEST) { |
|
| 173 | - return false; |
|
| 174 | - } else { |
|
| 175 | - $texte = "Dest : $destinataire\r\n" . $texte; |
|
| 176 | - $destinataire = _TEST_EMAIL_DEST; |
|
| 177 | - } |
|
| 178 | - } |
|
| 179 | - |
|
| 180 | - return @mail($destinataire, $sujet, $texte, $headers); |
|
| 100 | + if (!email_valide($destinataire)) { |
|
| 101 | + return false; |
|
| 102 | + } |
|
| 103 | + if ($destinataire == _T('info_mail_fournisseur')) { |
|
| 104 | + return false; |
|
| 105 | + } // tres fort |
|
| 106 | + |
|
| 107 | + // Fournir si possible un Message-Id: conforme au RFC1036, |
|
| 108 | + // sinon SpamAssassin denoncera un MSGID_FROM_MTA_HEADER |
|
| 109 | + |
|
| 110 | + $email_envoi = $GLOBALS['meta']['email_envoi']; |
|
| 111 | + if (!email_valide($email_envoi)) { |
|
| 112 | + spip_log('Meta email_envoi invalide. Le mail sera probablement vu comme spam.'); |
|
| 113 | + $email_envoi = $destinataire; |
|
| 114 | + } |
|
| 115 | + |
|
| 116 | + $parts = ''; |
|
| 117 | + if (is_array($corps)) { |
|
| 118 | + $texte = $corps['texte']; |
|
| 119 | + $from = ($corps['from'] ?? $from); |
|
| 120 | + $headers = ($corps['headers'] ?? $headers); |
|
| 121 | + if (is_array($headers)) { |
|
| 122 | + $headers = implode("\n", $headers); |
|
| 123 | + } |
|
| 124 | + if (isset($corps['pieces_jointes']) and function_exists('mail_embarquer_pieces_jointes')) { |
|
| 125 | + $parts = mail_embarquer_pieces_jointes($corps['pieces_jointes']); |
|
| 126 | + } |
|
| 127 | + } else { |
|
| 128 | + $texte = $corps; |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + if (!$from) { |
|
| 132 | + $from = $email_envoi; |
|
| 133 | + } |
|
| 134 | + |
|
| 135 | + // ceci est la RegExp NO_REAL_NAME faisant hurler SpamAssassin |
|
| 136 | + if (preg_match('/^["\s]*\<?\S+\@\S+\>?\s*$/', $from)) { |
|
| 137 | + $from .= ' (' . str_replace(')', '', translitteration(str_replace('@', ' at ', $from))) . ')'; |
|
| 138 | + } |
|
| 139 | + |
|
| 140 | + // nettoyer les é ’, &emdash; etc... |
|
| 141 | + // les 'cliquer ici' etc sont a eviter; voir: |
|
| 142 | + // http://mta.org.ua/spamassassin-2.55/stuff/wiki.CustomRulesets/20050914/rules/french_rules.cf |
|
| 143 | + $texte = nettoyer_caracteres_mail($texte); |
|
| 144 | + $sujet = nettoyer_caracteres_mail($sujet); |
|
| 145 | + |
|
| 146 | + // encoder le sujet si possible selon la RFC |
|
| 147 | + if (init_mb_string()) { |
|
| 148 | + # un bug de mb_string casse mb_encode_mimeheader si l'encoding interne |
|
| 149 | + # est UTF-8 et le charset iso-8859-1 (constate php5-mac ; php4.3-debian) |
|
| 150 | + $charset = $GLOBALS['meta']['charset']; |
|
| 151 | + mb_internal_encoding($charset); |
|
| 152 | + $sujet = mb_encode_mimeheader($sujet, $charset, 'Q', "\n"); |
|
| 153 | + mb_internal_encoding('utf-8'); |
|
| 154 | + } |
|
| 155 | + |
|
| 156 | + $headers = $headers ?? ''; |
|
| 157 | + if (function_exists('wordwrap') && (preg_match(',multipart/mixed,', $headers) == 0)) { |
|
| 158 | + $texte = wordwrap($texte); |
|
| 159 | + } |
|
| 160 | + |
|
| 161 | + [$headers, $texte] = mail_normaliser_headers($headers, $from, $destinataire, $texte, $parts); |
|
| 162 | + |
|
| 163 | + if (_OS_SERVEUR == 'windows') { |
|
| 164 | + $texte = preg_replace("@\r*\n@", "\r\n", $texte); |
|
| 165 | + $headers = preg_replace("@\r*\n@", "\r\n", $headers); |
|
| 166 | + $sujet = preg_replace("@\r*\n@", "\r\n", $sujet); |
|
| 167 | + } |
|
| 168 | + |
|
| 169 | + spip_log("mail $destinataire\n$sujet\n$headers", 'mails'); |
|
| 170 | + // mode TEST : forcer l'email |
|
| 171 | + if (defined('_TEST_EMAIL_DEST')) { |
|
| 172 | + if (!_TEST_EMAIL_DEST) { |
|
| 173 | + return false; |
|
| 174 | + } else { |
|
| 175 | + $texte = "Dest : $destinataire\r\n" . $texte; |
|
| 176 | + $destinataire = _TEST_EMAIL_DEST; |
|
| 177 | + } |
|
| 178 | + } |
|
| 179 | + |
|
| 180 | + return @mail($destinataire, $sujet, $texte, $headers); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /** |
@@ -191,58 +191,58 @@ discard block |
||
| 191 | 191 | * @return array |
| 192 | 192 | */ |
| 193 | 193 | function mail_normaliser_headers($headers, $from, $to, $texte, $parts = '') { |
| 194 | - $charset = $GLOBALS['meta']['charset']; |
|
| 195 | - |
|
| 196 | - // Ajouter le Content-Type et consort s'il n'y est pas deja |
|
| 197 | - if (strpos($headers, 'Content-Type: ') === false) { |
|
| 198 | - $type = |
|
| 199 | - "Content-Type: text/plain;charset=\"$charset\";\n" . |
|
| 200 | - "Content-Transfer-Encoding: 8bit\n"; |
|
| 201 | - } else { |
|
| 202 | - $type = ''; |
|
| 203 | - } |
|
| 204 | - |
|
| 205 | - // calculer un identifiant unique |
|
| 206 | - // Marie Toto <[email protected]> => @toto.com |
|
| 207 | - if (preg_match('/@[^\s>]+/', $from, $domain)) { |
|
| 208 | - $domain = $domain[0]; |
|
| 209 | - } |
|
| 210 | - else { |
|
| 211 | - $domain = '@unknown-' . md5($from) . '.org'; |
|
| 212 | - } |
|
| 213 | - $uniq = random_int(0, mt_getrandmax()) . '_' . md5($to . $texte) . $domain; |
|
| 214 | - |
|
| 215 | - // Si multi-part, s'en servir comme borne ... |
|
| 216 | - if ($parts) { |
|
| 217 | - $texte = "--$uniq\n$type\n" . $texte . "\n"; |
|
| 218 | - foreach ($parts as $part) { |
|
| 219 | - $n = strlen($part[1]) . ($part[0] ? "\n" : ''); |
|
| 220 | - $e = join("\n", $part[0]); |
|
| 221 | - $texte .= "\n--$uniq\nContent-Length: $n$e\n\n" . $part[1]; |
|
| 222 | - } |
|
| 223 | - $texte .= "\n\n--$uniq--\n"; |
|
| 224 | - // Si boundary n'est pas entre guillemets, |
|
| 225 | - // elle est comprise mais le charset est ignoree ! |
|
| 226 | - $type = "Content-Type: multipart/mixed; boundary=\"$uniq\"\n"; |
|
| 227 | - } |
|
| 228 | - |
|
| 229 | - // .. et s'en servir pour plaire a SpamAssassin |
|
| 230 | - |
|
| 231 | - $mid = 'Message-Id: <' . $uniq . '>'; |
|
| 232 | - |
|
| 233 | - // indispensable pour les sites qui collent d'office From: serveur-http |
|
| 234 | - // sauf si deja mis par l'envoyeur |
|
| 235 | - $rep = (strpos($headers, 'Reply-To:') !== false) ? '' : "Reply-To: $from\n"; |
|
| 236 | - |
|
| 237 | - // Nettoyer les en-tetes envoyees |
|
| 238 | - // Ajouter le \n final |
|
| 239 | - if (strlen($headers = trim($headers))) { |
|
| 240 | - $headers .= "\n"; |
|
| 241 | - } |
|
| 242 | - |
|
| 243 | - // Et mentionner l'indeboulonable nomenclature ratee |
|
| 244 | - |
|
| 245 | - $headers .= "From: $from\n$type$rep$mid\nMIME-Version: 1.0\n"; |
|
| 246 | - |
|
| 247 | - return [$headers, $texte]; |
|
| 194 | + $charset = $GLOBALS['meta']['charset']; |
|
| 195 | + |
|
| 196 | + // Ajouter le Content-Type et consort s'il n'y est pas deja |
|
| 197 | + if (strpos($headers, 'Content-Type: ') === false) { |
|
| 198 | + $type = |
|
| 199 | + "Content-Type: text/plain;charset=\"$charset\";\n" . |
|
| 200 | + "Content-Transfer-Encoding: 8bit\n"; |
|
| 201 | + } else { |
|
| 202 | + $type = ''; |
|
| 203 | + } |
|
| 204 | + |
|
| 205 | + // calculer un identifiant unique |
|
| 206 | + // Marie Toto <[email protected]> => @toto.com |
|
| 207 | + if (preg_match('/@[^\s>]+/', $from, $domain)) { |
|
| 208 | + $domain = $domain[0]; |
|
| 209 | + } |
|
| 210 | + else { |
|
| 211 | + $domain = '@unknown-' . md5($from) . '.org'; |
|
| 212 | + } |
|
| 213 | + $uniq = random_int(0, mt_getrandmax()) . '_' . md5($to . $texte) . $domain; |
|
| 214 | + |
|
| 215 | + // Si multi-part, s'en servir comme borne ... |
|
| 216 | + if ($parts) { |
|
| 217 | + $texte = "--$uniq\n$type\n" . $texte . "\n"; |
|
| 218 | + foreach ($parts as $part) { |
|
| 219 | + $n = strlen($part[1]) . ($part[0] ? "\n" : ''); |
|
| 220 | + $e = join("\n", $part[0]); |
|
| 221 | + $texte .= "\n--$uniq\nContent-Length: $n$e\n\n" . $part[1]; |
|
| 222 | + } |
|
| 223 | + $texte .= "\n\n--$uniq--\n"; |
|
| 224 | + // Si boundary n'est pas entre guillemets, |
|
| 225 | + // elle est comprise mais le charset est ignoree ! |
|
| 226 | + $type = "Content-Type: multipart/mixed; boundary=\"$uniq\"\n"; |
|
| 227 | + } |
|
| 228 | + |
|
| 229 | + // .. et s'en servir pour plaire a SpamAssassin |
|
| 230 | + |
|
| 231 | + $mid = 'Message-Id: <' . $uniq . '>'; |
|
| 232 | + |
|
| 233 | + // indispensable pour les sites qui collent d'office From: serveur-http |
|
| 234 | + // sauf si deja mis par l'envoyeur |
|
| 235 | + $rep = (strpos($headers, 'Reply-To:') !== false) ? '' : "Reply-To: $from\n"; |
|
| 236 | + |
|
| 237 | + // Nettoyer les en-tetes envoyees |
|
| 238 | + // Ajouter le \n final |
|
| 239 | + if (strlen($headers = trim($headers))) { |
|
| 240 | + $headers .= "\n"; |
|
| 241 | + } |
|
| 242 | + |
|
| 243 | + // Et mentionner l'indeboulonable nomenclature ratee |
|
| 244 | + |
|
| 245 | + $headers .= "From: $from\n$type$rep$mid\nMIME-Version: 1.0\n"; |
|
| 246 | + |
|
| 247 | + return [$headers, $texte]; |
|
| 248 | 248 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 24 | - return; |
|
| 24 | + return; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
@@ -44,70 +44,70 @@ discard block |
||
| 44 | 44 | * @return array|string |
| 45 | 45 | */ |
| 46 | 46 | function action_inscrire_auteur_dist($statut, $mail_complet, $nom, $options = []) { |
| 47 | - if (!is_array($options)) { |
|
| 48 | - $options = ['id' => $options]; |
|
| 49 | - } |
|
| 50 | - |
|
| 51 | - if (function_exists('test_inscription')) { |
|
| 52 | - $f = 'test_inscription'; |
|
| 53 | - } else { |
|
| 54 | - $f = 'test_inscription_dist'; |
|
| 55 | - } |
|
| 56 | - $desc = $f($statut, $mail_complet, $nom, $options); |
|
| 57 | - |
|
| 58 | - // erreur ? |
|
| 59 | - if (!is_array($desc)) { |
|
| 60 | - return _T($desc); |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - include_spip('base/abstract_sql'); |
|
| 64 | - $res = sql_select('statut, id_auteur, login, email, nom', 'spip_auteurs', 'email=' . sql_quote($desc['email'])); |
|
| 65 | - // erreur ? |
|
| 66 | - if (!$res) { |
|
| 67 | - return _T('titre_probleme_technique'); |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - $row = sql_fetch($res); |
|
| 71 | - sql_free($res); |
|
| 72 | - if ($row) { |
|
| 73 | - if (isset($options['force_nouveau']) and $options['force_nouveau'] == true) { |
|
| 74 | - $desc['id_auteur'] = $row['id_auteur']; |
|
| 75 | - $desc = inscription_nouveau($desc); |
|
| 76 | - } else { |
|
| 77 | - $desc = $row; |
|
| 78 | - } |
|
| 79 | - } else // s'il n'existe pas deja, creer les identifiants |
|
| 80 | - { |
|
| 81 | - $desc = inscription_nouveau($desc); |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - // erreur ? |
|
| 85 | - if (!is_array($desc)) { |
|
| 86 | - return $desc; |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - |
|
| 90 | - // generer le mot de passe (ou le refaire si compte inutilise) |
|
| 91 | - $desc['pass'] = creer_pass_pour_auteur($desc['id_auteur']); |
|
| 92 | - |
|
| 93 | - // attribuer un jeton pour confirmation par clic sur un lien |
|
| 94 | - $desc['jeton'] = auteur_attribuer_jeton($desc['id_auteur']); |
|
| 95 | - |
|
| 96 | - // charger de suite cette fonction, pour ses utilitaires |
|
| 97 | - $envoyer_inscription = charger_fonction('envoyer_inscription', ''); |
|
| 98 | - [$sujet, $msg, $from, $head] = $envoyer_inscription($desc, $nom, $statut, $options); |
|
| 99 | - |
|
| 100 | - $notifications = charger_fonction('notifications', 'inc'); |
|
| 101 | - notifications_envoyer_mails($mail_complet, $msg, $sujet, $from, $head); |
|
| 102 | - |
|
| 103 | - // Notifications |
|
| 104 | - $notifications( |
|
| 105 | - 'inscription', |
|
| 106 | - $desc['id_auteur'], |
|
| 107 | - ['nom' => $desc['nom'], 'email' => $desc['email']] |
|
| 108 | - ); |
|
| 109 | - |
|
| 110 | - return $desc; |
|
| 47 | + if (!is_array($options)) { |
|
| 48 | + $options = ['id' => $options]; |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + if (function_exists('test_inscription')) { |
|
| 52 | + $f = 'test_inscription'; |
|
| 53 | + } else { |
|
| 54 | + $f = 'test_inscription_dist'; |
|
| 55 | + } |
|
| 56 | + $desc = $f($statut, $mail_complet, $nom, $options); |
|
| 57 | + |
|
| 58 | + // erreur ? |
|
| 59 | + if (!is_array($desc)) { |
|
| 60 | + return _T($desc); |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + include_spip('base/abstract_sql'); |
|
| 64 | + $res = sql_select('statut, id_auteur, login, email, nom', 'spip_auteurs', 'email=' . sql_quote($desc['email'])); |
|
| 65 | + // erreur ? |
|
| 66 | + if (!$res) { |
|
| 67 | + return _T('titre_probleme_technique'); |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + $row = sql_fetch($res); |
|
| 71 | + sql_free($res); |
|
| 72 | + if ($row) { |
|
| 73 | + if (isset($options['force_nouveau']) and $options['force_nouveau'] == true) { |
|
| 74 | + $desc['id_auteur'] = $row['id_auteur']; |
|
| 75 | + $desc = inscription_nouveau($desc); |
|
| 76 | + } else { |
|
| 77 | + $desc = $row; |
|
| 78 | + } |
|
| 79 | + } else // s'il n'existe pas deja, creer les identifiants |
|
| 80 | + { |
|
| 81 | + $desc = inscription_nouveau($desc); |
|
| 82 | + } |
|
| 83 | + |
|
| 84 | + // erreur ? |
|
| 85 | + if (!is_array($desc)) { |
|
| 86 | + return $desc; |
|
| 87 | + } |
|
| 88 | + |
|
| 89 | + |
|
| 90 | + // generer le mot de passe (ou le refaire si compte inutilise) |
|
| 91 | + $desc['pass'] = creer_pass_pour_auteur($desc['id_auteur']); |
|
| 92 | + |
|
| 93 | + // attribuer un jeton pour confirmation par clic sur un lien |
|
| 94 | + $desc['jeton'] = auteur_attribuer_jeton($desc['id_auteur']); |
|
| 95 | + |
|
| 96 | + // charger de suite cette fonction, pour ses utilitaires |
|
| 97 | + $envoyer_inscription = charger_fonction('envoyer_inscription', ''); |
|
| 98 | + [$sujet, $msg, $from, $head] = $envoyer_inscription($desc, $nom, $statut, $options); |
|
| 99 | + |
|
| 100 | + $notifications = charger_fonction('notifications', 'inc'); |
|
| 101 | + notifications_envoyer_mails($mail_complet, $msg, $sujet, $from, $head); |
|
| 102 | + |
|
| 103 | + // Notifications |
|
| 104 | + $notifications( |
|
| 105 | + 'inscription', |
|
| 106 | + $desc['id_auteur'], |
|
| 107 | + ['nom' => $desc['nom'], 'email' => $desc['email']] |
|
| 108 | + ); |
|
| 109 | + |
|
| 110 | + return $desc; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
@@ -130,23 +130,23 @@ discard block |
||
| 130 | 130 | * |
| 131 | 131 | */ |
| 132 | 132 | function test_inscription_dist($statut, $mail, $nom, $options) { |
| 133 | - include_spip('inc/filtres'); |
|
| 134 | - if (!$r = email_valide($mail)) { |
|
| 135 | - return 'info_email_invalide'; |
|
| 136 | - } |
|
| 137 | - $nom = trim(corriger_caracteres($nom)); |
|
| 138 | - $res = ['email' => $r, 'nom' => $nom, 'prefs' => $statut]; |
|
| 139 | - if (isset($options['login'])) { |
|
| 140 | - $login = trim(corriger_caracteres($options['login'])); |
|
| 141 | - if ((strlen($login) >= _LOGIN_TROP_COURT) and (strlen($nom) <= 64)) { |
|
| 142 | - $res['login'] = $login; |
|
| 143 | - } |
|
| 144 | - } |
|
| 145 | - if (!isset($res['login']) and ((strlen($nom) < _LOGIN_TROP_COURT) or (strlen($nom) > 64))) { |
|
| 146 | - return 'ecrire:info_login_trop_court'; |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - return $res; |
|
| 133 | + include_spip('inc/filtres'); |
|
| 134 | + if (!$r = email_valide($mail)) { |
|
| 135 | + return 'info_email_invalide'; |
|
| 136 | + } |
|
| 137 | + $nom = trim(corriger_caracteres($nom)); |
|
| 138 | + $res = ['email' => $r, 'nom' => $nom, 'prefs' => $statut]; |
|
| 139 | + if (isset($options['login'])) { |
|
| 140 | + $login = trim(corriger_caracteres($options['login'])); |
|
| 141 | + if ((strlen($login) >= _LOGIN_TROP_COURT) and (strlen($nom) <= 64)) { |
|
| 142 | + $res['login'] = $login; |
|
| 143 | + } |
|
| 144 | + } |
|
| 145 | + if (!isset($res['login']) and ((strlen($nom) < _LOGIN_TROP_COURT) or (strlen($nom) > 64))) { |
|
| 146 | + return 'ecrire:info_login_trop_court'; |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + return $res; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
@@ -159,33 +159,33 @@ discard block |
||
| 159 | 159 | * @return mixed|string |
| 160 | 160 | */ |
| 161 | 161 | function inscription_nouveau($desc) { |
| 162 | - if (!isset($desc['login']) or !strlen($desc['login'])) { |
|
| 163 | - $desc['login'] = test_login($desc['nom'], $desc['email']); |
|
| 164 | - } |
|
| 162 | + if (!isset($desc['login']) or !strlen($desc['login'])) { |
|
| 163 | + $desc['login'] = test_login($desc['nom'], $desc['email']); |
|
| 164 | + } |
|
| 165 | 165 | |
| 166 | - $desc['statut'] = 'nouveau'; |
|
| 167 | - include_spip('action/editer_auteur'); |
|
| 168 | - if (isset($desc['id_auteur'])) { |
|
| 169 | - $id_auteur = $desc['id_auteur']; |
|
| 170 | - } else { |
|
| 171 | - $id_auteur = auteur_inserer(); |
|
| 172 | - } |
|
| 166 | + $desc['statut'] = 'nouveau'; |
|
| 167 | + include_spip('action/editer_auteur'); |
|
| 168 | + if (isset($desc['id_auteur'])) { |
|
| 169 | + $id_auteur = $desc['id_auteur']; |
|
| 170 | + } else { |
|
| 171 | + $id_auteur = auteur_inserer(); |
|
| 172 | + } |
|
| 173 | 173 | |
| 174 | - if (!$id_auteur) { |
|
| 175 | - return _T('titre_probleme_technique'); |
|
| 176 | - } |
|
| 174 | + if (!$id_auteur) { |
|
| 175 | + return _T('titre_probleme_technique'); |
|
| 176 | + } |
|
| 177 | 177 | |
| 178 | - $desc['lang'] = $GLOBALS['spip_lang']; |
|
| 178 | + $desc['lang'] = $GLOBALS['spip_lang']; |
|
| 179 | 179 | |
| 180 | - include_spip('inc/autoriser'); |
|
| 181 | - // lever l'autorisation pour pouvoir modifier le statut |
|
| 182 | - autoriser_exception('modifier', 'auteur', $id_auteur); |
|
| 183 | - auteur_modifier($id_auteur, $desc); |
|
| 184 | - autoriser_exception('modifier', 'auteur', $id_auteur, false); |
|
| 180 | + include_spip('inc/autoriser'); |
|
| 181 | + // lever l'autorisation pour pouvoir modifier le statut |
|
| 182 | + autoriser_exception('modifier', 'auteur', $id_auteur); |
|
| 183 | + auteur_modifier($id_auteur, $desc); |
|
| 184 | + autoriser_exception('modifier', 'auteur', $id_auteur, false); |
|
| 185 | 185 | |
| 186 | - $desc['id_auteur'] = $id_auteur; |
|
| 186 | + $desc['id_auteur'] = $id_auteur; |
|
| 187 | 187 | |
| 188 | - return $desc; |
|
| 188 | + return $desc; |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | |
@@ -202,27 +202,27 @@ discard block |
||
| 202 | 202 | * @return string |
| 203 | 203 | */ |
| 204 | 204 | function test_login($nom, $mail) { |
| 205 | - include_spip('inc/charsets'); |
|
| 206 | - $nom = strtolower(translitteration($nom)); |
|
| 207 | - $login_base = preg_replace('/[^\w\d_]/', '_', $nom); |
|
| 208 | - |
|
| 209 | - // il faut eviter que le login soit vraiment trop court |
|
| 210 | - if (strlen($login_base) < 3) { |
|
| 211 | - $mail = strtolower(translitteration(preg_replace('/@.*/', '', $mail))); |
|
| 212 | - $login_base = preg_replace('/[^\w\d]/', '_', $mail); |
|
| 213 | - } |
|
| 214 | - if (strlen($login_base) < 3) { |
|
| 215 | - $login_base = 'user'; |
|
| 216 | - } |
|
| 217 | - |
|
| 218 | - $login = $login_base; |
|
| 219 | - |
|
| 220 | - for ($i = 1;; $i++) { |
|
| 221 | - if (!sql_countsel('spip_auteurs', "login='$login'")) { |
|
| 222 | - return $login; |
|
| 223 | - } |
|
| 224 | - $login = $login_base . $i; |
|
| 225 | - } |
|
| 205 | + include_spip('inc/charsets'); |
|
| 206 | + $nom = strtolower(translitteration($nom)); |
|
| 207 | + $login_base = preg_replace('/[^\w\d_]/', '_', $nom); |
|
| 208 | + |
|
| 209 | + // il faut eviter que le login soit vraiment trop court |
|
| 210 | + if (strlen($login_base) < 3) { |
|
| 211 | + $mail = strtolower(translitteration(preg_replace('/@.*/', '', $mail))); |
|
| 212 | + $login_base = preg_replace('/[^\w\d]/', '_', $mail); |
|
| 213 | + } |
|
| 214 | + if (strlen($login_base) < 3) { |
|
| 215 | + $login_base = 'user'; |
|
| 216 | + } |
|
| 217 | + |
|
| 218 | + $login = $login_base; |
|
| 219 | + |
|
| 220 | + for ($i = 1;; $i++) { |
|
| 221 | + if (!sql_countsel('spip_auteurs', "login='$login'")) { |
|
| 222 | + return $login; |
|
| 223 | + } |
|
| 224 | + $login = $login_base . $i; |
|
| 225 | + } |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | |
@@ -240,26 +240,26 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | function envoyer_inscription_dist($desc, $nom, $mode, $options = []) { |
| 242 | 242 | |
| 243 | - $contexte = array_merge($desc, $options); |
|
| 244 | - $contexte['nom'] = $nom; |
|
| 245 | - $contexte['mode'] = $mode; |
|
| 246 | - $contexte['url_confirm'] = generer_url_action('confirmer_inscription', '', true, true); |
|
| 247 | - $contexte['url_confirm'] = parametre_url($contexte['url_confirm'], 'email', $desc['email']); |
|
| 248 | - $contexte['url_confirm'] = parametre_url($contexte['url_confirm'], 'jeton', $desc['jeton']); |
|
| 249 | - // S'il y a l'option redirect, on l'ajoute directement ici |
|
| 250 | - if (isset($options['redirect'])) { |
|
| 251 | - $contexte['url_confirm'] = parametre_url($contexte['url_confirm'], 'redirect', $options['redirect']); |
|
| 252 | - } |
|
| 253 | - |
|
| 254 | - $modele_mail = 'modeles/mail_inscription'; |
|
| 255 | - if (isset($options['modele_mail']) and $options['modele_mail']) { |
|
| 256 | - $modele_mail = $options['modele_mail']; |
|
| 257 | - } |
|
| 258 | - $message = recuperer_fond($modele_mail, $contexte); |
|
| 259 | - $from = ($options['from'] ?? ''); |
|
| 260 | - $head = ''; |
|
| 261 | - |
|
| 262 | - return ['', $message, $from, $head]; |
|
| 243 | + $contexte = array_merge($desc, $options); |
|
| 244 | + $contexte['nom'] = $nom; |
|
| 245 | + $contexte['mode'] = $mode; |
|
| 246 | + $contexte['url_confirm'] = generer_url_action('confirmer_inscription', '', true, true); |
|
| 247 | + $contexte['url_confirm'] = parametre_url($contexte['url_confirm'], 'email', $desc['email']); |
|
| 248 | + $contexte['url_confirm'] = parametre_url($contexte['url_confirm'], 'jeton', $desc['jeton']); |
|
| 249 | + // S'il y a l'option redirect, on l'ajoute directement ici |
|
| 250 | + if (isset($options['redirect'])) { |
|
| 251 | + $contexte['url_confirm'] = parametre_url($contexte['url_confirm'], 'redirect', $options['redirect']); |
|
| 252 | + } |
|
| 253 | + |
|
| 254 | + $modele_mail = 'modeles/mail_inscription'; |
|
| 255 | + if (isset($options['modele_mail']) and $options['modele_mail']) { |
|
| 256 | + $modele_mail = $options['modele_mail']; |
|
| 257 | + } |
|
| 258 | + $message = recuperer_fond($modele_mail, $contexte); |
|
| 259 | + $from = ($options['from'] ?? ''); |
|
| 260 | + $head = ''; |
|
| 261 | + |
|
| 262 | + return ['', $message, $from, $head]; |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | |
@@ -270,12 +270,12 @@ discard block |
||
| 270 | 270 | * @return string |
| 271 | 271 | */ |
| 272 | 272 | function creer_pass_pour_auteur($id_auteur) { |
| 273 | - include_spip('inc/acces'); |
|
| 274 | - $pass = creer_pass_aleatoire(max(_PASS_LONGUEUR_MINI, 16), $id_auteur); |
|
| 275 | - include_spip('action/editer_auteur'); |
|
| 276 | - auteur_instituer($id_auteur, ['pass' => $pass]); |
|
| 273 | + include_spip('inc/acces'); |
|
| 274 | + $pass = creer_pass_aleatoire(max(_PASS_LONGUEUR_MINI, 16), $id_auteur); |
|
| 275 | + include_spip('action/editer_auteur'); |
|
| 276 | + auteur_instituer($id_auteur, ['pass' => $pass]); |
|
| 277 | 277 | |
| 278 | - return $pass; |
|
| 278 | + return $pass; |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | /** |
@@ -288,17 +288,17 @@ discard block |
||
| 288 | 288 | * @return string |
| 289 | 289 | */ |
| 290 | 290 | function tester_statut_inscription($statut_tmp, $id) { |
| 291 | - include_spip('inc/autoriser'); |
|
| 292 | - if ($statut_tmp) { |
|
| 293 | - return autoriser('inscrireauteur', $statut_tmp, $id) ? $statut_tmp : ''; |
|
| 294 | - } elseif ( |
|
| 295 | - autoriser('inscrireauteur', $statut_tmp = '1comite', $id) |
|
| 296 | - or autoriser('inscrireauteur', $statut_tmp = '6forum', $id) |
|
| 297 | - ) { |
|
| 298 | - return $statut_tmp; |
|
| 299 | - } |
|
| 300 | - |
|
| 301 | - return ''; |
|
| 291 | + include_spip('inc/autoriser'); |
|
| 292 | + if ($statut_tmp) { |
|
| 293 | + return autoriser('inscrireauteur', $statut_tmp, $id) ? $statut_tmp : ''; |
|
| 294 | + } elseif ( |
|
| 295 | + autoriser('inscrireauteur', $statut_tmp = '1comite', $id) |
|
| 296 | + or autoriser('inscrireauteur', $statut_tmp = '6forum', $id) |
|
| 297 | + ) { |
|
| 298 | + return $statut_tmp; |
|
| 299 | + } |
|
| 300 | + |
|
| 301 | + return ''; |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | |
@@ -312,35 +312,35 @@ discard block |
||
| 312 | 312 | * @return array |
| 313 | 313 | */ |
| 314 | 314 | function confirmer_statut_inscription($auteur) { |
| 315 | - // securite |
|
| 316 | - if ($auteur['statut'] != 'nouveau') { |
|
| 317 | - return $auteur; |
|
| 318 | - } |
|
| 319 | - |
|
| 320 | - $s = $auteur['prefs']; |
|
| 321 | - // securite, au cas ou prefs aurait ete corrompu (ou deja ecrase par un tableau serialize) |
|
| 322 | - if (!preg_match(',^\w+$,', $s)) { |
|
| 323 | - $s = '6forum'; |
|
| 324 | - } |
|
| 325 | - include_spip('inc/autoriser'); |
|
| 326 | - if (!autoriser('inscrireauteur', $s)) { |
|
| 327 | - return $auteur; |
|
| 328 | - } |
|
| 329 | - |
|
| 330 | - include_spip('inc/autoriser'); |
|
| 331 | - // accorder l'autorisation de modif du statut auteur |
|
| 332 | - autoriser_exception('modifier', 'auteur', $auteur['id_auteur']); |
|
| 333 | - include_spip('action/editer_auteur'); |
|
| 334 | - // changer le statut |
|
| 335 | - auteur_modifier($auteur['id_auteur'], ['statut' => $s]); |
|
| 336 | - unset($_COOKIE['spip_session']); // forcer la maj de la session |
|
| 337 | - // lever l'autorisation de modif du statut auteur |
|
| 338 | - autoriser_exception('modifier', 'auteur', $auteur['id_auteur'], false); |
|
| 339 | - |
|
| 340 | - // mettre a jour le statut |
|
| 341 | - $auteur['statut'] = $s; |
|
| 342 | - |
|
| 343 | - return $auteur; |
|
| 315 | + // securite |
|
| 316 | + if ($auteur['statut'] != 'nouveau') { |
|
| 317 | + return $auteur; |
|
| 318 | + } |
|
| 319 | + |
|
| 320 | + $s = $auteur['prefs']; |
|
| 321 | + // securite, au cas ou prefs aurait ete corrompu (ou deja ecrase par un tableau serialize) |
|
| 322 | + if (!preg_match(',^\w+$,', $s)) { |
|
| 323 | + $s = '6forum'; |
|
| 324 | + } |
|
| 325 | + include_spip('inc/autoriser'); |
|
| 326 | + if (!autoriser('inscrireauteur', $s)) { |
|
| 327 | + return $auteur; |
|
| 328 | + } |
|
| 329 | + |
|
| 330 | + include_spip('inc/autoriser'); |
|
| 331 | + // accorder l'autorisation de modif du statut auteur |
|
| 332 | + autoriser_exception('modifier', 'auteur', $auteur['id_auteur']); |
|
| 333 | + include_spip('action/editer_auteur'); |
|
| 334 | + // changer le statut |
|
| 335 | + auteur_modifier($auteur['id_auteur'], ['statut' => $s]); |
|
| 336 | + unset($_COOKIE['spip_session']); // forcer la maj de la session |
|
| 337 | + // lever l'autorisation de modif du statut auteur |
|
| 338 | + autoriser_exception('modifier', 'auteur', $auteur['id_auteur'], false); |
|
| 339 | + |
|
| 340 | + // mettre a jour le statut |
|
| 341 | + $auteur['statut'] = $s; |
|
| 342 | + |
|
| 343 | + return $auteur; |
|
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | |
@@ -354,20 +354,20 @@ discard block |
||
| 354 | 354 | * @return string |
| 355 | 355 | */ |
| 356 | 356 | function auteur_attribuer_jeton($id_auteur): string { |
| 357 | - include_spip('base/abstract_sql'); |
|
| 358 | - include_spip('inc/acces'); |
|
| 359 | - include_spip('inc/chiffrer'); |
|
| 360 | - // s'assurer de l'unicite du jeton pour le couple (email,cookie) |
|
| 361 | - do { |
|
| 362 | - // Un morceau du jeton est lisible en bdd pour éviter de devoir déchiffrer |
|
| 363 | - // tous les jetons connus pour vérifier le jeton d’un auteur. |
|
| 364 | - $public = substr(creer_uniqid(), 0, 7) . '.'; |
|
| 365 | - $jeton = $public . creer_uniqid(); |
|
| 366 | - $jeton_chiffre_prefixe = $public . Chiffrement::chiffrer($jeton, SpipCles::secret_du_site()); |
|
| 367 | - sql_updateq('spip_auteurs', ['cookie_oubli' => $jeton_chiffre_prefixe], 'id_auteur=' . intval($id_auteur)); |
|
| 368 | - } while (sql_countsel('spip_auteurs', 'cookie_oubli=' . sql_quote($jeton_chiffre_prefixe, '', 'string')) > 1); |
|
| 369 | - |
|
| 370 | - return $jeton; |
|
| 357 | + include_spip('base/abstract_sql'); |
|
| 358 | + include_spip('inc/acces'); |
|
| 359 | + include_spip('inc/chiffrer'); |
|
| 360 | + // s'assurer de l'unicite du jeton pour le couple (email,cookie) |
|
| 361 | + do { |
|
| 362 | + // Un morceau du jeton est lisible en bdd pour éviter de devoir déchiffrer |
|
| 363 | + // tous les jetons connus pour vérifier le jeton d’un auteur. |
|
| 364 | + $public = substr(creer_uniqid(), 0, 7) . '.'; |
|
| 365 | + $jeton = $public . creer_uniqid(); |
|
| 366 | + $jeton_chiffre_prefixe = $public . Chiffrement::chiffrer($jeton, SpipCles::secret_du_site()); |
|
| 367 | + sql_updateq('spip_auteurs', ['cookie_oubli' => $jeton_chiffre_prefixe], 'id_auteur=' . intval($id_auteur)); |
|
| 368 | + } while (sql_countsel('spip_auteurs', 'cookie_oubli=' . sql_quote($jeton_chiffre_prefixe, '', 'string')) > 1); |
|
| 369 | + |
|
| 370 | + return $jeton; |
|
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | /** |
@@ -381,20 +381,20 @@ discard block |
||
| 381 | 381 | * @return string|null |
| 382 | 382 | */ |
| 383 | 383 | function auteur_lire_jeton(int $id_auteur, bool $autoInit = false): ?string { |
| 384 | - include_spip('base/abstract_sql'); |
|
| 385 | - $jeton_chiffre_prefixe = sql_getfetsel('cookie_oubli', 'spip_auteurs', 'id_auteur=' . $id_auteur); |
|
| 386 | - if ($jeton_chiffre_prefixe) { |
|
| 387 | - include_spip('inc/chiffrer'); |
|
| 388 | - $jeton_chiffre = substr($jeton_chiffre_prefixe, 8); |
|
| 389 | - $jeton = Chiffrement::dechiffrer($jeton_chiffre, SpipCles::secret_du_site()); |
|
| 390 | - if ($jeton) { |
|
| 391 | - return $jeton; |
|
| 392 | - } |
|
| 393 | - } |
|
| 394 | - if ($autoInit) { |
|
| 395 | - return auteur_attribuer_jeton($id_auteur); |
|
| 396 | - } |
|
| 397 | - return null; |
|
| 384 | + include_spip('base/abstract_sql'); |
|
| 385 | + $jeton_chiffre_prefixe = sql_getfetsel('cookie_oubli', 'spip_auteurs', 'id_auteur=' . $id_auteur); |
|
| 386 | + if ($jeton_chiffre_prefixe) { |
|
| 387 | + include_spip('inc/chiffrer'); |
|
| 388 | + $jeton_chiffre = substr($jeton_chiffre_prefixe, 8); |
|
| 389 | + $jeton = Chiffrement::dechiffrer($jeton_chiffre, SpipCles::secret_du_site()); |
|
| 390 | + if ($jeton) { |
|
| 391 | + return $jeton; |
|
| 392 | + } |
|
| 393 | + } |
|
| 394 | + if ($autoInit) { |
|
| 395 | + return auteur_attribuer_jeton($id_auteur); |
|
| 396 | + } |
|
| 397 | + return null; |
|
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | /** |
@@ -404,25 +404,25 @@ discard block |
||
| 404 | 404 | * @return array|bool |
| 405 | 405 | */ |
| 406 | 406 | function auteur_verifier_jeton($jeton) { |
| 407 | - // refuser un jeton corrompu |
|
| 408 | - if (preg_match(',[^0-9a-f.],i', $jeton)) { |
|
| 409 | - return false; |
|
| 410 | - } |
|
| 411 | - |
|
| 412 | - include_spip('base/abstract_sql'); |
|
| 413 | - include_spip('inc/chiffrer'); |
|
| 414 | - $public = substr($jeton, 0, 8); |
|
| 415 | - |
|
| 416 | - // Les auteurs qui ont un jetons ressemblant |
|
| 417 | - $auteurs = sql_allfetsel('*', 'spip_auteurs', 'cookie_oubli LIKE ' . sql_quote($public . '%')); |
|
| 418 | - foreach ($auteurs as $auteur) { |
|
| 419 | - $jeton_chiffre = substr($auteur['cookie_oubli'], 8); |
|
| 420 | - $_jeton = Chiffrement::dechiffrer($jeton_chiffre, SpipCles::secret_du_site()); |
|
| 421 | - if ($_jeton and hash_equals($jeton, $_jeton)) { |
|
| 422 | - return $auteur; |
|
| 423 | - } |
|
| 424 | - } |
|
| 425 | - return false; |
|
| 407 | + // refuser un jeton corrompu |
|
| 408 | + if (preg_match(',[^0-9a-f.],i', $jeton)) { |
|
| 409 | + return false; |
|
| 410 | + } |
|
| 411 | + |
|
| 412 | + include_spip('base/abstract_sql'); |
|
| 413 | + include_spip('inc/chiffrer'); |
|
| 414 | + $public = substr($jeton, 0, 8); |
|
| 415 | + |
|
| 416 | + // Les auteurs qui ont un jetons ressemblant |
|
| 417 | + $auteurs = sql_allfetsel('*', 'spip_auteurs', 'cookie_oubli LIKE ' . sql_quote($public . '%')); |
|
| 418 | + foreach ($auteurs as $auteur) { |
|
| 419 | + $jeton_chiffre = substr($auteur['cookie_oubli'], 8); |
|
| 420 | + $_jeton = Chiffrement::dechiffrer($jeton_chiffre, SpipCles::secret_du_site()); |
|
| 421 | + if ($_jeton and hash_equals($jeton, $_jeton)) { |
|
| 422 | + return $auteur; |
|
| 423 | + } |
|
| 424 | + } |
|
| 425 | + return false; |
|
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | /** |
@@ -432,6 +432,6 @@ discard block |
||
| 432 | 432 | * @return bool |
| 433 | 433 | */ |
| 434 | 434 | function auteur_effacer_jeton($id_auteur) { |
| 435 | - include_spip('base/abstract_sql'); |
|
| 436 | - return sql_updateq('spip_auteurs', ['cookie_oubli' => ''], 'id_auteur=' . intval($id_auteur)); |
|
| 435 | + include_spip('base/abstract_sql'); |
|
| 436 | + return sql_updateq('spip_auteurs', ['cookie_oubli' => ''], 'id_auteur=' . intval($id_auteur)); |
|
| 437 | 437 | } |
@@ -19,78 +19,78 @@ |
||
| 19 | 19 | * @link https://www.php.net/manual/fr/book.sodium.php |
| 20 | 20 | */ |
| 21 | 21 | class Chiffrement { |
| 22 | - /** Chiffre un message en utilisant une clé ou un mot de passe */ |
|
| 23 | - public static function chiffrer( |
|
| 24 | - string $message, |
|
| 25 | - #[\SensitiveParameter] |
|
| 26 | - string $key |
|
| 27 | - ): ?string { |
|
| 28 | - // create a random salt for key derivation |
|
| 29 | - $salt = random_bytes(SODIUM_CRYPTO_PWHASH_SALTBYTES); |
|
| 30 | - $key = self::deriveKeyFromPassword($key, $salt); |
|
| 31 | - $nonce = random_bytes(\SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); |
|
| 32 | - $padded_message = sodium_pad($message, 16); |
|
| 33 | - $encrypted = sodium_crypto_secretbox($padded_message, $nonce, $key); |
|
| 34 | - $encoded = base64_encode($salt . $nonce . $encrypted); |
|
| 35 | - sodium_memzero($key); |
|
| 36 | - sodium_memzero($nonce); |
|
| 37 | - sodium_memzero($salt); |
|
| 38 | - #spip_log("chiffrer($message)=$encoded", 'chiffrer' . _LOG_DEBUG); |
|
| 39 | - return $encoded; |
|
| 40 | - } |
|
| 22 | + /** Chiffre un message en utilisant une clé ou un mot de passe */ |
|
| 23 | + public static function chiffrer( |
|
| 24 | + string $message, |
|
| 25 | + #[\SensitiveParameter] |
|
| 26 | + string $key |
|
| 27 | + ): ?string { |
|
| 28 | + // create a random salt for key derivation |
|
| 29 | + $salt = random_bytes(SODIUM_CRYPTO_PWHASH_SALTBYTES); |
|
| 30 | + $key = self::deriveKeyFromPassword($key, $salt); |
|
| 31 | + $nonce = random_bytes(\SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); |
|
| 32 | + $padded_message = sodium_pad($message, 16); |
|
| 33 | + $encrypted = sodium_crypto_secretbox($padded_message, $nonce, $key); |
|
| 34 | + $encoded = base64_encode($salt . $nonce . $encrypted); |
|
| 35 | + sodium_memzero($key); |
|
| 36 | + sodium_memzero($nonce); |
|
| 37 | + sodium_memzero($salt); |
|
| 38 | + #spip_log("chiffrer($message)=$encoded", 'chiffrer' . _LOG_DEBUG); |
|
| 39 | + return $encoded; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - /** Déchiffre un message en utilisant une clé ou un mot de passe */ |
|
| 43 | - public static function dechiffrer( |
|
| 44 | - string $encoded, |
|
| 45 | - #[\SensitiveParameter] |
|
| 46 | - string $key |
|
| 47 | - ): ?string { |
|
| 48 | - $decoded = base64_decode($encoded); |
|
| 49 | - $salt = substr($decoded, 0, \SODIUM_CRYPTO_PWHASH_SALTBYTES); |
|
| 50 | - $nonce = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES, \SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); |
|
| 51 | - $encrypted = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES + \SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); |
|
| 52 | - $key = self::deriveKeyFromPassword($key, $salt); |
|
| 53 | - $padded_message = sodium_crypto_secretbox_open($encrypted, $nonce, $key); |
|
| 54 | - sodium_memzero($key); |
|
| 55 | - sodium_memzero($nonce); |
|
| 56 | - sodium_memzero($salt); |
|
| 57 | - if ($padded_message === false) { |
|
| 58 | - spip_log("dechiffrer() chiffre corrompu `$encoded`", 'chiffrer' . _LOG_DEBUG); |
|
| 59 | - return null; |
|
| 60 | - } |
|
| 61 | - $message = sodium_unpad($padded_message, 16); |
|
| 62 | - #spip_log("dechiffrer($encoded)=$message", 'chiffrer' . _LOG_DEBUG); |
|
| 63 | - return $message; |
|
| 64 | - } |
|
| 42 | + /** Déchiffre un message en utilisant une clé ou un mot de passe */ |
|
| 43 | + public static function dechiffrer( |
|
| 44 | + string $encoded, |
|
| 45 | + #[\SensitiveParameter] |
|
| 46 | + string $key |
|
| 47 | + ): ?string { |
|
| 48 | + $decoded = base64_decode($encoded); |
|
| 49 | + $salt = substr($decoded, 0, \SODIUM_CRYPTO_PWHASH_SALTBYTES); |
|
| 50 | + $nonce = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES, \SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); |
|
| 51 | + $encrypted = substr($decoded, \SODIUM_CRYPTO_PWHASH_SALTBYTES + \SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); |
|
| 52 | + $key = self::deriveKeyFromPassword($key, $salt); |
|
| 53 | + $padded_message = sodium_crypto_secretbox_open($encrypted, $nonce, $key); |
|
| 54 | + sodium_memzero($key); |
|
| 55 | + sodium_memzero($nonce); |
|
| 56 | + sodium_memzero($salt); |
|
| 57 | + if ($padded_message === false) { |
|
| 58 | + spip_log("dechiffrer() chiffre corrompu `$encoded`", 'chiffrer' . _LOG_DEBUG); |
|
| 59 | + return null; |
|
| 60 | + } |
|
| 61 | + $message = sodium_unpad($padded_message, 16); |
|
| 62 | + #spip_log("dechiffrer($encoded)=$message", 'chiffrer' . _LOG_DEBUG); |
|
| 63 | + return $message; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - /** Génère une clé de la taille attendue pour le chiffrement */ |
|
| 67 | - public static function keygen(): string { |
|
| 68 | - return sodium_crypto_secretbox_keygen(); |
|
| 69 | - } |
|
| 66 | + /** Génère une clé de la taille attendue pour le chiffrement */ |
|
| 67 | + public static function keygen(): string { |
|
| 68 | + return sodium_crypto_secretbox_keygen(); |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - /** |
|
| 72 | - * Retourne une clé de la taille attendue pour le chiffrement |
|
| 73 | - * |
|
| 74 | - * Notamment si on utilise un mot de passe comme clé, il faut le hacher |
|
| 75 | - * pour servir de clé à la taille correspondante. |
|
| 76 | - */ |
|
| 77 | - private static function deriveKeyFromPassword( |
|
| 78 | - #[\SensitiveParameter] |
|
| 79 | - string $password, |
|
| 80 | - string $salt |
|
| 81 | - ): string { |
|
| 82 | - if (strlen($password) === \SODIUM_CRYPTO_SECRETBOX_KEYBYTES) { |
|
| 83 | - return $password; |
|
| 84 | - } |
|
| 85 | - $key = sodium_crypto_pwhash( |
|
| 86 | - \SODIUM_CRYPTO_SECRETBOX_KEYBYTES, |
|
| 87 | - $password, |
|
| 88 | - $salt, |
|
| 89 | - \SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE, |
|
| 90 | - \SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE |
|
| 91 | - ); |
|
| 92 | - sodium_memzero($password); |
|
| 71 | + /** |
|
| 72 | + * Retourne une clé de la taille attendue pour le chiffrement |
|
| 73 | + * |
|
| 74 | + * Notamment si on utilise un mot de passe comme clé, il faut le hacher |
|
| 75 | + * pour servir de clé à la taille correspondante. |
|
| 76 | + */ |
|
| 77 | + private static function deriveKeyFromPassword( |
|
| 78 | + #[\SensitiveParameter] |
|
| 79 | + string $password, |
|
| 80 | + string $salt |
|
| 81 | + ): string { |
|
| 82 | + if (strlen($password) === \SODIUM_CRYPTO_SECRETBOX_KEYBYTES) { |
|
| 83 | + return $password; |
|
| 84 | + } |
|
| 85 | + $key = sodium_crypto_pwhash( |
|
| 86 | + \SODIUM_CRYPTO_SECRETBOX_KEYBYTES, |
|
| 87 | + $password, |
|
| 88 | + $salt, |
|
| 89 | + \SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE, |
|
| 90 | + \SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE |
|
| 91 | + ); |
|
| 92 | + sodium_memzero($password); |
|
| 93 | 93 | |
| 94 | - return $key; |
|
| 95 | - } |
|
| 94 | + return $key; |
|
| 95 | + } |
|
| 96 | 96 | } |
@@ -14,48 +14,48 @@ |
||
| 14 | 14 | |
| 15 | 15 | /** Conteneur de clés (chiffrement, authentification) */ |
| 16 | 16 | class Cles implements \Countable /* , ContainerInterface */ { |
| 17 | - private array $keys; |
|
| 18 | - public function __construct(array $keys) { |
|
| 19 | - $this->keys = $keys; |
|
| 20 | - } |
|
| 21 | - |
|
| 22 | - public function has(string $name): bool { |
|
| 23 | - return array_key_exists($name, $this->keys); |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - public function get(string $name): ?string { |
|
| 27 | - return $this->keys[$name] ?? null; |
|
| 28 | - } |
|
| 29 | - |
|
| 30 | - public function generate(string $name): string { |
|
| 31 | - $key = Chiffrement::keygen(); |
|
| 32 | - $this->keys[$name] = $key; |
|
| 33 | - spip_log("Création de la cle $name", 'chiffrer' . _LOG_INFO_IMPORTANTE); |
|
| 34 | - return $key; |
|
| 35 | - } |
|
| 36 | - |
|
| 37 | - public function set( |
|
| 38 | - string $name, |
|
| 39 | - #[\SensitiveParameter] |
|
| 40 | - string $key |
|
| 41 | - ): void { |
|
| 42 | - $this->keys[$name] = $key; |
|
| 43 | - } |
|
| 44 | - |
|
| 45 | - public function delete(string $name): bool { |
|
| 46 | - if (isset($this->keys[$name])) { |
|
| 47 | - unset($this->keys[$name]); |
|
| 48 | - return true; |
|
| 49 | - }; |
|
| 50 | - return false; |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - public function count(): int { |
|
| 54 | - return count($this->keys); |
|
| 55 | - } |
|
| 56 | - |
|
| 57 | - public function toJson(): string { |
|
| 58 | - $json = array_map('base64_encode', $this->keys); |
|
| 59 | - return \json_encode($json); |
|
| 60 | - } |
|
| 17 | + private array $keys; |
|
| 18 | + public function __construct(array $keys) { |
|
| 19 | + $this->keys = $keys; |
|
| 20 | + } |
|
| 21 | + |
|
| 22 | + public function has(string $name): bool { |
|
| 23 | + return array_key_exists($name, $this->keys); |
|
| 24 | + } |
|
| 25 | + |
|
| 26 | + public function get(string $name): ?string { |
|
| 27 | + return $this->keys[$name] ?? null; |
|
| 28 | + } |
|
| 29 | + |
|
| 30 | + public function generate(string $name): string { |
|
| 31 | + $key = Chiffrement::keygen(); |
|
| 32 | + $this->keys[$name] = $key; |
|
| 33 | + spip_log("Création de la cle $name", 'chiffrer' . _LOG_INFO_IMPORTANTE); |
|
| 34 | + return $key; |
|
| 35 | + } |
|
| 36 | + |
|
| 37 | + public function set( |
|
| 38 | + string $name, |
|
| 39 | + #[\SensitiveParameter] |
|
| 40 | + string $key |
|
| 41 | + ): void { |
|
| 42 | + $this->keys[$name] = $key; |
|
| 43 | + } |
|
| 44 | + |
|
| 45 | + public function delete(string $name): bool { |
|
| 46 | + if (isset($this->keys[$name])) { |
|
| 47 | + unset($this->keys[$name]); |
|
| 48 | + return true; |
|
| 49 | + }; |
|
| 50 | + return false; |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + public function count(): int { |
|
| 54 | + return count($this->keys); |
|
| 55 | + } |
|
| 56 | + |
|
| 57 | + public function toJson(): string { |
|
| 58 | + $json = array_map('base64_encode', $this->keys); |
|
| 59 | + return \json_encode($json); |
|
| 60 | + } |
|
| 61 | 61 | } |
@@ -4,248 +4,248 @@ discard block |
||
| 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 | - 'access_interface_graphique' => 'Ritorna all’interfaccia grafica completa', |
|
| 14 | - 'access_mode_texte' => 'Visualizza l’interfaccia testuale semplificata', |
|
| 15 | - 'admin_debug' => 'debug', |
|
| 16 | - 'admin_modifier_article' => 'Modifica l’articolo', |
|
| 17 | - 'admin_modifier_auteur' => 'Modifica l’autore', |
|
| 18 | - 'admin_modifier_breve' => 'Modifica la breve', |
|
| 19 | - 'admin_modifier_mot' => 'Modifica la parola chiave', |
|
| 20 | - 'admin_modifier_rubrique' => 'Modifica la rubrica', |
|
| 21 | - 'admin_recalculer' => 'Rigenera la pagina', |
|
| 22 | - 'afficher_calendrier' => 'Mostra il calendario', |
|
| 23 | - 'afficher_trad' => 'visualizzare le traduzioni', |
|
| 24 | - 'alerte_maj_impossible' => '<b>Attenzione!</b> L’aggiornamento del database SQL alla versione @version@ è impossibile, forse a causa di un problema con i diritti di modifica nel database. Contattare il proprio fornitore di hosting.', |
|
| 25 | - 'alerte_modif_info_concourante' => 'ATTENZIONE: Questa informazione è stata modificata altrove. Il valore attuale è:', |
|
| 26 | - 'analyse_xml' => 'Analisi XML', |
|
| 27 | - 'annuler' => 'Annulla', |
|
| 28 | - 'antispam_champ_vide' => 'Si prega di lasciare vuoto questo campo:', |
|
| 29 | - 'articles_recents' => 'Articoli più recenti', |
|
| 30 | - 'attention_champ_mini_nb_caractères' => 'Attenzione! Minimo @nb@ caratteri', |
|
| 31 | - 'avis_1_erreur_saisie' => 'C’è un errore nell’input, verificare le informazioni.', |
|
| 32 | - 'avis_archive_incorrect' => 'il file archivio non è un file SPIP', |
|
| 33 | - 'avis_archive_invalide' => 'il file archivio non è valido', |
|
| 34 | - 'avis_attention' => 'ATTENZIONE!', |
|
| 35 | - 'avis_champ_incorrect_type_objet' => 'Nome di campo errato @name@ per oggetto di tipo @type@', |
|
| 36 | - 'avis_colonne_inexistante' => 'La colonna @col@ non esiste', |
|
| 37 | - 'avis_erreur' => 'Errore: vedi sopra', |
|
| 38 | - 'avis_erreur_connexion' => 'Errore di connessione', |
|
| 39 | - 'avis_erreur_cookie' => 'problema di cookie', |
|
| 40 | - 'avis_erreur_fonction_contexte' => 'Errore di programmazione. Questa funzione non deve essere chiamata in questo contesto.', |
|
| 41 | - 'avis_erreur_mysql' => 'Errore SQL ', |
|
| 42 | - 'avis_erreur_sauvegarde' => 'Errore nel salvataggio (@type@ @id_objet@)! ', |
|
| 43 | - 'avis_erreur_visiteur' => 'Problema di accesso all’area riservata', |
|
| 44 | - 'avis_nb_erreurs_saisie' => 'Ci sono @nb@ errori nell’input, verificare le informazioni.', |
|
| 12 | + // A |
|
| 13 | + 'access_interface_graphique' => 'Ritorna all’interfaccia grafica completa', |
|
| 14 | + 'access_mode_texte' => 'Visualizza l’interfaccia testuale semplificata', |
|
| 15 | + 'admin_debug' => 'debug', |
|
| 16 | + 'admin_modifier_article' => 'Modifica l’articolo', |
|
| 17 | + 'admin_modifier_auteur' => 'Modifica l’autore', |
|
| 18 | + 'admin_modifier_breve' => 'Modifica la breve', |
|
| 19 | + 'admin_modifier_mot' => 'Modifica la parola chiave', |
|
| 20 | + 'admin_modifier_rubrique' => 'Modifica la rubrica', |
|
| 21 | + 'admin_recalculer' => 'Rigenera la pagina', |
|
| 22 | + 'afficher_calendrier' => 'Mostra il calendario', |
|
| 23 | + 'afficher_trad' => 'visualizzare le traduzioni', |
|
| 24 | + 'alerte_maj_impossible' => '<b>Attenzione!</b> L’aggiornamento del database SQL alla versione @version@ è impossibile, forse a causa di un problema con i diritti di modifica nel database. Contattare il proprio fornitore di hosting.', |
|
| 25 | + 'alerte_modif_info_concourante' => 'ATTENZIONE: Questa informazione è stata modificata altrove. Il valore attuale è:', |
|
| 26 | + 'analyse_xml' => 'Analisi XML', |
|
| 27 | + 'annuler' => 'Annulla', |
|
| 28 | + 'antispam_champ_vide' => 'Si prega di lasciare vuoto questo campo:', |
|
| 29 | + 'articles_recents' => 'Articoli più recenti', |
|
| 30 | + 'attention_champ_mini_nb_caractères' => 'Attenzione! Minimo @nb@ caratteri', |
|
| 31 | + 'avis_1_erreur_saisie' => 'C’è un errore nell’input, verificare le informazioni.', |
|
| 32 | + 'avis_archive_incorrect' => 'il file archivio non è un file SPIP', |
|
| 33 | + 'avis_archive_invalide' => 'il file archivio non è valido', |
|
| 34 | + 'avis_attention' => 'ATTENZIONE!', |
|
| 35 | + 'avis_champ_incorrect_type_objet' => 'Nome di campo errato @name@ per oggetto di tipo @type@', |
|
| 36 | + 'avis_colonne_inexistante' => 'La colonna @col@ non esiste', |
|
| 37 | + 'avis_erreur' => 'Errore: vedi sopra', |
|
| 38 | + 'avis_erreur_connexion' => 'Errore di connessione', |
|
| 39 | + 'avis_erreur_cookie' => 'problema di cookie', |
|
| 40 | + 'avis_erreur_fonction_contexte' => 'Errore di programmazione. Questa funzione non deve essere chiamata in questo contesto.', |
|
| 41 | + 'avis_erreur_mysql' => 'Errore SQL ', |
|
| 42 | + 'avis_erreur_sauvegarde' => 'Errore nel salvataggio (@type@ @id_objet@)! ', |
|
| 43 | + 'avis_erreur_visiteur' => 'Problema di accesso all’area riservata', |
|
| 44 | + 'avis_nb_erreurs_saisie' => 'Ci sono @nb@ errori nell’input, verificare le informazioni.', |
|
| 45 | 45 | |
| 46 | - // B |
|
| 47 | - 'barre_a_accent_grave' => 'Inserire una A maiscola con accento grave', |
|
| 48 | - 'barre_aide' => 'Utilizzare le scorciatoie tipografiche di SPIP per migliorare l\\’impaginazione del testo', |
|
| 49 | - 'barre_e_accent_aigu' => 'Inserire una E maiscola con accento acuto', |
|
| 50 | - 'barre_eo' => 'Inserire una E nell’O', |
|
| 51 | - 'barre_eo_maj' => 'Inserire una E nell’O maiuscola', |
|
| 52 | - 'barre_euro' => 'Inserire il simbolo €', |
|
| 53 | - 'barre_gras' => 'Formattare in {{grassetto}}', |
|
| 54 | - 'barre_guillemets' => 'Porre il testo fra « virgolette basse francesi »', |
|
| 55 | - 'barre_guillemets_simples' => 'Porre il testo fra „virgolette“', |
|
| 56 | - 'barre_intertitre' => 'Trasformare in {{{titolo di paragrafo}}}', |
|
| 57 | - 'barre_italic' => 'Formattare in {corsivo}', |
|
| 58 | - 'barre_lien' => 'Trasformare in un [link ipertestuale->http://...]', |
|
| 59 | - 'barre_lien_input' => 'Indicare l’indirizzo del link (è possibile indicare l’indirizzo Web come http://www.ilmiosito.com o semplicemente indicare il numero di un singolo articolo).', |
|
| 60 | - 'barre_note' => 'Trasformare in [[Nota a fondo pagina]]', |
|
| 61 | - 'barre_paragraphe' => 'Crea un paragrafo', |
|
| 62 | - 'barre_quote' => '<quote>Citare un messaggio</quote>', |
|
| 63 | - 'bouton_changer' => 'Cambia', |
|
| 64 | - 'bouton_chercher' => 'Cerca', |
|
| 65 | - 'bouton_choisir' => 'Scegli', |
|
| 66 | - 'bouton_deplacer' => 'Sposta', |
|
| 67 | - 'bouton_download' => 'Download', |
|
| 68 | - 'bouton_enregistrer' => 'Salva', |
|
| 69 | - 'bouton_radio_desactiver_messagerie_interne' => 'Disattiva la messaggistica interna', |
|
| 70 | - 'bouton_radio_envoi_annonces' => 'Invia gli annunci editoriali', |
|
| 71 | - 'bouton_radio_non_envoi_annonces' => 'Non inviare annunci', |
|
| 72 | - 'bouton_radio_non_envoi_liste_nouveautes' => 'Non inviare l’elenco delle novità', |
|
| 73 | - 'bouton_recharger_page' => 'ricaricare questa pagina', |
|
| 74 | - 'bouton_telecharger' => 'Upload', |
|
| 75 | - 'bouton_upload' => 'Upload', |
|
| 76 | - 'bouton_valider' => 'Invia', |
|
| 46 | + // B |
|
| 47 | + 'barre_a_accent_grave' => 'Inserire una A maiscola con accento grave', |
|
| 48 | + 'barre_aide' => 'Utilizzare le scorciatoie tipografiche di SPIP per migliorare l\\’impaginazione del testo', |
|
| 49 | + 'barre_e_accent_aigu' => 'Inserire una E maiscola con accento acuto', |
|
| 50 | + 'barre_eo' => 'Inserire una E nell’O', |
|
| 51 | + 'barre_eo_maj' => 'Inserire una E nell’O maiuscola', |
|
| 52 | + 'barre_euro' => 'Inserire il simbolo €', |
|
| 53 | + 'barre_gras' => 'Formattare in {{grassetto}}', |
|
| 54 | + 'barre_guillemets' => 'Porre il testo fra « virgolette basse francesi »', |
|
| 55 | + 'barre_guillemets_simples' => 'Porre il testo fra „virgolette“', |
|
| 56 | + 'barre_intertitre' => 'Trasformare in {{{titolo di paragrafo}}}', |
|
| 57 | + 'barre_italic' => 'Formattare in {corsivo}', |
|
| 58 | + 'barre_lien' => 'Trasformare in un [link ipertestuale->http://...]', |
|
| 59 | + 'barre_lien_input' => 'Indicare l’indirizzo del link (è possibile indicare l’indirizzo Web come http://www.ilmiosito.com o semplicemente indicare il numero di un singolo articolo).', |
|
| 60 | + 'barre_note' => 'Trasformare in [[Nota a fondo pagina]]', |
|
| 61 | + 'barre_paragraphe' => 'Crea un paragrafo', |
|
| 62 | + 'barre_quote' => '<quote>Citare un messaggio</quote>', |
|
| 63 | + 'bouton_changer' => 'Cambia', |
|
| 64 | + 'bouton_chercher' => 'Cerca', |
|
| 65 | + 'bouton_choisir' => 'Scegli', |
|
| 66 | + 'bouton_deplacer' => 'Sposta', |
|
| 67 | + 'bouton_download' => 'Download', |
|
| 68 | + 'bouton_enregistrer' => 'Salva', |
|
| 69 | + 'bouton_radio_desactiver_messagerie_interne' => 'Disattiva la messaggistica interna', |
|
| 70 | + 'bouton_radio_envoi_annonces' => 'Invia gli annunci editoriali', |
|
| 71 | + 'bouton_radio_non_envoi_annonces' => 'Non inviare annunci', |
|
| 72 | + 'bouton_radio_non_envoi_liste_nouveautes' => 'Non inviare l’elenco delle novità', |
|
| 73 | + 'bouton_recharger_page' => 'ricaricare questa pagina', |
|
| 74 | + 'bouton_telecharger' => 'Upload', |
|
| 75 | + 'bouton_upload' => 'Upload', |
|
| 76 | + 'bouton_valider' => 'Invia', |
|
| 77 | 77 | |
| 78 | - // C |
|
| 79 | - 'cal_apresmidi' => 'pomeriggio', |
|
| 80 | - 'cal_jour_entier' => 'giorno intero', |
|
| 81 | - 'cal_matin' => 'mattina', |
|
| 82 | - 'cal_par_jour' => 'calendario giornaliero', |
|
| 83 | - 'cal_par_mois' => 'calendario mensile', |
|
| 84 | - 'cal_par_semaine' => 'calendario settimanale', |
|
| 85 | - 'choix_couleur_interface' => 'colore', |
|
| 86 | - 'choix_interface' => 'scelta dell’interfaccia', |
|
| 87 | - 'colonne' => 'Colonna', |
|
| 88 | - 'confirm_changer_statut' => 'Attenzione, è stato chiesto di modificare lo status di questo elemento. Continuare?', |
|
| 89 | - 'correcte' => 'corretto', |
|
| 78 | + // C |
|
| 79 | + 'cal_apresmidi' => 'pomeriggio', |
|
| 80 | + 'cal_jour_entier' => 'giorno intero', |
|
| 81 | + 'cal_matin' => 'mattina', |
|
| 82 | + 'cal_par_jour' => 'calendario giornaliero', |
|
| 83 | + 'cal_par_mois' => 'calendario mensile', |
|
| 84 | + 'cal_par_semaine' => 'calendario settimanale', |
|
| 85 | + 'choix_couleur_interface' => 'colore', |
|
| 86 | + 'choix_interface' => 'scelta dell’interfaccia', |
|
| 87 | + 'colonne' => 'Colonna', |
|
| 88 | + 'confirm_changer_statut' => 'Attenzione, è stato chiesto di modificare lo status di questo elemento. Continuare?', |
|
| 89 | + 'correcte' => 'corretto', |
|
| 90 | 90 | |
| 91 | - // D |
|
| 92 | - 'date_aujourdhui' => 'oggi', |
|
| 93 | - 'date_avant_jc' => 'a.C.', |
|
| 94 | - 'date_dans' => 'tra @delai@', |
|
| 95 | - 'date_de_mois_1' => '@j@ gennaio', |
|
| 96 | - 'date_de_mois_10' => '@j@ ottobre', |
|
| 97 | - 'date_de_mois_11' => '@j@ novembre', |
|
| 98 | - 'date_de_mois_12' => '@j@ dicembre', |
|
| 99 | - 'date_de_mois_2' => '@j@ febbraio', |
|
| 100 | - 'date_de_mois_3' => '@j@ marzo', |
|
| 101 | - 'date_de_mois_4' => '@j@ aprile', |
|
| 102 | - 'date_de_mois_5' => '@j@ maggio', |
|
| 103 | - 'date_de_mois_6' => '@j@ giugno', |
|
| 104 | - 'date_de_mois_7' => '@j@ luglio', |
|
| 105 | - 'date_de_mois_8' => '@j@ agosto', |
|
| 106 | - 'date_de_mois_9' => '@j@ settembre', |
|
| 107 | - 'date_demain' => 'domani', |
|
| 108 | - 'date_fmt_heures_minutes' => '@h@:@m@', |
|
| 109 | - 'date_fmt_heures_minutes_court' => '@h@h@m@', |
|
| 110 | - 'date_fmt_jour' => '@nomjour@ @jour@', |
|
| 111 | - 'date_fmt_jour_heure' => '@jour@ ore @heure@', |
|
| 112 | - 'date_fmt_jour_heure_debut_fin' => 'Il @jour@ dalle @heure_debut@ alle @heure_fin@', |
|
| 113 | - 'date_fmt_jour_heure_debut_fin_abbr' => 'Il @dtstart@@jour@ dalle @heure_debut@@dtabbr@ alle @dtstart@@heure_fin@@dtend@', |
|
| 114 | - 'date_fmt_jour_mois' => '@jourmois@', |
|
| 115 | - 'date_fmt_jour_mois_annee' => '@jourmois@ @annee@', |
|
| 116 | - 'date_fmt_mois_annee' => '@nommois@ @annee@', |
|
| 117 | - 'date_fmt_nomjour' => '@nomjour@ @date@', |
|
| 118 | - 'date_fmt_nomjour_date' => 'il @nomjour@ @date@', |
|
| 119 | - 'date_fmt_periode' => 'Dal @date_debut@ al @date_fin@', |
|
| 120 | - 'date_fmt_periode_abbr' => 'Dal @dtart@@date_debut@@dtabbr@ al @dtend@@date_fin@@dtabbr@', |
|
| 121 | - 'date_fmt_periode_from' => 'Dal', |
|
| 122 | - 'date_fmt_periode_to' => 'a', |
|
| 123 | - 'date_fmt_saison_annee' => '@saison@ @annee@', |
|
| 124 | - 'date_heures' => 'ore', |
|
| 125 | - 'date_hier' => 'ieri', |
|
| 126 | - 'date_il_y_a' => '@delai@ fa', |
|
| 127 | - 'date_jnum1' => '1', |
|
| 128 | - 'date_jnum10' => '10', |
|
| 129 | - 'date_jnum11' => '11', |
|
| 130 | - 'date_jnum12' => '12', |
|
| 131 | - 'date_jnum13' => '13', |
|
| 132 | - 'date_jnum14' => '14', |
|
| 133 | - 'date_jnum15' => '15', |
|
| 134 | - 'date_jnum16' => '16', |
|
| 135 | - 'date_jnum17' => '17', |
|
| 136 | - 'date_jnum18' => '18', |
|
| 137 | - 'date_jnum19' => '19', |
|
| 138 | - 'date_jnum2' => '2', |
|
| 139 | - 'date_jnum20' => '20', |
|
| 140 | - 'date_jnum21' => '21', |
|
| 141 | - 'date_jnum22' => '22', |
|
| 142 | - 'date_jnum23' => '23', |
|
| 143 | - 'date_jnum24' => '24', |
|
| 144 | - 'date_jnum25' => '25', |
|
| 145 | - 'date_jnum26' => '26', |
|
| 146 | - 'date_jnum27' => '27', |
|
| 147 | - 'date_jnum28' => '28', |
|
| 148 | - 'date_jnum29' => '29', |
|
| 149 | - 'date_jnum3' => '3', |
|
| 150 | - 'date_jnum30' => '30', |
|
| 151 | - 'date_jnum31' => '31', |
|
| 152 | - 'date_jnum4' => '4', |
|
| 153 | - 'date_jnum5' => '5', |
|
| 154 | - 'date_jnum6' => '6', |
|
| 155 | - 'date_jnum7' => '7', |
|
| 156 | - 'date_jnum8' => '8', |
|
| 157 | - 'date_jnum9' => '9', |
|
| 158 | - 'date_jour_1' => 'domenica', |
|
| 159 | - 'date_jour_1_abbr' => 'dom', |
|
| 160 | - 'date_jour_1_initiale' => 'd', |
|
| 161 | - 'date_jour_2' => 'lunedì', |
|
| 162 | - 'date_jour_2_abbr' => 'lun', |
|
| 163 | - 'date_jour_2_initiale' => 'l', |
|
| 164 | - 'date_jour_3' => 'martedì', |
|
| 165 | - 'date_jour_3_abbr' => 'mar', |
|
| 166 | - 'date_jour_3_initiale' => 'm', |
|
| 167 | - 'date_jour_4' => 'mercoledì', |
|
| 168 | - 'date_jour_4_abbr' => 'mer', |
|
| 169 | - 'date_jour_4_initiale' => 'm', |
|
| 170 | - 'date_jour_5' => 'giovedì', |
|
| 171 | - 'date_jour_5_abbr' => 'giov', |
|
| 172 | - 'date_jour_5_initiale' => 'g', |
|
| 173 | - 'date_jour_6' => 'venerdì', |
|
| 174 | - 'date_jour_6_abbr' => 'ven', |
|
| 175 | - 'date_jour_6_initiale' => 'v', |
|
| 176 | - 'date_jour_7' => 'sabato', |
|
| 177 | - 'date_jour_7_abbr' => 'sab', |
|
| 178 | - 'date_jour_7_initiale' => 's', |
|
| 179 | - 'date_jours' => 'giorni', |
|
| 180 | - 'date_minutes' => 'minuti', |
|
| 181 | - 'date_mois' => 'mesi', |
|
| 182 | - 'date_mois_1' => 'Gennaio', |
|
| 183 | - 'date_mois_10' => 'Ottobre', |
|
| 184 | - 'date_mois_10_abbr' => 'ott', |
|
| 185 | - 'date_mois_11' => 'Novembre', |
|
| 186 | - 'date_mois_11_abbr' => 'nov', |
|
| 187 | - 'date_mois_12' => 'Dicembre', |
|
| 188 | - 'date_mois_12_abbr' => 'dic', |
|
| 189 | - 'date_mois_1_abbr' => 'gen', |
|
| 190 | - 'date_mois_2' => 'Febbraio', |
|
| 191 | - 'date_mois_2_abbr' => 'feb', |
|
| 192 | - 'date_mois_3' => 'Marzo', |
|
| 193 | - 'date_mois_3_abbr' => 'mar', |
|
| 194 | - 'date_mois_4' => 'Aprile', |
|
| 195 | - 'date_mois_4_abbr' => 'apr', |
|
| 196 | - 'date_mois_5' => 'Maggio', |
|
| 197 | - 'date_mois_5_abbr' => 'mag', |
|
| 198 | - 'date_mois_6' => 'Giugno', |
|
| 199 | - 'date_mois_6_abbr' => 'giu', |
|
| 200 | - 'date_mois_7' => 'Luglio', |
|
| 201 | - 'date_mois_7_abbr' => 'lug', |
|
| 202 | - 'date_mois_8' => 'Agosto', |
|
| 203 | - 'date_mois_8_abbr' => 'ago', |
|
| 204 | - 'date_mois_9' => 'Settembre', |
|
| 205 | - 'date_mois_9_abbr' => 'set', |
|
| 206 | - 'date_saison_1' => 'inverno', |
|
| 207 | - 'date_saison_2' => 'primavera', |
|
| 208 | - 'date_saison_3' => 'estate', |
|
| 209 | - 'date_saison_4' => 'autunno', |
|
| 210 | - 'date_secondes' => 'secondi', |
|
| 211 | - 'date_semaines' => 'settimane', |
|
| 212 | - 'date_un_mois' => 'mese', |
|
| 213 | - 'date_une_heure' => 'ora', |
|
| 214 | - 'date_une_minute' => 'minuto', |
|
| 215 | - 'date_une_seconde' => 'secondo', |
|
| 216 | - 'date_une_semaine' => 'settimana', |
|
| 217 | - 'dirs_commencer' => ' per iniziare realmente l’installazione', |
|
| 218 | - 'dirs_preliminaire' => 'Prima di iniziare: <b>impostare i diritti di accesso</b>', |
|
| 219 | - 'dirs_probleme_droits' => 'Problema nei diritti di accesso', |
|
| 220 | - 'dirs_repertoires_absents' => '<p><b>Le seguenti cartelle non sono state trovate: </b></p><ul>@bad_dirs@.</ul> |
|
| 91 | + // D |
|
| 92 | + 'date_aujourdhui' => 'oggi', |
|
| 93 | + 'date_avant_jc' => 'a.C.', |
|
| 94 | + 'date_dans' => 'tra @delai@', |
|
| 95 | + 'date_de_mois_1' => '@j@ gennaio', |
|
| 96 | + 'date_de_mois_10' => '@j@ ottobre', |
|
| 97 | + 'date_de_mois_11' => '@j@ novembre', |
|
| 98 | + 'date_de_mois_12' => '@j@ dicembre', |
|
| 99 | + 'date_de_mois_2' => '@j@ febbraio', |
|
| 100 | + 'date_de_mois_3' => '@j@ marzo', |
|
| 101 | + 'date_de_mois_4' => '@j@ aprile', |
|
| 102 | + 'date_de_mois_5' => '@j@ maggio', |
|
| 103 | + 'date_de_mois_6' => '@j@ giugno', |
|
| 104 | + 'date_de_mois_7' => '@j@ luglio', |
|
| 105 | + 'date_de_mois_8' => '@j@ agosto', |
|
| 106 | + 'date_de_mois_9' => '@j@ settembre', |
|
| 107 | + 'date_demain' => 'domani', |
|
| 108 | + 'date_fmt_heures_minutes' => '@h@:@m@', |
|
| 109 | + 'date_fmt_heures_minutes_court' => '@h@h@m@', |
|
| 110 | + 'date_fmt_jour' => '@nomjour@ @jour@', |
|
| 111 | + 'date_fmt_jour_heure' => '@jour@ ore @heure@', |
|
| 112 | + 'date_fmt_jour_heure_debut_fin' => 'Il @jour@ dalle @heure_debut@ alle @heure_fin@', |
|
| 113 | + 'date_fmt_jour_heure_debut_fin_abbr' => 'Il @dtstart@@jour@ dalle @heure_debut@@dtabbr@ alle @dtstart@@heure_fin@@dtend@', |
|
| 114 | + 'date_fmt_jour_mois' => '@jourmois@', |
|
| 115 | + 'date_fmt_jour_mois_annee' => '@jourmois@ @annee@', |
|
| 116 | + 'date_fmt_mois_annee' => '@nommois@ @annee@', |
|
| 117 | + 'date_fmt_nomjour' => '@nomjour@ @date@', |
|
| 118 | + 'date_fmt_nomjour_date' => 'il @nomjour@ @date@', |
|
| 119 | + 'date_fmt_periode' => 'Dal @date_debut@ al @date_fin@', |
|
| 120 | + 'date_fmt_periode_abbr' => 'Dal @dtart@@date_debut@@dtabbr@ al @dtend@@date_fin@@dtabbr@', |
|
| 121 | + 'date_fmt_periode_from' => 'Dal', |
|
| 122 | + 'date_fmt_periode_to' => 'a', |
|
| 123 | + 'date_fmt_saison_annee' => '@saison@ @annee@', |
|
| 124 | + 'date_heures' => 'ore', |
|
| 125 | + 'date_hier' => 'ieri', |
|
| 126 | + 'date_il_y_a' => '@delai@ fa', |
|
| 127 | + 'date_jnum1' => '1', |
|
| 128 | + 'date_jnum10' => '10', |
|
| 129 | + 'date_jnum11' => '11', |
|
| 130 | + 'date_jnum12' => '12', |
|
| 131 | + 'date_jnum13' => '13', |
|
| 132 | + 'date_jnum14' => '14', |
|
| 133 | + 'date_jnum15' => '15', |
|
| 134 | + 'date_jnum16' => '16', |
|
| 135 | + 'date_jnum17' => '17', |
|
| 136 | + 'date_jnum18' => '18', |
|
| 137 | + 'date_jnum19' => '19', |
|
| 138 | + 'date_jnum2' => '2', |
|
| 139 | + 'date_jnum20' => '20', |
|
| 140 | + 'date_jnum21' => '21', |
|
| 141 | + 'date_jnum22' => '22', |
|
| 142 | + 'date_jnum23' => '23', |
|
| 143 | + 'date_jnum24' => '24', |
|
| 144 | + 'date_jnum25' => '25', |
|
| 145 | + 'date_jnum26' => '26', |
|
| 146 | + 'date_jnum27' => '27', |
|
| 147 | + 'date_jnum28' => '28', |
|
| 148 | + 'date_jnum29' => '29', |
|
| 149 | + 'date_jnum3' => '3', |
|
| 150 | + 'date_jnum30' => '30', |
|
| 151 | + 'date_jnum31' => '31', |
|
| 152 | + 'date_jnum4' => '4', |
|
| 153 | + 'date_jnum5' => '5', |
|
| 154 | + 'date_jnum6' => '6', |
|
| 155 | + 'date_jnum7' => '7', |
|
| 156 | + 'date_jnum8' => '8', |
|
| 157 | + 'date_jnum9' => '9', |
|
| 158 | + 'date_jour_1' => 'domenica', |
|
| 159 | + 'date_jour_1_abbr' => 'dom', |
|
| 160 | + 'date_jour_1_initiale' => 'd', |
|
| 161 | + 'date_jour_2' => 'lunedì', |
|
| 162 | + 'date_jour_2_abbr' => 'lun', |
|
| 163 | + 'date_jour_2_initiale' => 'l', |
|
| 164 | + 'date_jour_3' => 'martedì', |
|
| 165 | + 'date_jour_3_abbr' => 'mar', |
|
| 166 | + 'date_jour_3_initiale' => 'm', |
|
| 167 | + 'date_jour_4' => 'mercoledì', |
|
| 168 | + 'date_jour_4_abbr' => 'mer', |
|
| 169 | + 'date_jour_4_initiale' => 'm', |
|
| 170 | + 'date_jour_5' => 'giovedì', |
|
| 171 | + 'date_jour_5_abbr' => 'giov', |
|
| 172 | + 'date_jour_5_initiale' => 'g', |
|
| 173 | + 'date_jour_6' => 'venerdì', |
|
| 174 | + 'date_jour_6_abbr' => 'ven', |
|
| 175 | + 'date_jour_6_initiale' => 'v', |
|
| 176 | + 'date_jour_7' => 'sabato', |
|
| 177 | + 'date_jour_7_abbr' => 'sab', |
|
| 178 | + 'date_jour_7_initiale' => 's', |
|
| 179 | + 'date_jours' => 'giorni', |
|
| 180 | + 'date_minutes' => 'minuti', |
|
| 181 | + 'date_mois' => 'mesi', |
|
| 182 | + 'date_mois_1' => 'Gennaio', |
|
| 183 | + 'date_mois_10' => 'Ottobre', |
|
| 184 | + 'date_mois_10_abbr' => 'ott', |
|
| 185 | + 'date_mois_11' => 'Novembre', |
|
| 186 | + 'date_mois_11_abbr' => 'nov', |
|
| 187 | + 'date_mois_12' => 'Dicembre', |
|
| 188 | + 'date_mois_12_abbr' => 'dic', |
|
| 189 | + 'date_mois_1_abbr' => 'gen', |
|
| 190 | + 'date_mois_2' => 'Febbraio', |
|
| 191 | + 'date_mois_2_abbr' => 'feb', |
|
| 192 | + 'date_mois_3' => 'Marzo', |
|
| 193 | + 'date_mois_3_abbr' => 'mar', |
|
| 194 | + 'date_mois_4' => 'Aprile', |
|
| 195 | + 'date_mois_4_abbr' => 'apr', |
|
| 196 | + 'date_mois_5' => 'Maggio', |
|
| 197 | + 'date_mois_5_abbr' => 'mag', |
|
| 198 | + 'date_mois_6' => 'Giugno', |
|
| 199 | + 'date_mois_6_abbr' => 'giu', |
|
| 200 | + 'date_mois_7' => 'Luglio', |
|
| 201 | + 'date_mois_7_abbr' => 'lug', |
|
| 202 | + 'date_mois_8' => 'Agosto', |
|
| 203 | + 'date_mois_8_abbr' => 'ago', |
|
| 204 | + 'date_mois_9' => 'Settembre', |
|
| 205 | + 'date_mois_9_abbr' => 'set', |
|
| 206 | + 'date_saison_1' => 'inverno', |
|
| 207 | + 'date_saison_2' => 'primavera', |
|
| 208 | + 'date_saison_3' => 'estate', |
|
| 209 | + 'date_saison_4' => 'autunno', |
|
| 210 | + 'date_secondes' => 'secondi', |
|
| 211 | + 'date_semaines' => 'settimane', |
|
| 212 | + 'date_un_mois' => 'mese', |
|
| 213 | + 'date_une_heure' => 'ora', |
|
| 214 | + 'date_une_minute' => 'minuto', |
|
| 215 | + 'date_une_seconde' => 'secondo', |
|
| 216 | + 'date_une_semaine' => 'settimana', |
|
| 217 | + 'dirs_commencer' => ' per iniziare realmente l’installazione', |
|
| 218 | + 'dirs_preliminaire' => 'Prima di iniziare: <b>impostare i diritti di accesso</b>', |
|
| 219 | + 'dirs_probleme_droits' => 'Problema nei diritti di accesso', |
|
| 220 | + 'dirs_repertoires_absents' => '<p><b>Le seguenti cartelle non sono state trovate: </b></p><ul>@bad_dirs@.</ul> |
|
| 221 | 221 | <p>Probabilmente ciò è dovuto a un’errata formattazione delle lettere maiuscole o minuscole. |
| 222 | 222 | Verificare che le maiuscole e le minuscole delle cartelle coincidano con quelle visualizzate |
| 223 | 223 | qui sopra; se non è così, rinominare le cartelle utilizzando il software FTP.</p> |
| 224 | 224 | <p>Una volta effettuata questa correzione, si potrà', |
| 225 | - 'dirs_repertoires_suivants' => '<p><b>Le seguenti cartelle non sono accessibili in scrittura:</b></p> <ul>@bad_dirs@</ul> |
|
| 225 | + 'dirs_repertoires_suivants' => '<p><b>Le seguenti cartelle non sono accessibili in scrittura:</b></p> <ul>@bad_dirs@</ul> |
|
| 226 | 226 | <p>Per risolvere il problema, utilizzare un client FTP per impostare i diritti di accesso |
| 227 | 227 | di ciascuna di queste cartelle. La procedura è spiegata in dettaglio nella guida d’installazione.</p> |
| 228 | 228 | <p>Una volta attribuiti i permessi, si potrà ', |
| 229 | - 'double_occurrence' => 'Doppia occorrenza', |
|
| 229 | + 'double_occurrence' => 'Doppia occorrenza', |
|
| 230 | 230 | |
| 231 | - // E |
|
| 232 | - 'en_cours' => 'in corso', |
|
| 233 | - 'envoi_via_le_site' => 'Invio tramite il sito', |
|
| 234 | - 'erreur' => 'Errore', |
|
| 235 | - 'erreur_balise_non_fermee' => 'ultimo tag non chiuso:', |
|
| 236 | - 'erreur_technique_ajaxform' => 'Ops. Un’errore inaspettato non ti consente di inviare il form. Puoi provare di nuovo.', |
|
| 237 | - 'erreur_technique_enregistrement_champs' => 'Un errore tecnico ha impedito la corretta registrazione del campo @champs@.', |
|
| 238 | - 'erreur_technique_enregistrement_impossible' => 'Un errore tecnico ha impedito la registrazione.', |
|
| 239 | - 'erreur_texte' => 'errore/i', |
|
| 240 | - 'etape' => 'Fase', |
|
| 231 | + // E |
|
| 232 | + 'en_cours' => 'in corso', |
|
| 233 | + 'envoi_via_le_site' => 'Invio tramite il sito', |
|
| 234 | + 'erreur' => 'Errore', |
|
| 235 | + 'erreur_balise_non_fermee' => 'ultimo tag non chiuso:', |
|
| 236 | + 'erreur_technique_ajaxform' => 'Ops. Un’errore inaspettato non ti consente di inviare il form. Puoi provare di nuovo.', |
|
| 237 | + 'erreur_technique_enregistrement_champs' => 'Un errore tecnico ha impedito la corretta registrazione del campo @champs@.', |
|
| 238 | + 'erreur_technique_enregistrement_impossible' => 'Un errore tecnico ha impedito la registrazione.', |
|
| 239 | + 'erreur_texte' => 'errore/i', |
|
| 240 | + 'etape' => 'Fase', |
|
| 241 | 241 | |
| 242 | - // F |
|
| 243 | - 'fichier_introuvable' => 'File @fichier@ non trovato', |
|
| 244 | - 'fonction_introuvable' => 'Funzione @fonction@() non trovata', |
|
| 245 | - 'form_auteur_confirmation' => 'Per cortesia conferma il tuo indirizzo email', |
|
| 246 | - 'form_auteur_email_modifie' => 'Il tuo indirizzo email è stato modificato', |
|
| 247 | - 'form_auteur_envoi_mail_confirmation' => 'Una email di conferma è stata inviata a @email@. È necessario visitare l’URL indicata nel messaggio per convalidare il tuo indirizzo email.', |
|
| 248 | - 'form_auteur_mail_confirmation' => 'Ciao, |
|
| 242 | + // F |
|
| 243 | + 'fichier_introuvable' => 'File @fichier@ non trovato', |
|
| 244 | + 'fonction_introuvable' => 'Funzione @fonction@() non trovata', |
|
| 245 | + 'form_auteur_confirmation' => 'Per cortesia conferma il tuo indirizzo email', |
|
| 246 | + 'form_auteur_email_modifie' => 'Il tuo indirizzo email è stato modificato', |
|
| 247 | + 'form_auteur_envoi_mail_confirmation' => 'Una email di conferma è stata inviata a @email@. È necessario visitare l’URL indicata nel messaggio per convalidare il tuo indirizzo email.', |
|
| 248 | + 'form_auteur_mail_confirmation' => 'Ciao, |
|
| 249 | 249 | |
| 250 | 250 | Hai chiesto di modificare l’indirizzo email. |
| 251 | 251 | Per confermare la tua nuova email, devi connetterti all’ |
@@ -253,346 +253,346 @@ discard block |
||
| 253 | 253 | |
| 254 | 254 | @url@ |
| 255 | 255 | ', |
| 256 | - 'form_deja_inscrit' => 'Sei già iscritto.', |
|
| 257 | - 'form_email_non_valide' => 'L’indirizzo email non è valido.', |
|
| 258 | - 'form_forum_access_refuse' => 'Non hai più accesso a questo sito.', |
|
| 259 | - 'form_forum_bonjour' => 'Buongiorno @nom@,', |
|
| 260 | - 'form_forum_confirmer_email' => 'Puoi confermare il tuo indirizzo email,vai a questo indirizzo: @url_confirm@', |
|
| 261 | - 'form_forum_email_deja_enregistre' => 'Questo indirizzo email è già registrato, puoi dunque utilizzare la tua password abituale.', |
|
| 262 | - 'form_forum_identifiant_mail' => 'Il nuovo codice identificativo (ID) ti è stato appena inviato tramite email.', |
|
| 263 | - 'form_forum_identifiants' => 'Dati personali', |
|
| 264 | - 'form_forum_indiquer_nom_email' => 'Indica qui nome e indirizzo email. L’ID personale ti verrà recapitato tramite email a breve.', |
|
| 265 | - 'form_forum_login' => 'login:', |
|
| 266 | - 'form_forum_message_auto' => '(questo è un messaggio generato automaticamente)', |
|
| 267 | - 'form_forum_pass' => 'password:', |
|
| 268 | - 'form_forum_probleme_mail' => 'Problema di posta: l’ID non può essere inviato.', |
|
| 269 | - 'form_forum_voici1' => 'Ecco i dati per poter partecipare ai forum |
|
| 256 | + 'form_deja_inscrit' => 'Sei già iscritto.', |
|
| 257 | + 'form_email_non_valide' => 'L’indirizzo email non è valido.', |
|
| 258 | + 'form_forum_access_refuse' => 'Non hai più accesso a questo sito.', |
|
| 259 | + 'form_forum_bonjour' => 'Buongiorno @nom@,', |
|
| 260 | + 'form_forum_confirmer_email' => 'Puoi confermare il tuo indirizzo email,vai a questo indirizzo: @url_confirm@', |
|
| 261 | + 'form_forum_email_deja_enregistre' => 'Questo indirizzo email è già registrato, puoi dunque utilizzare la tua password abituale.', |
|
| 262 | + 'form_forum_identifiant_mail' => 'Il nuovo codice identificativo (ID) ti è stato appena inviato tramite email.', |
|
| 263 | + 'form_forum_identifiants' => 'Dati personali', |
|
| 264 | + 'form_forum_indiquer_nom_email' => 'Indica qui nome e indirizzo email. L’ID personale ti verrà recapitato tramite email a breve.', |
|
| 265 | + 'form_forum_login' => 'login:', |
|
| 266 | + 'form_forum_message_auto' => '(questo è un messaggio generato automaticamente)', |
|
| 267 | + 'form_forum_pass' => 'password:', |
|
| 268 | + 'form_forum_probleme_mail' => 'Problema di posta: l’ID non può essere inviato.', |
|
| 269 | + 'form_forum_voici1' => 'Ecco i dati per poter partecipare ai forum |
|
| 270 | 270 | del sito"@nom_site_spip@" (@adresse_site@):', |
| 271 | - 'form_forum_voici2' => 'Ecco i dati per poter proporre degli articoli sul sito |
|
| 271 | + 'form_forum_voici2' => 'Ecco i dati per poter proporre degli articoli sul sito |
|
| 272 | 272 | "@nom_site_spip@" (@adresse_login@):', |
| 273 | - 'form_indiquer_email' => 'Indica il tuo indirizzo email.', |
|
| 274 | - 'form_indiquer_nom' => 'Indica il tuo nome.', |
|
| 275 | - 'form_indiquer_nom_site' => 'Indica il nome del tuo sito.', |
|
| 276 | - 'form_pet_deja_enregistre' => 'Questo sito è già registrato', |
|
| 277 | - 'form_pet_signature_pasprise' => 'La tua adesione non è stata presa in considerazione.', |
|
| 278 | - 'form_prop_confirmer_envoi' => 'Conferma l’invio', |
|
| 279 | - 'form_prop_description' => 'Descrizione/commento', |
|
| 280 | - 'form_prop_enregistre' => 'La tua proposta è stata registrata ed apparirà on line dopo l’approvazione del responsabile del sito.', |
|
| 281 | - 'form_prop_envoyer' => 'Invia un messaggio', |
|
| 282 | - 'form_prop_indiquer_email' => 'Indica un indirizzo email valido', |
|
| 283 | - 'form_prop_indiquer_nom_site' => 'Indica il nome del sito.', |
|
| 284 | - 'form_prop_indiquer_sujet' => 'Indica un argomento', |
|
| 285 | - 'form_prop_message_envoye' => 'Messaggio inviato', |
|
| 286 | - 'form_prop_non_enregistre' => 'La tua proposta non è stata registrata.', |
|
| 287 | - 'form_prop_sujet' => 'Argomento', |
|
| 288 | - 'form_prop_url_site' => 'Indirizzo (URL) del sito', |
|
| 289 | - 'format_date_attendu' => 'Inserire una data nel formato gg/mm/aaaa.', |
|
| 290 | - 'format_date_incorrecte' => 'La data (o il suo formato) non è corretta', |
|
| 291 | - 'format_heure_attendu' => 'Inserire un’ora nel formato hh:mm.', |
|
| 292 | - 'format_heure_incorrecte' => 'L’ora (o il suo formato) non è corretta', |
|
| 293 | - 'forum_non_inscrit' => 'Non sei iscritto, oppure l’indirizzo o la password inseriti non sono corretti.', |
|
| 294 | - 'forum_par_auteur' => 'di @auteur@', |
|
| 295 | - 'forum_titre_erreur' => 'Errore...', |
|
| 273 | + 'form_indiquer_email' => 'Indica il tuo indirizzo email.', |
|
| 274 | + 'form_indiquer_nom' => 'Indica il tuo nome.', |
|
| 275 | + 'form_indiquer_nom_site' => 'Indica il nome del tuo sito.', |
|
| 276 | + 'form_pet_deja_enregistre' => 'Questo sito è già registrato', |
|
| 277 | + 'form_pet_signature_pasprise' => 'La tua adesione non è stata presa in considerazione.', |
|
| 278 | + 'form_prop_confirmer_envoi' => 'Conferma l’invio', |
|
| 279 | + 'form_prop_description' => 'Descrizione/commento', |
|
| 280 | + 'form_prop_enregistre' => 'La tua proposta è stata registrata ed apparirà on line dopo l’approvazione del responsabile del sito.', |
|
| 281 | + 'form_prop_envoyer' => 'Invia un messaggio', |
|
| 282 | + 'form_prop_indiquer_email' => 'Indica un indirizzo email valido', |
|
| 283 | + 'form_prop_indiquer_nom_site' => 'Indica il nome del sito.', |
|
| 284 | + 'form_prop_indiquer_sujet' => 'Indica un argomento', |
|
| 285 | + 'form_prop_message_envoye' => 'Messaggio inviato', |
|
| 286 | + 'form_prop_non_enregistre' => 'La tua proposta non è stata registrata.', |
|
| 287 | + 'form_prop_sujet' => 'Argomento', |
|
| 288 | + 'form_prop_url_site' => 'Indirizzo (URL) del sito', |
|
| 289 | + 'format_date_attendu' => 'Inserire una data nel formato gg/mm/aaaa.', |
|
| 290 | + 'format_date_incorrecte' => 'La data (o il suo formato) non è corretta', |
|
| 291 | + 'format_heure_attendu' => 'Inserire un’ora nel formato hh:mm.', |
|
| 292 | + 'format_heure_incorrecte' => 'L’ora (o il suo formato) non è corretta', |
|
| 293 | + 'forum_non_inscrit' => 'Non sei iscritto, oppure l’indirizzo o la password inseriti non sono corretti.', |
|
| 294 | + 'forum_par_auteur' => 'di @auteur@', |
|
| 295 | + 'forum_titre_erreur' => 'Errore...', |
|
| 296 | 296 | |
| 297 | - // I |
|
| 298 | - 'ical_texte_rss_articles' => 'Il file di "backend" degli articoli di questo sito si trova al seguente indirizzo:', |
|
| 299 | - 'ical_texte_rss_articles2' => 'È anche possibile ottenere un file di "backend" per gli articoli di una singola rubrica:', |
|
| 300 | - 'ical_texte_rss_breves' => 'Inoltre esiste un file per l’insieme delle brevi del sito. Precisando un numero di rubrica ci si può limitare alle brevi in essa contenute.', |
|
| 301 | - 'icone_a_suivre' => 'Pannello di controllo', |
|
| 302 | - 'icone_admin_site' => 'Amministrazione del sito', |
|
| 303 | - 'icone_agenda' => 'Agenda', |
|
| 304 | - 'icone_aide_ligne' => 'Guida in linea', |
|
| 305 | - 'icone_articles' => 'Articoli', |
|
| 306 | - 'icone_auteurs' => 'Autori', |
|
| 307 | - 'icone_brouteur' => 'Navigazione rapida', |
|
| 308 | - 'icone_configuration_site' => 'Configurazione del sito', |
|
| 309 | - 'icone_configurer_site' => 'Configura il sito', |
|
| 310 | - 'icone_creer_nouvel_auteur' => 'Crea un nuovo autore', |
|
| 311 | - 'icone_creer_rubrique' => 'Crea una rubrica', |
|
| 312 | - 'icone_creer_sous_rubrique' => 'Crea una sottorubrica', |
|
| 313 | - 'icone_deconnecter' => 'Esci', |
|
| 314 | - 'icone_discussions' => 'Discussioni', |
|
| 315 | - 'icone_doc_rubrique' => 'Documenti delle rubriche', |
|
| 316 | - 'icone_ecrire_article' => 'Scrivi un articolo', |
|
| 317 | - 'icone_edition_site' => 'Redazione del sito', |
|
| 318 | - 'icone_gestion_langues' => 'Gestione delle lingue', |
|
| 319 | - 'icone_informations_personnelles' => 'Dati personali', |
|
| 320 | - 'icone_interface_complet' => 'Interfaccia completa', |
|
| 321 | - 'icone_interface_simple' => 'Interfaccia semplificata', |
|
| 322 | - 'icone_maintenance_site' => 'Manutenzione tecnica', |
|
| 323 | - 'icone_messagerie_personnelle' => 'Messaggi personali', |
|
| 324 | - 'icone_repartition_debut' => 'Mostra la ripartizione dall’inizio', |
|
| 325 | - 'icone_rubriques' => 'Rubriche', |
|
| 326 | - 'icone_sauver_site' => 'Backup del sito', |
|
| 327 | - 'icone_site_entier' => 'Tutto il sito', |
|
| 328 | - 'icone_sites_references' => 'Siti repertoriati', |
|
| 329 | - 'icone_statistiques' => 'Statistiche del sito', |
|
| 330 | - 'icone_suivi_activite' => 'Monitorare l’attività del sito', |
|
| 331 | - 'icone_suivi_actualite' => 'Evoluzione del sito', |
|
| 332 | - 'icone_suivi_pettions' => 'Gestione delle petizioni', |
|
| 333 | - 'icone_suivi_revisions' => 'Modifiche agli articoli', |
|
| 334 | - 'icone_supprimer_document' => 'Elimina il documento', |
|
| 335 | - 'icone_supprimer_image' => 'Elimina l’immagine', |
|
| 336 | - 'icone_tous_articles' => 'Tutti i tuoi articoli', |
|
| 337 | - 'icone_tous_auteur' => 'Tutti gli autori', |
|
| 338 | - 'icone_tous_visiteur' => 'Tutti i visitatori', |
|
| 339 | - 'icone_visiter_site' => 'Visita il sito', |
|
| 340 | - 'icone_voir_en_ligne' => 'Vedi on line', |
|
| 341 | - 'img_indisponible' => 'immagine non disponibile', |
|
| 342 | - 'impossible' => 'impossibile', |
|
| 343 | - 'info_a_suivre' => 'PANNELLO DI CONTROLLO »', |
|
| 344 | - 'info_acces_interdit' => 'Accesso vietato', |
|
| 345 | - 'info_acces_refuse' => 'Accesso rifiutato', |
|
| 346 | - 'info_action' => 'Azione: @action@', |
|
| 347 | - 'info_administrer_rubriques' => 'Puoi amministrare questa rubrica e le relative sottorubriche', |
|
| 348 | - 'info_adresse_non_indiquee' => 'Non hai indicato l’indirizzo da testare!', |
|
| 349 | - 'info_aide' => 'AIUTO:', |
|
| 350 | - 'info_ajouter_mot' => 'Aggiungi questa parola', |
|
| 351 | - 'info_annonce' => 'ANNUNCIO', |
|
| 352 | - 'info_annonces_generales' => 'Annunci generali:', |
|
| 353 | - 'info_article_propose' => 'Articolo proposto', |
|
| 354 | - 'info_article_publie' => 'Articolo pubblicato', |
|
| 355 | - 'info_article_redaction' => 'Articolo in corso di redazione', |
|
| 356 | - 'info_article_refuse' => 'Articolo rifiutato', |
|
| 357 | - 'info_article_supprime' => 'Articolo eliminato', |
|
| 358 | - 'info_articles' => 'Articoli', |
|
| 359 | - 'info_articles_a_valider' => 'Articoli da convalidare', |
|
| 360 | - 'info_articles_nb' => '@nb@ articoli', |
|
| 361 | - 'info_articles_proposes' => 'Articoli proposti', |
|
| 362 | - 'info_articles_un' => '1 articolo', |
|
| 363 | - 'info_auteurs_nombre' => 'autore(i):', |
|
| 364 | - 'info_authentification_ftp' => 'Autenticazione (via FTP).', |
|
| 365 | - 'info_breves_2' => 'brevi', |
|
| 366 | - 'info_breves_nb' => '@nb@ notizie', |
|
| 367 | - 'info_breves_un' => '1 notizia', |
|
| 368 | - 'info_connexion_refusee' => 'Connessione rifiutata', |
|
| 369 | - 'info_contact_developpeur' => 'Contatta un programmatore.', |
|
| 370 | - 'info_contenance' => 'Questo sito contiene:', |
|
| 371 | - 'info_contribution' => 'contributi dei forum', |
|
| 372 | - 'info_copyright' => '@spip@ è un software libero distribuito @lien_gpl@.', |
|
| 373 | - 'info_copyright_doc' => 'Per maggiori informazioni, vedi il sito <a href="@spipnet@">@spipnet_affiche@</a>.', |
|
| 374 | - 'info_copyright_gpl' => 'sotto licenza GPL', |
|
| 375 | - 'info_cours_edition' => 'Articoli in fase di redazione', |
|
| 376 | - 'info_creer_repertoire' => 'Creare un file o una cartella chiamata:', |
|
| 377 | - 'info_creer_repertoire_2' => 'all’interno della sottocartella <b>@repertoire@</b>, poi:', |
|
| 378 | - 'info_creer_vignette' => 'creazione automatica dell’anteprima', |
|
| 379 | - 'info_creerdansrubrique_non_autorise' => 'Non si dispone di diritti sufficienti per creare contenuti in questa rubrica', |
|
| 380 | - 'info_deplier' => 'Espandi', |
|
| 381 | - 'info_descriptif_nombre' => 'descrizione(i):', |
|
| 382 | - 'info_description' => 'Descrizione:', |
|
| 383 | - 'info_description_2' => 'Descrizione:', |
|
| 384 | - 'info_dimension' => 'Dimensioni:', |
|
| 385 | - 'info_documents_nb' => '@nb@ documenti', |
|
| 386 | - 'info_documents_un' => '1 documento', |
|
| 387 | - 'info_ecire_message_prive' => 'Scrivi un messaggio privato', |
|
| 388 | - 'info_email_invalide' => 'Indirizzo email non valido.', |
|
| 389 | - 'info_en_cours_validation' => 'I tuoi articoli in corso di redazione', |
|
| 390 | - 'info_en_ligne' => 'Attualmente on line:', |
|
| 391 | - 'info_envoyer_message_prive' => 'Invia un messaggio privato a questo autore', |
|
| 392 | - 'info_erreur_requete' => 'Errore nella richiesta: ', |
|
| 393 | - 'info_erreur_squelette2' => 'Nessun modello di layout <b>@fichier@</b> trovato...', |
|
| 394 | - 'info_erreur_systeme' => 'Errore di sistema (errno @errsys@)', |
|
| 395 | - 'info_erreur_systeme2' => 'Il disco rigido potrebbe essere pieno o la base dati danneggiata.<br /> |
|
| 297 | + // I |
|
| 298 | + 'ical_texte_rss_articles' => 'Il file di "backend" degli articoli di questo sito si trova al seguente indirizzo:', |
|
| 299 | + 'ical_texte_rss_articles2' => 'È anche possibile ottenere un file di "backend" per gli articoli di una singola rubrica:', |
|
| 300 | + 'ical_texte_rss_breves' => 'Inoltre esiste un file per l’insieme delle brevi del sito. Precisando un numero di rubrica ci si può limitare alle brevi in essa contenute.', |
|
| 301 | + 'icone_a_suivre' => 'Pannello di controllo', |
|
| 302 | + 'icone_admin_site' => 'Amministrazione del sito', |
|
| 303 | + 'icone_agenda' => 'Agenda', |
|
| 304 | + 'icone_aide_ligne' => 'Guida in linea', |
|
| 305 | + 'icone_articles' => 'Articoli', |
|
| 306 | + 'icone_auteurs' => 'Autori', |
|
| 307 | + 'icone_brouteur' => 'Navigazione rapida', |
|
| 308 | + 'icone_configuration_site' => 'Configurazione del sito', |
|
| 309 | + 'icone_configurer_site' => 'Configura il sito', |
|
| 310 | + 'icone_creer_nouvel_auteur' => 'Crea un nuovo autore', |
|
| 311 | + 'icone_creer_rubrique' => 'Crea una rubrica', |
|
| 312 | + 'icone_creer_sous_rubrique' => 'Crea una sottorubrica', |
|
| 313 | + 'icone_deconnecter' => 'Esci', |
|
| 314 | + 'icone_discussions' => 'Discussioni', |
|
| 315 | + 'icone_doc_rubrique' => 'Documenti delle rubriche', |
|
| 316 | + 'icone_ecrire_article' => 'Scrivi un articolo', |
|
| 317 | + 'icone_edition_site' => 'Redazione del sito', |
|
| 318 | + 'icone_gestion_langues' => 'Gestione delle lingue', |
|
| 319 | + 'icone_informations_personnelles' => 'Dati personali', |
|
| 320 | + 'icone_interface_complet' => 'Interfaccia completa', |
|
| 321 | + 'icone_interface_simple' => 'Interfaccia semplificata', |
|
| 322 | + 'icone_maintenance_site' => 'Manutenzione tecnica', |
|
| 323 | + 'icone_messagerie_personnelle' => 'Messaggi personali', |
|
| 324 | + 'icone_repartition_debut' => 'Mostra la ripartizione dall’inizio', |
|
| 325 | + 'icone_rubriques' => 'Rubriche', |
|
| 326 | + 'icone_sauver_site' => 'Backup del sito', |
|
| 327 | + 'icone_site_entier' => 'Tutto il sito', |
|
| 328 | + 'icone_sites_references' => 'Siti repertoriati', |
|
| 329 | + 'icone_statistiques' => 'Statistiche del sito', |
|
| 330 | + 'icone_suivi_activite' => 'Monitorare l’attività del sito', |
|
| 331 | + 'icone_suivi_actualite' => 'Evoluzione del sito', |
|
| 332 | + 'icone_suivi_pettions' => 'Gestione delle petizioni', |
|
| 333 | + 'icone_suivi_revisions' => 'Modifiche agli articoli', |
|
| 334 | + 'icone_supprimer_document' => 'Elimina il documento', |
|
| 335 | + 'icone_supprimer_image' => 'Elimina l’immagine', |
|
| 336 | + 'icone_tous_articles' => 'Tutti i tuoi articoli', |
|
| 337 | + 'icone_tous_auteur' => 'Tutti gli autori', |
|
| 338 | + 'icone_tous_visiteur' => 'Tutti i visitatori', |
|
| 339 | + 'icone_visiter_site' => 'Visita il sito', |
|
| 340 | + 'icone_voir_en_ligne' => 'Vedi on line', |
|
| 341 | + 'img_indisponible' => 'immagine non disponibile', |
|
| 342 | + 'impossible' => 'impossibile', |
|
| 343 | + 'info_a_suivre' => 'PANNELLO DI CONTROLLO »', |
|
| 344 | + 'info_acces_interdit' => 'Accesso vietato', |
|
| 345 | + 'info_acces_refuse' => 'Accesso rifiutato', |
|
| 346 | + 'info_action' => 'Azione: @action@', |
|
| 347 | + 'info_administrer_rubriques' => 'Puoi amministrare questa rubrica e le relative sottorubriche', |
|
| 348 | + 'info_adresse_non_indiquee' => 'Non hai indicato l’indirizzo da testare!', |
|
| 349 | + 'info_aide' => 'AIUTO:', |
|
| 350 | + 'info_ajouter_mot' => 'Aggiungi questa parola', |
|
| 351 | + 'info_annonce' => 'ANNUNCIO', |
|
| 352 | + 'info_annonces_generales' => 'Annunci generali:', |
|
| 353 | + 'info_article_propose' => 'Articolo proposto', |
|
| 354 | + 'info_article_publie' => 'Articolo pubblicato', |
|
| 355 | + 'info_article_redaction' => 'Articolo in corso di redazione', |
|
| 356 | + 'info_article_refuse' => 'Articolo rifiutato', |
|
| 357 | + 'info_article_supprime' => 'Articolo eliminato', |
|
| 358 | + 'info_articles' => 'Articoli', |
|
| 359 | + 'info_articles_a_valider' => 'Articoli da convalidare', |
|
| 360 | + 'info_articles_nb' => '@nb@ articoli', |
|
| 361 | + 'info_articles_proposes' => 'Articoli proposti', |
|
| 362 | + 'info_articles_un' => '1 articolo', |
|
| 363 | + 'info_auteurs_nombre' => 'autore(i):', |
|
| 364 | + 'info_authentification_ftp' => 'Autenticazione (via FTP).', |
|
| 365 | + 'info_breves_2' => 'brevi', |
|
| 366 | + 'info_breves_nb' => '@nb@ notizie', |
|
| 367 | + 'info_breves_un' => '1 notizia', |
|
| 368 | + 'info_connexion_refusee' => 'Connessione rifiutata', |
|
| 369 | + 'info_contact_developpeur' => 'Contatta un programmatore.', |
|
| 370 | + 'info_contenance' => 'Questo sito contiene:', |
|
| 371 | + 'info_contribution' => 'contributi dei forum', |
|
| 372 | + 'info_copyright' => '@spip@ è un software libero distribuito @lien_gpl@.', |
|
| 373 | + 'info_copyright_doc' => 'Per maggiori informazioni, vedi il sito <a href="@spipnet@">@spipnet_affiche@</a>.', |
|
| 374 | + 'info_copyright_gpl' => 'sotto licenza GPL', |
|
| 375 | + 'info_cours_edition' => 'Articoli in fase di redazione', |
|
| 376 | + 'info_creer_repertoire' => 'Creare un file o una cartella chiamata:', |
|
| 377 | + 'info_creer_repertoire_2' => 'all’interno della sottocartella <b>@repertoire@</b>, poi:', |
|
| 378 | + 'info_creer_vignette' => 'creazione automatica dell’anteprima', |
|
| 379 | + 'info_creerdansrubrique_non_autorise' => 'Non si dispone di diritti sufficienti per creare contenuti in questa rubrica', |
|
| 380 | + 'info_deplier' => 'Espandi', |
|
| 381 | + 'info_descriptif_nombre' => 'descrizione(i):', |
|
| 382 | + 'info_description' => 'Descrizione:', |
|
| 383 | + 'info_description_2' => 'Descrizione:', |
|
| 384 | + 'info_dimension' => 'Dimensioni:', |
|
| 385 | + 'info_documents_nb' => '@nb@ documenti', |
|
| 386 | + 'info_documents_un' => '1 documento', |
|
| 387 | + 'info_ecire_message_prive' => 'Scrivi un messaggio privato', |
|
| 388 | + 'info_email_invalide' => 'Indirizzo email non valido.', |
|
| 389 | + 'info_en_cours_validation' => 'I tuoi articoli in corso di redazione', |
|
| 390 | + 'info_en_ligne' => 'Attualmente on line:', |
|
| 391 | + 'info_envoyer_message_prive' => 'Invia un messaggio privato a questo autore', |
|
| 392 | + 'info_erreur_requete' => 'Errore nella richiesta: ', |
|
| 393 | + 'info_erreur_squelette2' => 'Nessun modello di layout <b>@fichier@</b> trovato...', |
|
| 394 | + 'info_erreur_systeme' => 'Errore di sistema (errno @errsys@)', |
|
| 395 | + 'info_erreur_systeme2' => 'Il disco rigido potrebbe essere pieno o la base dati danneggiata.<br /> |
|
| 396 | 396 | <span style="color:red;">Tenta di <a href=\'@script@\'>ripristinare la base dati</a>, o contatta il tuo hoster.</span>', |
| 397 | - 'info_fini' => 'Finito!', |
|
| 398 | - 'info_format_image' => 'Formati di file immagine utilizzabili per la creazione delle etichette: @gd_formats@.', |
|
| 399 | - 'info_format_non_defini' => 'formato non definito', |
|
| 400 | - 'info_grand_ecran' => 'Layout per monitor grandi', |
|
| 401 | - 'info_image_aide' => 'AIUTO', |
|
| 402 | - 'info_image_process_titre' => 'Metodo per generare thumbnail', |
|
| 403 | - 'info_impossible_lire_page' => '<b>Errore!</b> Impossibile leggere la pagina <tt><html>@test_proxy@</html></tt> attraverso il proxy ', |
|
| 404 | - 'info_installation_systeme_publication' => 'Installazione del sistema di pubblicazione...', |
|
| 405 | - 'info_installer_documents' => 'È possibile installare automaticamente tutti i documenti contenuti nella cartella @upload@.', |
|
| 406 | - 'info_installer_ftp' => 'In qualità di amministratore, puoi installare file (via FTP) nella cartella @upload@ per poi selezionarli direttamente.', |
|
| 407 | - 'info_installer_images' => 'È possibile installare delle immagini in formato JPEG, GIF e PNG.', |
|
| 408 | - 'info_installer_images_dossier' => 'Installare delle immagini nella cartella @upload@ per poterle selezionare direttamente.', |
|
| 409 | - 'info_interface_complete' => 'Interfaccia completa', |
|
| 410 | - 'info_interface_simple' => 'Interfaccia semplificata', |
|
| 411 | - 'info_joindre_document_article' => 'Puoi allegare a questo articolo dei documenti del tipo', |
|
| 412 | - 'info_joindre_document_rubrique' => 'Puoi aggiungere a questa rubrica documenti del tipo', |
|
| 413 | - 'info_joindre_documents_article' => 'Puoi allegare all’articolo documenti del tipo: ', |
|
| 414 | - 'info_l_article' => 'l’articolo', |
|
| 415 | - 'info_la_breve' => 'la breve', |
|
| 416 | - 'info_la_rubrique' => 'la sezione', |
|
| 417 | - 'info_langue_principale' => 'Lingua predefinita del sito', |
|
| 418 | - 'info_largeur_vignette' => '@largeur_vignette@ x @hauteur_vignette@ pixel', |
|
| 419 | - 'info_les_auteurs_1' => 'di @les_auteurs@ ', |
|
| 420 | - 'info_logo_format_interdit' => 'Solo i logo in formato @formats@ sono permessi.', |
|
| 421 | - 'info_logo_max_poids' => 'I logo devono obbligatoriamente avere una dimensione inferiore a @maxi@ (questo file è di @actuel@).', |
|
| 422 | - 'info_mail_fournisseur' => '[email protected]', |
|
| 423 | - 'info_message_2' => 'MESSAGGIO', |
|
| 424 | - 'info_message_supprime' => 'MESSAGGIO ELIMINATO', |
|
| 425 | - 'info_messages_nb' => '@nb@ messaggi', |
|
| 426 | - 'info_messages_un' => '1 messaggio', |
|
| 427 | - 'info_mise_en_ligne' => 'Data di pubblicazione on line:', |
|
| 428 | - 'info_modification_parametres_securite' => 'modifiche dei parametri di sicurezza', |
|
| 429 | - 'info_mois_courant' => 'Durante il mese:', |
|
| 430 | - 'info_mot_cle_ajoute' => 'La seguente parola chiave è stata aggiunta a', |
|
| 431 | - 'info_multi_herit' => 'Lingua predefinita', |
|
| 432 | - 'info_multi_langues_soulignees' => 'Le <u>lingue sottolineate</u> hanno la traduzione parziale o totale per tutti i testi dell’interfaccia. Se si seleziona una di queste lingue, molti elementi del sito pubblico (date, form) verranno tradotti automaticamente. Per le lingue che non sono sottolineate, invece, tali elementi rimarranno nella lingua principale del sito.', |
|
| 433 | - 'info_multilinguisme' => 'Multilinguismo', |
|
| 434 | - 'info_nom_non_utilisateurs_connectes' => 'Il tuo nome non appare nella lista degli utenti collegati.', |
|
| 435 | - 'info_nom_utilisateurs_connectes' => 'Il tuo nome è visibile nella lista degli utenti collegati.', |
|
| 436 | - 'info_nombre_en_ligne' => 'Attualmente on line:', |
|
| 437 | - 'info_non_resultat' => 'Nessun risultato per "@cherche_mot@"', |
|
| 438 | - 'info_non_utilisation_messagerie' => 'Il sistema di messaggistica interna di questo sito non viene utilizzato.', |
|
| 439 | - 'info_nouveau_message' => 'HAI UN NUOVO MESSAGGIO', |
|
| 440 | - 'info_nouveaux_messages' => 'HAI @total_messages@ NUOVI MESSAGGI', |
|
| 441 | - 'info_numero_abbreviation' => 'N. ', |
|
| 442 | - 'info_obligatoire' => 'Questa informazione è obbligatoria', |
|
| 443 | - 'info_page_actuelle' => 'Pagina corrente', |
|
| 444 | - 'info_pense_bete' => 'MEMO', |
|
| 445 | - 'info_petit_ecran' => 'Layout per monitor piccoli', |
|
| 446 | - 'info_petition_close' => 'Petizione chiusa', |
|
| 447 | - 'info_pixels' => 'pixels', |
|
| 448 | - 'info_plusieurs_mots_trouves' => 'Numerose parole chiave trovate per "@cherche_mot@":', |
|
| 449 | - 'info_portfolio_automatique' => 'Portfolio automatico:', |
|
| 450 | - 'info_premier_resultat' => '[@debut_limit@ primi risultati su @total@]', |
|
| 451 | - 'info_premier_resultat_sur' => '[@debut_limit@ primi risultati su @total@]', |
|
| 452 | - 'info_propose_1' => '[@nom_site_spip@] Propone: @titre@', |
|
| 453 | - 'info_propose_2' => 'Articolo proposto |
|
| 397 | + 'info_fini' => 'Finito!', |
|
| 398 | + 'info_format_image' => 'Formati di file immagine utilizzabili per la creazione delle etichette: @gd_formats@.', |
|
| 399 | + 'info_format_non_defini' => 'formato non definito', |
|
| 400 | + 'info_grand_ecran' => 'Layout per monitor grandi', |
|
| 401 | + 'info_image_aide' => 'AIUTO', |
|
| 402 | + 'info_image_process_titre' => 'Metodo per generare thumbnail', |
|
| 403 | + 'info_impossible_lire_page' => '<b>Errore!</b> Impossibile leggere la pagina <tt><html>@test_proxy@</html></tt> attraverso il proxy ', |
|
| 404 | + 'info_installation_systeme_publication' => 'Installazione del sistema di pubblicazione...', |
|
| 405 | + 'info_installer_documents' => 'È possibile installare automaticamente tutti i documenti contenuti nella cartella @upload@.', |
|
| 406 | + 'info_installer_ftp' => 'In qualità di amministratore, puoi installare file (via FTP) nella cartella @upload@ per poi selezionarli direttamente.', |
|
| 407 | + 'info_installer_images' => 'È possibile installare delle immagini in formato JPEG, GIF e PNG.', |
|
| 408 | + 'info_installer_images_dossier' => 'Installare delle immagini nella cartella @upload@ per poterle selezionare direttamente.', |
|
| 409 | + 'info_interface_complete' => 'Interfaccia completa', |
|
| 410 | + 'info_interface_simple' => 'Interfaccia semplificata', |
|
| 411 | + 'info_joindre_document_article' => 'Puoi allegare a questo articolo dei documenti del tipo', |
|
| 412 | + 'info_joindre_document_rubrique' => 'Puoi aggiungere a questa rubrica documenti del tipo', |
|
| 413 | + 'info_joindre_documents_article' => 'Puoi allegare all’articolo documenti del tipo: ', |
|
| 414 | + 'info_l_article' => 'l’articolo', |
|
| 415 | + 'info_la_breve' => 'la breve', |
|
| 416 | + 'info_la_rubrique' => 'la sezione', |
|
| 417 | + 'info_langue_principale' => 'Lingua predefinita del sito', |
|
| 418 | + 'info_largeur_vignette' => '@largeur_vignette@ x @hauteur_vignette@ pixel', |
|
| 419 | + 'info_les_auteurs_1' => 'di @les_auteurs@ ', |
|
| 420 | + 'info_logo_format_interdit' => 'Solo i logo in formato @formats@ sono permessi.', |
|
| 421 | + 'info_logo_max_poids' => 'I logo devono obbligatoriamente avere una dimensione inferiore a @maxi@ (questo file è di @actuel@).', |
|
| 422 | + 'info_mail_fournisseur' => '[email protected]', |
|
| 423 | + 'info_message_2' => 'MESSAGGIO', |
|
| 424 | + 'info_message_supprime' => 'MESSAGGIO ELIMINATO', |
|
| 425 | + 'info_messages_nb' => '@nb@ messaggi', |
|
| 426 | + 'info_messages_un' => '1 messaggio', |
|
| 427 | + 'info_mise_en_ligne' => 'Data di pubblicazione on line:', |
|
| 428 | + 'info_modification_parametres_securite' => 'modifiche dei parametri di sicurezza', |
|
| 429 | + 'info_mois_courant' => 'Durante il mese:', |
|
| 430 | + 'info_mot_cle_ajoute' => 'La seguente parola chiave è stata aggiunta a', |
|
| 431 | + 'info_multi_herit' => 'Lingua predefinita', |
|
| 432 | + 'info_multi_langues_soulignees' => 'Le <u>lingue sottolineate</u> hanno la traduzione parziale o totale per tutti i testi dell’interfaccia. Se si seleziona una di queste lingue, molti elementi del sito pubblico (date, form) verranno tradotti automaticamente. Per le lingue che non sono sottolineate, invece, tali elementi rimarranno nella lingua principale del sito.', |
|
| 433 | + 'info_multilinguisme' => 'Multilinguismo', |
|
| 434 | + 'info_nom_non_utilisateurs_connectes' => 'Il tuo nome non appare nella lista degli utenti collegati.', |
|
| 435 | + 'info_nom_utilisateurs_connectes' => 'Il tuo nome è visibile nella lista degli utenti collegati.', |
|
| 436 | + 'info_nombre_en_ligne' => 'Attualmente on line:', |
|
| 437 | + 'info_non_resultat' => 'Nessun risultato per "@cherche_mot@"', |
|
| 438 | + 'info_non_utilisation_messagerie' => 'Il sistema di messaggistica interna di questo sito non viene utilizzato.', |
|
| 439 | + 'info_nouveau_message' => 'HAI UN NUOVO MESSAGGIO', |
|
| 440 | + 'info_nouveaux_messages' => 'HAI @total_messages@ NUOVI MESSAGGI', |
|
| 441 | + 'info_numero_abbreviation' => 'N. ', |
|
| 442 | + 'info_obligatoire' => 'Questa informazione è obbligatoria', |
|
| 443 | + 'info_page_actuelle' => 'Pagina corrente', |
|
| 444 | + 'info_pense_bete' => 'MEMO', |
|
| 445 | + 'info_petit_ecran' => 'Layout per monitor piccoli', |
|
| 446 | + 'info_petition_close' => 'Petizione chiusa', |
|
| 447 | + 'info_pixels' => 'pixels', |
|
| 448 | + 'info_plusieurs_mots_trouves' => 'Numerose parole chiave trovate per "@cherche_mot@":', |
|
| 449 | + 'info_portfolio_automatique' => 'Portfolio automatico:', |
|
| 450 | + 'info_premier_resultat' => '[@debut_limit@ primi risultati su @total@]', |
|
| 451 | + 'info_premier_resultat_sur' => '[@debut_limit@ primi risultati su @total@]', |
|
| 452 | + 'info_propose_1' => '[@nom_site_spip@] Propone: @titre@', |
|
| 453 | + 'info_propose_2' => 'Articolo proposto |
|
| 454 | 454 | ---------------', |
| 455 | - 'info_propose_3' => 'L’articolo "@titre@" è proposto per la pubblicazione', |
|
| 456 | - 'info_propose_4' => 'Sei invitato a consultare e a dare la tua opinione ', |
|
| 457 | - 'info_propose_5' => 'nel forum annesso. |
|
| 455 | + 'info_propose_3' => 'L’articolo "@titre@" è proposto per la pubblicazione', |
|
| 456 | + 'info_propose_4' => 'Sei invitato a consultare e a dare la tua opinione ', |
|
| 457 | + 'info_propose_5' => 'nel forum annesso. |
|
| 458 | 458 | |
| 459 | 459 | È disponibile all’indirizzo:', |
| 460 | - 'info_publie_01' => 'L’articolo "@titre@" è stato convalidato da @connect_nom@.', |
|
| 461 | - 'info_publie_1' => '[@nom_site_spip@] PUBBLICA: @titre@', |
|
| 462 | - 'info_publie_2' => 'Articolo pubblicato |
|
| 460 | + 'info_publie_01' => 'L’articolo "@titre@" è stato convalidato da @connect_nom@.', |
|
| 461 | + 'info_publie_1' => '[@nom_site_spip@] PUBBLICA: @titre@', |
|
| 462 | + 'info_publie_2' => 'Articolo pubblicato |
|
| 463 | 463 | --------------', |
| 464 | - 'info_rechercher' => 'Ricerca', |
|
| 465 | - 'info_rechercher_02' => 'Cerca:', |
|
| 466 | - 'info_remplacer_vignette' => 'Sostituire l’icona predefinita con una personalizzata:', |
|
| 467 | - 'info_rubriques_nb' => '@nb@ sezioni', |
|
| 468 | - 'info_rubriques_un' => '1 sezione', |
|
| 469 | - 'info_sans_titre_2' => 'senza titolo', |
|
| 470 | - 'info_selectionner_fichier' => 'Puoi selezionare un file della cartella @upload@', |
|
| 471 | - 'info_selectionner_fichier_2' => 'Seleziona un file:', |
|
| 472 | - 'info_sites_nb' => '@nb@ siti', |
|
| 473 | - 'info_sites_un' => '1 sito', |
|
| 474 | - 'info_supprimer_vignette' => 'Cancella l’immagine', |
|
| 475 | - 'info_symbole_bleu' => 'Il simbolo <b>blu</b> indica un <b>memo</b>: cioè un messaggio ad uso personale.', |
|
| 476 | - 'info_symbole_jaune' => 'Il simbolo <b>giallo</b> indica un <b>annuncio a tutti i redattori</b>: modificabile da tutti gli amministratori e visibile da tutti i redattori.', |
|
| 477 | - 'info_symbole_vert' => 'Il simbolo <b>verde</b> indica i <b>messaggi scambiati con altri utenti </b> del sito.', |
|
| 478 | - 'info_telecharger_nouveau_logo' => 'Upload di un nuovo logo:', |
|
| 479 | - 'info_telecharger_ordinateur' => 'Upload dal tuo computer:', |
|
| 480 | - 'info_tous_resultats_enregistres' => '[tutti i risultati sono salvati]', |
|
| 481 | - 'info_tout_afficher' => 'Visualizza tutto', |
|
| 482 | - 'info_travaux_texte' => 'Questo sito non è stato ancora configurato. Torna più tardi...', |
|
| 483 | - 'info_travaux_titre' => 'Lavori in corso', |
|
| 484 | - 'info_trop_resultat' => 'Troppi risultati per "@cherche_mot@" ; restringi la ricerca.', |
|
| 485 | - 'info_utilisation_messagerie_interne' => 'Stai utilizzando il sistema di messaggistica interna al sito.', |
|
| 486 | - 'info_valider_lien' => 'convalidare questo link', |
|
| 487 | - 'info_verifier_image' => ', verifica che le immagini siano state trasferite correttamente.', |
|
| 488 | - 'info_vignette_defaut' => 'Loghi predefiniti', |
|
| 489 | - 'info_vignette_personnalisee' => 'Loghi personalizzati', |
|
| 490 | - 'info_visite' => 'visita:', |
|
| 491 | - 'info_vos_rendez_vous' => 'I tuoi prossimi appuntamenti', |
|
| 492 | - 'infos_vos_pense_bete' => 'I tuoi memo', |
|
| 464 | + 'info_rechercher' => 'Ricerca', |
|
| 465 | + 'info_rechercher_02' => 'Cerca:', |
|
| 466 | + 'info_remplacer_vignette' => 'Sostituire l’icona predefinita con una personalizzata:', |
|
| 467 | + 'info_rubriques_nb' => '@nb@ sezioni', |
|
| 468 | + 'info_rubriques_un' => '1 sezione', |
|
| 469 | + 'info_sans_titre_2' => 'senza titolo', |
|
| 470 | + 'info_selectionner_fichier' => 'Puoi selezionare un file della cartella @upload@', |
|
| 471 | + 'info_selectionner_fichier_2' => 'Seleziona un file:', |
|
| 472 | + 'info_sites_nb' => '@nb@ siti', |
|
| 473 | + 'info_sites_un' => '1 sito', |
|
| 474 | + 'info_supprimer_vignette' => 'Cancella l’immagine', |
|
| 475 | + 'info_symbole_bleu' => 'Il simbolo <b>blu</b> indica un <b>memo</b>: cioè un messaggio ad uso personale.', |
|
| 476 | + 'info_symbole_jaune' => 'Il simbolo <b>giallo</b> indica un <b>annuncio a tutti i redattori</b>: modificabile da tutti gli amministratori e visibile da tutti i redattori.', |
|
| 477 | + 'info_symbole_vert' => 'Il simbolo <b>verde</b> indica i <b>messaggi scambiati con altri utenti </b> del sito.', |
|
| 478 | + 'info_telecharger_nouveau_logo' => 'Upload di un nuovo logo:', |
|
| 479 | + 'info_telecharger_ordinateur' => 'Upload dal tuo computer:', |
|
| 480 | + 'info_tous_resultats_enregistres' => '[tutti i risultati sono salvati]', |
|
| 481 | + 'info_tout_afficher' => 'Visualizza tutto', |
|
| 482 | + 'info_travaux_texte' => 'Questo sito non è stato ancora configurato. Torna più tardi...', |
|
| 483 | + 'info_travaux_titre' => 'Lavori in corso', |
|
| 484 | + 'info_trop_resultat' => 'Troppi risultati per "@cherche_mot@" ; restringi la ricerca.', |
|
| 485 | + 'info_utilisation_messagerie_interne' => 'Stai utilizzando il sistema di messaggistica interna al sito.', |
|
| 486 | + 'info_valider_lien' => 'convalidare questo link', |
|
| 487 | + 'info_verifier_image' => ', verifica che le immagini siano state trasferite correttamente.', |
|
| 488 | + 'info_vignette_defaut' => 'Loghi predefiniti', |
|
| 489 | + 'info_vignette_personnalisee' => 'Loghi personalizzati', |
|
| 490 | + 'info_visite' => 'visita:', |
|
| 491 | + 'info_vos_rendez_vous' => 'I tuoi prossimi appuntamenti', |
|
| 492 | + 'infos_vos_pense_bete' => 'I tuoi memo', |
|
| 493 | 493 | |
| 494 | - // L |
|
| 495 | - 'label_ajout_id_rapide' => 'Inserimento rapido', |
|
| 496 | - 'label_poids_fichier' => 'Dimensione', |
|
| 497 | - 'label_ponctuer' => '@label@:', |
|
| 498 | - 'lien_afficher_icones_seuls' => 'Mostra solo le icone', |
|
| 499 | - 'lien_afficher_texte_icones' => 'Mostra le icone e il testo', |
|
| 500 | - 'lien_afficher_texte_seul' => 'Mostra solo il testo', |
|
| 501 | - 'lien_aller_a_la_derniere_page' => 'Vai all’ultima pagina', |
|
| 502 | - 'lien_aller_a_la_page_nb' => 'Vai alla pagina @nb@', |
|
| 503 | - 'lien_aller_a_la_page_precedente' => 'Vai alla pagina precedente', |
|
| 504 | - 'lien_aller_a_la_page_suivante' => 'Vai alla pagina successiva', |
|
| 505 | - 'lien_aller_a_la_premiere_page' => 'Vai alla prima pagina', |
|
| 506 | - 'lien_liberer' => 'libera', |
|
| 507 | - 'lien_liberer_tous' => 'liberare questi articoli', |
|
| 508 | - 'lien_nouvea_pense_bete' => 'NUOVO MEMO', |
|
| 509 | - 'lien_nouveau_message' => 'NUOVO MESSAGGIO', |
|
| 510 | - 'lien_nouvelle_annonce' => 'NUOVO ANNUNCIO', |
|
| 511 | - 'lien_petitions' => 'PETIZIONE', |
|
| 512 | - 'lien_popularite' => 'popolarità: @popularite@%', |
|
| 513 | - 'lien_racine_site' => 'ROOT DEL SITO', |
|
| 514 | - 'lien_reessayer' => 'Prova di nuovo', |
|
| 515 | - 'lien_repondre_message' => 'Rispondi', |
|
| 516 | - 'lien_supprimer' => 'cancella', |
|
| 517 | - 'lien_tout_afficher' => 'Visualizza tutto ', |
|
| 518 | - 'lien_visite_site' => 'visita il sito', |
|
| 519 | - 'lien_visites' => '@visites@ visite', |
|
| 520 | - 'lien_voir_auteur' => 'Vedi questo autore', |
|
| 521 | - 'ligne' => 'Linea', |
|
| 522 | - 'login' => 'Collegamento', |
|
| 523 | - 'login_acces_prive' => 'accesso all’area riservata', |
|
| 524 | - 'login_autre_identifiant' => 'connettiti con un altro ID', |
|
| 525 | - 'login_cookie_accepte' => 'Imposta il tuo browser affinché li accetti (almeno per questo sito).', |
|
| 526 | - 'login_cookie_oblige' => 'Per identificarsi in modo sicuro su questo sito è necessario accettare i cookie.', |
|
| 527 | - 'login_deconnexion_ok' => 'Disconnessione effettuata.', |
|
| 528 | - 'login_erreur_pass' => 'Errore nella password.', |
|
| 529 | - 'login_espace_prive' => 'area riservata', |
|
| 530 | - 'login_identifiant_inconnu' => 'L’ID « @login@ » risulta inesistente.', |
|
| 531 | - 'login_login' => 'Login:', |
|
| 532 | - 'login_login2' => 'Login o indirizzo email:', |
|
| 533 | - 'login_login_pass_incorrect' => '(Login o password errati.)', |
|
| 534 | - 'login_motpasseoublie' => 'password dimenticata?', |
|
| 535 | - 'login_non_securise' => 'Attenzione, questo modulo non è sicuro. |
|
| 494 | + // L |
|
| 495 | + 'label_ajout_id_rapide' => 'Inserimento rapido', |
|
| 496 | + 'label_poids_fichier' => 'Dimensione', |
|
| 497 | + 'label_ponctuer' => '@label@:', |
|
| 498 | + 'lien_afficher_icones_seuls' => 'Mostra solo le icone', |
|
| 499 | + 'lien_afficher_texte_icones' => 'Mostra le icone e il testo', |
|
| 500 | + 'lien_afficher_texte_seul' => 'Mostra solo il testo', |
|
| 501 | + 'lien_aller_a_la_derniere_page' => 'Vai all’ultima pagina', |
|
| 502 | + 'lien_aller_a_la_page_nb' => 'Vai alla pagina @nb@', |
|
| 503 | + 'lien_aller_a_la_page_precedente' => 'Vai alla pagina precedente', |
|
| 504 | + 'lien_aller_a_la_page_suivante' => 'Vai alla pagina successiva', |
|
| 505 | + 'lien_aller_a_la_premiere_page' => 'Vai alla prima pagina', |
|
| 506 | + 'lien_liberer' => 'libera', |
|
| 507 | + 'lien_liberer_tous' => 'liberare questi articoli', |
|
| 508 | + 'lien_nouvea_pense_bete' => 'NUOVO MEMO', |
|
| 509 | + 'lien_nouveau_message' => 'NUOVO MESSAGGIO', |
|
| 510 | + 'lien_nouvelle_annonce' => 'NUOVO ANNUNCIO', |
|
| 511 | + 'lien_petitions' => 'PETIZIONE', |
|
| 512 | + 'lien_popularite' => 'popolarità: @popularite@%', |
|
| 513 | + 'lien_racine_site' => 'ROOT DEL SITO', |
|
| 514 | + 'lien_reessayer' => 'Prova di nuovo', |
|
| 515 | + 'lien_repondre_message' => 'Rispondi', |
|
| 516 | + 'lien_supprimer' => 'cancella', |
|
| 517 | + 'lien_tout_afficher' => 'Visualizza tutto ', |
|
| 518 | + 'lien_visite_site' => 'visita il sito', |
|
| 519 | + 'lien_visites' => '@visites@ visite', |
|
| 520 | + 'lien_voir_auteur' => 'Vedi questo autore', |
|
| 521 | + 'ligne' => 'Linea', |
|
| 522 | + 'login' => 'Collegamento', |
|
| 523 | + 'login_acces_prive' => 'accesso all’area riservata', |
|
| 524 | + 'login_autre_identifiant' => 'connettiti con un altro ID', |
|
| 525 | + 'login_cookie_accepte' => 'Imposta il tuo browser affinché li accetti (almeno per questo sito).', |
|
| 526 | + 'login_cookie_oblige' => 'Per identificarsi in modo sicuro su questo sito è necessario accettare i cookie.', |
|
| 527 | + 'login_deconnexion_ok' => 'Disconnessione effettuata.', |
|
| 528 | + 'login_erreur_pass' => 'Errore nella password.', |
|
| 529 | + 'login_espace_prive' => 'area riservata', |
|
| 530 | + 'login_identifiant_inconnu' => 'L’ID « @login@ » risulta inesistente.', |
|
| 531 | + 'login_login' => 'Login:', |
|
| 532 | + 'login_login2' => 'Login o indirizzo email:', |
|
| 533 | + 'login_login_pass_incorrect' => '(Login o password errati.)', |
|
| 534 | + 'login_motpasseoublie' => 'password dimenticata?', |
|
| 535 | + 'login_non_securise' => 'Attenzione, questo modulo non è sicuro. |
|
| 536 | 536 | Se non vuoi che la tua password possa essere intercettata sulla rete, |
| 537 | 537 | devi attivare Javascript nel tuo browser e', |
| 538 | - 'login_nouvelle_tentative' => 'Nuovo tentativo', |
|
| 539 | - 'login_par_ici' => 'Sei registrato... per di qua...', |
|
| 540 | - 'login_pass2' => 'Password:', |
|
| 541 | - 'login_preferez_refuser' => '<b>Se preferisci non accettare i cookie</b> c’è un altro metodo (meno sicuro) per connettersi:', |
|
| 542 | - 'login_recharger' => 'aggiorna questa pagina', |
|
| 543 | - 'login_rester_identifie' => 'Conservare l’identificazione per alcuni giorni', |
|
| 544 | - 'login_retour_public' => 'Ritorna al sito pubblico', |
|
| 545 | - 'login_retour_site' => 'Ritorna al sito pubblico', |
|
| 546 | - 'login_retoursitepublic' => 'ritorna al sito pubblico', |
|
| 547 | - 'login_sans_cookie' => 'Identificazione senza cookie', |
|
| 548 | - 'login_securise' => 'Accesso protetto', |
|
| 549 | - 'login_sinscrire' => 'registrati', |
|
| 550 | - 'login_test_navigateur' => 'test browser/riconnessione', |
|
| 551 | - 'login_verifiez_navigateur' => '(Verifica comunque se il tuo browser ha memorizzato la password...)', |
|
| 538 | + 'login_nouvelle_tentative' => 'Nuovo tentativo', |
|
| 539 | + 'login_par_ici' => 'Sei registrato... per di qua...', |
|
| 540 | + 'login_pass2' => 'Password:', |
|
| 541 | + 'login_preferez_refuser' => '<b>Se preferisci non accettare i cookie</b> c’è un altro metodo (meno sicuro) per connettersi:', |
|
| 542 | + 'login_recharger' => 'aggiorna questa pagina', |
|
| 543 | + 'login_rester_identifie' => 'Conservare l’identificazione per alcuni giorni', |
|
| 544 | + 'login_retour_public' => 'Ritorna al sito pubblico', |
|
| 545 | + 'login_retour_site' => 'Ritorna al sito pubblico', |
|
| 546 | + 'login_retoursitepublic' => 'ritorna al sito pubblico', |
|
| 547 | + 'login_sans_cookie' => 'Identificazione senza cookie', |
|
| 548 | + 'login_securise' => 'Accesso protetto', |
|
| 549 | + 'login_sinscrire' => 'registrati', |
|
| 550 | + 'login_test_navigateur' => 'test browser/riconnessione', |
|
| 551 | + 'login_verifiez_navigateur' => '(Verifica comunque se il tuo browser ha memorizzato la password...)', |
|
| 552 | 552 | |
| 553 | - // M |
|
| 554 | - 'masquer_colonne' => 'Nascondi questa colonna', |
|
| 555 | - 'masquer_trad' => 'nascondere le traduzioni', |
|
| 556 | - 'message_nouveaux_identifiants_echec' => 'Impossibile generare nuovi identificativi', |
|
| 557 | - 'message_nouveaux_identifiants_echec_envoi' => 'Le nuove credenziali di accesso non possono essere inviate.', |
|
| 558 | - 'message_nouveaux_identifiants_ok' => 'Le nuove credenziali di accsso sono state inviate a @email@.', |
|
| 559 | - 'module_fichiers_langues' => 'File lingua', |
|
| 553 | + // M |
|
| 554 | + 'masquer_colonne' => 'Nascondi questa colonna', |
|
| 555 | + 'masquer_trad' => 'nascondere le traduzioni', |
|
| 556 | + 'message_nouveaux_identifiants_echec' => 'Impossibile generare nuovi identificativi', |
|
| 557 | + 'message_nouveaux_identifiants_echec_envoi' => 'Le nuove credenziali di accesso non possono essere inviate.', |
|
| 558 | + 'message_nouveaux_identifiants_ok' => 'Le nuove credenziali di accsso sono state inviate a @email@.', |
|
| 559 | + 'module_fichiers_langues' => 'File lingua', |
|
| 560 | 560 | |
| 561 | - // N |
|
| 562 | - 'navigateur_pas_redirige' => 'Se la pagina non cambia automaticamente, cliccare qui per continuare.', |
|
| 563 | - 'numero' => 'Numero', |
|
| 561 | + // N |
|
| 562 | + 'navigateur_pas_redirige' => 'Se la pagina non cambia automaticamente, cliccare qui per continuare.', |
|
| 563 | + 'numero' => 'Numero', |
|
| 564 | 564 | |
| 565 | - // O |
|
| 566 | - 'occurence' => 'Occorrenza', |
|
| 567 | - 'onglet_affacer_base' => 'Svuota il database', |
|
| 568 | - 'onglet_auteur' => 'L’autore', |
|
| 569 | - 'onglet_contenu_site' => 'Contenuto del sito', |
|
| 570 | - 'onglet_evolution_visite_mod' => 'Evoluzione', |
|
| 571 | - 'onglet_fonctions_avances' => 'Funzioni avanzate', |
|
| 572 | - 'onglet_informations_personnelles' => 'Dati personali', |
|
| 573 | - 'onglet_interactivite' => 'Interattività', |
|
| 574 | - 'onglet_messagerie' => 'Messaggi', |
|
| 575 | - 'onglet_repartition_rubrique' => 'Ripartizione per rubriche', |
|
| 576 | - 'onglet_save_restaur_base' => 'Salva/ripristina il database', |
|
| 577 | - 'onglet_vider_cache' => 'Svuota la cache', |
|
| 565 | + // O |
|
| 566 | + 'occurence' => 'Occorrenza', |
|
| 567 | + 'onglet_affacer_base' => 'Svuota il database', |
|
| 568 | + 'onglet_auteur' => 'L’autore', |
|
| 569 | + 'onglet_contenu_site' => 'Contenuto del sito', |
|
| 570 | + 'onglet_evolution_visite_mod' => 'Evoluzione', |
|
| 571 | + 'onglet_fonctions_avances' => 'Funzioni avanzate', |
|
| 572 | + 'onglet_informations_personnelles' => 'Dati personali', |
|
| 573 | + 'onglet_interactivite' => 'Interattività', |
|
| 574 | + 'onglet_messagerie' => 'Messaggi', |
|
| 575 | + 'onglet_repartition_rubrique' => 'Ripartizione per rubriche', |
|
| 576 | + 'onglet_save_restaur_base' => 'Salva/ripristina il database', |
|
| 577 | + 'onglet_vider_cache' => 'Svuota la cache', |
|
| 578 | 578 | |
| 579 | - // P |
|
| 580 | - 'pass_choix_pass' => 'Inserisci una nuova password:', |
|
| 581 | - 'pass_erreur' => 'Errore', |
|
| 582 | - 'pass_erreur_acces_refuse' => '<b>Errore:</b> non hai più accesso a questo sito.', |
|
| 583 | - 'pass_erreur_code_inconnu' => '<b>Errore:</b> il codice inserito non corriponde a nessuno degli utenti che hanno accesso a questo sito.', |
|
| 584 | - 'pass_erreur_non_enregistre' => '<b>Errore:</b> l’indirizzo <tt>@email_oubli@</tt> non è registrato su questo sito.', |
|
| 585 | - 'pass_erreur_non_valide' => '<b>Errore:</b> questo indirizzo <tt>@email_oubli@</tt> non è valido!', |
|
| 586 | - 'pass_erreur_probleme_technique' => '<b>Errore:</b> l’email non può essere inviato a causa di un problema tecnico.', |
|
| 587 | - 'pass_espace_prive_bla' => 'L’area riservata di questo sito è accessibile |
|
| 579 | + // P |
|
| 580 | + 'pass_choix_pass' => 'Inserisci una nuova password:', |
|
| 581 | + 'pass_erreur' => 'Errore', |
|
| 582 | + 'pass_erreur_acces_refuse' => '<b>Errore:</b> non hai più accesso a questo sito.', |
|
| 583 | + 'pass_erreur_code_inconnu' => '<b>Errore:</b> il codice inserito non corriponde a nessuno degli utenti che hanno accesso a questo sito.', |
|
| 584 | + 'pass_erreur_non_enregistre' => '<b>Errore:</b> l’indirizzo <tt>@email_oubli@</tt> non è registrato su questo sito.', |
|
| 585 | + 'pass_erreur_non_valide' => '<b>Errore:</b> questo indirizzo <tt>@email_oubli@</tt> non è valido!', |
|
| 586 | + 'pass_erreur_probleme_technique' => '<b>Errore:</b> l’email non può essere inviato a causa di un problema tecnico.', |
|
| 587 | + 'pass_espace_prive_bla' => 'L’area riservata di questo sito è accessibile |
|
| 588 | 588 | unicamente agli utenti registrati. |
| 589 | 589 | Una volta iscritto, potrai consultare gli articoli in corso di redazione, |
| 590 | 590 | proporre nuovi articoli e partecipare a tutti i forum.', |
| 591 | - 'pass_forum_bla' => 'Hai chiesto di intervenire su un forum |
|
| 591 | + 'pass_forum_bla' => 'Hai chiesto di intervenire su un forum |
|
| 592 | 592 | riservato agli utenti registrati.', |
| 593 | - 'pass_indiquez_cidessous' => 'Indica qui sotto l’indirizzo email con il quale ti sei registrato precedentemente. |
|
| 593 | + 'pass_indiquez_cidessous' => 'Indica qui sotto l’indirizzo email con il quale ti sei registrato precedentemente. |
|
| 594 | 594 | Riceverai un email con le istruzioni per recuperare i dati di accesso al sito.', |
| 595 | - 'pass_mail_passcookie' => '(questo è un messaggio generato automaticamente) |
|
| 595 | + 'pass_mail_passcookie' => '(questo è un messaggio generato automaticamente) |
|
| 596 | 596 | Per recuperare i dati di accesso al sito |
| 597 | 597 | @nom_site_spip@ (@adresse_site@) |
| 598 | 598 | |
@@ -603,143 +603,143 @@ discard block |
||
| 603 | 603 | e riconnetterti all’area riservata. |
| 604 | 604 | |
| 605 | 605 | ', |
| 606 | - 'pass_mot_oublie' => 'Password dimenticata', |
|
| 607 | - 'pass_nouveau_enregistre' => 'La nuova password è stata salvata.', |
|
| 608 | - 'pass_nouveau_pass' => 'Nuova password', |
|
| 609 | - 'pass_ok' => 'OK', |
|
| 610 | - 'pass_oubli_mot' => 'Password dimenticata', |
|
| 611 | - 'pass_procedure_changer' => 'Per modificare la tua password, dobbiamo prima verificare la tua identità. Inserisci l’indirizzo email associato al tuo account.', |
|
| 612 | - 'pass_quitter_fenetre' => 'Chiudi la finestra', |
|
| 613 | - 'pass_rappel_login' => 'Ricorda: il tuo ID (login) è « @login@ ».', |
|
| 614 | - 'pass_recevoir_mail' => 'Riceverai un email contenente le istruzioni per recuperare i dati di accesso al sito.', |
|
| 615 | - 'pass_retour_public' => 'Torna al sito pubblico', |
|
| 616 | - 'pass_rien_a_faire_ici' => 'Vicolo cieco...', |
|
| 617 | - 'pass_vousinscrire' => 'Registrati al sito', |
|
| 618 | - 'precedent' => 'precedente', |
|
| 619 | - 'previsualisation' => 'Anteprima', |
|
| 620 | - 'previsualiser' => 'Visualizzare l’anteprima', |
|
| 606 | + 'pass_mot_oublie' => 'Password dimenticata', |
|
| 607 | + 'pass_nouveau_enregistre' => 'La nuova password è stata salvata.', |
|
| 608 | + 'pass_nouveau_pass' => 'Nuova password', |
|
| 609 | + 'pass_ok' => 'OK', |
|
| 610 | + 'pass_oubli_mot' => 'Password dimenticata', |
|
| 611 | + 'pass_procedure_changer' => 'Per modificare la tua password, dobbiamo prima verificare la tua identità. Inserisci l’indirizzo email associato al tuo account.', |
|
| 612 | + 'pass_quitter_fenetre' => 'Chiudi la finestra', |
|
| 613 | + 'pass_rappel_login' => 'Ricorda: il tuo ID (login) è « @login@ ».', |
|
| 614 | + 'pass_recevoir_mail' => 'Riceverai un email contenente le istruzioni per recuperare i dati di accesso al sito.', |
|
| 615 | + 'pass_retour_public' => 'Torna al sito pubblico', |
|
| 616 | + 'pass_rien_a_faire_ici' => 'Vicolo cieco...', |
|
| 617 | + 'pass_vousinscrire' => 'Registrati al sito', |
|
| 618 | + 'precedent' => 'precedente', |
|
| 619 | + 'previsualisation' => 'Anteprima', |
|
| 620 | + 'previsualiser' => 'Visualizzare l’anteprima', |
|
| 621 | 621 | |
| 622 | - // R |
|
| 623 | - 'retour' => 'Indietro', |
|
| 622 | + // R |
|
| 623 | + 'retour' => 'Indietro', |
|
| 624 | 624 | |
| 625 | - // S |
|
| 626 | - 'spip_conforme_dtd' => 'SPIP ritiene che questo documento è conforme al proprio DOCTYPE:', |
|
| 627 | - 'squelette' => 'modello di layout', |
|
| 628 | - 'squelette_inclus_ligne' => 'modello incluso, linea', |
|
| 629 | - 'squelette_ligne' => 'modello, linea', |
|
| 630 | - 'stats_visites_et_popularite' => '@visites@ visite; popolarità: @popularite@', |
|
| 631 | - 'suivant' => 'successivo', |
|
| 625 | + // S |
|
| 626 | + 'spip_conforme_dtd' => 'SPIP ritiene che questo documento è conforme al proprio DOCTYPE:', |
|
| 627 | + 'squelette' => 'modello di layout', |
|
| 628 | + 'squelette_inclus_ligne' => 'modello incluso, linea', |
|
| 629 | + 'squelette_ligne' => 'modello, linea', |
|
| 630 | + 'stats_visites_et_popularite' => '@visites@ visite; popolarità: @popularite@', |
|
| 631 | + 'suivant' => 'successivo', |
|
| 632 | 632 | |
| 633 | - // T |
|
| 634 | - 'taille_go' => '@taille@ Gb', |
|
| 635 | - 'taille_ko' => '@taille@ Kb', |
|
| 636 | - 'taille_mo' => '@taille@ Mb', |
|
| 637 | - 'taille_octets' => '@taille@ byte', |
|
| 638 | - 'texte_actualite_site_1' => 'Quando avrai maggiore familiarità con l’interfaccia, clicca su «', |
|
| 639 | - 'texte_actualite_site_2' => 'interfaccia completa', |
|
| 640 | - 'texte_actualite_site_3' => '» per avere accesso a nuove opzioni.', |
|
| 641 | - 'texte_creation_automatique_vignette' => 'La creazione automatica di thumbnail di anteprima è attivata. Se inserisci in questo campo delle immagini in formato @gd_formats@, esse saranno accompagnate da thumbnail con una dimensione massima di @taille_preview@ pixels. ', |
|
| 642 | - 'texte_documents_associes' => 'I seguenti documenti sono associati all’articolo, |
|
| 633 | + // T |
|
| 634 | + 'taille_go' => '@taille@ Gb', |
|
| 635 | + 'taille_ko' => '@taille@ Kb', |
|
| 636 | + 'taille_mo' => '@taille@ Mb', |
|
| 637 | + 'taille_octets' => '@taille@ byte', |
|
| 638 | + 'texte_actualite_site_1' => 'Quando avrai maggiore familiarità con l’interfaccia, clicca su «', |
|
| 639 | + 'texte_actualite_site_2' => 'interfaccia completa', |
|
| 640 | + 'texte_actualite_site_3' => '» per avere accesso a nuove opzioni.', |
|
| 641 | + 'texte_creation_automatique_vignette' => 'La creazione automatica di thumbnail di anteprima è attivata. Se inserisci in questo campo delle immagini in formato @gd_formats@, esse saranno accompagnate da thumbnail con una dimensione massima di @taille_preview@ pixels. ', |
|
| 642 | + 'texte_documents_associes' => 'I seguenti documenti sono associati all’articolo, |
|
| 643 | 643 | ma non vi sono stati inseriti direttamente. |
| 644 | 644 | A seconda delle impostazioni di pubblicazione del sito, |
| 645 | 645 | potranno essere disponibili sotto forma di documenti allegati.', |
| 646 | - 'texte_erreur_mise_niveau_base' => 'Errore nel database durante l’aggiornamento. |
|
| 646 | + 'texte_erreur_mise_niveau_base' => 'Errore nel database durante l’aggiornamento. |
|
| 647 | 647 | L’immagine <b>@fichier@</b> non è passata (articolo @id_article@). |
| 648 | 648 | Prendi nota di questo riferimento, ritenta l’aggiornamento, |
| 649 | 649 | e verifica che le immagini si vedano ancora |
| 650 | 650 | negli articoli.', |
| 651 | - 'texte_erreur_visiteur' => 'Si è tentato di entrare nell’area riservata con un login non valido.', |
|
| 652 | - 'texte_inc_auth_1' => 'Sei identificato con il |
|
| 651 | + 'texte_erreur_visiteur' => 'Si è tentato di entrare nell’area riservata con un login non valido.', |
|
| 652 | + 'texte_inc_auth_1' => 'Sei identificato con il |
|
| 653 | 653 | login <b>@auth_login@</b>, ma nel database non esiste. |
| 654 | 654 | Prova a ', |
| 655 | - 'texte_inc_auth_2' => 'collegarti nuovamente', |
|
| 656 | - 'texte_inc_auth_3' => ', dopo aver eventualmente effettuato un logout e |
|
| 655 | + 'texte_inc_auth_2' => 'collegarti nuovamente', |
|
| 656 | + 'texte_inc_auth_3' => ', dopo aver eventualmente effettuato un logout e |
|
| 657 | 657 | riavviato il tuo browser.', |
| 658 | - 'texte_inc_config' => 'Le modifiche effettuate in queste pagine influenzano notevolmente il |
|
| 658 | + 'texte_inc_config' => 'Le modifiche effettuate in queste pagine influenzano notevolmente il |
|
| 659 | 659 | funzionamento del sito. Non intervenire finché non conosci bene i meccanismi del sistema SPIP. <br /><br /><b>In generale, si consiglia di lasciare sempre al webmaster la configurazione delle opzioni qui presenti.</b>', |
| 660 | - 'texte_inc_meta_1' => 'La scrittura del file <code>@fichier@</code> ha causato un errore di sistema. L’amministratore del sito, ', |
|
| 661 | - 'texte_inc_meta_2' => 'verifichi i diritti di scrittura', |
|
| 662 | - 'texte_inc_meta_3' => 'nella cartella <code>@repertoire@</code>.', |
|
| 663 | - 'texte_statut_en_cours_redaction' => 'in corso di redazione', |
|
| 664 | - 'texte_statut_poubelle' => 'nel cestino', |
|
| 665 | - 'texte_statut_propose_evaluation' => 'proposto per una valutazione', |
|
| 666 | - 'texte_statut_publie' => 'pubblicato on line', |
|
| 667 | - 'texte_statut_refuse' => 'rifiutato', |
|
| 668 | - 'titre_ajouter_mot_cle' => 'AGGIUNGI UNA PAROLA CHIAVE:', |
|
| 669 | - 'titre_cadre_raccourcis' => 'SCELTA RAPIDA:', |
|
| 670 | - 'titre_changer_couleur_interface' => 'Cambia il colore dell’interfaccia', |
|
| 671 | - 'titre_image_admin_article' => 'Puoi amministrare questo articolo', |
|
| 672 | - 'titre_image_administrateur' => 'Amministratore', |
|
| 673 | - 'titre_image_aide' => 'Aiuto su questo elemento', |
|
| 674 | - 'titre_image_auteur_supprime' => 'Autore eliminato', |
|
| 675 | - 'titre_image_redacteur' => 'Redattore senza accesso', |
|
| 676 | - 'titre_image_redacteur_02' => 'Redattore', |
|
| 677 | - 'titre_image_selecteur' => 'Mostra la lista', |
|
| 678 | - 'titre_image_visiteur' => 'Visitatore', |
|
| 679 | - 'titre_joindre_document' => 'ALLEGA UN DOCUMENTO', |
|
| 680 | - 'titre_mots_cles' => 'PAROLE CHIAVE', |
|
| 681 | - 'titre_probleme_technique' => 'Attenzione: un problema tecnico (server SQL) impedisce l’accesso a questa parte del sito. Grazie per la comprensione.', |
|
| 682 | - 'titre_publier_document' => 'ALLEGA UN DOCUMENTO A QUESTA RUBRICA', |
|
| 683 | - 'titre_signatures_attente' => 'Firme in corso di convalida', |
|
| 684 | - 'titre_signatures_confirmees' => 'Firme confermate', |
|
| 685 | - 'titre_statistiques' => 'Statistiche del sito', |
|
| 686 | - 'titre_titre_document' => 'Titolo del documento:', |
|
| 687 | - 'todo' => 'prossimo', |
|
| 688 | - 'trad_definir_reference' => 'Scegliere "@titre@" come riferimento per le traduzioni', |
|
| 689 | - 'trad_reference' => '(articolo di riferimento)', |
|
| 660 | + 'texte_inc_meta_1' => 'La scrittura del file <code>@fichier@</code> ha causato un errore di sistema. L’amministratore del sito, ', |
|
| 661 | + 'texte_inc_meta_2' => 'verifichi i diritti di scrittura', |
|
| 662 | + 'texte_inc_meta_3' => 'nella cartella <code>@repertoire@</code>.', |
|
| 663 | + 'texte_statut_en_cours_redaction' => 'in corso di redazione', |
|
| 664 | + 'texte_statut_poubelle' => 'nel cestino', |
|
| 665 | + 'texte_statut_propose_evaluation' => 'proposto per una valutazione', |
|
| 666 | + 'texte_statut_publie' => 'pubblicato on line', |
|
| 667 | + 'texte_statut_refuse' => 'rifiutato', |
|
| 668 | + 'titre_ajouter_mot_cle' => 'AGGIUNGI UNA PAROLA CHIAVE:', |
|
| 669 | + 'titre_cadre_raccourcis' => 'SCELTA RAPIDA:', |
|
| 670 | + 'titre_changer_couleur_interface' => 'Cambia il colore dell’interfaccia', |
|
| 671 | + 'titre_image_admin_article' => 'Puoi amministrare questo articolo', |
|
| 672 | + 'titre_image_administrateur' => 'Amministratore', |
|
| 673 | + 'titre_image_aide' => 'Aiuto su questo elemento', |
|
| 674 | + 'titre_image_auteur_supprime' => 'Autore eliminato', |
|
| 675 | + 'titre_image_redacteur' => 'Redattore senza accesso', |
|
| 676 | + 'titre_image_redacteur_02' => 'Redattore', |
|
| 677 | + 'titre_image_selecteur' => 'Mostra la lista', |
|
| 678 | + 'titre_image_visiteur' => 'Visitatore', |
|
| 679 | + 'titre_joindre_document' => 'ALLEGA UN DOCUMENTO', |
|
| 680 | + 'titre_mots_cles' => 'PAROLE CHIAVE', |
|
| 681 | + 'titre_probleme_technique' => 'Attenzione: un problema tecnico (server SQL) impedisce l’accesso a questa parte del sito. Grazie per la comprensione.', |
|
| 682 | + 'titre_publier_document' => 'ALLEGA UN DOCUMENTO A QUESTA RUBRICA', |
|
| 683 | + 'titre_signatures_attente' => 'Firme in corso di convalida', |
|
| 684 | + 'titre_signatures_confirmees' => 'Firme confermate', |
|
| 685 | + 'titre_statistiques' => 'Statistiche del sito', |
|
| 686 | + 'titre_titre_document' => 'Titolo del documento:', |
|
| 687 | + 'todo' => 'prossimo', |
|
| 688 | + 'trad_definir_reference' => 'Scegliere "@titre@" come riferimento per le traduzioni', |
|
| 689 | + 'trad_reference' => '(articolo di riferimento)', |
|
| 690 | 690 | |
| 691 | - // U |
|
| 692 | - 'upload_limit' => 'Questo file è trppo grande per il server; la dimensione massima consentita in <i>upload</i> è di @max@.', |
|
| 691 | + // U |
|
| 692 | + 'upload_limit' => 'Questo file è trppo grande per il server; la dimensione massima consentita in <i>upload</i> è di @max@.', |
|
| 693 | 693 | |
| 694 | - // Z |
|
| 695 | - 'zbug_balise_b_aval' => ': ciclo B deve precedere ciclo BOUCLE', |
|
| 696 | - 'zbug_balise_inexistante' => 'errore @from@: il tag #@balise@ non esiste ', |
|
| 697 | - 'zbug_balise_sans_argument' => 'Argomento mancante nel tag @balise@', |
|
| 698 | - 'zbug_boucle' => 'ciclo', |
|
| 699 | - 'zbug_boucle_recursive_undef' => 'ciclo ricorsivo non definito', |
|
| 700 | - 'zbug_calcul' => 'calcolo', |
|
| 701 | - 'zbug_champ_hors_boucle' => 'Campo @champ@ fuori dal ciclo', |
|
| 702 | - 'zbug_champ_hors_critere' => 'Il campo @champ@ non rispetta il criterio @critere@', |
|
| 703 | - 'zbug_champ_hors_motif' => 'Campo @champ@ fuori da un contesto @motif@', |
|
| 704 | - 'zbug_code' => 'codice', |
|
| 705 | - 'zbug_critere_inconnu' => 'criterio sconosciuto @critere@', |
|
| 706 | - 'zbug_critere_sur_table_sans_cle_primaire' => '{@critere@} su una tabella senza una chiave primaria atomica', |
|
| 707 | - 'zbug_distant_interdit' => 'esterno non accessibile', |
|
| 708 | - 'zbug_doublon_table_sans_cle_primaire' => 'doppioni su una tabella senza chiave primaria atomica', |
|
| 709 | - 'zbug_doublon_table_sans_index' => 'doppioni su una tabella senza indice', |
|
| 710 | - 'zbug_erreur_boucle_double' => 'BOUCLE@id@: doppia definizione', |
|
| 711 | - 'zbug_erreur_boucle_fermant' => 'BOUCLE@id@: chiusura tag mancante', |
|
| 712 | - 'zbug_erreur_boucle_syntaxe' => 'Sintassi del ciclo errata', |
|
| 713 | - 'zbug_erreur_compilation' => 'Errore di compilazione', |
|
| 714 | - 'zbug_erreur_execution_page' => 'errore di esecuzione della pagina', |
|
| 715 | - 'zbug_erreur_filtre' => 'Errore : filtro <b>« @filtre@ »</b> non esistente', |
|
| 716 | - 'zbug_erreur_filtre_nbarg_min' => 'Filtro@filtre@: argomento(i) @nb@ mancante(i)', |
|
| 717 | - 'zbug_erreur_meme_parent' => 'il criterio {meme_parent} si applica unicamente ai cicli (FORUMS) o (RUBRIQUES)', |
|
| 718 | - 'zbug_erreur_squelette' => 'Errore/i nel modello di layout', |
|
| 719 | - 'zbug_hors_compilation' => 'Fuori Compilazione', |
|
| 720 | - 'zbug_info_erreur_squelette' => 'Errore sul sito', |
|
| 721 | - 'zbug_inversion_ordre_inexistant' => 'inversione di un ordine non esistente', |
|
| 722 | - 'zbug_pagination_sans_critere' => '#PAGINATION senza criterio {pagination} oppure usato in un ciclo ricorsivo', |
|
| 723 | - 'zbug_parametres_inclus_incorrects' => 'Parametri di inclusione non corretti', |
|
| 724 | - 'zbug_profile' => 'Tempo di elaborazione: @time@', |
|
| 725 | - 'zbug_resultat' => 'risultato', |
|
| 726 | - 'zbug_serveur_indefini' => 'server SQL non definito', |
|
| 727 | - 'zbug_statistiques' => 'Statistiche delle query SQL in ordine di durata', |
|
| 728 | - 'zbug_table_inconnue' => 'Tabella SQL « @table@ » sconosciuta', |
|
| 729 | - 'zxml_connus_attributs' => 'attributi conosciuti', |
|
| 730 | - 'zxml_de' => 'di', |
|
| 731 | - 'zxml_inconnu_attribut' => 'attributo sconosciuto', |
|
| 732 | - 'zxml_inconnu_balise' => 'segnaposto sconosciuto', |
|
| 733 | - 'zxml_inconnu_entite' => 'entità sconosciuta', |
|
| 734 | - 'zxml_inconnu_id' => 'ID sconosciuto', |
|
| 735 | - 'zxml_mais_de' => 'ma di', |
|
| 736 | - 'zxml_non_conforme' => 'non è conforme al motivo', |
|
| 737 | - 'zxml_non_fils' => 'non è un figlio di', |
|
| 738 | - 'zxml_nonvide_balise' => 'segnaposto non vuoto', |
|
| 739 | - 'zxml_obligatoire_attribut' => 'attributo obbligatorio ma assente in', |
|
| 740 | - 'zxml_succession_fils_incorrecte' => 'successione dei figli non corretta', |
|
| 741 | - 'zxml_survoler' => 'passarci sopra col mouse per vedere i corretti', |
|
| 742 | - 'zxml_valeur_attribut' => 'valore dell’attributo', |
|
| 743 | - 'zxml_vide_balise' => 'tag vuoto', |
|
| 744 | - 'zxml_vu' => 'visto in precedenza' |
|
| 694 | + // Z |
|
| 695 | + 'zbug_balise_b_aval' => ': ciclo B deve precedere ciclo BOUCLE', |
|
| 696 | + 'zbug_balise_inexistante' => 'errore @from@: il tag #@balise@ non esiste ', |
|
| 697 | + 'zbug_balise_sans_argument' => 'Argomento mancante nel tag @balise@', |
|
| 698 | + 'zbug_boucle' => 'ciclo', |
|
| 699 | + 'zbug_boucle_recursive_undef' => 'ciclo ricorsivo non definito', |
|
| 700 | + 'zbug_calcul' => 'calcolo', |
|
| 701 | + 'zbug_champ_hors_boucle' => 'Campo @champ@ fuori dal ciclo', |
|
| 702 | + 'zbug_champ_hors_critere' => 'Il campo @champ@ non rispetta il criterio @critere@', |
|
| 703 | + 'zbug_champ_hors_motif' => 'Campo @champ@ fuori da un contesto @motif@', |
|
| 704 | + 'zbug_code' => 'codice', |
|
| 705 | + 'zbug_critere_inconnu' => 'criterio sconosciuto @critere@', |
|
| 706 | + 'zbug_critere_sur_table_sans_cle_primaire' => '{@critere@} su una tabella senza una chiave primaria atomica', |
|
| 707 | + 'zbug_distant_interdit' => 'esterno non accessibile', |
|
| 708 | + 'zbug_doublon_table_sans_cle_primaire' => 'doppioni su una tabella senza chiave primaria atomica', |
|
| 709 | + 'zbug_doublon_table_sans_index' => 'doppioni su una tabella senza indice', |
|
| 710 | + 'zbug_erreur_boucle_double' => 'BOUCLE@id@: doppia definizione', |
|
| 711 | + 'zbug_erreur_boucle_fermant' => 'BOUCLE@id@: chiusura tag mancante', |
|
| 712 | + 'zbug_erreur_boucle_syntaxe' => 'Sintassi del ciclo errata', |
|
| 713 | + 'zbug_erreur_compilation' => 'Errore di compilazione', |
|
| 714 | + 'zbug_erreur_execution_page' => 'errore di esecuzione della pagina', |
|
| 715 | + 'zbug_erreur_filtre' => 'Errore : filtro <b>« @filtre@ »</b> non esistente', |
|
| 716 | + 'zbug_erreur_filtre_nbarg_min' => 'Filtro@filtre@: argomento(i) @nb@ mancante(i)', |
|
| 717 | + 'zbug_erreur_meme_parent' => 'il criterio {meme_parent} si applica unicamente ai cicli (FORUMS) o (RUBRIQUES)', |
|
| 718 | + 'zbug_erreur_squelette' => 'Errore/i nel modello di layout', |
|
| 719 | + 'zbug_hors_compilation' => 'Fuori Compilazione', |
|
| 720 | + 'zbug_info_erreur_squelette' => 'Errore sul sito', |
|
| 721 | + 'zbug_inversion_ordre_inexistant' => 'inversione di un ordine non esistente', |
|
| 722 | + 'zbug_pagination_sans_critere' => '#PAGINATION senza criterio {pagination} oppure usato in un ciclo ricorsivo', |
|
| 723 | + 'zbug_parametres_inclus_incorrects' => 'Parametri di inclusione non corretti', |
|
| 724 | + 'zbug_profile' => 'Tempo di elaborazione: @time@', |
|
| 725 | + 'zbug_resultat' => 'risultato', |
|
| 726 | + 'zbug_serveur_indefini' => 'server SQL non definito', |
|
| 727 | + 'zbug_statistiques' => 'Statistiche delle query SQL in ordine di durata', |
|
| 728 | + 'zbug_table_inconnue' => 'Tabella SQL « @table@ » sconosciuta', |
|
| 729 | + 'zxml_connus_attributs' => 'attributi conosciuti', |
|
| 730 | + 'zxml_de' => 'di', |
|
| 731 | + 'zxml_inconnu_attribut' => 'attributo sconosciuto', |
|
| 732 | + 'zxml_inconnu_balise' => 'segnaposto sconosciuto', |
|
| 733 | + 'zxml_inconnu_entite' => 'entità sconosciuta', |
|
| 734 | + 'zxml_inconnu_id' => 'ID sconosciuto', |
|
| 735 | + 'zxml_mais_de' => 'ma di', |
|
| 736 | + 'zxml_non_conforme' => 'non è conforme al motivo', |
|
| 737 | + 'zxml_non_fils' => 'non è un figlio di', |
|
| 738 | + 'zxml_nonvide_balise' => 'segnaposto non vuoto', |
|
| 739 | + 'zxml_obligatoire_attribut' => 'attributo obbligatorio ma assente in', |
|
| 740 | + 'zxml_succession_fils_incorrecte' => 'successione dei figli non corretta', |
|
| 741 | + 'zxml_survoler' => 'passarci sopra col mouse per vedere i corretti', |
|
| 742 | + 'zxml_valeur_attribut' => 'valore dell’attributo', |
|
| 743 | + 'zxml_vide_balise' => 'tag vuoto', |
|
| 744 | + 'zxml_vu' => 'visto in precedenza' |
|
| 745 | 745 | ); |
@@ -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 | include_spip('base/abstract_sql'); |
| 23 | 23 | |
@@ -59,56 +59,56 @@ discard block |
||
| 59 | 59 | * Retour des traitements. |
| 60 | 60 | **/ |
| 61 | 61 | function formulaires_editer_objet_traiter( |
| 62 | - $type, |
|
| 63 | - $id = 'new', |
|
| 64 | - $id_parent = 0, |
|
| 65 | - $lier_trad = 0, |
|
| 66 | - $retour = '', |
|
| 67 | - $config_fonc = 'articles_edit_config', |
|
| 68 | - $row = [], |
|
| 69 | - $hidden = '' |
|
| 62 | + $type, |
|
| 63 | + $id = 'new', |
|
| 64 | + $id_parent = 0, |
|
| 65 | + $lier_trad = 0, |
|
| 66 | + $retour = '', |
|
| 67 | + $config_fonc = 'articles_edit_config', |
|
| 68 | + $row = [], |
|
| 69 | + $hidden = '' |
|
| 70 | 70 | ) { |
| 71 | 71 | |
| 72 | - $res = []; |
|
| 73 | - // eviter la redirection forcee par l'action... |
|
| 74 | - set_request('redirect'); |
|
| 75 | - if ($action_editer = charger_fonction("editer_$type", 'action', true)) { |
|
| 76 | - [$id, $err] = $action_editer($id); |
|
| 77 | - } else { |
|
| 78 | - $action_editer = charger_fonction('editer_objet', 'action'); |
|
| 79 | - [$id, $err] = $action_editer($id, $type); |
|
| 80 | - } |
|
| 81 | - $id_table_objet = id_table_objet($type); |
|
| 82 | - $res[$id_table_objet] = $id; |
|
| 83 | - if ($err or !$id) { |
|
| 84 | - $res['message_erreur'] = ($err ?: _T('erreur')); |
|
| 85 | - } else { |
|
| 86 | - // Un lien de trad a prendre en compte |
|
| 87 | - if ($lier_trad) { |
|
| 88 | - // referencer la traduction |
|
| 89 | - $referencer_traduction = charger_fonction('referencer_traduction', 'action'); |
|
| 90 | - $referencer_traduction($type, $id, $lier_trad); |
|
| 91 | - // actions de recopie de champs / liens sur le nouvel objet créé |
|
| 92 | - $completer_traduction = charger_fonction('completer_traduction', 'inc'); |
|
| 93 | - $err = $completer_traduction($type, $id, $lier_trad); |
|
| 94 | - if ($err) { |
|
| 95 | - $res['message_erreur'] = $err; |
|
| 96 | - return $res; |
|
| 97 | - } |
|
| 98 | - } |
|
| 99 | - |
|
| 100 | - $res['message_ok'] = _T('info_modification_enregistree'); |
|
| 101 | - if ($retour) { |
|
| 102 | - if (strncmp($retour, 'javascript:', 11) == 0) { |
|
| 103 | - $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>'; |
|
| 104 | - $res['editable'] = true; |
|
| 105 | - } else { |
|
| 106 | - $res['redirect'] = parametre_url($retour, $id_table_objet, $id); |
|
| 107 | - } |
|
| 108 | - } |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - return $res; |
|
| 72 | + $res = []; |
|
| 73 | + // eviter la redirection forcee par l'action... |
|
| 74 | + set_request('redirect'); |
|
| 75 | + if ($action_editer = charger_fonction("editer_$type", 'action', true)) { |
|
| 76 | + [$id, $err] = $action_editer($id); |
|
| 77 | + } else { |
|
| 78 | + $action_editer = charger_fonction('editer_objet', 'action'); |
|
| 79 | + [$id, $err] = $action_editer($id, $type); |
|
| 80 | + } |
|
| 81 | + $id_table_objet = id_table_objet($type); |
|
| 82 | + $res[$id_table_objet] = $id; |
|
| 83 | + if ($err or !$id) { |
|
| 84 | + $res['message_erreur'] = ($err ?: _T('erreur')); |
|
| 85 | + } else { |
|
| 86 | + // Un lien de trad a prendre en compte |
|
| 87 | + if ($lier_trad) { |
|
| 88 | + // referencer la traduction |
|
| 89 | + $referencer_traduction = charger_fonction('referencer_traduction', 'action'); |
|
| 90 | + $referencer_traduction($type, $id, $lier_trad); |
|
| 91 | + // actions de recopie de champs / liens sur le nouvel objet créé |
|
| 92 | + $completer_traduction = charger_fonction('completer_traduction', 'inc'); |
|
| 93 | + $err = $completer_traduction($type, $id, $lier_trad); |
|
| 94 | + if ($err) { |
|
| 95 | + $res['message_erreur'] = $err; |
|
| 96 | + return $res; |
|
| 97 | + } |
|
| 98 | + } |
|
| 99 | + |
|
| 100 | + $res['message_ok'] = _T('info_modification_enregistree'); |
|
| 101 | + if ($retour) { |
|
| 102 | + if (strncmp($retour, 'javascript:', 11) == 0) { |
|
| 103 | + $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>'; |
|
| 104 | + $res['editable'] = true; |
|
| 105 | + } else { |
|
| 106 | + $res['redirect'] = parametre_url($retour, $id_table_objet, $id); |
|
| 107 | + } |
|
| 108 | + } |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + return $res; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -132,29 +132,29 @@ discard block |
||
| 132 | 132 | * Tableau des erreurs |
| 133 | 133 | **/ |
| 134 | 134 | function formulaires_editer_objet_verifier($type, $id = 'new', $oblis = []) { |
| 135 | - $erreurs = []; |
|
| 136 | - if (intval($id)) { |
|
| 137 | - $conflits = controler_contenu($type, $id); |
|
| 138 | - if ($conflits and is_countable($conflits) ? count($conflits) : 0) { |
|
| 139 | - foreach ($conflits as $champ => $conflit) { |
|
| 140 | - if (!isset($erreurs[$champ])) { |
|
| 141 | - $erreurs[$champ] = ''; |
|
| 142 | - } |
|
| 143 | - $erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>'; |
|
| 144 | - } |
|
| 145 | - } |
|
| 146 | - } |
|
| 147 | - foreach ($oblis as $obli) { |
|
| 148 | - $value = _request($obli); |
|
| 149 | - if (is_null($value) or !(is_array($value) ? count($value) : strlen($value))) { |
|
| 150 | - if (!isset($erreurs[$obli])) { |
|
| 151 | - $erreurs[$obli] = ''; |
|
| 152 | - } |
|
| 153 | - $erreurs[$obli] .= _T('info_obligatoire'); |
|
| 154 | - } |
|
| 155 | - } |
|
| 156 | - |
|
| 157 | - return $erreurs; |
|
| 135 | + $erreurs = []; |
|
| 136 | + if (intval($id)) { |
|
| 137 | + $conflits = controler_contenu($type, $id); |
|
| 138 | + if ($conflits and is_countable($conflits) ? count($conflits) : 0) { |
|
| 139 | + foreach ($conflits as $champ => $conflit) { |
|
| 140 | + if (!isset($erreurs[$champ])) { |
|
| 141 | + $erreurs[$champ] = ''; |
|
| 142 | + } |
|
| 143 | + $erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>'; |
|
| 144 | + } |
|
| 145 | + } |
|
| 146 | + } |
|
| 147 | + foreach ($oblis as $obli) { |
|
| 148 | + $value = _request($obli); |
|
| 149 | + if (is_null($value) or !(is_array($value) ? count($value) : strlen($value))) { |
|
| 150 | + if (!isset($erreurs[$obli])) { |
|
| 151 | + $erreurs[$obli] = ''; |
|
| 152 | + } |
|
| 153 | + $erreurs[$obli] .= _T('info_obligatoire'); |
|
| 154 | + } |
|
| 155 | + } |
|
| 156 | + |
|
| 157 | + return $erreurs; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /** |
@@ -199,154 +199,154 @@ discard block |
||
| 199 | 199 | * Environnement du formulaire. |
| 200 | 200 | **/ |
| 201 | 201 | function formulaires_editer_objet_charger( |
| 202 | - $type, |
|
| 203 | - $id = 'new', |
|
| 204 | - $id_parent = 0, |
|
| 205 | - $lier_trad = 0, |
|
| 206 | - $retour = '', |
|
| 207 | - $config_fonc = 'articles_edit_config', |
|
| 208 | - $row = [], |
|
| 209 | - $hidden = '' |
|
| 202 | + $type, |
|
| 203 | + $id = 'new', |
|
| 204 | + $id_parent = 0, |
|
| 205 | + $lier_trad = 0, |
|
| 206 | + $retour = '', |
|
| 207 | + $config_fonc = 'articles_edit_config', |
|
| 208 | + $row = [], |
|
| 209 | + $hidden = '' |
|
| 210 | 210 | ) { |
| 211 | 211 | |
| 212 | - $table_objet = table_objet($type); |
|
| 213 | - $table_objet_sql = table_objet_sql($type); |
|
| 214 | - $id_table_objet = id_table_objet($type); |
|
| 215 | - if (!is_array($row)) { |
|
| 216 | - $row = []; |
|
| 217 | - } |
|
| 218 | - |
|
| 219 | - // on accepte pas une fonction de config inconnue si elle vient d'un modele |
|
| 220 | - if ( |
|
| 221 | - $config_fonc |
|
| 222 | - and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config']) |
|
| 223 | - and $config_fonc !== $table_objet . '_edit_config' |
|
| 224 | - ) { |
|
| 225 | - if ( |
|
| 226 | - $args = test_formulaire_inclus_par_modele() |
|
| 227 | - and in_array($config_fonc, $args) |
|
| 228 | - ) { |
|
| 229 | - $config_fonc = ''; |
|
| 230 | - } |
|
| 231 | - } |
|
| 232 | - |
|
| 233 | - $new = !is_numeric($id); |
|
| 234 | - $lang_default = ''; |
|
| 235 | - // Appel direct dans un squelette |
|
| 236 | - if (!$row) { |
|
| 237 | - if (!$new or $lier_trad) { |
|
| 238 | - if ($select = charger_fonction('precharger_' . $type, 'inc', true)) { |
|
| 239 | - $row = $select($id, $id_parent, $lier_trad); |
|
| 240 | - // si on a une fonction precharger, elle pu faire un reglage de langue |
|
| 241 | - $lang_default = (!empty($row['lang']) ? $row['lang'] : null); |
|
| 242 | - } else { |
|
| 243 | - $row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id)); |
|
| 244 | - } |
|
| 245 | - if (!$new) { |
|
| 246 | - $md5 = controles_md5($row ?: []); |
|
| 247 | - } |
|
| 248 | - } |
|
| 249 | - if (!$row) { |
|
| 250 | - $row = []; |
|
| 251 | - $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 252 | - if ($desc = $trouver_table($table_objet)) { |
|
| 253 | - foreach ($desc['field'] as $k => $v) { |
|
| 254 | - $row[$k] = ''; |
|
| 255 | - } |
|
| 256 | - } |
|
| 257 | - } |
|
| 258 | - } |
|
| 259 | - |
|
| 260 | - // Gaffe: sans ceci, on ecrase systematiquement l'article d'origine |
|
| 261 | - // (et donc: pas de lien de traduction) |
|
| 262 | - $id = ($new or $lier_trad) |
|
| 263 | - ? 'oui' |
|
| 264 | - : $row[$id_table_objet]; |
|
| 265 | - $row[$id_table_objet] = $id; |
|
| 266 | - |
|
| 267 | - $contexte = $row; |
|
| 268 | - if (is_numeric($id_parent) && strlen($id_parent) && (!isset($contexte['id_parent']) or $new)) { |
|
| 269 | - if (!isset($contexte['id_parent'])) { |
|
| 270 | - unset($contexte['id_rubrique']); |
|
| 271 | - } |
|
| 272 | - $contexte['id_parent'] = $id_parent; |
|
| 273 | - } elseif (!isset($contexte['id_parent'])) { |
|
| 274 | - // id_rubrique dans id_parent si possible |
|
| 275 | - if (isset($contexte['id_rubrique'])) { |
|
| 276 | - $contexte['id_parent'] = $contexte['id_rubrique']; |
|
| 277 | - unset($contexte['id_rubrique']); |
|
| 278 | - } else { |
|
| 279 | - $contexte['id_parent'] = ''; |
|
| 280 | - } |
|
| 281 | - if ( |
|
| 282 | - !$contexte['id_parent'] |
|
| 283 | - and $preselectionner_parent_nouvel_objet = charger_fonction('preselectionner_parent_nouvel_objet', 'inc', true) |
|
| 284 | - ) { |
|
| 285 | - $contexte['id_parent'] = $preselectionner_parent_nouvel_objet($type, $row); |
|
| 286 | - } |
|
| 287 | - } |
|
| 288 | - |
|
| 289 | - $config = []; |
|
| 290 | - if ($config_fonc) { |
|
| 291 | - $contexte['config'] = $config = $config_fonc($contexte); |
|
| 292 | - if (!$lang_default) { |
|
| 293 | - $lang_default = $config['langue'] ?? session_get('lang') ; |
|
| 294 | - } |
|
| 295 | - } |
|
| 296 | - $config = $config + [ |
|
| 297 | - 'lignes' => 0, |
|
| 298 | - 'langue' => '', |
|
| 299 | - ]; |
|
| 300 | - |
|
| 301 | - $att_text = " class='textarea' " |
|
| 302 | - . " rows='" |
|
| 303 | - . ($config['lignes'] + 15) |
|
| 304 | - . "' cols='40'"; |
|
| 305 | - if (isset($contexte['texte'])) { |
|
| 306 | - [$contexte['texte'], $contexte['_texte_trop_long']] = editer_texte_recolle($contexte['texte'], $att_text); |
|
| 307 | - } |
|
| 308 | - |
|
| 309 | - // on veut conserver la langue de l'interface ; |
|
| 310 | - // on passe cette donnee sous un autre nom, au cas ou le squelette |
|
| 311 | - // voudrait l'exploiter |
|
| 312 | - if (isset($contexte['lang'])) { |
|
| 313 | - $contexte['langue'] = $contexte['lang']; |
|
| 314 | - unset($contexte['lang']); |
|
| 315 | - } |
|
| 316 | - |
|
| 317 | - $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" . |
|
| 318 | - (!$lier_trad ? '' : |
|
| 319 | - ("\n<input type='hidden' name='lier_trad' value='" . |
|
| 320 | - $lier_trad . |
|
| 321 | - "' />" . |
|
| 322 | - "\n<input type='hidden' name='changer_lang' value='" . |
|
| 323 | - $lang_default . |
|
| 324 | - "' />")) |
|
| 325 | - . $hidden |
|
| 326 | - . ($md5 ?? ''); |
|
| 327 | - |
|
| 328 | - // preciser que le formulaire doit passer dans un pipeline |
|
| 329 | - $contexte['_pipeline'] = ['editer_contenu_objet', ['type' => $type, 'id' => $id]]; |
|
| 330 | - |
|
| 331 | - // preciser que le formulaire doit etre securise auteur/action |
|
| 332 | - // n'est plus utile lorsque l'action accepte l'id en argument direct |
|
| 333 | - // on le garde pour compat |
|
| 334 | - $contexte['_action'] = ["editer_$type", $id]; |
|
| 335 | - |
|
| 336 | - // et in fine placer l'autorisation |
|
| 337 | - include_spip('inc/autoriser'); |
|
| 338 | - if (intval($id)) { |
|
| 339 | - if (!autoriser('modifier', $type, intval($id))) { |
|
| 340 | - $contexte['editable'] = ''; |
|
| 341 | - } |
|
| 342 | - } |
|
| 343 | - else { |
|
| 344 | - if (!autoriser('creer', $type, 0, null, ['id_parent' => $id_parent])) { |
|
| 345 | - $contexte['editable'] = ''; |
|
| 346 | - } |
|
| 347 | - } |
|
| 348 | - |
|
| 349 | - return $contexte; |
|
| 212 | + $table_objet = table_objet($type); |
|
| 213 | + $table_objet_sql = table_objet_sql($type); |
|
| 214 | + $id_table_objet = id_table_objet($type); |
|
| 215 | + if (!is_array($row)) { |
|
| 216 | + $row = []; |
|
| 217 | + } |
|
| 218 | + |
|
| 219 | + // on accepte pas une fonction de config inconnue si elle vient d'un modele |
|
| 220 | + if ( |
|
| 221 | + $config_fonc |
|
| 222 | + and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config']) |
|
| 223 | + and $config_fonc !== $table_objet . '_edit_config' |
|
| 224 | + ) { |
|
| 225 | + if ( |
|
| 226 | + $args = test_formulaire_inclus_par_modele() |
|
| 227 | + and in_array($config_fonc, $args) |
|
| 228 | + ) { |
|
| 229 | + $config_fonc = ''; |
|
| 230 | + } |
|
| 231 | + } |
|
| 232 | + |
|
| 233 | + $new = !is_numeric($id); |
|
| 234 | + $lang_default = ''; |
|
| 235 | + // Appel direct dans un squelette |
|
| 236 | + if (!$row) { |
|
| 237 | + if (!$new or $lier_trad) { |
|
| 238 | + if ($select = charger_fonction('precharger_' . $type, 'inc', true)) { |
|
| 239 | + $row = $select($id, $id_parent, $lier_trad); |
|
| 240 | + // si on a une fonction precharger, elle pu faire un reglage de langue |
|
| 241 | + $lang_default = (!empty($row['lang']) ? $row['lang'] : null); |
|
| 242 | + } else { |
|
| 243 | + $row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id)); |
|
| 244 | + } |
|
| 245 | + if (!$new) { |
|
| 246 | + $md5 = controles_md5($row ?: []); |
|
| 247 | + } |
|
| 248 | + } |
|
| 249 | + if (!$row) { |
|
| 250 | + $row = []; |
|
| 251 | + $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 252 | + if ($desc = $trouver_table($table_objet)) { |
|
| 253 | + foreach ($desc['field'] as $k => $v) { |
|
| 254 | + $row[$k] = ''; |
|
| 255 | + } |
|
| 256 | + } |
|
| 257 | + } |
|
| 258 | + } |
|
| 259 | + |
|
| 260 | + // Gaffe: sans ceci, on ecrase systematiquement l'article d'origine |
|
| 261 | + // (et donc: pas de lien de traduction) |
|
| 262 | + $id = ($new or $lier_trad) |
|
| 263 | + ? 'oui' |
|
| 264 | + : $row[$id_table_objet]; |
|
| 265 | + $row[$id_table_objet] = $id; |
|
| 266 | + |
|
| 267 | + $contexte = $row; |
|
| 268 | + if (is_numeric($id_parent) && strlen($id_parent) && (!isset($contexte['id_parent']) or $new)) { |
|
| 269 | + if (!isset($contexte['id_parent'])) { |
|
| 270 | + unset($contexte['id_rubrique']); |
|
| 271 | + } |
|
| 272 | + $contexte['id_parent'] = $id_parent; |
|
| 273 | + } elseif (!isset($contexte['id_parent'])) { |
|
| 274 | + // id_rubrique dans id_parent si possible |
|
| 275 | + if (isset($contexte['id_rubrique'])) { |
|
| 276 | + $contexte['id_parent'] = $contexte['id_rubrique']; |
|
| 277 | + unset($contexte['id_rubrique']); |
|
| 278 | + } else { |
|
| 279 | + $contexte['id_parent'] = ''; |
|
| 280 | + } |
|
| 281 | + if ( |
|
| 282 | + !$contexte['id_parent'] |
|
| 283 | + and $preselectionner_parent_nouvel_objet = charger_fonction('preselectionner_parent_nouvel_objet', 'inc', true) |
|
| 284 | + ) { |
|
| 285 | + $contexte['id_parent'] = $preselectionner_parent_nouvel_objet($type, $row); |
|
| 286 | + } |
|
| 287 | + } |
|
| 288 | + |
|
| 289 | + $config = []; |
|
| 290 | + if ($config_fonc) { |
|
| 291 | + $contexte['config'] = $config = $config_fonc($contexte); |
|
| 292 | + if (!$lang_default) { |
|
| 293 | + $lang_default = $config['langue'] ?? session_get('lang') ; |
|
| 294 | + } |
|
| 295 | + } |
|
| 296 | + $config = $config + [ |
|
| 297 | + 'lignes' => 0, |
|
| 298 | + 'langue' => '', |
|
| 299 | + ]; |
|
| 300 | + |
|
| 301 | + $att_text = " class='textarea' " |
|
| 302 | + . " rows='" |
|
| 303 | + . ($config['lignes'] + 15) |
|
| 304 | + . "' cols='40'"; |
|
| 305 | + if (isset($contexte['texte'])) { |
|
| 306 | + [$contexte['texte'], $contexte['_texte_trop_long']] = editer_texte_recolle($contexte['texte'], $att_text); |
|
| 307 | + } |
|
| 308 | + |
|
| 309 | + // on veut conserver la langue de l'interface ; |
|
| 310 | + // on passe cette donnee sous un autre nom, au cas ou le squelette |
|
| 311 | + // voudrait l'exploiter |
|
| 312 | + if (isset($contexte['lang'])) { |
|
| 313 | + $contexte['langue'] = $contexte['lang']; |
|
| 314 | + unset($contexte['lang']); |
|
| 315 | + } |
|
| 316 | + |
|
| 317 | + $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" . |
|
| 318 | + (!$lier_trad ? '' : |
|
| 319 | + ("\n<input type='hidden' name='lier_trad' value='" . |
|
| 320 | + $lier_trad . |
|
| 321 | + "' />" . |
|
| 322 | + "\n<input type='hidden' name='changer_lang' value='" . |
|
| 323 | + $lang_default . |
|
| 324 | + "' />")) |
|
| 325 | + . $hidden |
|
| 326 | + . ($md5 ?? ''); |
|
| 327 | + |
|
| 328 | + // preciser que le formulaire doit passer dans un pipeline |
|
| 329 | + $contexte['_pipeline'] = ['editer_contenu_objet', ['type' => $type, 'id' => $id]]; |
|
| 330 | + |
|
| 331 | + // preciser que le formulaire doit etre securise auteur/action |
|
| 332 | + // n'est plus utile lorsque l'action accepte l'id en argument direct |
|
| 333 | + // on le garde pour compat |
|
| 334 | + $contexte['_action'] = ["editer_$type", $id]; |
|
| 335 | + |
|
| 336 | + // et in fine placer l'autorisation |
|
| 337 | + include_spip('inc/autoriser'); |
|
| 338 | + if (intval($id)) { |
|
| 339 | + if (!autoriser('modifier', $type, intval($id))) { |
|
| 340 | + $contexte['editable'] = ''; |
|
| 341 | + } |
|
| 342 | + } |
|
| 343 | + else { |
|
| 344 | + if (!autoriser('creer', $type, 0, null, ['id_parent' => $id_parent])) { |
|
| 345 | + $contexte['editable'] = ''; |
|
| 346 | + } |
|
| 347 | + } |
|
| 348 | + |
|
| 349 | + return $contexte; |
|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | /** |
@@ -357,29 +357,29 @@ discard block |
||
| 357 | 357 | * @return array |
| 358 | 358 | */ |
| 359 | 359 | function coupe_trop_long($texte) { |
| 360 | - $aider = charger_fonction('aider', 'inc'); |
|
| 361 | - if (strlen($texte) > 28 * 1024) { |
|
| 362 | - $texte = str_replace("\r\n", "\n", $texte); |
|
| 363 | - $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 364 | - if ($pos > 0 and $pos < 32 * 1024) { |
|
| 365 | - $debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n"; |
|
| 366 | - $suite = substr($texte, $pos + 2); |
|
| 367 | - } else { |
|
| 368 | - $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 369 | - if (!($pos > 0 and $pos < 32 * 1024)) { |
|
| 370 | - $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 371 | - $decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere |
|
| 372 | - } else { |
|
| 373 | - $decalage = 1; |
|
| 374 | - } |
|
| 375 | - $debut = substr($texte, 0, $pos + $decalage); // Il faut conserver l'espace s'il y en a un |
|
| 376 | - $suite = substr($texte, $pos + $decalage); |
|
| 377 | - } |
|
| 378 | - |
|
| 379 | - return ([$debut, $suite]); |
|
| 380 | - } else { |
|
| 381 | - return ([$texte, '']); |
|
| 382 | - } |
|
| 360 | + $aider = charger_fonction('aider', 'inc'); |
|
| 361 | + if (strlen($texte) > 28 * 1024) { |
|
| 362 | + $texte = str_replace("\r\n", "\n", $texte); |
|
| 363 | + $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 364 | + if ($pos > 0 and $pos < 32 * 1024) { |
|
| 365 | + $debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n"; |
|
| 366 | + $suite = substr($texte, $pos + 2); |
|
| 367 | + } else { |
|
| 368 | + $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 369 | + if (!($pos > 0 and $pos < 32 * 1024)) { |
|
| 370 | + $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 371 | + $decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere |
|
| 372 | + } else { |
|
| 373 | + $decalage = 1; |
|
| 374 | + } |
|
| 375 | + $debut = substr($texte, 0, $pos + $decalage); // Il faut conserver l'espace s'il y en a un |
|
| 376 | + $suite = substr($texte, $pos + $decalage); |
|
| 377 | + } |
|
| 378 | + |
|
| 379 | + return ([$debut, $suite]); |
|
| 380 | + } else { |
|
| 381 | + return ([$texte, '']); |
|
| 382 | + } |
|
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | /** |
@@ -390,25 +390,25 @@ discard block |
||
| 390 | 390 | * @return array |
| 391 | 391 | */ |
| 392 | 392 | function editer_texte_recolle($texte, $att_text) { |
| 393 | - if ( |
|
| 394 | - (strlen($texte) < 29 * 1024) |
|
| 395 | - or (include_spip('inc/layer') and ($GLOBALS['browser_name'] != 'MSIE')) |
|
| 396 | - ) { |
|
| 397 | - return [$texte, '']; |
|
| 398 | - } |
|
| 399 | - |
|
| 400 | - include_spip('inc/barre'); |
|
| 401 | - $textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n"; |
|
| 402 | - $nombre = 0; |
|
| 403 | - |
|
| 404 | - while (strlen($texte) > 29 * 1024) { |
|
| 405 | - $nombre++; |
|
| 406 | - [$texte1, $texte] = coupe_trop_long($texte); |
|
| 407 | - $textes_supplement .= '<br />' . |
|
| 408 | - "<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n"; |
|
| 409 | - } |
|
| 410 | - |
|
| 411 | - return [$texte, $textes_supplement]; |
|
| 393 | + if ( |
|
| 394 | + (strlen($texte) < 29 * 1024) |
|
| 395 | + or (include_spip('inc/layer') and ($GLOBALS['browser_name'] != 'MSIE')) |
|
| 396 | + ) { |
|
| 397 | + return [$texte, '']; |
|
| 398 | + } |
|
| 399 | + |
|
| 400 | + include_spip('inc/barre'); |
|
| 401 | + $textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n"; |
|
| 402 | + $nombre = 0; |
|
| 403 | + |
|
| 404 | + while (strlen($texte) > 29 * 1024) { |
|
| 405 | + $nombre++; |
|
| 406 | + [$texte1, $texte] = coupe_trop_long($texte); |
|
| 407 | + $textes_supplement .= '<br />' . |
|
| 408 | + "<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n"; |
|
| 409 | + } |
|
| 410 | + |
|
| 411 | + return [$texte, $textes_supplement]; |
|
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | /** |
@@ -419,17 +419,17 @@ discard block |
||
| 419 | 419 | * @param int $longueur |
| 420 | 420 | */ |
| 421 | 421 | function titre_automatique($champ_titre, $champs_contenu, $longueur = null) { |
| 422 | - if (!_request($champ_titre)) { |
|
| 423 | - $titrer_contenu = charger_fonction('titrer_contenu', 'inc'); |
|
| 424 | - if (!is_null($longueur)) { |
|
| 425 | - $t = $titrer_contenu($champs_contenu, null, $longueur); |
|
| 426 | - } else { |
|
| 427 | - $t = $titrer_contenu($champs_contenu); |
|
| 428 | - } |
|
| 429 | - if ($t) { |
|
| 430 | - set_request($champ_titre, $t); |
|
| 431 | - } |
|
| 432 | - } |
|
| 422 | + if (!_request($champ_titre)) { |
|
| 423 | + $titrer_contenu = charger_fonction('titrer_contenu', 'inc'); |
|
| 424 | + if (!is_null($longueur)) { |
|
| 425 | + $t = $titrer_contenu($champs_contenu, null, $longueur); |
|
| 426 | + } else { |
|
| 427 | + $t = $titrer_contenu($champs_contenu); |
|
| 428 | + } |
|
| 429 | + if ($t) { |
|
| 430 | + set_request($champ_titre, $t); |
|
| 431 | + } |
|
| 432 | + } |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | /** |
@@ -449,20 +449,20 @@ discard block |
||
| 449 | 449 | * @return string |
| 450 | 450 | */ |
| 451 | 451 | function inc_titrer_contenu_dist($champs_contenu, $c = null, $longueur = 50) { |
| 452 | - // trouver un champ texte non vide |
|
| 453 | - $t = ''; |
|
| 454 | - foreach ($champs_contenu as $champ) { |
|
| 455 | - if ($t = _request($champ, $c)) { |
|
| 456 | - break; |
|
| 457 | - } |
|
| 458 | - } |
|
| 459 | - |
|
| 460 | - if ($t) { |
|
| 461 | - include_spip('inc/texte_mini'); |
|
| 462 | - $t = couper($t, $longueur, '...'); |
|
| 463 | - } |
|
| 464 | - |
|
| 465 | - return $t; |
|
| 452 | + // trouver un champ texte non vide |
|
| 453 | + $t = ''; |
|
| 454 | + foreach ($champs_contenu as $champ) { |
|
| 455 | + if ($t = _request($champ, $c)) { |
|
| 456 | + break; |
|
| 457 | + } |
|
| 458 | + } |
|
| 459 | + |
|
| 460 | + if ($t) { |
|
| 461 | + include_spip('inc/texte_mini'); |
|
| 462 | + $t = couper($t, $longueur, '...'); |
|
| 463 | + } |
|
| 464 | + |
|
| 465 | + return $t; |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | /** |
@@ -484,26 +484,26 @@ discard block |
||
| 484 | 484 | * - array sinon couples ('$prefixe$colonne => md5) |
| 485 | 485 | **/ |
| 486 | 486 | function controles_md5(array $data, string $prefixe = 'ctr_', string $format = 'html') { |
| 487 | - $ctr = []; |
|
| 488 | - foreach ($data as $key => $val) { |
|
| 489 | - $m = md5($val ?? ''); |
|
| 490 | - $k = $prefixe . $key; |
|
| 491 | - |
|
| 492 | - switch ($format) { |
|
| 493 | - case 'html': |
|
| 494 | - $ctr[$k] = "<input type='hidden' value='$m' name='$k' />"; |
|
| 495 | - break; |
|
| 496 | - default: |
|
| 497 | - $ctr[$k] = $m; |
|
| 498 | - break; |
|
| 499 | - } |
|
| 500 | - } |
|
| 501 | - |
|
| 502 | - if ($format === 'html') { |
|
| 503 | - return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n"; |
|
| 504 | - } else { |
|
| 505 | - return $ctr; |
|
| 506 | - } |
|
| 487 | + $ctr = []; |
|
| 488 | + foreach ($data as $key => $val) { |
|
| 489 | + $m = md5($val ?? ''); |
|
| 490 | + $k = $prefixe . $key; |
|
| 491 | + |
|
| 492 | + switch ($format) { |
|
| 493 | + case 'html': |
|
| 494 | + $ctr[$k] = "<input type='hidden' value='$m' name='$k' />"; |
|
| 495 | + break; |
|
| 496 | + default: |
|
| 497 | + $ctr[$k] = $m; |
|
| 498 | + break; |
|
| 499 | + } |
|
| 500 | + } |
|
| 501 | + |
|
| 502 | + if ($format === 'html') { |
|
| 503 | + return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n"; |
|
| 504 | + } else { |
|
| 505 | + return $ctr; |
|
| 506 | + } |
|
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | /** |
@@ -542,80 +542,80 @@ discard block |
||
| 542 | 542 | * - post : le contenu posté |
| 543 | 543 | **/ |
| 544 | 544 | function controler_contenu($type, $id, $options = [], $c = false, $serveur = '') { |
| 545 | - include_spip('inc/filtres'); |
|
| 546 | - |
|
| 547 | - $table_objet = table_objet($type); |
|
| 548 | - $spip_table_objet = table_objet_sql($type); |
|
| 549 | - $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 550 | - $desc = $trouver_table($table_objet, $serveur); |
|
| 551 | - |
|
| 552 | - // Appels incomplets (sans $c) |
|
| 553 | - if (!is_array($c)) { |
|
| 554 | - $c = []; |
|
| 555 | - foreach ($desc['field'] as $champ => $ignore) { |
|
| 556 | - if (_request($champ)) { |
|
| 557 | - $c[$champ] = _request($champ); |
|
| 558 | - } |
|
| 559 | - } |
|
| 560 | - } |
|
| 561 | - |
|
| 562 | - // Securite : certaines variables ne sont jamais acceptees ici |
|
| 563 | - // car elles ne relevent pas de autoriser(article, modifier) ; |
|
| 564 | - // il faut passer par instituer_XX() |
|
| 565 | - // TODO: faut-il passer ces variables interdites |
|
| 566 | - // dans un fichier de description separe ? |
|
| 567 | - unset($c['statut']); |
|
| 568 | - unset($c['id_parent']); |
|
| 569 | - unset($c['id_rubrique']); |
|
| 570 | - unset($c['id_secteur']); |
|
| 571 | - |
|
| 572 | - // Gerer les champs non vides |
|
| 573 | - if (isset($options['nonvide']) and is_array($options['nonvide'])) { |
|
| 574 | - foreach ($options['nonvide'] as $champ => $sinon) { |
|
| 575 | - if ($c[$champ] === '') { |
|
| 576 | - $c[$champ] = $sinon; |
|
| 577 | - } |
|
| 578 | - } |
|
| 579 | - } |
|
| 580 | - |
|
| 581 | - // N'accepter que les champs qui existent |
|
| 582 | - // [TODO] ici aussi on peut valider les contenus en fonction du type |
|
| 583 | - $champs = []; |
|
| 584 | - foreach ($desc['field'] as $champ => $ignore) { |
|
| 585 | - if (isset($c[$champ])) { |
|
| 586 | - $champs[$champ] = $c[$champ]; |
|
| 587 | - } |
|
| 588 | - } |
|
| 589 | - |
|
| 590 | - // Nettoyer les valeurs |
|
| 591 | - $champs = array_map('corriger_caracteres', $champs); |
|
| 592 | - |
|
| 593 | - // Envoyer aux plugins |
|
| 594 | - $champs = pipeline( |
|
| 595 | - 'pre_edition', |
|
| 596 | - [ |
|
| 597 | - 'args' => [ |
|
| 598 | - 'table' => $spip_table_objet, // compatibilite |
|
| 599 | - 'table_objet' => $table_objet, |
|
| 600 | - 'spip_table_objet' => $spip_table_objet, |
|
| 601 | - 'type' => $type, |
|
| 602 | - 'id_objet' => $id, |
|
| 603 | - 'champs' => $options['champs'] ?? [], // [doc] c'est quoi ? |
|
| 604 | - 'action' => 'controler', |
|
| 605 | - 'serveur' => $serveur, |
|
| 606 | - ], |
|
| 607 | - 'data' => $champs |
|
| 608 | - ] |
|
| 609 | - ); |
|
| 610 | - |
|
| 611 | - if (!$champs) { |
|
| 612 | - return false; |
|
| 613 | - } |
|
| 614 | - |
|
| 615 | - // Verifier si les mises a jour sont pertinentes, datees, en conflit etc |
|
| 616 | - $conflits = controler_md5($champs, $_POST, $type, $id, $serveur, $options['prefix'] ?? 'ctr_'); |
|
| 617 | - |
|
| 618 | - return $conflits; |
|
| 545 | + include_spip('inc/filtres'); |
|
| 546 | + |
|
| 547 | + $table_objet = table_objet($type); |
|
| 548 | + $spip_table_objet = table_objet_sql($type); |
|
| 549 | + $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 550 | + $desc = $trouver_table($table_objet, $serveur); |
|
| 551 | + |
|
| 552 | + // Appels incomplets (sans $c) |
|
| 553 | + if (!is_array($c)) { |
|
| 554 | + $c = []; |
|
| 555 | + foreach ($desc['field'] as $champ => $ignore) { |
|
| 556 | + if (_request($champ)) { |
|
| 557 | + $c[$champ] = _request($champ); |
|
| 558 | + } |
|
| 559 | + } |
|
| 560 | + } |
|
| 561 | + |
|
| 562 | + // Securite : certaines variables ne sont jamais acceptees ici |
|
| 563 | + // car elles ne relevent pas de autoriser(article, modifier) ; |
|
| 564 | + // il faut passer par instituer_XX() |
|
| 565 | + // TODO: faut-il passer ces variables interdites |
|
| 566 | + // dans un fichier de description separe ? |
|
| 567 | + unset($c['statut']); |
|
| 568 | + unset($c['id_parent']); |
|
| 569 | + unset($c['id_rubrique']); |
|
| 570 | + unset($c['id_secteur']); |
|
| 571 | + |
|
| 572 | + // Gerer les champs non vides |
|
| 573 | + if (isset($options['nonvide']) and is_array($options['nonvide'])) { |
|
| 574 | + foreach ($options['nonvide'] as $champ => $sinon) { |
|
| 575 | + if ($c[$champ] === '') { |
|
| 576 | + $c[$champ] = $sinon; |
|
| 577 | + } |
|
| 578 | + } |
|
| 579 | + } |
|
| 580 | + |
|
| 581 | + // N'accepter que les champs qui existent |
|
| 582 | + // [TODO] ici aussi on peut valider les contenus en fonction du type |
|
| 583 | + $champs = []; |
|
| 584 | + foreach ($desc['field'] as $champ => $ignore) { |
|
| 585 | + if (isset($c[$champ])) { |
|
| 586 | + $champs[$champ] = $c[$champ]; |
|
| 587 | + } |
|
| 588 | + } |
|
| 589 | + |
|
| 590 | + // Nettoyer les valeurs |
|
| 591 | + $champs = array_map('corriger_caracteres', $champs); |
|
| 592 | + |
|
| 593 | + // Envoyer aux plugins |
|
| 594 | + $champs = pipeline( |
|
| 595 | + 'pre_edition', |
|
| 596 | + [ |
|
| 597 | + 'args' => [ |
|
| 598 | + 'table' => $spip_table_objet, // compatibilite |
|
| 599 | + 'table_objet' => $table_objet, |
|
| 600 | + 'spip_table_objet' => $spip_table_objet, |
|
| 601 | + 'type' => $type, |
|
| 602 | + 'id_objet' => $id, |
|
| 603 | + 'champs' => $options['champs'] ?? [], // [doc] c'est quoi ? |
|
| 604 | + 'action' => 'controler', |
|
| 605 | + 'serveur' => $serveur, |
|
| 606 | + ], |
|
| 607 | + 'data' => $champs |
|
| 608 | + ] |
|
| 609 | + ); |
|
| 610 | + |
|
| 611 | + if (!$champs) { |
|
| 612 | + return false; |
|
| 613 | + } |
|
| 614 | + |
|
| 615 | + // Verifier si les mises a jour sont pertinentes, datees, en conflit etc |
|
| 616 | + $conflits = controler_md5($champs, $_POST, $type, $id, $serveur, $options['prefix'] ?? 'ctr_'); |
|
| 617 | + |
|
| 618 | + return $conflits; |
|
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | |
@@ -645,64 +645,64 @@ discard block |
||
| 645 | 645 | * - post : le contenu posté |
| 646 | 646 | **/ |
| 647 | 647 | function controler_md5(&$champs, $ctr, $type, $id, $serveur, $prefix = 'ctr_') { |
| 648 | - $spip_table_objet = table_objet_sql($type); |
|
| 649 | - $id_table_objet = id_table_objet($type); |
|
| 650 | - |
|
| 651 | - // Controle des MD5 envoyes |
|
| 652 | - // On elimine les donnees non modifiees par le formulaire (mais |
|
| 653 | - // potentiellement modifiees entre temps par un autre utilisateur) |
|
| 654 | - foreach ($champs as $key => $val) { |
|
| 655 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 656 | - if (is_scalar($val) and $m == md5($val)) { |
|
| 657 | - unset($champs[$key]); |
|
| 658 | - } |
|
| 659 | - } |
|
| 660 | - } |
|
| 661 | - if (!$champs) { |
|
| 662 | - return; |
|
| 663 | - } |
|
| 664 | - |
|
| 665 | - // On veut savoir si notre modif va avoir un impact |
|
| 666 | - // par rapport aux donnees contenues dans la base |
|
| 667 | - // (qui peuvent etre differentes de celles ayant servi a calculer le ctr) |
|
| 668 | - $s = sql_fetsel(array_keys($champs), $spip_table_objet, "$id_table_objet=$id", $serveur); |
|
| 669 | - $intact = true; |
|
| 670 | - foreach ($champs as $ch => $val) { |
|
| 671 | - $intact &= ($s[$ch] == $val); |
|
| 672 | - } |
|
| 673 | - if ($intact) { |
|
| 674 | - return; |
|
| 675 | - } |
|
| 676 | - |
|
| 677 | - // Detection de conflits : |
|
| 678 | - // On verifie si notre modif ne provient pas d'un formulaire |
|
| 679 | - // genere a partir de donnees modifiees dans l'intervalle ; ici |
|
| 680 | - // on compare a ce qui est dans la base, et on bloque en cas |
|
| 681 | - // de conflit. |
|
| 682 | - $ctrh = $ctrq = $conflits = []; |
|
| 683 | - foreach (array_keys($champs) as $key) { |
|
| 684 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 685 | - $ctrh[$key] = $m; |
|
| 686 | - $ctrq[] = $key; |
|
| 687 | - } |
|
| 688 | - } |
|
| 689 | - if ($ctrq) { |
|
| 690 | - $ctrq = sql_fetsel($ctrq, $spip_table_objet, "$id_table_objet=$id", $serveur); |
|
| 691 | - foreach ($ctrh as $key => $m) { |
|
| 692 | - if ( |
|
| 693 | - $m != md5($ctrq[$key]) |
|
| 694 | - and $champs[$key] !== $ctrq[$key] |
|
| 695 | - ) { |
|
| 696 | - $conflits[$key] = [ |
|
| 697 | - 'base' => $ctrq[$key], |
|
| 698 | - 'post' => $champs[$key] |
|
| 699 | - ]; |
|
| 700 | - unset($champs[$key]); # stocker quand meme les modifs ? |
|
| 701 | - } |
|
| 702 | - } |
|
| 703 | - } |
|
| 704 | - |
|
| 705 | - return $conflits; |
|
| 648 | + $spip_table_objet = table_objet_sql($type); |
|
| 649 | + $id_table_objet = id_table_objet($type); |
|
| 650 | + |
|
| 651 | + // Controle des MD5 envoyes |
|
| 652 | + // On elimine les donnees non modifiees par le formulaire (mais |
|
| 653 | + // potentiellement modifiees entre temps par un autre utilisateur) |
|
| 654 | + foreach ($champs as $key => $val) { |
|
| 655 | + if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 656 | + if (is_scalar($val) and $m == md5($val)) { |
|
| 657 | + unset($champs[$key]); |
|
| 658 | + } |
|
| 659 | + } |
|
| 660 | + } |
|
| 661 | + if (!$champs) { |
|
| 662 | + return; |
|
| 663 | + } |
|
| 664 | + |
|
| 665 | + // On veut savoir si notre modif va avoir un impact |
|
| 666 | + // par rapport aux donnees contenues dans la base |
|
| 667 | + // (qui peuvent etre differentes de celles ayant servi a calculer le ctr) |
|
| 668 | + $s = sql_fetsel(array_keys($champs), $spip_table_objet, "$id_table_objet=$id", $serveur); |
|
| 669 | + $intact = true; |
|
| 670 | + foreach ($champs as $ch => $val) { |
|
| 671 | + $intact &= ($s[$ch] == $val); |
|
| 672 | + } |
|
| 673 | + if ($intact) { |
|
| 674 | + return; |
|
| 675 | + } |
|
| 676 | + |
|
| 677 | + // Detection de conflits : |
|
| 678 | + // On verifie si notre modif ne provient pas d'un formulaire |
|
| 679 | + // genere a partir de donnees modifiees dans l'intervalle ; ici |
|
| 680 | + // on compare a ce qui est dans la base, et on bloque en cas |
|
| 681 | + // de conflit. |
|
| 682 | + $ctrh = $ctrq = $conflits = []; |
|
| 683 | + foreach (array_keys($champs) as $key) { |
|
| 684 | + if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 685 | + $ctrh[$key] = $m; |
|
| 686 | + $ctrq[] = $key; |
|
| 687 | + } |
|
| 688 | + } |
|
| 689 | + if ($ctrq) { |
|
| 690 | + $ctrq = sql_fetsel($ctrq, $spip_table_objet, "$id_table_objet=$id", $serveur); |
|
| 691 | + foreach ($ctrh as $key => $m) { |
|
| 692 | + if ( |
|
| 693 | + $m != md5($ctrq[$key]) |
|
| 694 | + and $champs[$key] !== $ctrq[$key] |
|
| 695 | + ) { |
|
| 696 | + $conflits[$key] = [ |
|
| 697 | + 'base' => $ctrq[$key], |
|
| 698 | + 'post' => $champs[$key] |
|
| 699 | + ]; |
|
| 700 | + unset($champs[$key]); # stocker quand meme les modifs ? |
|
| 701 | + } |
|
| 702 | + } |
|
| 703 | + } |
|
| 704 | + |
|
| 705 | + return $conflits; |
|
| 706 | 706 | } |
| 707 | 707 | |
| 708 | 708 | /** |
@@ -714,9 +714,9 @@ discard block |
||
| 714 | 714 | * @return string |
| 715 | 715 | */ |
| 716 | 716 | function display_conflit_champ($x) { |
| 717 | - if (strstr($x, "\n") or strlen($x) > 80) { |
|
| 718 | - return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n"; |
|
| 719 | - } else { |
|
| 720 | - return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n"; |
|
| 721 | - } |
|
| 717 | + if (strstr($x, "\n") or strlen($x) > 80) { |
|
| 718 | + return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n"; |
|
| 719 | + } else { |
|
| 720 | + return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n"; |
|
| 721 | + } |
|
| 722 | 722 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | **/ |
| 24 | 24 | |
| 25 | 25 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 26 | - return; |
|
| 26 | + return; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | // public/interfaces definit des traitements sur les champs qui utilisent des fonctions de inc/texte |
@@ -55,75 +55,75 @@ discard block |
||
| 55 | 55 | * Introduction calculée |
| 56 | 56 | **/ |
| 57 | 57 | function filtre_introduction_dist($descriptif, $texte, $longueur, $connect, $suite = null) { |
| 58 | - // Si un descriptif est envoye, on l'utilise directement |
|
| 59 | - if (strlen($descriptif)) { |
|
| 60 | - return appliquer_traitement_champ($descriptif, 'introduction', '', [], $connect); |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - // De preference ce qui est marque <intro>...</intro> |
|
| 64 | - $intro = ''; |
|
| 65 | - $texte = preg_replace(',(</?)intro>,i', "\\1intro>", $texte); // minuscules |
|
| 66 | - while ($fin = strpos($texte, '</intro>')) { |
|
| 67 | - $zone = substr($texte, 0, $fin); |
|
| 68 | - $texte = substr($texte, $fin + strlen('</intro>')); |
|
| 69 | - if ($deb = strpos($zone, '<intro>') or substr($zone, 0, 7) == '<intro>') { |
|
| 70 | - $zone = substr($zone, $deb + 7); |
|
| 71 | - } |
|
| 72 | - $intro .= $zone; |
|
| 73 | - } |
|
| 74 | - |
|
| 75 | - // [12025] On ne *PEUT* pas couper simplement ici car c'est du texte brut, |
|
| 76 | - // qui inclus raccourcis et modeles |
|
| 77 | - // un simple <articlexx> peut etre ensuite transforme en 1000 lignes ... |
|
| 78 | - // par ailleurs le nettoyage des raccourcis ne tient pas compte |
|
| 79 | - // des surcharges et enrichissement de propre |
|
| 80 | - // couper doit se faire apres propre |
|
| 81 | - //$texte = nettoyer_raccourcis_typo($intro ? $intro : $texte, $connect); |
|
| 82 | - |
|
| 83 | - // Cependant pour des questions de perfs on coupe quand meme, en prenant |
|
| 84 | - // large et en se mefiant des tableaux #1323 |
|
| 85 | - |
|
| 86 | - if (strlen($intro)) { |
|
| 87 | - $texte = $intro; |
|
| 88 | - } else { |
|
| 89 | - if ( |
|
| 90 | - strpos("\n" . $texte, "\n|") === false |
|
| 91 | - and strlen($texte) > 2.5 * $longueur |
|
| 92 | - ) { |
|
| 93 | - if (strpos($texte, '<multi') !== false) { |
|
| 94 | - $texte = extraire_multi($texte); |
|
| 95 | - } |
|
| 96 | - $texte = couper($texte, 2 * $longueur); |
|
| 97 | - } |
|
| 98 | - } |
|
| 99 | - |
|
| 100 | - // ne pas tenir compte des notes |
|
| 101 | - if ($notes = charger_fonction('notes', 'inc', true)) { |
|
| 102 | - $notes('', 'empiler'); |
|
| 103 | - } |
|
| 104 | - // Supprimer les modèles avant le propre afin d'éviter qu'ils n'ajoutent du texte indésirable |
|
| 105 | - // dans l'introduction. |
|
| 106 | - $texte = supprime_img($texte, ''); |
|
| 107 | - $texte = appliquer_traitement_champ($texte, 'introduction', '', [], $connect); |
|
| 108 | - |
|
| 109 | - if ($notes) { |
|
| 110 | - $notes('', 'depiler'); |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - if (is_null($suite) and defined('_INTRODUCTION_SUITE')) { |
|
| 114 | - $suite = _INTRODUCTION_SUITE; |
|
| 115 | - } |
|
| 116 | - $texte = couper($texte, $longueur, $suite); |
|
| 117 | - // comme on a coupe il faut repasser la typo (on a perdu les insecables) |
|
| 118 | - $texte = typo($texte, true, $connect, []); |
|
| 119 | - |
|
| 120 | - // et reparagrapher si necessaire (coherence avec le cas descriptif) |
|
| 121 | - // une introduction a tojours un <p> |
|
| 122 | - if ($GLOBALS['toujours_paragrapher']) { // Fermer les paragraphes |
|
| 123 | - $texte = paragrapher($texte, $GLOBALS['toujours_paragrapher']); |
|
| 124 | - } |
|
| 125 | - |
|
| 126 | - return $texte; |
|
| 58 | + // Si un descriptif est envoye, on l'utilise directement |
|
| 59 | + if (strlen($descriptif)) { |
|
| 60 | + return appliquer_traitement_champ($descriptif, 'introduction', '', [], $connect); |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + // De preference ce qui est marque <intro>...</intro> |
|
| 64 | + $intro = ''; |
|
| 65 | + $texte = preg_replace(',(</?)intro>,i', "\\1intro>", $texte); // minuscules |
|
| 66 | + while ($fin = strpos($texte, '</intro>')) { |
|
| 67 | + $zone = substr($texte, 0, $fin); |
|
| 68 | + $texte = substr($texte, $fin + strlen('</intro>')); |
|
| 69 | + if ($deb = strpos($zone, '<intro>') or substr($zone, 0, 7) == '<intro>') { |
|
| 70 | + $zone = substr($zone, $deb + 7); |
|
| 71 | + } |
|
| 72 | + $intro .= $zone; |
|
| 73 | + } |
|
| 74 | + |
|
| 75 | + // [12025] On ne *PEUT* pas couper simplement ici car c'est du texte brut, |
|
| 76 | + // qui inclus raccourcis et modeles |
|
| 77 | + // un simple <articlexx> peut etre ensuite transforme en 1000 lignes ... |
|
| 78 | + // par ailleurs le nettoyage des raccourcis ne tient pas compte |
|
| 79 | + // des surcharges et enrichissement de propre |
|
| 80 | + // couper doit se faire apres propre |
|
| 81 | + //$texte = nettoyer_raccourcis_typo($intro ? $intro : $texte, $connect); |
|
| 82 | + |
|
| 83 | + // Cependant pour des questions de perfs on coupe quand meme, en prenant |
|
| 84 | + // large et en se mefiant des tableaux #1323 |
|
| 85 | + |
|
| 86 | + if (strlen($intro)) { |
|
| 87 | + $texte = $intro; |
|
| 88 | + } else { |
|
| 89 | + if ( |
|
| 90 | + strpos("\n" . $texte, "\n|") === false |
|
| 91 | + and strlen($texte) > 2.5 * $longueur |
|
| 92 | + ) { |
|
| 93 | + if (strpos($texte, '<multi') !== false) { |
|
| 94 | + $texte = extraire_multi($texte); |
|
| 95 | + } |
|
| 96 | + $texte = couper($texte, 2 * $longueur); |
|
| 97 | + } |
|
| 98 | + } |
|
| 99 | + |
|
| 100 | + // ne pas tenir compte des notes |
|
| 101 | + if ($notes = charger_fonction('notes', 'inc', true)) { |
|
| 102 | + $notes('', 'empiler'); |
|
| 103 | + } |
|
| 104 | + // Supprimer les modèles avant le propre afin d'éviter qu'ils n'ajoutent du texte indésirable |
|
| 105 | + // dans l'introduction. |
|
| 106 | + $texte = supprime_img($texte, ''); |
|
| 107 | + $texte = appliquer_traitement_champ($texte, 'introduction', '', [], $connect); |
|
| 108 | + |
|
| 109 | + if ($notes) { |
|
| 110 | + $notes('', 'depiler'); |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + if (is_null($suite) and defined('_INTRODUCTION_SUITE')) { |
|
| 114 | + $suite = _INTRODUCTION_SUITE; |
|
| 115 | + } |
|
| 116 | + $texte = couper($texte, $longueur, $suite); |
|
| 117 | + // comme on a coupe il faut repasser la typo (on a perdu les insecables) |
|
| 118 | + $texte = typo($texte, true, $connect, []); |
|
| 119 | + |
|
| 120 | + // et reparagrapher si necessaire (coherence avec le cas descriptif) |
|
| 121 | + // une introduction a tojours un <p> |
|
| 122 | + if ($GLOBALS['toujours_paragrapher']) { // Fermer les paragraphes |
|
| 123 | + $texte = paragrapher($texte, $GLOBALS['toujours_paragrapher']); |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + return $texte; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | |
@@ -158,73 +158,73 @@ discard block |
||
| 158 | 158 | * Code HTML de la pagination |
| 159 | 159 | **/ |
| 160 | 160 | function filtre_pagination_dist( |
| 161 | - $total, |
|
| 162 | - $nom, |
|
| 163 | - $position, |
|
| 164 | - $pas, |
|
| 165 | - $liste = true, |
|
| 166 | - $modele = '', |
|
| 167 | - string $connect = '', |
|
| 168 | - $env = [] |
|
| 161 | + $total, |
|
| 162 | + $nom, |
|
| 163 | + $position, |
|
| 164 | + $pas, |
|
| 165 | + $liste = true, |
|
| 166 | + $modele = '', |
|
| 167 | + string $connect = '', |
|
| 168 | + $env = [] |
|
| 169 | 169 | ) { |
| 170 | - static $ancres = []; |
|
| 171 | - if ($pas < 1) { |
|
| 172 | - return ''; |
|
| 173 | - } |
|
| 174 | - $ancre = 'pagination' . $nom; // #pagination_articles |
|
| 175 | - $debut = 'debut' . $nom; // 'debut_articles' |
|
| 176 | - |
|
| 177 | - // n'afficher l'ancre qu'une fois |
|
| 178 | - if (!isset($ancres[$ancre])) { |
|
| 179 | - $bloc_ancre = $ancres[$ancre] = "<a id='" . $ancre . "' class='pagination_ancre'></a>"; |
|
| 180 | - } else { |
|
| 181 | - $bloc_ancre = ''; |
|
| 182 | - } |
|
| 183 | - // liste = false : on ne veut que l'ancre |
|
| 184 | - if (!$liste) { |
|
| 185 | - return $ancres[$ancre]; |
|
| 186 | - } |
|
| 187 | - |
|
| 188 | - $self = (empty($env['self']) ? self() : $env['self']); |
|
| 189 | - $pagination = [ |
|
| 190 | - 'debut' => $debut, |
|
| 191 | - 'url' => parametre_url($self, 'fragment', ''), // nettoyer l'id ahah eventuel |
|
| 192 | - 'total' => $total, |
|
| 193 | - 'position' => intval($position), |
|
| 194 | - 'pas' => $pas, |
|
| 195 | - 'nombre_pages' => floor(($total - 1) / $pas) + 1, |
|
| 196 | - 'page_courante' => floor(intval($position) / $pas) + 1, |
|
| 197 | - 'ancre' => $ancre, |
|
| 198 | - 'bloc_ancre' => $bloc_ancre |
|
| 199 | - ]; |
|
| 200 | - if (is_array($env)) { |
|
| 201 | - $pagination = array_merge($env, $pagination); |
|
| 202 | - } |
|
| 203 | - |
|
| 204 | - // Pas de pagination |
|
| 205 | - if ($pagination['nombre_pages'] <= 1) { |
|
| 206 | - return ''; |
|
| 207 | - } |
|
| 208 | - |
|
| 209 | - if ($modele) { |
|
| 210 | - $pagination['type_pagination'] = $modele; |
|
| 211 | - if (trouver_fond('pagination_' . $modele, 'modeles')) { |
|
| 212 | - $modele = '_' . $modele; |
|
| 213 | - } |
|
| 214 | - else { |
|
| 215 | - $modele = ''; |
|
| 216 | - } |
|
| 217 | - } |
|
| 218 | - |
|
| 219 | - if (!defined('_PAGINATION_NOMBRE_LIENS_MAX')) { |
|
| 220 | - define('_PAGINATION_NOMBRE_LIENS_MAX', 10); |
|
| 221 | - } |
|
| 222 | - if (!defined('_PAGINATION_NOMBRE_LIENS_MAX_ECRIRE')) { |
|
| 223 | - define('_PAGINATION_NOMBRE_LIENS_MAX_ECRIRE', 5); |
|
| 224 | - } |
|
| 225 | - |
|
| 226 | - |
|
| 227 | - return recuperer_fond("modeles/pagination$modele", $pagination, ['trim' => true], $connect); |
|
| 170 | + static $ancres = []; |
|
| 171 | + if ($pas < 1) { |
|
| 172 | + return ''; |
|
| 173 | + } |
|
| 174 | + $ancre = 'pagination' . $nom; // #pagination_articles |
|
| 175 | + $debut = 'debut' . $nom; // 'debut_articles' |
|
| 176 | + |
|
| 177 | + // n'afficher l'ancre qu'une fois |
|
| 178 | + if (!isset($ancres[$ancre])) { |
|
| 179 | + $bloc_ancre = $ancres[$ancre] = "<a id='" . $ancre . "' class='pagination_ancre'></a>"; |
|
| 180 | + } else { |
|
| 181 | + $bloc_ancre = ''; |
|
| 182 | + } |
|
| 183 | + // liste = false : on ne veut que l'ancre |
|
| 184 | + if (!$liste) { |
|
| 185 | + return $ancres[$ancre]; |
|
| 186 | + } |
|
| 187 | + |
|
| 188 | + $self = (empty($env['self']) ? self() : $env['self']); |
|
| 189 | + $pagination = [ |
|
| 190 | + 'debut' => $debut, |
|
| 191 | + 'url' => parametre_url($self, 'fragment', ''), // nettoyer l'id ahah eventuel |
|
| 192 | + 'total' => $total, |
|
| 193 | + 'position' => intval($position), |
|
| 194 | + 'pas' => $pas, |
|
| 195 | + 'nombre_pages' => floor(($total - 1) / $pas) + 1, |
|
| 196 | + 'page_courante' => floor(intval($position) / $pas) + 1, |
|
| 197 | + 'ancre' => $ancre, |
|
| 198 | + 'bloc_ancre' => $bloc_ancre |
|
| 199 | + ]; |
|
| 200 | + if (is_array($env)) { |
|
| 201 | + $pagination = array_merge($env, $pagination); |
|
| 202 | + } |
|
| 203 | + |
|
| 204 | + // Pas de pagination |
|
| 205 | + if ($pagination['nombre_pages'] <= 1) { |
|
| 206 | + return ''; |
|
| 207 | + } |
|
| 208 | + |
|
| 209 | + if ($modele) { |
|
| 210 | + $pagination['type_pagination'] = $modele; |
|
| 211 | + if (trouver_fond('pagination_' . $modele, 'modeles')) { |
|
| 212 | + $modele = '_' . $modele; |
|
| 213 | + } |
|
| 214 | + else { |
|
| 215 | + $modele = ''; |
|
| 216 | + } |
|
| 217 | + } |
|
| 218 | + |
|
| 219 | + if (!defined('_PAGINATION_NOMBRE_LIENS_MAX')) { |
|
| 220 | + define('_PAGINATION_NOMBRE_LIENS_MAX', 10); |
|
| 221 | + } |
|
| 222 | + if (!defined('_PAGINATION_NOMBRE_LIENS_MAX_ECRIRE')) { |
|
| 223 | + define('_PAGINATION_NOMBRE_LIENS_MAX_ECRIRE', 5); |
|
| 224 | + } |
|
| 225 | + |
|
| 226 | + |
|
| 227 | + return recuperer_fond("modeles/pagination$modele", $pagination, ['trim' => true], $connect); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | |
@@ -243,44 +243,44 @@ discard block |
||
| 243 | 243 | * Liste (première page, dernière page). |
| 244 | 244 | **/ |
| 245 | 245 | function filtre_bornes_pagination_dist($courante, $nombre, $max = 10) { |
| 246 | - if ($max <= 0 or $max >= $nombre) { |
|
| 247 | - return [1, $nombre]; |
|
| 248 | - } |
|
| 249 | - if ($max <= 1) { |
|
| 250 | - return [$courante, $courante]; |
|
| 251 | - } |
|
| 252 | - |
|
| 253 | - $premiere = max(1, $courante - floor(($max - 1) / 2)); |
|
| 254 | - $derniere = min($nombre, $premiere + $max - 2); |
|
| 255 | - $premiere = $derniere == $nombre ? $derniere - $max + 1 : $premiere; |
|
| 256 | - |
|
| 257 | - return [$premiere, $derniere]; |
|
| 246 | + if ($max <= 0 or $max >= $nombre) { |
|
| 247 | + return [1, $nombre]; |
|
| 248 | + } |
|
| 249 | + if ($max <= 1) { |
|
| 250 | + return [$courante, $courante]; |
|
| 251 | + } |
|
| 252 | + |
|
| 253 | + $premiere = max(1, $courante - floor(($max - 1) / 2)); |
|
| 254 | + $derniere = min($nombre, $premiere + $max - 2); |
|
| 255 | + $premiere = $derniere == $nombre ? $derniere - $max + 1 : $premiere; |
|
| 256 | + |
|
| 257 | + return [$premiere, $derniere]; |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | function filtre_pagination_affiche_texte_lien_page_dist($type_pagination, $numero_page, $rang_item) { |
| 261 | - if ($numero_page === 'tous') { |
|
| 262 | - return '∞'; |
|
| 263 | - } |
|
| 264 | - if ($numero_page === 'prev') { |
|
| 265 | - return '<'; |
|
| 266 | - } |
|
| 267 | - if ($numero_page === 'next') { |
|
| 268 | - return '>'; |
|
| 269 | - } |
|
| 270 | - |
|
| 271 | - switch ($type_pagination) { |
|
| 272 | - case 'resultats': |
|
| 273 | - return $rang_item + 1; // 1 11 21 31... |
|
| 274 | - case 'naturel': |
|
| 275 | - return $rang_item ?: 1; // 1 10 20 30... |
|
| 276 | - case 'rang': |
|
| 277 | - return $rang_item; // 0 10 20 30... |
|
| 278 | - |
|
| 279 | - case 'page': |
|
| 280 | - case 'prive': |
|
| 281 | - default: |
|
| 282 | - return $numero_page; // 1 2 3 4 5... |
|
| 283 | - } |
|
| 261 | + if ($numero_page === 'tous') { |
|
| 262 | + return '∞'; |
|
| 263 | + } |
|
| 264 | + if ($numero_page === 'prev') { |
|
| 265 | + return '<'; |
|
| 266 | + } |
|
| 267 | + if ($numero_page === 'next') { |
|
| 268 | + return '>'; |
|
| 269 | + } |
|
| 270 | + |
|
| 271 | + switch ($type_pagination) { |
|
| 272 | + case 'resultats': |
|
| 273 | + return $rang_item + 1; // 1 11 21 31... |
|
| 274 | + case 'naturel': |
|
| 275 | + return $rang_item ?: 1; // 1 10 20 30... |
|
| 276 | + case 'rang': |
|
| 277 | + return $rang_item; // 0 10 20 30... |
|
| 278 | + |
|
| 279 | + case 'page': |
|
| 280 | + case 'prive': |
|
| 281 | + default: |
|
| 282 | + return $numero_page; // 1 2 3 4 5... |
|
| 283 | + } |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | /** |
@@ -293,15 +293,15 @@ discard block |
||
| 293 | 293 | **/ |
| 294 | 294 | function lister_objets_avec_logos($type) { |
| 295 | 295 | |
| 296 | - $objet = objet_type($type); |
|
| 297 | - $ids = sql_allfetsel('L.id_objet', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode=' . sql_quote('logoon') . ' AND L.objet=' . sql_quote($objet)); |
|
| 298 | - if ($ids) { |
|
| 299 | - $ids = array_column($ids, 'id_objet'); |
|
| 300 | - return implode(',', $ids); |
|
| 301 | - } |
|
| 302 | - else { |
|
| 303 | - return '0'; |
|
| 304 | - } |
|
| 296 | + $objet = objet_type($type); |
|
| 297 | + $ids = sql_allfetsel('L.id_objet', 'spip_documents AS D JOIN spip_documents_liens AS L ON L.id_document=D.id_document', 'D.mode=' . sql_quote('logoon') . ' AND L.objet=' . sql_quote($objet)); |
|
| 298 | + if ($ids) { |
|
| 299 | + $ids = array_column($ids, 'id_objet'); |
|
| 300 | + return implode(',', $ids); |
|
| 301 | + } |
|
| 302 | + else { |
|
| 303 | + return '0'; |
|
| 304 | + } |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | |
@@ -317,14 +317,14 @@ discard block |
||
| 317 | 317 | * Code HTML des notes |
| 318 | 318 | **/ |
| 319 | 319 | function calculer_notes() { |
| 320 | - $r = ''; |
|
| 321 | - if ($notes = charger_fonction('notes', 'inc', true)) { |
|
| 322 | - $r = $notes([]); |
|
| 323 | - $notes('', 'depiler'); |
|
| 324 | - $notes('', 'empiler'); |
|
| 325 | - } |
|
| 326 | - |
|
| 327 | - return $r; |
|
| 320 | + $r = ''; |
|
| 321 | + if ($notes = charger_fonction('notes', 'inc', true)) { |
|
| 322 | + $r = $notes([]); |
|
| 323 | + $notes('', 'depiler'); |
|
| 324 | + $notes('', 'empiler'); |
|
| 325 | + } |
|
| 326 | + |
|
| 327 | + return $r; |
|
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | |
@@ -341,10 +341,10 @@ discard block |
||
| 341 | 341 | * @return string |
| 342 | 342 | */ |
| 343 | 343 | function retrouver_rang_lien($objet_source, $ids, $objet_lie, $idl, $objet_lien) { |
| 344 | - $res = lister_objets_liens($objet_source, $objet_lie, $idl, $objet_lien); |
|
| 345 | - $res = array_column($res, 'rang_lien', $objet_source); |
|
| 344 | + $res = lister_objets_liens($objet_source, $objet_lie, $idl, $objet_lien); |
|
| 345 | + $res = array_column($res, 'rang_lien', $objet_source); |
|
| 346 | 346 | |
| 347 | - return ($res[$ids] ?? ''); |
|
| 347 | + return ($res[$ids] ?? ''); |
|
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | |
@@ -361,19 +361,19 @@ discard block |
||
| 361 | 361 | * @private |
| 362 | 362 | */ |
| 363 | 363 | function lister_objets_liens($objet_source, $objet, $id_objet, $objet_lien) { |
| 364 | - static $liens = []; |
|
| 365 | - if (!isset($liens["$objet_source-$objet-$id_objet-$objet_lien"])) { |
|
| 366 | - include_spip('action/editer_liens'); |
|
| 367 | - // quand $objet == $objet_lien == $objet_source on reste sur le cas par defaut de $objet_lien == $objet_source |
|
| 368 | - if ($objet_lien == $objet and $objet_lien !== $objet_source) { |
|
| 369 | - $res = objet_trouver_liens([$objet => $id_objet], [$objet_source => '*']); |
|
| 370 | - } else { |
|
| 371 | - $res = objet_trouver_liens([$objet_source => '*'], [$objet => $id_objet]); |
|
| 372 | - } |
|
| 373 | - |
|
| 374 | - $liens["$objet_source-$objet-$id_objet-$objet_lien"] = $res; |
|
| 375 | - } |
|
| 376 | - return $liens["$objet_source-$objet-$id_objet-$objet_lien"]; |
|
| 364 | + static $liens = []; |
|
| 365 | + if (!isset($liens["$objet_source-$objet-$id_objet-$objet_lien"])) { |
|
| 366 | + include_spip('action/editer_liens'); |
|
| 367 | + // quand $objet == $objet_lien == $objet_source on reste sur le cas par defaut de $objet_lien == $objet_source |
|
| 368 | + if ($objet_lien == $objet and $objet_lien !== $objet_source) { |
|
| 369 | + $res = objet_trouver_liens([$objet => $id_objet], [$objet_source => '*']); |
|
| 370 | + } else { |
|
| 371 | + $res = objet_trouver_liens([$objet_source => '*'], [$objet => $id_objet]); |
|
| 372 | + } |
|
| 373 | + |
|
| 374 | + $liens["$objet_source-$objet-$id_objet-$objet_lien"] = $res; |
|
| 375 | + } |
|
| 376 | + return $liens["$objet_source-$objet-$id_objet-$objet_lien"]; |
|
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | /** |
@@ -387,24 +387,24 @@ discard block |
||
| 387 | 387 | * @return int|string |
| 388 | 388 | */ |
| 389 | 389 | function calculer_rang_smart($titre, $objet_source, $id, $env) { |
| 390 | - // Cas du #RANG utilisé dans #FORMULAIRE_EDITER_LIENS -> attraper le rang du lien |
|
| 391 | - // permet de voir le rang du lien si il y en a un en base, meme avant un squelette xxxx-lies.html ne gerant pas les liens |
|
| 392 | - if ( |
|
| 393 | - isset($env['form']) and $env['form'] |
|
| 394 | - and isset($env['_objet_lien']) and $env['_objet_lien'] |
|
| 395 | - and (function_exists('lien_triables') or include_spip('action/editer_liens')) |
|
| 396 | - and $r = objet_associable($env['_objet_lien']) |
|
| 397 | - and [$p, $table_lien] = $r |
|
| 398 | - and lien_triables($table_lien) |
|
| 399 | - and isset($env['objet']) and $env['objet'] |
|
| 400 | - and isset($env['id_objet']) and $env['id_objet'] |
|
| 401 | - and $objet_source |
|
| 402 | - and $id = intval($id) |
|
| 403 | - ) { |
|
| 404 | - $rang = retrouver_rang_lien($objet_source, $id, $env['objet'], $env['id_objet'], $env['_objet_lien']); |
|
| 405 | - return ($rang ?: ''); |
|
| 406 | - } |
|
| 407 | - return recuperer_numero($titre); |
|
| 390 | + // Cas du #RANG utilisé dans #FORMULAIRE_EDITER_LIENS -> attraper le rang du lien |
|
| 391 | + // permet de voir le rang du lien si il y en a un en base, meme avant un squelette xxxx-lies.html ne gerant pas les liens |
|
| 392 | + if ( |
|
| 393 | + isset($env['form']) and $env['form'] |
|
| 394 | + and isset($env['_objet_lien']) and $env['_objet_lien'] |
|
| 395 | + and (function_exists('lien_triables') or include_spip('action/editer_liens')) |
|
| 396 | + and $r = objet_associable($env['_objet_lien']) |
|
| 397 | + and [$p, $table_lien] = $r |
|
| 398 | + and lien_triables($table_lien) |
|
| 399 | + and isset($env['objet']) and $env['objet'] |
|
| 400 | + and isset($env['id_objet']) and $env['id_objet'] |
|
| 401 | + and $objet_source |
|
| 402 | + and $id = intval($id) |
|
| 403 | + ) { |
|
| 404 | + $rang = retrouver_rang_lien($objet_source, $id, $env['objet'], $env['id_objet'], $env['_objet_lien']); |
|
| 405 | + return ($rang ?: ''); |
|
| 406 | + } |
|
| 407 | + return recuperer_numero($titre); |
|
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | /** |
@@ -431,72 +431,72 @@ discard block |
||
| 431 | 431 | */ |
| 432 | 432 | function calculer_balise_tri(string $champ_ou_sens, string $libelle, string $classe, string $tri_nom, string $tri_champ, string $tri_sens, $liste_tri_sens_defaut): string { |
| 433 | 433 | |
| 434 | - $url = self('&'); |
|
| 435 | - $tri_sens = (int) $tri_sens; |
|
| 436 | - $alias_sens = [ |
|
| 437 | - '<' => -1, |
|
| 438 | - '>' => 1, |
|
| 439 | - 'inverse' => -1, |
|
| 440 | - ]; |
|
| 441 | - |
|
| 442 | - // Normaliser la liste des sens de tri par défaut |
|
| 443 | - // On ajoute un jocker pour les champs non présents dans la liste |
|
| 444 | - // avec la valeur du 1er item de la liste, idem critère {tri} |
|
| 445 | - if (is_array($liste_tri_sens_defaut)) { |
|
| 446 | - $liste_tri_sens_defaut['*'] = array_values($liste_tri_sens_defaut)[0]; |
|
| 447 | - } else { |
|
| 448 | - $liste_tri_sens_defaut = [ |
|
| 449 | - '*' => (int) ($alias_sens[$liste_tri_sens_defaut] ?? $liste_tri_sens_defaut), |
|
| 450 | - ]; |
|
| 451 | - } |
|
| 452 | - |
|
| 453 | - // Les sens de tri actuel et nouveau : |
|
| 454 | - // Soit c'est un sens fixe donné en paramètre (< ou >) |
|
| 455 | - $is_sens_fixe = array_key_exists($champ_ou_sens, $alias_sens); |
|
| 456 | - if ($is_sens_fixe) { |
|
| 457 | - $tri_sens_actuel = $tri_sens; |
|
| 458 | - $tri_sens_nouveau = $alias_sens[$champ_ou_sens]; |
|
| 459 | - // Soit c'est le champ utilisé actuellement pour le tri → on inverse le sens |
|
| 460 | - } elseif ($champ_ou_sens === $tri_champ) { |
|
| 461 | - $tri_sens_actuel = $tri_sens; |
|
| 462 | - $tri_sens_nouveau = $tri_sens * -1; |
|
| 463 | - // Sinon c'est un nouveau champ, et on prend son tri par défaut |
|
| 464 | - } else { |
|
| 465 | - $tri_sens_actuel = $tri_sens_nouveau = (int) ($liste_tri_sens_defaut[$champ_ou_sens] ?? $liste_tri_sens_defaut['*']); |
|
| 466 | - } |
|
| 467 | - |
|
| 468 | - // URL : ajouter le champ sur lequel porte le tri |
|
| 469 | - if (!$is_sens_fixe) { |
|
| 470 | - $param_tri = "tri$tri_nom"; |
|
| 471 | - $url = parametre_url($url, $param_tri, $champ_ou_sens); |
|
| 472 | - } |
|
| 473 | - |
|
| 474 | - // URL : n'ajouter le sens de tri que si nécessaire, |
|
| 475 | - // c.à.d différent du sens par défaut pour le champ |
|
| 476 | - $param_sens = "sens$tri_nom"; |
|
| 477 | - $tri_sens_defaut_champ = (int) ($liste_tri_sens_defaut[$champ_ou_sens] ?? $liste_tri_sens_defaut['*']); |
|
| 478 | - if ($tri_sens_nouveau !== $tri_sens_defaut_champ) { |
|
| 479 | - $url = parametre_url($url, $param_sens, $tri_sens_nouveau); |
|
| 480 | - } else { |
|
| 481 | - $url = parametre_url($url, $param_sens, ''); |
|
| 482 | - } |
|
| 483 | - |
|
| 484 | - // Drapeau pour garder en session ? |
|
| 485 | - $param_memo = (!$is_sens_fixe ? $param_tri : $param_sens); |
|
| 486 | - $url = parametre_url($url, 'var_memotri', strncmp($tri_nom, 'session', 7) == 0 ? $param_memo : ''); |
|
| 487 | - |
|
| 488 | - // Classes : on indique le sens de tri et l'item exposé |
|
| 489 | - if (!$is_sens_fixe) { |
|
| 490 | - $classe .= ' item-tri item-tri_' . ($tri_sens_actuel === 1 ? 'asc' : 'desc'); |
|
| 491 | - } |
|
| 492 | - if ($champ_ou_sens === $tri_champ) { |
|
| 493 | - $classe .= ' item-tri_actif'; |
|
| 494 | - } |
|
| 495 | - |
|
| 496 | - // Lien |
|
| 497 | - $balise = lien_ou_expose($url, $libelle, false, $classe); |
|
| 498 | - |
|
| 499 | - return $balise; |
|
| 434 | + $url = self('&'); |
|
| 435 | + $tri_sens = (int) $tri_sens; |
|
| 436 | + $alias_sens = [ |
|
| 437 | + '<' => -1, |
|
| 438 | + '>' => 1, |
|
| 439 | + 'inverse' => -1, |
|
| 440 | + ]; |
|
| 441 | + |
|
| 442 | + // Normaliser la liste des sens de tri par défaut |
|
| 443 | + // On ajoute un jocker pour les champs non présents dans la liste |
|
| 444 | + // avec la valeur du 1er item de la liste, idem critère {tri} |
|
| 445 | + if (is_array($liste_tri_sens_defaut)) { |
|
| 446 | + $liste_tri_sens_defaut['*'] = array_values($liste_tri_sens_defaut)[0]; |
|
| 447 | + } else { |
|
| 448 | + $liste_tri_sens_defaut = [ |
|
| 449 | + '*' => (int) ($alias_sens[$liste_tri_sens_defaut] ?? $liste_tri_sens_defaut), |
|
| 450 | + ]; |
|
| 451 | + } |
|
| 452 | + |
|
| 453 | + // Les sens de tri actuel et nouveau : |
|
| 454 | + // Soit c'est un sens fixe donné en paramètre (< ou >) |
|
| 455 | + $is_sens_fixe = array_key_exists($champ_ou_sens, $alias_sens); |
|
| 456 | + if ($is_sens_fixe) { |
|
| 457 | + $tri_sens_actuel = $tri_sens; |
|
| 458 | + $tri_sens_nouveau = $alias_sens[$champ_ou_sens]; |
|
| 459 | + // Soit c'est le champ utilisé actuellement pour le tri → on inverse le sens |
|
| 460 | + } elseif ($champ_ou_sens === $tri_champ) { |
|
| 461 | + $tri_sens_actuel = $tri_sens; |
|
| 462 | + $tri_sens_nouveau = $tri_sens * -1; |
|
| 463 | + // Sinon c'est un nouveau champ, et on prend son tri par défaut |
|
| 464 | + } else { |
|
| 465 | + $tri_sens_actuel = $tri_sens_nouveau = (int) ($liste_tri_sens_defaut[$champ_ou_sens] ?? $liste_tri_sens_defaut['*']); |
|
| 466 | + } |
|
| 467 | + |
|
| 468 | + // URL : ajouter le champ sur lequel porte le tri |
|
| 469 | + if (!$is_sens_fixe) { |
|
| 470 | + $param_tri = "tri$tri_nom"; |
|
| 471 | + $url = parametre_url($url, $param_tri, $champ_ou_sens); |
|
| 472 | + } |
|
| 473 | + |
|
| 474 | + // URL : n'ajouter le sens de tri que si nécessaire, |
|
| 475 | + // c.à.d différent du sens par défaut pour le champ |
|
| 476 | + $param_sens = "sens$tri_nom"; |
|
| 477 | + $tri_sens_defaut_champ = (int) ($liste_tri_sens_defaut[$champ_ou_sens] ?? $liste_tri_sens_defaut['*']); |
|
| 478 | + if ($tri_sens_nouveau !== $tri_sens_defaut_champ) { |
|
| 479 | + $url = parametre_url($url, $param_sens, $tri_sens_nouveau); |
|
| 480 | + } else { |
|
| 481 | + $url = parametre_url($url, $param_sens, ''); |
|
| 482 | + } |
|
| 483 | + |
|
| 484 | + // Drapeau pour garder en session ? |
|
| 485 | + $param_memo = (!$is_sens_fixe ? $param_tri : $param_sens); |
|
| 486 | + $url = parametre_url($url, 'var_memotri', strncmp($tri_nom, 'session', 7) == 0 ? $param_memo : ''); |
|
| 487 | + |
|
| 488 | + // Classes : on indique le sens de tri et l'item exposé |
|
| 489 | + if (!$is_sens_fixe) { |
|
| 490 | + $classe .= ' item-tri item-tri_' . ($tri_sens_actuel === 1 ? 'asc' : 'desc'); |
|
| 491 | + } |
|
| 492 | + if ($champ_ou_sens === $tri_champ) { |
|
| 493 | + $classe .= ' item-tri_actif'; |
|
| 494 | + } |
|
| 495 | + |
|
| 496 | + // Lien |
|
| 497 | + $balise = lien_ou_expose($url, $libelle, false, $classe); |
|
| 498 | + |
|
| 499 | + return $balise; |
|
| 500 | 500 | } |
| 501 | 501 | |
| 502 | 502 | |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | * @return string |
| 513 | 513 | */ |
| 514 | 514 | function tri_protege_champ($t) { |
| 515 | - return preg_replace(',[^\s\w.+\[\]],', '', $t); |
|
| 515 | + return preg_replace(',[^\s\w.+\[\]],', '', $t); |
|
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | /** |
@@ -525,43 +525,43 @@ discard block |
||
| 525 | 525 | * @return string |
| 526 | 526 | */ |
| 527 | 527 | function tri_champ_order($t, $from = null, $senstri = '') { |
| 528 | - if (strncmp($t, 'multi ', 6) == 0) { |
|
| 529 | - return 'multi' . $senstri; |
|
| 530 | - } |
|
| 531 | - |
|
| 532 | - $champ = $t; |
|
| 533 | - |
|
| 534 | - $prefixe = ''; |
|
| 535 | - foreach (['num ', 'sinum '] as $p) { |
|
| 536 | - if (strpos($t, $p) === 0) { |
|
| 537 | - $champ = substr($t, strlen($p)); |
|
| 538 | - $prefixe = $p; |
|
| 539 | - } |
|
| 540 | - } |
|
| 541 | - |
|
| 542 | - // enlever les autres espaces non evacues par tri_protege_champ |
|
| 543 | - $champ = preg_replace(',\s,', '', $champ); |
|
| 544 | - |
|
| 545 | - if (is_array($from)) { |
|
| 546 | - $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 547 | - foreach ($from as $idt => $table_sql) { |
|
| 548 | - if ( |
|
| 549 | - $desc = $trouver_table($table_sql) |
|
| 550 | - and isset($desc['field'][$champ]) |
|
| 551 | - ) { |
|
| 552 | - $champ = "$idt.$champ"; |
|
| 553 | - break; |
|
| 554 | - } |
|
| 555 | - } |
|
| 556 | - } |
|
| 557 | - switch ($prefixe) { |
|
| 558 | - case 'num ': |
|
| 559 | - return "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}, 0+$champ{$senstri}"; |
|
| 560 | - case 'sinum ': |
|
| 561 | - return "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}"; |
|
| 562 | - default: |
|
| 563 | - return $champ . $senstri; |
|
| 564 | - } |
|
| 528 | + if (strncmp($t, 'multi ', 6) == 0) { |
|
| 529 | + return 'multi' . $senstri; |
|
| 530 | + } |
|
| 531 | + |
|
| 532 | + $champ = $t; |
|
| 533 | + |
|
| 534 | + $prefixe = ''; |
|
| 535 | + foreach (['num ', 'sinum '] as $p) { |
|
| 536 | + if (strpos($t, $p) === 0) { |
|
| 537 | + $champ = substr($t, strlen($p)); |
|
| 538 | + $prefixe = $p; |
|
| 539 | + } |
|
| 540 | + } |
|
| 541 | + |
|
| 542 | + // enlever les autres espaces non evacues par tri_protege_champ |
|
| 543 | + $champ = preg_replace(',\s,', '', $champ); |
|
| 544 | + |
|
| 545 | + if (is_array($from)) { |
|
| 546 | + $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 547 | + foreach ($from as $idt => $table_sql) { |
|
| 548 | + if ( |
|
| 549 | + $desc = $trouver_table($table_sql) |
|
| 550 | + and isset($desc['field'][$champ]) |
|
| 551 | + ) { |
|
| 552 | + $champ = "$idt.$champ"; |
|
| 553 | + break; |
|
| 554 | + } |
|
| 555 | + } |
|
| 556 | + } |
|
| 557 | + switch ($prefixe) { |
|
| 558 | + case 'num ': |
|
| 559 | + return "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}, 0+$champ{$senstri}"; |
|
| 560 | + case 'sinum ': |
|
| 561 | + return "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}"; |
|
| 562 | + default: |
|
| 563 | + return $champ . $senstri; |
|
| 564 | + } |
|
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | /** |
@@ -575,18 +575,18 @@ discard block |
||
| 575 | 575 | * @return string |
| 576 | 576 | */ |
| 577 | 577 | function tri_champ_select($t) { |
| 578 | - if (strncmp($t, 'multi ', 6) == 0) { |
|
| 579 | - $t = substr($t, 6); |
|
| 580 | - $t = preg_replace(',\s,', '', $t); |
|
| 581 | - $t = sql_multi($t, $GLOBALS['spip_lang']); |
|
| 582 | - |
|
| 583 | - return $t; |
|
| 584 | - } |
|
| 585 | - if (trim($t) == 'hasard') { |
|
| 586 | - return 'rand() AS hasard'; |
|
| 587 | - } |
|
| 588 | - |
|
| 589 | - return "''"; |
|
| 578 | + if (strncmp($t, 'multi ', 6) == 0) { |
|
| 579 | + $t = substr($t, 6); |
|
| 580 | + $t = preg_replace(',\s,', '', $t); |
|
| 581 | + $t = sql_multi($t, $GLOBALS['spip_lang']); |
|
| 582 | + |
|
| 583 | + return $t; |
|
| 584 | + } |
|
| 585 | + if (trim($t) == 'hasard') { |
|
| 586 | + return 'rand() AS hasard'; |
|
| 587 | + } |
|
| 588 | + |
|
| 589 | + return "''"; |
|
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | /** |
@@ -598,16 +598,16 @@ discard block |
||
| 598 | 598 | * @return string |
| 599 | 599 | */ |
| 600 | 600 | function formate_liste_critere_par_ordre_liste($valeurs, $serveur = '') { |
| 601 | - if (!is_array($valeurs)) { |
|
| 602 | - return ''; |
|
| 603 | - } |
|
| 604 | - $f = sql_serveur('quote', $serveur, true); |
|
| 605 | - if (!is_string($f) or !$f) { |
|
| 606 | - return ''; |
|
| 607 | - } |
|
| 608 | - $valeurs = implode(',', array_map($f, array_unique($valeurs))); |
|
| 609 | - |
|
| 610 | - return $valeurs; |
|
| 601 | + if (!is_array($valeurs)) { |
|
| 602 | + return ''; |
|
| 603 | + } |
|
| 604 | + $f = sql_serveur('quote', $serveur, true); |
|
| 605 | + if (!is_string($f) or !$f) { |
|
| 606 | + return ''; |
|
| 607 | + } |
|
| 608 | + $valeurs = implode(',', array_map($f, array_unique($valeurs))); |
|
| 609 | + |
|
| 610 | + return $valeurs; |
|
| 611 | 611 | } |
| 612 | 612 | |
| 613 | 613 | /** |
@@ -630,20 +630,20 @@ discard block |
||
| 630 | 630 | * Valeur $defaut sinon. |
| 631 | 631 | **/ |
| 632 | 632 | function appliquer_filtre_sinon($arg, $filtre, $args, $defaut = '') { |
| 633 | - // Si c'est un filtre d'image, on utilise image_filtrer() |
|
| 634 | - // Attention : les 2 premiers arguments sont inversés dans ce cas |
|
| 635 | - if (trouver_filtre_matrice($filtre) and substr($filtre, 0, 6) == 'image_') { |
|
| 636 | - include_spip('inc/filtres_images_lib_mini'); |
|
| 637 | - $args[1] = $args[0]; |
|
| 638 | - $args[0] = $filtre; |
|
| 639 | - return image_graver(image_filtrer($args)); |
|
| 640 | - } |
|
| 641 | - |
|
| 642 | - $f = chercher_filtre($filtre); |
|
| 643 | - if (!$f) { |
|
| 644 | - return $defaut; |
|
| 645 | - } |
|
| 646 | - array_shift($args); // enlever $arg |
|
| 647 | - array_shift($args); // enlever $filtre |
|
| 648 | - return $f($arg, ...$args); |
|
| 633 | + // Si c'est un filtre d'image, on utilise image_filtrer() |
|
| 634 | + // Attention : les 2 premiers arguments sont inversés dans ce cas |
|
| 635 | + if (trouver_filtre_matrice($filtre) and substr($filtre, 0, 6) == 'image_') { |
|
| 636 | + include_spip('inc/filtres_images_lib_mini'); |
|
| 637 | + $args[1] = $args[0]; |
|
| 638 | + $args[0] = $filtre; |
|
| 639 | + return image_graver(image_filtrer($args)); |
|
| 640 | + } |
|
| 641 | + |
|
| 642 | + $f = chercher_filtre($filtre); |
|
| 643 | + if (!$f) { |
|
| 644 | + return $defaut; |
|
| 645 | + } |
|
| 646 | + array_shift($args); // enlever $arg |
|
| 647 | + array_shift($args); // enlever $filtre |
|
| 648 | + return $f($arg, ...$args); |
|
| 649 | 649 | } |