@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | include_spip('inc/texte'); |
| 21 | 21 | $titre = $descriptif = ''; |
| 22 | 22 | if ($type === 'rubrique') { |
| 23 | - $row = sql_fetsel('titre, descriptif', 'spip_rubriques', 'id_rubrique = ' . intval($id)); |
|
| 23 | + $row = sql_fetsel('titre, descriptif', 'spip_rubriques', 'id_rubrique = '.intval($id)); |
|
| 24 | 24 | if ($row) { |
| 25 | 25 | $titre = typo($row['titre']); |
| 26 | 26 | $descriptif = propre($row['descriptif']); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | include_spip('inc/filtres_images_mini'); |
| 43 | 43 | $res = image_reduire("<img src='$fid' alt='' />", 100, 48); |
| 44 | 44 | if ($res) { |
| 45 | - $res = "<div class='informer__media' style='float: " . $GLOBALS['spip_lang_right'] . '; margin-' . $GLOBALS['spip_lang_right'] . ": -5px; margin-top: -5px;'>$res</div>"; |
|
| 45 | + $res = "<div class='informer__media' style='float: ".$GLOBALS['spip_lang_right'].'; margin-'.$GLOBALS['spip_lang_right'].": -5px; margin-top: -5px;'>$res</div>"; |
|
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -64,21 +64,21 @@ discard block |
||
| 64 | 64 | ' ' |
| 65 | 65 | ); |
| 66 | 66 | |
| 67 | - $js_func = $do . '_selection_titre'; |
|
| 67 | + $js_func = $do.'_selection_titre'; |
|
| 68 | 68 | |
| 69 | 69 | return "<div style='display: none;'>" |
| 70 | - . "<input type='text' id='" . $rac . "_sel' value='$id' />" |
|
| 71 | - . "<input type='text' id='" . $rac . "_sel2' value=\"" |
|
| 70 | + . "<input type='text' id='".$rac."_sel' value='$id' />" |
|
| 71 | + . "<input type='text' id='".$rac."_sel2' value=\"" |
|
| 72 | 72 | . entites_html($titre) |
| 73 | 73 | . '" />' |
| 74 | 74 | . '</div>' |
| 75 | 75 | . "<div class='informer' style='padding: 5px; border-top: 0px;'>" |
| 76 | 76 | . '<div class="informer__item">' |
| 77 | 77 | . (!$res ? '' : $res) |
| 78 | - . "<p class='informer__titre'><b>" . safehtml($titre) . '</b></p>' |
|
| 79 | - . (!$descriptif ? '' : "<div class='informer__descriptif'>" . safehtml($descriptif) . '</div>') |
|
| 78 | + . "<p class='informer__titre'><b>".safehtml($titre).'</b></p>' |
|
| 79 | + . (!$descriptif ? '' : "<div class='informer__descriptif'>".safehtml($descriptif).'</div>') |
|
| 80 | 80 | . '</div>' |
| 81 | - . "<div class='informer__action' style='clear:both; text-align: " . $GLOBALS['spip_lang_right'] . ";'>" |
|
| 81 | + . "<div class='informer__action' style='clear:both; text-align: ".$GLOBALS['spip_lang_right'].";'>" |
|
| 82 | 82 | . "<input type='submit' class='fondo btn submit' value='" |
| 83 | 83 | . _T('bouton_choisir') |
| 84 | 84 | . "'\nonclick=\"$js_func('$titre',$id,'selection_rubrique','id_parent'); return false;\" />" |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $titre = '[' |
| 91 | 91 | . $nom_site_spip |
| 92 | 92 | . ']' |
| 93 | - . ($titre ? ' ' . textebrut(typo($titre)) : ''); |
|
| 93 | + . ($titre ? ' '.textebrut(typo($titre)) : ''); |
|
| 94 | 94 | |
| 95 | 95 | return _DOCTYPE_ECRIRE |
| 96 | 96 | . html_lang_attributes() |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | function init_body($rubrique = 'accueil', $sous_rubrique = 'accueil', $id_rubrique = '', $menu = true) { |
| 134 | 134 | |
| 135 | 135 | $res = pipeline('body_prive', "<body class='" |
| 136 | - . init_body_class() . ' ' . _request('exec') . "'" |
|
| 136 | + . init_body_class().' '._request('exec')."'" |
|
| 137 | 137 | . ($GLOBALS['spip_lang_rtl'] ? " dir='rtl'" : '') |
| 138 | 138 | . '>'); |
| 139 | 139 | |
@@ -76,12 +76,12 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | function objet_modifier($objet, $id, $set = null) { |
| 78 | 78 | if (($t = objet_type($objet)) !== $objet) { |
| 79 | - spip_log("objet_modifier: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE); |
|
| 79 | + spip_log("objet_modifier: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE); |
|
| 80 | 80 | $objet = $t; |
| 81 | 81 | } |
| 82 | 82 | if ( |
| 83 | - include_spip('action/editer_' . $objet) |
|
| 84 | - and function_exists($modifier = $objet . '_modifier') |
|
| 83 | + include_spip('action/editer_'.$objet) |
|
| 84 | + and function_exists($modifier = $objet.'_modifier') |
|
| 85 | 85 | ) { |
| 86 | 86 | return $modifier($id, $set); |
| 87 | 87 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $trouver_table = charger_fonction('trouver_table', 'base'); |
| 91 | 91 | $desc = $trouver_table($table_sql); |
| 92 | 92 | if (!$desc or !isset($desc['field'])) { |
| 93 | - spip_log("Objet $objet inconnu dans objet_modifier", 'editer' . _LOG_ERREUR); |
|
| 93 | + spip_log("Objet $objet inconnu dans objet_modifier", 'editer'._LOG_ERREUR); |
|
| 94 | 94 | |
| 95 | 95 | return _L("Erreur objet $objet inconnu"); |
| 96 | 96 | } |
@@ -170,12 +170,12 @@ discard block |
||
| 170 | 170 | function objet_inserer($objet, $id_parent = null, $set = null) { |
| 171 | 171 | $d = null; |
| 172 | 172 | if (($t = objet_type($objet)) !== $objet) { |
| 173 | - spip_log("objet_inserer: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE); |
|
| 173 | + spip_log("objet_inserer: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE); |
|
| 174 | 174 | $objet = $t; |
| 175 | 175 | } |
| 176 | 176 | if ( |
| 177 | - include_spip('action/editer_' . $objet) |
|
| 178 | - and function_exists($inserer = $objet . '_inserer') |
|
| 177 | + include_spip('action/editer_'.$objet) |
|
| 178 | + and function_exists($inserer = $objet.'_inserer') |
|
| 179 | 179 | ) { |
| 180 | 180 | return $inserer($id_parent, $set); |
| 181 | 181 | } |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | $row = sql_fetsel('id_rubrique, id_secteur, lang', 'spip_rubriques', 'id_parent=0', '', '0+titre,titre', '1'); |
| 197 | 197 | $id_rubrique = $row['id_rubrique']; |
| 198 | 198 | } else { |
| 199 | - $row = sql_fetsel('lang, id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 199 | + $row = sql_fetsel('lang, id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | $champs['id_rubrique'] = $id_rubrique; |
@@ -314,12 +314,12 @@ discard block |
||
| 314 | 314 | */ |
| 315 | 315 | function objet_instituer($objet, $id, $c, $calcul_rub = true) { |
| 316 | 316 | if (($t = objet_type($objet)) !== $objet) { |
| 317 | - spip_log("objet_instituer: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE); |
|
| 317 | + spip_log("objet_instituer: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE); |
|
| 318 | 318 | $objet = $t; |
| 319 | 319 | } |
| 320 | 320 | if ( |
| 321 | - include_spip('action/editer_' . $objet) |
|
| 322 | - and function_exists($instituer = $objet . '_instituer') |
|
| 321 | + include_spip('action/editer_'.$objet) |
|
| 322 | + and function_exists($instituer = $objet.'_instituer') |
|
| 323 | 323 | ) { |
| 324 | 324 | return $instituer($id, $c, $calcul_rub); |
| 325 | 325 | } |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | $sel[] = ($champ_date ? "$champ_date as date" : "'' as date"); |
| 349 | 349 | $sel[] = (isset($desc['field']['id_rubrique']) ? 'id_rubrique' : '0 as id_rubrique'); |
| 350 | 350 | |
| 351 | - $row = sql_fetsel($sel, $table_sql, id_table_objet($objet) . '=' . intval($id)); |
|
| 351 | + $row = sql_fetsel($sel, $table_sql, id_table_objet($objet).'='.intval($id)); |
|
| 352 | 352 | |
| 353 | 353 | $id_rubrique = $row['id_rubrique']; |
| 354 | 354 | $statut_ancien = $statut = $row['statut']; |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | if ($s != 'publie' and autoriser('modifier', $objet, $id)) { |
| 372 | 372 | $statut = $champs['statut'] = $s; |
| 373 | 373 | } else { |
| 374 | - spip_log("editer_objet $objet #$id refus " . json_encode($c, JSON_THROW_ON_ERROR), 'editer' . _LOG_INFO_IMPORTANTE); |
|
| 374 | + spip_log("editer_objet $objet #$id refus ".json_encode($c, JSON_THROW_ON_ERROR), 'editer'._LOG_INFO_IMPORTANTE); |
|
| 375 | 375 | } |
| 376 | 376 | } |
| 377 | 377 | |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | and isset($c['id_parent']) |
| 402 | 402 | and $id_parent = $c['id_parent'] |
| 403 | 403 | and $id_parent != $id_rubrique |
| 404 | - and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique=' . intval($id_parent))) |
|
| 404 | + and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique='.intval($id_parent))) |
|
| 405 | 405 | ) { |
| 406 | 406 | $champs['id_rubrique'] = $id_parent; |
| 407 | 407 | |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | // Si on deplace l'objet |
| 501 | 501 | // changer aussi son secteur et sa langue (si heritee) |
| 502 | 502 | if (isset($champs['id_rubrique'])) { |
| 503 | - $row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique=' . sql_quote($champs['id_rubrique'])); |
|
| 503 | + $row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique='.sql_quote($champs['id_rubrique'])); |
|
| 504 | 504 | $langue = $row_rub['lang']; |
| 505 | 505 | |
| 506 | 506 | if (isset($desc['field']['id_secteur'])) { |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | sql_fetsel( |
| 513 | 513 | '1', |
| 514 | 514 | $table_sql, |
| 515 | - id_table_objet($objet) . '=' . intval($id) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue) |
|
| 515 | + id_table_objet($objet).'='.intval($id)." AND langue_choisie<>'oui' AND lang<>".sql_quote($langue) |
|
| 516 | 516 | ) |
| 517 | 517 | ) { |
| 518 | 518 | $champs['lang'] = $langue; |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | if (!$champs) { |
| 524 | 524 | return; |
| 525 | 525 | } |
| 526 | - sql_updateq($table_sql, $champs, id_table_objet($objet) . '=' . intval($id)); |
|
| 526 | + sql_updateq($table_sql, $champs, id_table_objet($objet).'='.intval($id)); |
|
| 527 | 527 | |
| 528 | 528 | // Changer le statut des rubriques concernees |
| 529 | 529 | if ($cond) { |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | */ |
| 568 | 568 | function objet_lire($objet, $valeur_id, $options = []) { |
| 569 | 569 | if (($t = objet_type($objet)) !== $objet) { |
| 570 | - spip_log("objet_lire: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE); |
|
| 570 | + spip_log("objet_lire: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE); |
|
| 571 | 571 | $objet = $t; |
| 572 | 572 | } |
| 573 | 573 | |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | ) { |
| 590 | 590 | // Il est possible pour un type d'objet de fournir une fonction de lecture de tous les champs d'un objet. |
| 591 | 591 | if ( |
| 592 | - include_spip('action/editer_' . $objet) |
|
| 592 | + include_spip('action/editer_'.$objet) |
|
| 593 | 593 | and function_exists($lire = "{$objet}_lire_champs") |
| 594 | 594 | ) { |
| 595 | 595 | $valeurs = $lire($objet, $valeur_id, $champ_id); |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | |
| 600 | 600 | // La condition est appliquée sur le champ désigné par l'utilisateur. |
| 601 | 601 | $where = [ |
| 602 | - $champ_id . '=' . sql_quote($valeur_id) |
|
| 602 | + $champ_id.'='.sql_quote($valeur_id) |
|
| 603 | 603 | ]; |
| 604 | 604 | |
| 605 | 605 | // Acquisition de tous les champs de l'objet : si l'accès SQL retourne une erreur on renvoie un tableau vide. |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $_id = $e['id_table_objet']; |
| 51 | 51 | if (isset($contexte[$_id]) and $id = intval($contexte[$_id])) { |
| 52 | 52 | $table = $e['table_objet_sql']; |
| 53 | - $row = sql_fetsel('*', $table, "$_id=" . intval($id)); |
|
| 53 | + $row = sql_fetsel('*', $table, "$_id=".intval($id)); |
|
| 54 | 54 | if (isset($row['id_rubrique'])) { |
| 55 | 55 | $contexte['id_rubrique'] = $row['id_rubrique']; |
| 56 | 56 | if (isset($row['id_secteur'])) { |
@@ -114,8 +114,8 @@ discard block |
||
| 114 | 114 | $boutons_admin[$parent]->sousmenu = array_slice($boutons_admin[$parent]->sousmenu, 0, $position) |
| 115 | 115 | + [ |
| 116 | 116 | $id => new Bouton( |
| 117 | - ($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone |
|
| 118 | - $infos['titre'], // titre |
|
| 117 | + ($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone |
|
| 118 | + $infos['titre'], // titre |
|
| 119 | 119 | (isset($infos['action']) and $infos['action']) ? $infos['action'] : null, |
| 120 | 120 | (isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null |
| 121 | 121 | ) |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | $boutons_admin = array_slice($boutons_admin, 0, $position) |
| 133 | 133 | + [ |
| 134 | 134 | $id => new Bouton( |
| 135 | - ($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 136 | - $infos['titre'], // titre |
|
| 135 | + ($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 136 | + $infos['titre'], // titre |
|
| 137 | 137 | (isset($infos['action']) and $infos['action']) ? $infos['action'] : null, |
| 138 | 138 | (isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null |
| 139 | 139 | ) |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $url = str_replace('&', '&', $url); |
| 221 | 221 | while (preg_match(',[&?]([a-z_]+)=@([a-z_]+)@,i', $url, $matches)) { |
| 222 | 222 | if ($matches[2] == 'id_secteur' and !isset($contexte['id_secteur']) and isset($contexte['id_rubrique'])) { |
| 223 | - $contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($contexte['id_rubrique'])); |
|
| 223 | + $contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($contexte['id_rubrique'])); |
|
| 224 | 224 | } |
| 225 | 225 | $val = _request($matches[2], $contexte); |
| 226 | 226 | $url = parametre_url($url, $matches[1], $val ?: '', '&'); |
@@ -40,13 +40,13 @@ discard block |
||
| 40 | 40 | function changer_langue($lang, $liste_langues = null) { |
| 41 | 41 | |
| 42 | 42 | if (is_null($liste_langues)) { |
| 43 | - $liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '') . ',' . ($GLOBALS['meta']['langues_multilingue'] ?? ''); |
|
| 43 | + $liste_langues = ($GLOBALS['meta']['langues_proposees'] ?? '').','.($GLOBALS['meta']['langues_multilingue'] ?? ''); |
|
| 44 | 44 | } else { |
| 45 | 45 | if (is_array($liste_langues)) { |
| 46 | 46 | $liste_langues = implode(',', $liste_langues); |
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | - $liste_langues = ',' . $liste_langues . ','; |
|
| 49 | + $liste_langues = ','.$liste_langues.','; |
|
| 50 | 50 | |
| 51 | 51 | // Si la langue demandee n'existe pas, on essaie d'autres variantes |
| 52 | 52 | // Exemple : 'pt-br' => 'pt_br' => 'pt' |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | } |
| 193 | 193 | foreach ($langues as $l) { |
| 194 | 194 | $selected = ($l == $default) ? ' selected=\'selected\'' : ''; |
| 195 | - $ret .= "<option value='$l'$selected>[" . $l . '] ' . traduire_nom_langue($l) . "</option>\n"; |
|
| 195 | + $ret .= "<option value='$l'$selected>[".$l.'] '.traduire_nom_langue($l)."</option>\n"; |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | if (!test_espace_prive()) { |
@@ -210,23 +210,21 @@ discard block |
||
| 210 | 210 | $base, |
| 211 | 211 | $cible, |
| 212 | 212 | (select_langues($nom_select, $change, $ret) |
| 213 | - . "<noscript><div style='display:inline'><input type='submit' class='fondo' value='" . _T('bouton_changer') . "' /></div></noscript>"), |
|
| 213 | + . "<noscript><div style='display:inline'><input type='submit' class='fondo' value='"._T('bouton_changer')."' /></div></noscript>"), |
|
| 214 | 214 | " method='post'" |
| 215 | 215 | ); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | function select_langues($nom_select, $change, $options, $label = '') { |
| 219 | 219 | static $cpt = 0; |
| 220 | - $id = 'menu_langues' . $cpt++; |
|
| 220 | + $id = 'menu_langues'.$cpt++; |
|
| 221 | 221 | |
| 222 | 222 | return |
| 223 | - "<label for='$id'>" . ($label ?: _T('info_langues')) . '</label> ' . |
|
| 223 | + "<label for='$id'>".($label ?: _T('info_langues')).'</label> '. |
|
| 224 | 224 | "<select name='$nom_select' id='$id' " |
| 225 | 225 | . ((!test_espace_prive()) ? |
| 226 | - ("class='forml menu_langues'") : |
|
| 227 | - (($nom_select == 'var_lang_ecrire') ? |
|
| 228 | - ("class='lang_ecrire'") : |
|
| 229 | - "class='fondl'")) |
|
| 226 | + ("class='forml menu_langues'") : (($nom_select == 'var_lang_ecrire') ? |
|
| 227 | + ("class='lang_ecrire'") : "class='fondl'")) |
|
| 230 | 228 | . $change |
| 231 | 229 | . ">\n" |
| 232 | 230 | . $options |
@@ -352,7 +350,7 @@ discard block |
||
| 352 | 350 | and (!isset($GLOBALS['spip_lang']) |
| 353 | 351 | or $GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site']) |
| 354 | 352 | ) { |
| 355 | - return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues);//@:install |
|
| 353 | + return changer_langue($GLOBALS['meta']['langue_site'], $liste_langues); //@:install |
|
| 356 | 354 | } |
| 357 | 355 | // en theorie là, la globale est définie, sinon c'est un problème. |
| 358 | 356 | if (!isset($GLOBALS['spip_lang'])) { |
@@ -455,7 +453,7 @@ discard block |
||
| 455 | 453 | if (!isset($GLOBALS['meta']['langue_site'])) { |
| 456 | 454 | // Initialisation : le francais si dispo, sinon la premiere langue trouvee |
| 457 | 455 | $GLOBALS['meta']['langue_site'] = $tout = |
| 458 | - (!$all_langs or (strpos(',' . _LANGUE_PAR_DEFAUT . ',', (string) ",$all_langs,") !== false)) |
|
| 456 | + (!$all_langs or (strpos(','._LANGUE_PAR_DEFAUT.',', (string) ",$all_langs,") !== false)) |
|
| 459 | 457 | ? _LANGUE_PAR_DEFAUT : substr($all_langs, 0, strpos($all_langs, ',')); |
| 460 | 458 | ecrire_meta('langue_site', $tout); |
| 461 | 459 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | /** l'adresse du repertoire de telechargement et de decompactage des plugins */ |
| 24 | 24 | if (!defined('_DIR_PLUGINS_AUTO')) { |
| 25 | - define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS . 'auto/'); |
|
| 25 | + define('_DIR_PLUGINS_AUTO', _DIR_PLUGINS.'auto/'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | #include_spip('inc/texte'); // ????? Appelle public/parametrer trop tot avant la reconstruction du chemin des plugins. |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | if ($dir) { |
| 382 | 382 | $dir .= '/'; |
| 383 | 383 | } |
| 384 | - $dir .= 'procure:' . $procure['nom']; |
|
| 384 | + $dir .= 'procure:'.$procure['nom']; |
|
| 385 | 385 | |
| 386 | 386 | $procure['etat'] = '?'; |
| 387 | 387 | $procure['dir_type'] = $resume['dir_type']; |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | $plug = $resume['dir']; |
| 566 | 566 | $k = $infos[$dir_type][$plug]; |
| 567 | 567 | |
| 568 | - $plug = constant($dir_type) . $plug; |
|
| 568 | + $plug = constant($dir_type).$plug; |
|
| 569 | 569 | if (!isset($msg[$p])) { |
| 570 | 570 | if (isset($resume['erreur']) and $resume['erreur']) { |
| 571 | 571 | $msg[$p] = [$resume['erreur']]; |
@@ -608,10 +608,10 @@ discard block |
||
| 608 | 608 | $list = $raw ? [] : $GLOBALS['meta']['plugin_erreur_activation']; |
| 609 | 609 | } elseif (!$raw) { |
| 610 | 610 | foreach ($list as $plug => $msg) { |
| 611 | - $list[$plug] = '<li>' . _T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 612 | - . '<ul><li>' . implode('</li><li>', $msg) . '</li></ul></li>'; |
|
| 611 | + $list[$plug] = '<li>'._T('plugin_impossible_activer', ['plugin' => $plug]) |
|
| 612 | + . '<ul><li>'.implode('</li><li>', $msg).'</li></ul></li>'; |
|
| 613 | 613 | } |
| 614 | - $list = '<ul>' . join("\n", $list) . '</ul>'; |
|
| 614 | + $list = '<ul>'.join("\n", $list).'</ul>'; |
|
| 615 | 615 | } |
| 616 | 616 | if ($raz) { |
| 617 | 617 | effacer_meta('plugin_erreur_activation'); |
@@ -725,13 +725,13 @@ discard block |
||
| 725 | 725 | if ($minimum_inclus and spip_version_compare($version, $minimum, '<')) { |
| 726 | 726 | return _T("plugin_{$balise}_{$type}", [ |
| 727 | 727 | 'plugin' => $nom, |
| 728 | - 'version' => ' ≥ ' . $minimum |
|
| 728 | + 'version' => ' ≥ '.$minimum |
|
| 729 | 729 | ]); |
| 730 | 730 | } |
| 731 | 731 | if (!$minimum_inclus and spip_version_compare($version, $minimum, '<=')) { |
| 732 | 732 | return _T("plugin_{$balise}_{$type}", [ |
| 733 | 733 | 'plugin' => $nom, |
| 734 | - 'version' => ' > ' . $minimum |
|
| 734 | + 'version' => ' > '.$minimum |
|
| 735 | 735 | ]); |
| 736 | 736 | } |
| 737 | 737 | } |
@@ -740,13 +740,13 @@ discard block |
||
| 740 | 740 | if ($maximum_inclus and spip_version_compare($version, $maximum, '>')) { |
| 741 | 741 | return _T("plugin_{$balise}_{$type}", [ |
| 742 | 742 | 'plugin' => $nom, |
| 743 | - 'version' => ' ≤ ' . $maximum |
|
| 743 | + 'version' => ' ≤ '.$maximum |
|
| 744 | 744 | ]); |
| 745 | 745 | } |
| 746 | 746 | if (!$maximum_inclus and spip_version_compare($version, $maximum, '>=')) { |
| 747 | 747 | return _T("plugin_{$balise}_plugin", [ |
| 748 | 748 | 'plugin' => $nom, |
| 749 | - 'version' => ' < ' . $maximum |
|
| 749 | + 'version' => ' < '.$maximum |
|
| 750 | 750 | ]); |
| 751 | 751 | } |
| 752 | 752 | } |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | include_spip('inc/charger_plugin'); |
| 766 | 766 | $url = '<br />' . bouton_telechargement_plugin($url, 'lib'); |
| 767 | 767 | }*/ |
| 768 | - return _T('plugin_necessite_lib', ['lib' => $lib]) . " <a href='$url'>$url</a>"; |
|
| 768 | + return _T('plugin_necessite_lib', ['lib' => $lib])." <a href='$url'>$url</a>"; |
|
| 769 | 769 | } |
| 770 | 770 | |
| 771 | 771 | |
@@ -865,7 +865,7 @@ discard block |
||
| 865 | 865 | foreach ($plugin_valides as $p => $resume) { |
| 866 | 866 | // Les headers ne doivent pas indiquer les versions des extensions PHP, ni la version PHP |
| 867 | 867 | if (0 !== strpos($p, 'PHP:') and $p !== 'PHP') { |
| 868 | - $header[] = $p . ($resume['version'] ? '(' . $resume['version'] . ')' : ''); |
|
| 868 | + $header[] = $p.($resume['version'] ? '('.$resume['version'].')' : ''); |
|
| 869 | 869 | } |
| 870 | 870 | if ($resume['dir']) { |
| 871 | 871 | foreach ($infos[$resume['dir_type']][$resume['dir']]['lib'] as $l) { |
@@ -890,11 +890,11 @@ discard block |
||
| 890 | 890 | $header = strtolower(implode(',', $header)); |
| 891 | 891 | if (!isset($GLOBALS['spip_header_silencieux']) or !$GLOBALS['spip_header_silencieux']) { |
| 892 | 892 | ecrire_fichier( |
| 893 | - _DIR_VAR . 'config.txt', |
|
| 894 | - (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP') . ' ' . $GLOBALS['spip_version_affichee'] . ' @ www.spip.net + ' . $header |
|
| 893 | + _DIR_VAR.'config.txt', |
|
| 894 | + (defined('_HEADER_COMPOSED_BY') ? _HEADER_COMPOSED_BY : 'Composed-By: SPIP').' '.$GLOBALS['spip_version_affichee'].' @ www.spip.net + '.$header |
|
| 895 | 895 | ); |
| 896 | 896 | } else { |
| 897 | - @unlink(_DIR_VAR . 'config.txt'); |
|
| 897 | + @unlink(_DIR_VAR.'config.txt'); |
|
| 898 | 898 | } |
| 899 | 899 | // generer charger_plugins_chemin.php |
| 900 | 900 | plugins_precompile_chemin($plugin_valides, $ordre); |
@@ -948,7 +948,7 @@ discard block |
||
| 948 | 948 | // definir le plugin, donc le path avant l'include du fichier options |
| 949 | 949 | // permet de faire des include_spip pour attraper un inc_ du plugin |
| 950 | 950 | |
| 951 | - $dir = $dir_type . ".'" . $plug . "/'"; |
|
| 951 | + $dir = $dir_type.".'".$plug."/'"; |
|
| 952 | 952 | |
| 953 | 953 | $prefix = strtoupper(preg_replace(',\W,', '_', $info['prefix'])); |
| 954 | 954 | if ( |
@@ -959,7 +959,7 @@ discard block |
||
| 959 | 959 | if (!$info['chemin']) { |
| 960 | 960 | $chemins['public'][] = "_DIR_PLUGIN_$prefix"; |
| 961 | 961 | $chemins['prive'][] = "_DIR_PLUGIN_$prefix"; |
| 962 | - if (is_dir(constant($dir_type) . $plug . '/squelettes/')) { |
|
| 962 | + if (is_dir(constant($dir_type).$plug.'/squelettes/')) { |
|
| 963 | 963 | $chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'"; |
| 964 | 964 | } |
| 965 | 965 | } |
@@ -980,13 +980,13 @@ discard block |
||
| 980 | 980 | $dir = ''; |
| 981 | 981 | } |
| 982 | 982 | if (strlen($dir)) { |
| 983 | - $dir = rtrim($dir, '/') . '/'; |
|
| 983 | + $dir = rtrim($dir, '/').'/'; |
|
| 984 | 984 | } |
| 985 | 985 | if (!isset($chemin['type']) or $chemin['type'] == 'public') { |
| 986 | - $chemins['public'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 986 | + $chemins['public'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 987 | 987 | } |
| 988 | 988 | if (!isset($chemin['type']) or $chemin['type'] == 'prive') { |
| 989 | - $chemins['prive'][] = "_DIR_PLUGIN_$prefix" . (strlen($dir) ? ".'$dir'" : ''); |
|
| 989 | + $chemins['prive'][] = "_DIR_PLUGIN_$prefix".(strlen($dir) ? ".'$dir'" : ''); |
|
| 990 | 990 | } |
| 991 | 991 | } |
| 992 | 992 | } |
@@ -995,11 +995,11 @@ discard block |
||
| 995 | 995 | } |
| 996 | 996 | } |
| 997 | 997 | if (count($chemins['public']) or count($chemins['prive'])) { |
| 998 | - $contenu .= 'if (_DIR_RESTREINT) _chemin([' . implode( |
|
| 998 | + $contenu .= 'if (_DIR_RESTREINT) _chemin(['.implode( |
|
| 999 | 999 | ',', |
| 1000 | 1000 | array_reverse($chemins['public']) |
| 1001 | - ) . "]);\n" |
|
| 1002 | - . 'else _chemin([' . implode(',', array_reverse($chemins['prive'])) . "]);\n"; |
|
| 1001 | + )."]);\n" |
|
| 1002 | + . 'else _chemin(['.implode(',', array_reverse($chemins['prive']))."]);\n"; |
|
| 1003 | 1003 | } |
| 1004 | 1004 | |
| 1005 | 1005 | ecrire_fichier_php(_CACHE_PLUGINS_PATH, $contenu); |
@@ -1048,7 +1048,7 @@ discard block |
||
| 1048 | 1048 | and strpos($dir, ':') === false // exclure le cas des procure: |
| 1049 | 1049 | and file_exists("$dir$plug/paquet.xml") // uniquement pour les paquet.xml |
| 1050 | 1050 | ) { |
| 1051 | - if (is_readable("$dir$plug/" . ($file = $info['prefix'] . '_' . $charge . '.php'))) { |
|
| 1051 | + if (is_readable("$dir$plug/".($file = $info['prefix'].'_'.$charge.'.php'))) { |
|
| 1052 | 1052 | $info[$charge] = [$file]; |
| 1053 | 1053 | } |
| 1054 | 1054 | } |
@@ -1065,7 +1065,7 @@ discard block |
||
| 1065 | 1065 | ) { |
| 1066 | 1066 | unset($info[$charge][$k]); |
| 1067 | 1067 | } else { |
| 1068 | - $_file = $root_dir_type . ".'$plug/$file'"; |
|
| 1068 | + $_file = $root_dir_type.".'$plug/$file'"; |
|
| 1069 | 1069 | $contenu[$charge] .= "include_once_check($_file);\n"; |
| 1070 | 1070 | } |
| 1071 | 1071 | } |
@@ -1075,7 +1075,7 @@ discard block |
||
| 1075 | 1075 | } |
| 1076 | 1076 | } |
| 1077 | 1077 | |
| 1078 | - $contenu['options'] = "define('_PLUGINS_HASH','" . md5($sign) . "');\n" . $contenu['options']; |
|
| 1078 | + $contenu['options'] = "define('_PLUGINS_HASH','".md5($sign)."');\n".$contenu['options']; |
|
| 1079 | 1079 | $contenu['fonctions'] .= plugin_ongletbouton('boutons_plugins', $boutons) |
| 1080 | 1080 | . plugin_ongletbouton('onglets_plugins', $onglets); |
| 1081 | 1081 | |
@@ -1110,12 +1110,12 @@ discard block |
||
| 1110 | 1110 | define("_UPDATED_$nom", $val); |
| 1111 | 1111 | define("_UPDATED_md5_$nom", $md5); |
| 1112 | 1112 | } |
| 1113 | - $val = "unserialize('" . str_replace("'", "\'", $val) . "')"; |
|
| 1113 | + $val = "unserialize('".str_replace("'", "\'", $val)."')"; |
|
| 1114 | 1114 | |
| 1115 | 1115 | return |
| 1116 | 1116 | "if (!function_exists('$nom')) {\n" |
| 1117 | 1117 | . "function $nom(){return defined('_UPDATED_$nom')?unserialize(_UPDATED_$nom):$val;}\n" |
| 1118 | - . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'" . $md5 . "';}\n" |
|
| 1118 | + . "function md5_$nom(){return defined('_UPDATED_md5_$nom')?_UPDATED_md5_$nom:'".$md5."';}\n" |
|
| 1119 | 1119 | . "}\n"; |
| 1120 | 1120 | } |
| 1121 | 1121 | |
@@ -1138,7 +1138,7 @@ discard block |
||
| 1138 | 1138 | if (@is_readable(_CACHE_PLUGINS_OPT)) { |
| 1139 | 1139 | include_once(_CACHE_PLUGINS_OPT); |
| 1140 | 1140 | } else { |
| 1141 | - spip_log('pipelines desactives: impossible de produire ' . _CACHE_PLUGINS_OPT); |
|
| 1141 | + spip_log('pipelines desactives: impossible de produire '._CACHE_PLUGINS_OPT); |
|
| 1142 | 1142 | } |
| 1143 | 1143 | } |
| 1144 | 1144 | |
@@ -1175,7 +1175,7 @@ discard block |
||
| 1175 | 1175 | $dir_type = $plugin_valides[$p]['dir_type']; |
| 1176 | 1176 | $root_dir_type = str_replace('_DIR_', '_ROOT_', $dir_type); |
| 1177 | 1177 | $plug = $plugin_valides[$p]['dir']; |
| 1178 | - $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'] . '_'); |
|
| 1178 | + $prefix = (($info['prefix'] == 'spip') ? '' : $info['prefix'].'_'); |
|
| 1179 | 1179 | if (isset($info['pipeline']) and is_array($info['pipeline'])) { |
| 1180 | 1180 | foreach ($info['pipeline'] as $pipe) { |
| 1181 | 1181 | $nom = $pipe['nom']; |
@@ -1209,7 +1209,7 @@ discard block |
||
| 1209 | 1209 | } |
| 1210 | 1210 | if (isset($pipe['inclure'])) { |
| 1211 | 1211 | $GLOBALS['spip_matrice']["$prefix$action"] = |
| 1212 | - "$root_dir_type:$plug/" . $pipe['inclure']; |
|
| 1212 | + "$root_dir_type:$plug/".$pipe['inclure']; |
|
| 1213 | 1213 | } |
| 1214 | 1214 | } |
| 1215 | 1215 | } |
@@ -1219,7 +1219,7 @@ discard block |
||
| 1219 | 1219 | $prepend_code['taches_generales_cron'] = ''; |
| 1220 | 1220 | } |
| 1221 | 1221 | foreach ($info['genie'] as $genie) { |
| 1222 | - $nom = $prefix . $genie['nom']; |
|
| 1222 | + $nom = $prefix.$genie['nom']; |
|
| 1223 | 1223 | $periode = max(60, intval($genie['periode'])); |
| 1224 | 1224 | if (charger_fonction($nom, 'genie', true)) { |
| 1225 | 1225 | $prepend_code['taches_generales_cron'] .= "\$val['$nom'] = $periode;\n"; |
@@ -1237,13 +1237,13 @@ discard block |
||
| 1237 | 1237 | } |
| 1238 | 1238 | foreach ($info['style'] as $style) { |
| 1239 | 1239 | if (isset($style['path']) and $style['path']) { |
| 1240 | - $code = "if (\$f=timestamp(direction_css(find_in_path('" . addslashes($style['path']) . "')))) "; |
|
| 1240 | + $code = "if (\$f=timestamp(direction_css(find_in_path('".addslashes($style['path'])."')))) "; |
|
| 1241 | 1241 | } else { |
| 1242 | - $code = "if (\$f='" . addslashes($style['url']) . "') "; |
|
| 1242 | + $code = "if (\$f='".addslashes($style['url'])."') "; |
|
| 1243 | 1243 | } |
| 1244 | 1244 | $code .= "\$val .= '<link rel=\"stylesheet\" href=\"'.\$f.'\" type=\"text/css\""; |
| 1245 | 1245 | if (isset($style['media']) and strlen($style['media'])) { |
| 1246 | - $code .= ' media="' . addslashes($style['media']) . '"'; |
|
| 1246 | + $code .= ' media="'.addslashes($style['media']).'"'; |
|
| 1247 | 1247 | } |
| 1248 | 1248 | $code .= "/>';\n"; |
| 1249 | 1249 | if ($style['type'] != 'prive') { |
@@ -1263,9 +1263,9 @@ discard block |
||
| 1263 | 1263 | if (isset($info['script']) and is_countable($info['script']) ? count($info['script']) : 0) { |
| 1264 | 1264 | foreach ($info['script'] as $script) { |
| 1265 | 1265 | if (isset($script['path']) and $script['path']) { |
| 1266 | - $code = "if (\$f=timestamp(find_in_path('" . addslashes($script['path']) . "'))) "; |
|
| 1266 | + $code = "if (\$f=timestamp(find_in_path('".addslashes($script['path'])."'))) "; |
|
| 1267 | 1267 | } else { |
| 1268 | - $code = "if (\$f='" . addslashes($script['url']) . "') "; |
|
| 1268 | + $code = "if (\$f='".addslashes($script['url'])."') "; |
|
| 1269 | 1269 | } |
| 1270 | 1270 | $code .= "\$val .= '<script src=\"'.\$f.'\" type=\"text/javascript\"></script>';\n"; |
| 1271 | 1271 | if ($script['type'] != 'prive') { |
@@ -1328,10 +1328,10 @@ discard block |
||
| 1328 | 1328 | unset($GLOBALS['spip_pipeline']['all']); |
| 1329 | 1329 | $all_pipes = trim(array_shift($a)); |
| 1330 | 1330 | if ($all_pipes) { |
| 1331 | - $all_pipes = '|' . ltrim($all_pipes, '|'); |
|
| 1331 | + $all_pipes = '|'.ltrim($all_pipes, '|'); |
|
| 1332 | 1332 | } |
| 1333 | 1333 | if (count($a)) { |
| 1334 | - $all_pipes_end = '||' . array_shift($a); |
|
| 1334 | + $all_pipes_end = '||'.array_shift($a); |
|
| 1335 | 1335 | } |
| 1336 | 1336 | } |
| 1337 | 1337 | $content = ''; |
@@ -1348,7 +1348,7 @@ discard block |
||
| 1348 | 1348 | // Eclater le pipeline en filtres et appliquer chaque filtre |
| 1349 | 1349 | foreach ($pipe as $fonc) { |
| 1350 | 1350 | $fonc = trim($fonc); |
| 1351 | - $s_call .= '$val = minipipe(\'' . $fonc . '\', $val);' . "\n"; |
|
| 1351 | + $s_call .= '$val = minipipe(\''.$fonc.'\', $val);'."\n"; |
|
| 1352 | 1352 | if (isset($GLOBALS['spip_matrice'][$fonc])) { |
| 1353 | 1353 | $file = $GLOBALS['spip_matrice'][$fonc]; |
| 1354 | 1354 | $file = "'$file'"; |
@@ -1359,7 +1359,7 @@ discard block |
||
| 1359 | 1359 | if (defined($root_dir)) { |
| 1360 | 1360 | $dir = $root_dir; |
| 1361 | 1361 | } |
| 1362 | - $file = str_replace($regs[0], "'." . $dir . ".'", $file); |
|
| 1362 | + $file = str_replace($regs[0], "'.".$dir.".'", $file); |
|
| 1363 | 1363 | $file = str_replace("''.", '', $file); |
| 1364 | 1364 | $file = str_replace(constant($dir), '', $file); |
| 1365 | 1365 | } |
@@ -1372,7 +1372,7 @@ discard block |
||
| 1372 | 1372 | $content .= "// Pipeline $action \n" |
| 1373 | 1373 | . "function execute_pipeline_$action(&\$val){\n" |
| 1374 | 1374 | . $s_inc |
| 1375 | - . ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action]) . "\n" : '') |
|
| 1375 | + . ((isset($prepend_code[$action]) and strlen($prepend_code[$action])) ? trim($prepend_code[$action])."\n" : '') |
|
| 1376 | 1376 | . $s_call |
| 1377 | 1377 | . "return \$val;\n}\n"; |
| 1378 | 1378 | } |
@@ -1428,9 +1428,9 @@ discard block |
||
| 1428 | 1428 | $result = ($ok ? ((isset($infos['upgrade']) && $infos['upgrade']) ? _T('plugin_info_upgrade_ok') : _T('plugin_info_install_ok')) : _T('avis_operation_echec')); |
| 1429 | 1429 | if (_IS_CLI) { |
| 1430 | 1430 | include_spip('inc/filtres'); |
| 1431 | - $trace = ltrim(textebrut($trace) . "\n" . $result); |
|
| 1432 | - $trace = ' ' . str_replace("\n", "\n ", $trace); |
|
| 1433 | - echo "\n" . ($ok ? 'OK ' : '/!\ ') . textebrut($titre) . "\n", |
|
| 1431 | + $trace = ltrim(textebrut($trace)."\n".$result); |
|
| 1432 | + $trace = ' '.str_replace("\n", "\n ", $trace); |
|
| 1433 | + echo "\n".($ok ? 'OK ' : '/!\ ').textebrut($titre)."\n", |
|
| 1434 | 1434 | $trace, |
| 1435 | 1435 | "\n"; |
| 1436 | 1436 | } |
@@ -1465,15 +1465,15 @@ discard block |
||
| 1465 | 1465 | $GLOBALS['fichier_php_compile_recent'] = 0; |
| 1466 | 1466 | } |
| 1467 | 1467 | |
| 1468 | - $contenu = '<' . '?php' . "\n" . $comment . "\nif (defined('_ECRIRE_INC_VERSION')) {\n" . $contenu . "}\n?" . '>'; |
|
| 1468 | + $contenu = '<'.'?php'."\n".$comment."\nif (defined('_ECRIRE_INC_VERSION')) {\n".$contenu."}\n?".'>'; |
|
| 1469 | 1469 | // si un fichier existe deja on verifie que son contenu change avant de l'ecraser |
| 1470 | 1470 | // si pas de modif on ne touche pas au fichier initial |
| 1471 | 1471 | if (file_exists($nom)) { |
| 1472 | 1472 | if (substr($nom, -4) == '.php') { |
| 1473 | - $fichier_tmp = substr($nom, 0, -4) . '.tmp.php'; |
|
| 1473 | + $fichier_tmp = substr($nom, 0, -4).'.tmp.php'; |
|
| 1474 | 1474 | } |
| 1475 | 1475 | else { |
| 1476 | - $fichier_tmp = $nom . '.tmp'; |
|
| 1476 | + $fichier_tmp = $nom.'.tmp'; |
|
| 1477 | 1477 | } |
| 1478 | 1478 | file_put_contents($fichier_tmp, $contenu); |
| 1479 | 1479 | if (md5_file($nom) == md5_file($fichier_tmp)) { |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | $blue = dechex($blue); |
| 44 | 44 | |
| 45 | 45 | if (strlen($red) == 1) { |
| 46 | - $red = '0' . $red; |
|
| 46 | + $red = '0'.$red; |
|
| 47 | 47 | } |
| 48 | 48 | if (strlen($green) == 1) { |
| 49 | - $green = '0' . $green; |
|
| 49 | + $green = '0'.$green; |
|
| 50 | 50 | } |
| 51 | 51 | if (strlen($blue) == 1) { |
| 52 | - $blue = '0' . $blue; |
|
| 52 | + $blue = '0'.$blue; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | return "$red$green$blue"; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $couleur = couleur_html_to_hex($couleur); |
| 68 | 68 | $couleur = ltrim($couleur, '#'); |
| 69 | 69 | if (strlen($couleur) === 3) { |
| 70 | - $couleur = $couleur[0] . $couleur[0] . $couleur[1] . $couleur[1] . $couleur[2] . $couleur[2]; |
|
| 70 | + $couleur = $couleur[0].$couleur[0].$couleur[1].$couleur[1].$couleur[2].$couleur[2]; |
|
| 71 | 71 | } |
| 72 | 72 | $retour = []; |
| 73 | 73 | $retour['red'] = hexdec(substr($couleur, 0, 2)); |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | $var_G = ($G / 255); |
| 126 | 126 | $var_B = ($B / 255); |
| 127 | 127 | |
| 128 | - $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 129 | - $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 130 | - $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 128 | + $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 129 | + $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 130 | + $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 131 | 131 | |
| 132 | 132 | $L = ($var_Max + $var_Min) / 2; |
| 133 | 133 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | function _couleur_hsl_to_rgb($H, $S, $L) { |
| 191 | 191 | // helper |
| 192 | - $hue_2_rgb = function ($v1, $v2, $vH) { |
|
| 192 | + $hue_2_rgb = function($v1, $v2, $vH) { |
|
| 193 | 193 | if ($vH < 0) { |
| 194 | 194 | $vH += 1; |
| 195 | 195 | } |
@@ -321,11 +321,11 @@ discard block |
||
| 321 | 321 | $img = "<img src='$source' />"; |
| 322 | 322 | } elseif ( |
| 323 | 323 | preg_match('@^data:image/([^;]*);base64,(.*)$@isS', $source, $regs) |
| 324 | - and $extension = _image_trouver_extension_depuis_mime('image/' . $regs[1]) |
|
| 324 | + and $extension = _image_trouver_extension_depuis_mime('image/'.$regs[1]) |
|
| 325 | 325 | and in_array($extension, _image_extensions_acceptees_en_entree()) |
| 326 | 326 | ) { |
| 327 | 327 | # gerer img src="data:....base64" |
| 328 | - $local = sous_repertoire(_DIR_VAR, 'image-data') . md5($regs[2]) . '.' . _image_extension_normalisee($extension); |
|
| 328 | + $local = sous_repertoire(_DIR_VAR, 'image-data').md5($regs[2]).'.'._image_extension_normalisee($extension); |
|
| 329 | 329 | if (!file_exists($local)) { |
| 330 | 330 | ecrire_fichier($local, base64_decode($regs[2])); |
| 331 | 331 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | // les protocoles web prennent au moins 3 lettres |
| 343 | 343 | if (tester_url_absolue($source)) { |
| 344 | 344 | include_spip('inc/distant'); |
| 345 | - $fichier = _DIR_RACINE . copie_locale($source); |
|
| 345 | + $fichier = _DIR_RACINE.copie_locale($source); |
|
| 346 | 346 | if (!$fichier) { |
| 347 | 347 | return ''; |
| 348 | 348 | } |
@@ -440,9 +440,9 @@ discard block |
||
| 440 | 440 | // on garde la terminaison initiale car image simplement copiee |
| 441 | 441 | // et on postfixe son nom avec un md5 du path |
| 442 | 442 | $terminaison_dest = $terminaison; |
| 443 | - $fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5); |
|
| 443 | + $fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5); |
|
| 444 | 444 | } else { |
| 445 | - $fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5); |
|
| 445 | + $fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5); |
|
| 446 | 446 | } |
| 447 | 447 | $cache = sous_repertoire(_DIR_VAR, $cache); |
| 448 | 448 | $cache = sous_repertoire($cache, $effet); |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | $fichier_dest = substr($fichier_dest, 2); |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | - $fichier_dest = $cache . $fichier_dest . '.' . $terminaison_dest; |
|
| 456 | + $fichier_dest = $cache.$fichier_dest.'.'.$terminaison_dest; |
|
| 457 | 457 | |
| 458 | 458 | $GLOBALS['images_calculees'][] = $fichier_dest; |
| 459 | 459 | |
@@ -491,15 +491,15 @@ discard block |
||
| 491 | 491 | |
| 492 | 492 | if ($creer) { |
| 493 | 493 | spip_log( |
| 494 | - 'filtre image ' . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier", |
|
| 495 | - 'images' . _LOG_DEBUG |
|
| 494 | + 'filtre image '.($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier", |
|
| 495 | + 'images'._LOG_DEBUG |
|
| 496 | 496 | ); |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | $term_fonction = _image_trouver_extension_pertinente($fichier); |
| 500 | - $ret['fonction_imagecreatefrom'] = '_imagecreatefrom' . $term_fonction; |
|
| 500 | + $ret['fonction_imagecreatefrom'] = '_imagecreatefrom'.$term_fonction; |
|
| 501 | 501 | $ret['fichier'] = $fichier; |
| 502 | - $ret['fonction_image'] = '_image_image' . $terminaison_dest; |
|
| 502 | + $ret['fonction_image'] = '_image_image'.$terminaison_dest; |
|
| 503 | 503 | $ret['fichier_dest'] = $fichier_dest; |
| 504 | 504 | $ret['format_source'] = _image_extension_normalisee($terminaison); |
| 505 | 505 | $ret['format_dest'] = $terminaison_dest; |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | |
| 650 | 650 | $_terminaison = _image_trouver_extension_depuis_mime($mime); |
| 651 | 651 | if ($_terminaison and $_terminaison !== $terminaison) { |
| 652 | - spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.' . _LOG_INFO_IMPORTANTE); |
|
| 652 | + spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.'._LOG_INFO_IMPORTANTE); |
|
| 653 | 653 | $terminaison = $_terminaison; |
| 654 | 654 | } |
| 655 | 655 | return $terminaison; |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | if (!function_exists('imagepng')) { |
| 807 | 807 | return false; |
| 808 | 808 | } |
| 809 | - $tmp = $fichier . '.tmp'; |
|
| 809 | + $tmp = $fichier.'.tmp'; |
|
| 810 | 810 | $ret = imagepng($img, $tmp); |
| 811 | 811 | if (file_exists($tmp)) { |
| 812 | 812 | $taille_test = getimagesize($tmp); |
@@ -841,7 +841,7 @@ discard block |
||
| 841 | 841 | if (!function_exists('imagegif')) { |
| 842 | 842 | return false; |
| 843 | 843 | } |
| 844 | - $tmp = $fichier . '.tmp'; |
|
| 844 | + $tmp = $fichier.'.tmp'; |
|
| 845 | 845 | $ret = imagegif($img, $tmp); |
| 846 | 846 | if (file_exists($tmp)) { |
| 847 | 847 | $taille_test = getimagesize($tmp); |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | if (!function_exists('imagejpeg')) { |
| 882 | 882 | return false; |
| 883 | 883 | } |
| 884 | - $tmp = $fichier . '.tmp'; |
|
| 884 | + $tmp = $fichier.'.tmp'; |
|
| 885 | 885 | |
| 886 | 886 | // Enable interlancing |
| 887 | 887 | imageinterlace($img, true); |
@@ -942,7 +942,7 @@ discard block |
||
| 942 | 942 | if (!function_exists('imagewebp')) { |
| 943 | 943 | return false; |
| 944 | 944 | } |
| 945 | - $tmp = $fichier . '.tmp'; |
|
| 945 | + $tmp = $fichier.'.tmp'; |
|
| 946 | 946 | $ret = imagewebp($img, $tmp, $qualite); |
| 947 | 947 | if (file_exists($tmp)) { |
| 948 | 948 | $taille_test = getimagesize($tmp); |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | */ |
| 977 | 977 | function _image_imagesvg($img, $fichier) { |
| 978 | 978 | |
| 979 | - $tmp = $fichier . '.tmp'; |
|
| 979 | + $tmp = $fichier.'.tmp'; |
|
| 980 | 980 | if (strpos($img, '<') === false) { |
| 981 | 981 | $img = supprimer_timestamp($img); |
| 982 | 982 | if (!file_exists($img)) { |
@@ -1033,13 +1033,13 @@ discard block |
||
| 1033 | 1033 | */ |
| 1034 | 1034 | function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) { |
| 1035 | 1035 | if (is_null($fonction)) { |
| 1036 | - $fonction = '_image_image' . $valeurs['format_dest']; |
|
| 1036 | + $fonction = '_image_image'.$valeurs['format_dest']; |
|
| 1037 | 1037 | } |
| 1038 | 1038 | $ret = false; |
| 1039 | 1039 | #un flag pour reperer les images gravees |
| 1040 | 1040 | $lock = ( |
| 1041 | 1041 | !statut_effacer_images_temporaires('get') // si la fonction n'a pas ete activee, on grave tout |
| 1042 | - or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'] . '.src')) |
|
| 1042 | + or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'].'.src')) |
|
| 1043 | 1043 | ); |
| 1044 | 1044 | if ( |
| 1045 | 1045 | function_exists($fonction) |
@@ -1051,7 +1051,7 @@ discard block |
||
| 1051 | 1051 | // dans tous les cas mettre a jour la taille de l'image finale |
| 1052 | 1052 | [$valeurs['hauteur_dest'], $valeurs['largeur_dest']] = taille_image($valeurs['fichier_dest']); |
| 1053 | 1053 | $valeurs['date'] = @filemtime($valeurs['fichier_dest']); // pour la retrouver apres disparition |
| 1054 | - ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true); |
|
| 1054 | + ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true); |
|
| 1055 | 1055 | } |
| 1056 | 1056 | } |
| 1057 | 1057 | |
@@ -1226,7 +1226,7 @@ discard block |
||
| 1226 | 1226 | |
| 1227 | 1227 | // attributs deprecies. Transformer en CSS |
| 1228 | 1228 | if ($espace = extraire_attribut($tag, 'hspace')) { |
| 1229 | - $style = "margin:{$espace}px;" . $style; |
|
| 1229 | + $style = "margin:{$espace}px;".$style; |
|
| 1230 | 1230 | $tag = inserer_attribut($tag, 'hspace', ''); |
| 1231 | 1231 | } |
| 1232 | 1232 | |
@@ -1353,7 +1353,7 @@ discard block |
||
| 1353 | 1353 | $image = $valeurs['fichier']; |
| 1354 | 1354 | $format = $valeurs['format_source']; |
| 1355 | 1355 | $destdir = dirname($valeurs['fichier_dest']); |
| 1356 | - $destfile = basename($valeurs['fichier_dest'], '.' . $valeurs['format_dest']); |
|
| 1356 | + $destfile = basename($valeurs['fichier_dest'], '.'.$valeurs['format_dest']); |
|
| 1357 | 1357 | |
| 1358 | 1358 | $format_sortie = $valeurs['format_dest']; |
| 1359 | 1359 | |
@@ -1385,14 +1385,14 @@ discard block |
||
| 1385 | 1385 | |
| 1386 | 1386 | // Si l'image est de la taille demandee (ou plus petite), simplement la retourner |
| 1387 | 1387 | if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) { |
| 1388 | - $vignette = $destination . '.' . $format; |
|
| 1388 | + $vignette = $destination.'.'.$format; |
|
| 1389 | 1389 | @copy($image, $vignette); |
| 1390 | 1390 | } |
| 1391 | 1391 | |
| 1392 | 1392 | elseif ($valeurs['format_source'] === 'svg') { |
| 1393 | 1393 | if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) { |
| 1394 | 1394 | $format_sortie = 'svg'; |
| 1395 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1395 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1396 | 1396 | $valeurs['fichier_dest'] = $vignette; |
| 1397 | 1397 | _image_gd_output($svg, $valeurs); |
| 1398 | 1398 | } |
@@ -1404,9 +1404,9 @@ discard block |
||
| 1404 | 1404 | define('_CONVERT_COMMAND', 'convert'); |
| 1405 | 1405 | } // Securite : mes_options.php peut preciser le chemin absolu |
| 1406 | 1406 | if (!defined('_RESIZE_COMMAND')) { |
| 1407 | - define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -resize %xx%y! %src %dest'); |
|
| 1407 | + define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -resize %xx%y! %src %dest'); |
|
| 1408 | 1408 | } |
| 1409 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1409 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1410 | 1410 | $commande = str_replace( |
| 1411 | 1411 | ['%x', '%y', '%src', '%dest'], |
| 1412 | 1412 | [ |
@@ -1422,7 +1422,7 @@ discard block |
||
| 1422 | 1422 | if (!@file_exists($vignette)) { |
| 1423 | 1423 | spip_log("echec convert sur $vignette"); |
| 1424 | 1424 | |
| 1425 | - return; // echec commande |
|
| 1425 | + return; // echec commande |
|
| 1426 | 1426 | } |
| 1427 | 1427 | } |
| 1428 | 1428 | |
@@ -1439,7 +1439,7 @@ discard block |
||
| 1439 | 1439 | if (!$output) { |
| 1440 | 1440 | return; |
| 1441 | 1441 | } |
| 1442 | - $vignette = $output . DIRECTORY_SEPARATOR . basename($destination) . '.' . $format_sortie; |
|
| 1442 | + $vignette = $output.DIRECTORY_SEPARATOR.basename($destination).'.'.$format_sortie; |
|
| 1443 | 1443 | |
| 1444 | 1444 | $imagick = new Imagick(); |
| 1445 | 1445 | $imagick->readImage(realpath($image)); |
@@ -1448,7 +1448,7 @@ discard block |
||
| 1448 | 1448 | $destHeight, |
| 1449 | 1449 | Imagick::FILTER_LANCZOS, |
| 1450 | 1450 | 1 |
| 1451 | - );//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1451 | + ); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1452 | 1452 | $imagick->writeImage($vignette); |
| 1453 | 1453 | |
| 1454 | 1454 | if (!@file_exists($vignette)) { |
@@ -1457,7 +1457,7 @@ discard block |
||
| 1457 | 1457 | return; |
| 1458 | 1458 | } |
| 1459 | 1459 | // remettre le chemin relatif car c'est ce qu'attend SPIP pour la suite (en particlier action/tester) |
| 1460 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1460 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1461 | 1461 | } |
| 1462 | 1462 | |
| 1463 | 1463 | // netpbm |
@@ -1468,11 +1468,11 @@ discard block |
||
| 1468 | 1468 | if (_PNMSCALE_COMMAND == '') { |
| 1469 | 1469 | return; |
| 1470 | 1470 | } |
| 1471 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1471 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1472 | 1472 | $pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND); |
| 1473 | 1473 | if ($format == 'jpg') { |
| 1474 | 1474 | $jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _PNMSCALE_COMMAND); |
| 1475 | - exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1475 | + exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1476 | 1476 | if (!($s = @filesize($vignette))) { |
| 1477 | 1477 | spip_unlink($vignette); |
| 1478 | 1478 | } |
@@ -1484,7 +1484,7 @@ discard block |
||
| 1484 | 1484 | } else { |
| 1485 | 1485 | if ($format == 'gif') { |
| 1486 | 1486 | $giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND); |
| 1487 | - exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1487 | + exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1488 | 1488 | if (!($s = @filesize($vignette))) { |
| 1489 | 1489 | spip_unlink($vignette); |
| 1490 | 1490 | } |
@@ -1496,7 +1496,7 @@ discard block |
||
| 1496 | 1496 | } else { |
| 1497 | 1497 | if ($format == 'png') { |
| 1498 | 1498 | $pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND); |
| 1499 | - exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1499 | + exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1500 | 1500 | if (!($s = @filesize($vignette))) { |
| 1501 | 1501 | spip_unlink($vignette); |
| 1502 | 1502 | } |
@@ -1518,7 +1518,7 @@ discard block |
||
| 1518 | 1518 | return; |
| 1519 | 1519 | } |
| 1520 | 1520 | if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) { |
| 1521 | - spip_log('vignette gd1/gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels'); |
|
| 1521 | + spip_log('vignette gd1/gd2 impossible : '.$srcWidth * $srcHeight.'pixels'); |
|
| 1522 | 1522 | |
| 1523 | 1523 | return; |
| 1524 | 1524 | } |
@@ -1828,7 +1828,7 @@ discard block |
||
| 1828 | 1828 | // de l'image, de facon a tromper le cache du navigateur |
| 1829 | 1829 | // quand on fait supprimer/reuploader un logo |
| 1830 | 1830 | // (pas de filemtime si SAFE MODE) |
| 1831 | - $date = test_espace_prive() ? ('?' . $date) : ''; |
|
| 1831 | + $date = test_espace_prive() ? ('?'.$date) : ''; |
|
| 1832 | 1832 | |
| 1833 | 1833 | return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]); |
| 1834 | 1834 | } |
@@ -1874,7 +1874,7 @@ discard block |
||
| 1874 | 1874 | public static function LittleEndian2String($number, $minbytes = 1) { |
| 1875 | 1875 | $intstring = ''; |
| 1876 | 1876 | while ($number > 0) { |
| 1877 | - $intstring = $intstring . chr($number & 255); |
|
| 1877 | + $intstring = $intstring.chr($number & 255); |
|
| 1878 | 1878 | $number >>= 8; |
| 1879 | 1879 | } |
| 1880 | 1880 | |
@@ -1906,9 +1906,9 @@ discard block |
||
| 1906 | 1906 | $b = $argb['blue']; |
| 1907 | 1907 | |
| 1908 | 1908 | if ($bpp[$key] == 32) { |
| 1909 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a); |
|
| 1909 | + $icXOR[$key] .= chr($b).chr($g).chr($r).chr($a); |
|
| 1910 | 1910 | } elseif ($bpp[$key] == 24) { |
| 1911 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r); |
|
| 1911 | + $icXOR[$key] .= chr($b).chr($g).chr($r); |
|
| 1912 | 1912 | } |
| 1913 | 1913 | |
| 1914 | 1914 | if ($a < 128) { |
@@ -1935,48 +1935,48 @@ discard block |
||
| 1935 | 1935 | |
| 1936 | 1936 | // BITMAPINFOHEADER - 40 bytes |
| 1937 | 1937 | $BitmapInfoHeader[$key] = ''; |
| 1938 | - $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1939 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1938 | + $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1939 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1940 | 1940 | // The biHeight member specifies the combined |
| 1941 | 1941 | // height of the XOR and AND masks. |
| 1942 | 1942 | $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG biHeight; |
| 1943 | - $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1944 | - $BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00"; // wBitCount; |
|
| 1945 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1946 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1947 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1948 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1949 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1950 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1943 | + $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1944 | + $BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount; |
|
| 1945 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1946 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1947 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1948 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1949 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1950 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1951 | 1951 | } |
| 1952 | 1952 | |
| 1953 | 1953 | |
| 1954 | - $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1955 | - $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1956 | - $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1954 | + $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1955 | + $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1956 | + $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1957 | 1957 | |
| 1958 | 1958 | $dwImageOffset = 6 + (count($gd_image_array) * 16); |
| 1959 | 1959 | foreach ($gd_image_array as $key => $gd_image) { |
| 1960 | 1960 | // ICONDIRENTRY idEntries[1]; // An entry for each image (idCount of 'em) |
| 1961 | 1961 | |
| 1962 | - $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1963 | - $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1964 | - $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1965 | - $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1962 | + $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1963 | + $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1964 | + $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1965 | + $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1966 | 1966 | |
| 1967 | - $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1968 | - $icondata .= chr($bpp[$key]) . "\x00"; // wBitCount; // Bits per pixel |
|
| 1967 | + $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1968 | + $icondata .= chr($bpp[$key])."\x00"; // wBitCount; // Bits per pixel |
|
| 1969 | 1969 | |
| 1970 | 1970 | $dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]); |
| 1971 | 1971 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1972 | 1972 | $dwBytesInRes, |
| 1973 | 1973 | 4 |
| 1974 | - ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1974 | + ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1975 | 1975 | |
| 1976 | 1976 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1977 | 1977 | $dwImageOffset, |
| 1978 | 1978 | 4 |
| 1979 | - ); // dwImageOffset; // Where in the file is this image? |
|
| 1979 | + ); // dwImageOffset; // Where in the file is this image? |
|
| 1980 | 1980 | $dwImageOffset += strlen($BitmapInfoHeader[$key]); |
| 1981 | 1981 | $dwImageOffset += strlen($icXOR[$key]); |
| 1982 | 1982 | $dwImageOffset += strlen($icAND[$key]); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | static $dirs = []; |
| 42 | 42 | $liste = []; |
| 43 | 43 | foreach (creer_chemin() as $dir) { |
| 44 | - if (!isset($dirs[$a = $dir . $dirname])) { |
|
| 44 | + if (!isset($dirs[$a = $dir.$dirname])) { |
|
| 45 | 45 | $dirs[$a] = (is_dir($a) || !$a); |
| 46 | 46 | } |
| 47 | 47 | if ($dirs[$a]) { |
@@ -67,21 +67,21 @@ discard block |
||
| 67 | 67 | **/ |
| 68 | 68 | function chercher_module_lang($module, $lang = '') { |
| 69 | 69 | if ($lang) { |
| 70 | - $lang = '_' . $lang; |
|
| 70 | + $lang = '_'.$lang; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // 1) dans un repertoire nomme lang/ se trouvant sur le chemin |
| 74 | 74 | if ( |
| 75 | 75 | $f = ($module == 'local' |
| 76 | - ? find_in_path($module . $lang . '.php', 'lang/') |
|
| 77 | - : find_langs_in_path($module . $lang . '.php', 'lang/')) |
|
| 76 | + ? find_in_path($module.$lang.'.php', 'lang/') |
|
| 77 | + : find_langs_in_path($module.$lang.'.php', 'lang/')) |
|
| 78 | 78 | ) { |
| 79 | 79 | return is_array($f) ? $f : [$f]; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | // 2) directement dans le chemin (old style, uniquement pour local) |
| 83 | 83 | return (($module == 'local') or strpos($module, '/')) |
| 84 | - ? (($f = find_in_path($module . $lang . '.php')) ? [$f] : false) |
|
| 84 | + ? (($f = find_in_path($module.$lang.'.php')) ? [$f] : false) |
|
| 85 | 85 | : false; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | **/ |
| 106 | 106 | function charger_langue($lang, $module = 'spip') { |
| 107 | 107 | static $langs = []; |
| 108 | - $var = 'i18n_' . $module . '_' . $lang; |
|
| 108 | + $var = 'i18n_'.$module.'_'.$lang; |
|
| 109 | 109 | if (!isset($langs[$lang])) { |
| 110 | 110 | $langs[$lang] = []; |
| 111 | 111 | if ($lang) { |
@@ -120,13 +120,13 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | foreach ($langs[$lang] as $l) { |
| 122 | 122 | if ($fichiers_lang = chercher_module_lang($module, $l)) { |
| 123 | - $GLOBALS['idx_lang'] = 'i18n_' . $module . '_' . $l; |
|
| 123 | + $GLOBALS['idx_lang'] = 'i18n_'.$module.'_'.$l; |
|
| 124 | 124 | $GLOBALS[$GLOBALS['idx_lang']] = lire_fichier_langue(array_shift($fichiers_lang)); |
| 125 | 125 | surcharger_langue($fichiers_lang); |
| 126 | 126 | if ($l !== $lang) { |
| 127 | - $GLOBALS[$var] = &$GLOBALS['i18n_' . $module . '_' . $l]; |
|
| 127 | + $GLOBALS[$var] = &$GLOBALS['i18n_'.$module.'_'.$l]; |
|
| 128 | 128 | } |
| 129 | - $GLOBALS['lang_' . $var] = $l; |
|
| 129 | + $GLOBALS['lang_'.$var] = $l; |
|
| 130 | 130 | #spip_log("module de langue : {$module}_$l.php", 'traduire'); |
| 131 | 131 | break; |
| 132 | 132 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | function lire_fichier_langue(string $fichier): array { |
| 146 | 146 | $idx_lang_before = $GLOBALS['idx_lang'] ?? null; |
| 147 | - $idx_lang_tmp = ($GLOBALS['idx_lang'] ?? 'lang') . '@temporaire'; |
|
| 147 | + $idx_lang_tmp = ($GLOBALS['idx_lang'] ?? 'lang').'@temporaire'; |
|
| 148 | 148 | $GLOBALS['idx_lang'] = $idx_lang_tmp; |
| 149 | 149 | $idx_lang = include $fichier; |
| 150 | 150 | $GLOBALS['idx_lang'] = $idx_lang_before; |
@@ -273,27 +273,27 @@ discard block |
||
| 273 | 273 | } else { |
| 274 | 274 | $modules = ['spip', 'ecrire']; |
| 275 | 275 | $code = $ori; |
| 276 | - $ori_complet = implode('|', $modules) . ':' . $ori; |
|
| 276 | + $ori_complet = implode('|', $modules).':'.$ori; |
|
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | $desc = new SPIP_Traductions_Description(); |
| 280 | 280 | |
| 281 | 281 | // parcourir tous les modules jusqu'a ce qu'on trouve |
| 282 | 282 | foreach ($modules as $module) { |
| 283 | - $var = 'i18n_' . $module . '_' . $lang; |
|
| 283 | + $var = 'i18n_'.$module.'_'.$lang; |
|
| 284 | 284 | |
| 285 | 285 | if (empty($GLOBALS[$var])) { |
| 286 | 286 | charger_langue($lang, $module); |
| 287 | 287 | // surcharges persos -- on cherche |
| 288 | 288 | // (lang/)local_xx.php et/ou (lang/)local.php ... |
| 289 | - if (!isset($local['local_' . $lang])) { |
|
| 289 | + if (!isset($local['local_'.$lang])) { |
|
| 290 | 290 | // redéfinir la langue en cours pour les surcharges (chercher_langue a pu le changer) |
| 291 | 291 | $GLOBALS['idx_lang'] = $var; |
| 292 | 292 | // ... (lang/)local_xx.php |
| 293 | - $local['local_' . $lang] = chercher_module_lang('local', $lang); |
|
| 293 | + $local['local_'.$lang] = chercher_module_lang('local', $lang); |
|
| 294 | 294 | } |
| 295 | - if ($local['local_' . $lang]) { |
|
| 296 | - surcharger_langue($local['local_' . $lang]); |
|
| 295 | + if ($local['local_'.$lang]) { |
|
| 296 | + surcharger_langue($local['local_'.$lang]); |
|
| 297 | 297 | } |
| 298 | 298 | // ... puis (lang/)local.php |
| 299 | 299 | if (!isset($local['local'])) { |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | if (isset($GLOBALS[$var][$code])) { |
| 308 | 308 | $desc->code = $code; |
| 309 | 309 | $desc->module = $module; |
| 310 | - $desc->langue = $GLOBALS['lang_' . $var] ?? $lang; |
|
| 310 | + $desc->langue = $GLOBALS['lang_'.$var] ?? $lang; |
|
| 311 | 311 | $desc->texte = $GLOBALS[$var][$code]; |
| 312 | 312 | break; |
| 313 | 313 | } |
@@ -365,13 +365,13 @@ discard block |
||
| 365 | 365 | if (!$desc->mode and $desc->texte) { |
| 366 | 366 | // ne pas modifier 2 fois l'affichage |
| 367 | 367 | $desc->mode = 'traduction'; |
| 368 | - $classe = 'debug-traduction' . ($desc->module == 'ecrire' ? '-prive' : ''); |
|
| 368 | + $classe = 'debug-traduction'.($desc->module == 'ecrire' ? '-prive' : ''); |
|
| 369 | 369 | $desc->texte = '<span ' |
| 370 | - . 'lang=' . $desc->langue |
|
| 371 | - . ' class=' . $classe |
|
| 372 | - . ' data-module=' . $desc->module |
|
| 373 | - . ' data-code=' . $desc->code |
|
| 374 | - . ' title=' . $modules . '(' . $desc->langue . ')>' |
|
| 370 | + . 'lang='.$desc->langue |
|
| 371 | + . ' class='.$classe |
|
| 372 | + . ' data-module='.$desc->module |
|
| 373 | + . ' data-code='.$desc->code |
|
| 374 | + . ' title='.$modules.'('.$desc->langue.')>' |
|
| 375 | 375 | . $desc->texte |
| 376 | 376 | . '</span>'; |
| 377 | 377 | $desc->texte = str_replace( |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | : calculer_liste($val, $p->descr, $boucles, $id_boucle); |
| 121 | 121 | if ($var !== 1) { |
| 122 | 122 | $val = ($echap ? "\'$var\' => ' . argumenter_squelette(" : "'$var' => ") |
| 123 | - . $val . ($echap ? ") . '" : ' '); |
|
| 123 | + . $val.($echap ? ") . '" : ' '); |
|
| 124 | 124 | } else { |
| 125 | 125 | $val = $echap ? "'.$val.'" : $val; |
| 126 | 126 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | if (!$lang) { |
| 142 | 142 | $lang = '$GLOBALS["spip_lang"]'; |
| 143 | 143 | } |
| 144 | - $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ") . $lang . ($echap ? ") . '" : ' '); |
|
| 144 | + $l['lang'] = ($echap ? "\'lang\' => ' . argumenter_squelette(" : "'lang' => ").$lang.($echap ? ") . '" : ' '); |
|
| 145 | 145 | |
| 146 | 146 | return $l; |
| 147 | 147 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $_contexte = argumenter_inclure($p->param, false, $p, $boucles, $id_boucle, true, '', true); |
| 172 | 172 | if (is_string($p->texte)) { |
| 173 | 173 | $fichier = $p->texte; |
| 174 | - $code = '"' . str_replace('"', '\"', $fichier) . '"'; |
|
| 174 | + $code = '"'.str_replace('"', '\"', $fichier).'"'; |
|
| 175 | 175 | } else { |
| 176 | 176 | $code = calculer_liste($p->texte, $p->descr, $boucles, $id_boucle); |
| 177 | 177 | if ($code and preg_match("/^'([^']*)'/s", $code, $r)) { |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | return false; |
| 221 | 221 | } // j'aurais voulu toucher le fond ... |
| 222 | 222 | |
| 223 | - $contexte = 'array(' . $_contexte . ')'; |
|
| 223 | + $contexte = 'array('.$_contexte.')'; |
|
| 224 | 224 | |
| 225 | 225 | if ($env) { |
| 226 | 226 | $contexte = "array_merge('.var_export(\$Pile[0],1).',$contexte)"; |
@@ -235,16 +235,16 @@ discard block |
||
| 235 | 235 | $_options[] = $ajax; |
| 236 | 236 | } |
| 237 | 237 | $code = " ' . argumenter_squelette($code) . '"; |
| 238 | - $code = 'echo ' . sprintf( |
|
| 238 | + $code = 'echo '.sprintf( |
|
| 239 | 239 | CODE_RECUPERER_FOND, |
| 240 | 240 | $code, |
| 241 | 241 | $contexte, |
| 242 | 242 | implode(',', $_options), |
| 243 | 243 | "_request(\\'connect\\') ?? \\'\\'" |
| 244 | - ) . ';'; |
|
| 244 | + ).';'; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - return "\n'<'.'" . '?php ' . $code . "\n?'." . "'>'"; |
|
| 247 | + return "\n'<'.'".'?php '.$code."\n?'."."'>'"; |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | $id = $id_table; |
| 325 | 325 | $statut = preg_replace(',\W,', '', $s['champ']); // securite |
| 326 | 326 | } |
| 327 | - $mstatut = $id . '.' . $statut; |
|
| 327 | + $mstatut = $id.'.'.$statut; |
|
| 328 | 328 | |
| 329 | 329 | $arg_ignore_previsu = ($ignore_previsu ? ',true' : ''); |
| 330 | 330 | include_spip('public/quete'); |
@@ -332,11 +332,11 @@ discard block |
||
| 332 | 332 | isset($s['post_date']) and $s['post_date'] |
| 333 | 333 | and $GLOBALS['meta']['post_dates'] == 'non' |
| 334 | 334 | ) { |
| 335 | - $date = $id . '.' . preg_replace(',\W,', '', $s['post_date']); // securite |
|
| 335 | + $date = $id.'.'.preg_replace(',\W,', '', $s['post_date']); // securite |
|
| 336 | 336 | array_unshift( |
| 337 | 337 | $boucle->where, |
| 338 | 338 | $echapper ? |
| 339 | - "\nquete_condition_postdates('$date'," . _q($boucle->sql_serveur) . "$arg_ignore_previsu)" |
|
| 339 | + "\nquete_condition_postdates('$date',"._q($boucle->sql_serveur)."$arg_ignore_previsu)" |
|
| 340 | 340 | : |
| 341 | 341 | quete_condition_postdates($date, $boucle->sql_serveur, $ignore_previsu) |
| 342 | 342 | ); |
@@ -345,9 +345,9 @@ discard block |
||
| 345 | 345 | $boucle->where, |
| 346 | 346 | $echapper ? |
| 347 | 347 | "\nquete_condition_statut('$mstatut'," |
| 348 | - . _q($s['previsu']) . ',' |
|
| 349 | - . _q($s['publie']) . ',' |
|
| 350 | - . _q($boucle->sql_serveur) . "$arg_ignore_previsu)" |
|
| 348 | + . _q($s['previsu']).',' |
|
| 349 | + . _q($s['publie']).',' |
|
| 350 | + . _q($boucle->sql_serveur)."$arg_ignore_previsu)" |
|
| 351 | 351 | : |
| 352 | 352 | quete_condition_statut($mstatut, $s['previsu'], $s['publie'], $boucle->sql_serveur, $ignore_previsu) |
| 353 | 353 | ); |
@@ -381,14 +381,14 @@ discard block |
||
| 381 | 381 | if (_request('var_mode_affiche') != 'resultat') { |
| 382 | 382 | $trace = ''; |
| 383 | 383 | } else { |
| 384 | - $_trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle; |
|
| 384 | + $_trace = $boucles[$id_boucle]->descr['nom'].$id_boucle; |
|
| 385 | 385 | $_trace = "\$GLOBALS['debug_objets']['resultat']['$_trace']"; |
| 386 | 386 | $trace = " |
| 387 | 387 | if (empty($_trace)) { |
| 388 | 388 | $_trace = []; |
| 389 | 389 | } |
| 390 | 390 | if (count($_trace) < 3) { |
| 391 | - $_trace" . '[] = $t0; |
|
| 391 | + $_trace".'[] = $t0; |
|
| 392 | 392 | }'; |
| 393 | 393 | } |
| 394 | 394 | |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | return |
| 423 | 423 | // Numrows[$nom] peut ne pas être encore defini |
| 424 | 424 | "\n\t\$save_numrows = (isset(\$Numrows['$nom']) ? \$Numrows['$nom'] : array());" |
| 425 | - . "\n\t\$t0 = " . $boucles[$id_boucle]->return . ';' |
|
| 425 | + . "\n\t\$t0 = ".$boucles[$id_boucle]->return.';' |
|
| 426 | 426 | . "\n\t\$Numrows['$nom'] = (\$save_numrows);" |
| 427 | 427 | . $trace |
| 428 | 428 | . "\n\treturn \$t0;"; |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | // faudrait expanser le foreach a la compil, car y en a souvent qu'un |
| 491 | 491 | // et puis faire un [] plutot qu'un "','." |
| 492 | 492 | if ($boucle->doublons) { |
| 493 | - $corps .= "\n\t\t\tforeach(" . $boucle->doublons . ' as $k) $doublons[$k] .= "," . ' . |
|
| 493 | + $corps .= "\n\t\t\tforeach(".$boucle->doublons.' as $k) $doublons[$k] .= "," . '. |
|
| 494 | 494 | index_pile($id_boucle, $primary, $boucles) |
| 495 | 495 | . "; // doublons\n"; |
| 496 | 496 | } |
@@ -518,13 +518,13 @@ discard block |
||
| 518 | 518 | $corps .= |
| 519 | 519 | "\n\t\tlang_select_public(" |
| 520 | 520 | . index_pile($id_boucle, 'lang', $boucles) |
| 521 | - . ", '" . $boucle->lang_select . "'" |
|
| 521 | + . ", '".$boucle->lang_select."'" |
|
| 522 | 522 | . (in_array($type_boucle, [ |
| 523 | 523 | 'articles', |
| 524 | 524 | 'rubriques', |
| 525 | 525 | 'hierarchie', |
| 526 | 526 | 'breves' |
| 527 | - ]) ? ', ' . index_pile($id_boucle, 'titre', $boucles) : '') |
|
| 527 | + ]) ? ', '.index_pile($id_boucle, 'titre', $boucles) : '') |
|
| 528 | 528 | . ');'; |
| 529 | 529 | } else { |
| 530 | 530 | $init_lang = ''; |
@@ -546,20 +546,16 @@ discard block |
||
| 546 | 546 | |
| 547 | 547 | // gestion optimale des separateurs et des boucles constantes |
| 548 | 548 | if (is_countable($boucle->separateur) ? count($boucle->separateur) : 0) { |
| 549 | - $code_sep = ("'" . str_replace("'", "\'", join('', $boucle->separateur)) . "'"); |
|
| 549 | + $code_sep = ("'".str_replace("'", "\'", join('', $boucle->separateur))."'"); |
|
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | $corps .= |
| 553 | 553 | ((!$boucle->separateur) ? |
| 554 | - (($constant && !$corps && !$flag_cpt) ? $return : |
|
| 555 | - (($return === "''") ? '' : |
|
| 556 | - ("\n\t\t" . '$t0 .= ' . $return . ';'))) : |
|
| 557 | - ("\n\t\t\$t1 " . |
|
| 554 | + (($constant && !$corps && !$flag_cpt) ? $return : (($return === "''") ? '' : ("\n\t\t".'$t0 .= '.$return.';'))) : ("\n\t\t\$t1 ". |
|
| 558 | 555 | ((strpos($return, '$t1.') === 0) ? |
| 559 | - ('.=' . substr($return, 4)) : |
|
| 560 | - ('= ' . $return)) . |
|
| 561 | - ";\n\t\t" . |
|
| 562 | - '$t0 .= ((strlen($t1) && strlen($t0)) ? ' . $code_sep . " : '') . \$t1;")); |
|
| 556 | + ('.='.substr($return, 4)) : ('= '.$return)). |
|
| 557 | + ";\n\t\t". |
|
| 558 | + '$t0 .= ((strlen($t1) && strlen($t0)) ? '.$code_sep." : '') . \$t1;")); |
|
| 563 | 559 | |
| 564 | 560 | // Calculer les invalideurs si c'est une boucle non constante et si on |
| 565 | 561 | // souhaite invalider ces elements |
@@ -641,7 +637,7 @@ discard block |
||
| 641 | 637 | $corps, |
| 642 | 638 | $fin_lang, |
| 643 | 639 | $trace, |
| 644 | - 'BOUCLE' . $id_boucle . ' @ ' . ($boucle->descr['sourcefile']) |
|
| 640 | + 'BOUCLE'.$id_boucle.' @ '.($boucle->descr['sourcefile']) |
|
| 645 | 641 | ); |
| 646 | 642 | |
| 647 | 643 | # var_dump($a);exit; |
@@ -662,25 +658,24 @@ discard block |
||
| 662 | 658 | **/ |
| 663 | 659 | function calculer_requete_sql($boucle) { |
| 664 | 660 | $init = []; |
| 665 | - $init[] = calculer_dec('table', "'" . $boucle->id_table . "'"); |
|
| 666 | - $init[] = calculer_dec('id', "'" . $boucle->id_boucle . "'"); |
|
| 661 | + $init[] = calculer_dec('table', "'".$boucle->id_table."'"); |
|
| 662 | + $init[] = calculer_dec('id', "'".$boucle->id_boucle."'"); |
|
| 667 | 663 | # En absence de champ c'est un decompte : |
| 668 | 664 | $init[] = calculer_dec('from', calculer_from($boucle)); |
| 669 | 665 | $init[] = calculer_dec('type', calculer_from_type($boucle)); |
| 670 | 666 | $init[] = calculer_dec( |
| 671 | 667 | 'groupby', |
| 672 | - 'array(' . (($g = join("\",\n\t\t\"", $boucle->group)) ? '"' . $g . '"' : '') . ')' |
|
| 668 | + 'array('.(($g = join("\",\n\t\t\"", $boucle->group)) ? '"'.$g.'"' : '').')' |
|
| 673 | 669 | ); |
| 674 | - $init[] = calculer_dec('select', 'array("' . join("\",\n\t\t\"", $boucle->select) . '")'); |
|
| 675 | - $init[] = calculer_dec('orderby', 'array(' . calculer_order($boucle) . ')'); |
|
| 670 | + $init[] = calculer_dec('select', 'array("'.join("\",\n\t\t\"", $boucle->select).'")'); |
|
| 671 | + $init[] = calculer_dec('orderby', 'array('.calculer_order($boucle).')'); |
|
| 676 | 672 | $init[] = calculer_dec('where', calculer_dump_array($boucle->where)); |
| 677 | 673 | $init[] = calculer_dec('join', calculer_dump_join($boucle->join)); |
| 678 | 674 | $init[] = calculer_dec( |
| 679 | 675 | 'limit', |
| 680 | 676 | ( |
| 681 | 677 | strpos($boucle->limit, 'intval') === false ? |
| 682 | - "'" . ($boucle->limit) . "'" : |
|
| 683 | - $boucle->limit |
|
| 678 | + "'".($boucle->limit)."'" : $boucle->limit |
|
| 684 | 679 | ) |
| 685 | 680 | ); |
| 686 | 681 | $init[] = calculer_dec('having', calculer_dump_array($boucle->having)); |
@@ -689,17 +684,17 @@ discard block |
||
| 689 | 684 | // ou recalculée à chaque passage (vide) |
| 690 | 685 | foreach ($init as $i) { |
| 691 | 686 | if (reset($i)) { |
| 692 | - $s .= "\n\t\t" . end($i); |
|
| 687 | + $s .= "\n\t\t".end($i); |
|
| 693 | 688 | } # statique |
| 694 | 689 | else { |
| 695 | - $d .= "\n\t" . end($i); |
|
| 690 | + $d .= "\n\t".end($i); |
|
| 696 | 691 | } # dynamique |
| 697 | 692 | } |
| 698 | 693 | |
| 699 | 694 | return ($boucle->hierarchie ? "\n\t$boucle->hierarchie" : '') |
| 700 | 695 | . $boucle->in |
| 701 | 696 | . $boucle->hash |
| 702 | - . "\n\t" . 'if (!isset($command[\'table\'])) {' |
|
| 697 | + . "\n\t".'if (!isset($command[\'table\'])) {' |
|
| 703 | 698 | . $s |
| 704 | 699 | . "\n\t}" |
| 705 | 700 | . $d; |
@@ -754,7 +749,7 @@ discard block |
||
| 754 | 749 | ]; |
| 755 | 750 | |
| 756 | 751 | $p->id_boucle = $context_compil[2] ?? ''; |
| 757 | - $p->ligne = (int)($context_compil[3] ?? 0); |
|
| 752 | + $p->ligne = (int) ($context_compil[3] ?? 0); |
|
| 758 | 753 | $p->lang = $context_compil[4] ?? ''; |
| 759 | 754 | |
| 760 | 755 | return $p; |
@@ -783,7 +778,7 @@ discard block |
||
| 783 | 778 | * - index 1 : Code de l'affectation |
| 784 | 779 | **/ |
| 785 | 780 | function calculer_dec($nom, $val) { |
| 786 | - $static = 'if (!isset($command[\'' . $nom . '\'])) '; |
|
| 781 | + $static = 'if (!isset($command[\''.$nom.'\'])) '; |
|
| 787 | 782 | // si une variable apparait dans le calcul de la clause |
| 788 | 783 | // il faut la re-evaluer a chaque passage |
| 789 | 784 | if ( |
@@ -800,7 +795,7 @@ discard block |
||
| 800 | 795 | $static = ''; |
| 801 | 796 | } |
| 802 | 797 | |
| 803 | - return [$static, '$command[\'' . $nom . '\'] = ' . $val . ';']; |
|
| 798 | + return [$static, '$command[\''.$nom.'\'] = '.$val.';']; |
|
| 804 | 799 | } |
| 805 | 800 | |
| 806 | 801 | /** |
@@ -825,27 +820,27 @@ discard block |
||
| 825 | 820 | } |
| 826 | 821 | $res = ''; |
| 827 | 822 | if ($a and $a[0] == "'?'") { |
| 828 | - return ('(' . calculer_dump_array($a[1]) . |
|
| 829 | - ' ? ' . calculer_dump_array($a[2]) . |
|
| 830 | - ' : ' . calculer_dump_array($a[3]) . |
|
| 823 | + return ('('.calculer_dump_array($a[1]). |
|
| 824 | + ' ? '.calculer_dump_array($a[2]). |
|
| 825 | + ' : '.calculer_dump_array($a[3]). |
|
| 831 | 826 | ')'); |
| 832 | 827 | } else { |
| 833 | 828 | foreach ($a as $k => $v) { |
| 834 | - $showk = (is_numeric($k) ? '' : sql_quote($k) . ' => '); |
|
| 835 | - $res .= ', ' . $showk . calculer_dump_array($v); |
|
| 829 | + $showk = (is_numeric($k) ? '' : sql_quote($k).' => '); |
|
| 830 | + $res .= ', '.$showk.calculer_dump_array($v); |
|
| 836 | 831 | } |
| 837 | 832 | |
| 838 | - return "\n\t\t\tarray(" . substr($res, 2) . ')'; |
|
| 833 | + return "\n\t\t\tarray(".substr($res, 2).')'; |
|
| 839 | 834 | } |
| 840 | 835 | } |
| 841 | 836 | |
| 842 | 837 | function calculer_dump_join($a) { |
| 843 | 838 | $res = ''; |
| 844 | 839 | foreach ($a as $k => $v) { |
| 845 | - $res .= ", '$k' => array(" . implode(',', $v) . ')'; |
|
| 840 | + $res .= ", '$k' => array(".implode(',', $v).')'; |
|
| 846 | 841 | } |
| 847 | 842 | |
| 848 | - return 'array(' . substr($res, 2) . ')'; |
|
| 843 | + return 'array('.substr($res, 2).')'; |
|
| 849 | 844 | } |
| 850 | 845 | |
| 851 | 846 | /** |
@@ -862,7 +857,7 @@ discard block |
||
| 862 | 857 | $res .= ",'$k' => '$v'"; |
| 863 | 858 | } |
| 864 | 859 | |
| 865 | - return 'array(' . substr($res, 1) . ')'; |
|
| 860 | + return 'array('.substr($res, 1).')'; |
|
| 866 | 861 | } |
| 867 | 862 | |
| 868 | 863 | /** |
@@ -880,7 +875,7 @@ discard block |
||
| 880 | 875 | $res .= ",'$k' => '$v'"; |
| 881 | 876 | } |
| 882 | 877 | |
| 883 | - return 'array(' . substr($res, 1) . ')'; |
|
| 878 | + return 'array('.substr($res, 1).')'; |
|
| 884 | 879 | } |
| 885 | 880 | |
| 886 | 881 | function calculer_order(&$boucle) { |
@@ -949,19 +944,19 @@ discard block |
||
| 949 | 944 | ) { |
| 950 | 945 | $res .= " .\n$tab$code"; |
| 951 | 946 | } else { |
| 952 | - $res = substr($res, 0, -1) . substr($code, 1); |
|
| 947 | + $res = substr($res, 0, -1).substr($code, 1); |
|
| 953 | 948 | } |
| 954 | 949 | } |
| 955 | 950 | |
| 956 | - return '(' . substr($res, 2 + $descr['niv']) . ')'; |
|
| 951 | + return '('.substr($res, 2 + $descr['niv']).')'; |
|
| 957 | 952 | } |
| 958 | 953 | } else { |
| 959 | - $nom = $descr['nom'] . $id_boucle . ($descr['niv'] ?: ''); |
|
| 954 | + $nom = $descr['nom'].$id_boucle.($descr['niv'] ?: ''); |
|
| 960 | 955 | |
| 961 | - return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(" . join( |
|
| 956 | + return "join('', array_map('array_shift', \$GLOBALS['debug_objets']['sequence']['$nom'] = array(".join( |
|
| 962 | 957 | " ,\n$tab", |
| 963 | 958 | $codes |
| 964 | - ) . ')))'; |
|
| 959 | + ).')))'; |
|
| 965 | 960 | } |
| 966 | 961 | } |
| 967 | 962 | |
@@ -988,7 +983,7 @@ discard block |
||
| 988 | 983 | // texte seul |
| 989 | 984 | case 'texte': |
| 990 | 985 | $code = sandbox_composer_texte($p->texte, $p); |
| 991 | - $commentaire = strlen($p->texte) . ' signes'; |
|
| 986 | + $commentaire = strlen($p->texte).' signes'; |
|
| 992 | 987 | $avant = ''; |
| 993 | 988 | $apres = ''; |
| 994 | 989 | $altern = "''"; |
@@ -997,14 +992,14 @@ discard block |
||
| 997 | 992 | case 'polyglotte': |
| 998 | 993 | $code = ''; |
| 999 | 994 | foreach ($p->traductions as $k => $v) { |
| 1000 | - $code .= ",'" . |
|
| 1001 | - str_replace(['\\', "'"], ['\\\\', "\\'"], $k) . |
|
| 1002 | - "' => '" . |
|
| 1003 | - str_replace(['\\', "'"], ['\\\\', "\\'"], $v) . |
|
| 995 | + $code .= ",'". |
|
| 996 | + str_replace(['\\', "'"], ['\\\\', "\\'"], $k). |
|
| 997 | + "' => '". |
|
| 998 | + str_replace(['\\', "'"], ['\\\\', "\\'"], $v). |
|
| 1004 | 999 | "'"; |
| 1005 | 1000 | } |
| 1006 | - $code = 'choisir_traduction(array(' . |
|
| 1007 | - substr($code, 1) . |
|
| 1001 | + $code = 'choisir_traduction(array('. |
|
| 1002 | + substr($code, 1). |
|
| 1008 | 1003 | '))'; |
| 1009 | 1004 | $commentaire = '&'; |
| 1010 | 1005 | $avant = ''; |
@@ -1020,7 +1015,7 @@ discard block |
||
| 1020 | 1015 | $err_e_c = true; |
| 1021 | 1016 | $code = "''"; |
| 1022 | 1017 | } else { |
| 1023 | - $commentaire = '<INCLURE ' . addslashes(str_replace("\n", ' ', $code)) . '>'; |
|
| 1018 | + $commentaire = '<INCLURE '.addslashes(str_replace("\n", ' ', $code)).'>'; |
|
| 1024 | 1019 | $avant = ''; |
| 1025 | 1020 | $apres = ''; |
| 1026 | 1021 | $altern = "''"; |
@@ -1049,8 +1044,8 @@ discard block |
||
| 1049 | 1044 | $err_e_c = true; |
| 1050 | 1045 | $code = "''"; |
| 1051 | 1046 | } else { |
| 1052 | - $code = 'BOUCLE' . |
|
| 1053 | - str_replace('-', '_', $nom) . $descr['nom'] . |
|
| 1047 | + $code = 'BOUCLE'. |
|
| 1048 | + str_replace('-', '_', $nom).$descr['nom']. |
|
| 1054 | 1049 | '($Cache, $Pile, $doublons, $Numrows, $SP)'; |
| 1055 | 1050 | $commentaire = "?$nom"; |
| 1056 | 1051 | if ( |
@@ -1092,24 +1087,22 @@ discard block |
||
| 1092 | 1087 | foreach ($p->arg as $k => $v) { |
| 1093 | 1088 | $_v = calculer_liste($v, $descr, $boucles, $id_boucle); |
| 1094 | 1089 | if ($k) { |
| 1095 | - $l[] = _q($k) . ' => ' . $_v; |
|
| 1090 | + $l[] = _q($k).' => '.$_v; |
|
| 1096 | 1091 | } else { |
| 1097 | 1092 | $code = $_v; |
| 1098 | 1093 | } |
| 1099 | 1094 | } |
| 1100 | 1095 | // Si le module n'est pas fourni, l'expliciter sauf si calculé |
| 1101 | 1096 | if ($p->module) { |
| 1102 | - $m = $p->module . ':' . $p->nom_champ; |
|
| 1097 | + $m = $p->module.':'.$p->nom_champ; |
|
| 1103 | 1098 | } elseif ($p->nom_champ) { |
| 1104 | - $m = MODULES_IDIOMES . ':' . $p->nom_champ; |
|
| 1099 | + $m = MODULES_IDIOMES.':'.$p->nom_champ; |
|
| 1105 | 1100 | } else { |
| 1106 | 1101 | $m = ''; |
| 1107 | 1102 | } |
| 1108 | 1103 | |
| 1109 | - $code = (!$code ? "'$m'" : |
|
| 1110 | - ($m ? "'$m' . $code" : |
|
| 1111 | - ("(strpos(\$x=$code, ':') ? \$x : ('" . MODULES_IDIOMES . ":' . \$x))"))) |
|
| 1112 | - . (!$l ? '' : (', array(' . implode(",\n", $l) . ')')); |
|
| 1104 | + $code = (!$code ? "'$m'" : ($m ? "'$m' . $code" : ("(strpos(\$x=$code, ':') ? \$x : ('".MODULES_IDIOMES.":' . \$x))"))) |
|
| 1105 | + . (!$l ? '' : (', array('.implode(",\n", $l).')')); |
|
| 1113 | 1106 | $code = "_T($code)"; |
| 1114 | 1107 | if ($p->param) { |
| 1115 | 1108 | $p->id_boucle = $id_boucle; |
@@ -1131,7 +1124,7 @@ discard block |
||
| 1131 | 1124 | $p->type_requete = $type; |
| 1132 | 1125 | |
| 1133 | 1126 | $code = calculer_champ($p); |
| 1134 | - $commentaire = '#' . $p->nom_champ . $p->etoile; |
|
| 1127 | + $commentaire = '#'.$p->nom_champ.$p->etoile; |
|
| 1135 | 1128 | $avant = calculer_liste( |
| 1136 | 1129 | $p->avant, |
| 1137 | 1130 | $descr, |
@@ -1171,10 +1164,9 @@ discard block |
||
| 1171 | 1164 | if ($code != "''") { |
| 1172 | 1165 | $code = compile_retour($code, $avant, $apres, $altern, $tab, $descr['niv']); |
| 1173 | 1166 | $codes[] = (($mode == 'validation') ? |
| 1174 | - "array($code, '$commentaire', " . $p->ligne . ')' |
|
| 1167 | + "array($code, '$commentaire', ".$p->ligne.')' |
|
| 1175 | 1168 | : (($mode == 'code') ? |
| 1176 | - "\n// $commentaire\n$code" : |
|
| 1177 | - $code)); |
|
| 1169 | + "\n// $commentaire\n$code" : $code)); |
|
| 1178 | 1170 | } |
| 1179 | 1171 | } // foreach |
| 1180 | 1172 | |
@@ -1230,19 +1222,19 @@ discard block |
||
| 1230 | 1222 | $cond = ''; |
| 1231 | 1223 | } elseif (preg_match(_REGEXP_COND_VIDE_NONVIDE, $code, $r)) { |
| 1232 | 1224 | $t = $r[2]; |
| 1233 | - $cond = '!' . $r[1]; |
|
| 1225 | + $cond = '!'.$r[1]; |
|
| 1234 | 1226 | } else { |
| 1235 | 1227 | if (preg_match(_REGEXP_COND_NONVIDE_VIDE, $code, $r)) { |
| 1236 | 1228 | $t = $r[2]; |
| 1237 | 1229 | $cond = $r[1]; |
| 1238 | 1230 | } else { |
| 1239 | - $t = '$t' . $n; |
|
| 1231 | + $t = '$t'.$n; |
|
| 1240 | 1232 | $cond = "($t = $code)!==''"; |
| 1241 | 1233 | } |
| 1242 | 1234 | } |
| 1243 | 1235 | |
| 1244 | - $res = (!$avant ? '' : "$avant . ") . |
|
| 1245 | - $t . |
|
| 1236 | + $res = (!$avant ? '' : "$avant . "). |
|
| 1237 | + $t. |
|
| 1246 | 1238 | (!$apres ? '' : " . $apres"); |
| 1247 | 1239 | |
| 1248 | 1240 | if ($res !== $t) { |
@@ -1293,12 +1285,12 @@ discard block |
||
| 1293 | 1285 | |
| 1294 | 1286 | // rendre inertes les echappements de #[](){}<> |
| 1295 | 1287 | $i = 0; |
| 1296 | - while (false !== strpos($squelette, $inerte = '-INERTE' . $i)) { |
|
| 1288 | + while (false !== strpos($squelette, $inerte = '-INERTE'.$i)) { |
|
| 1297 | 1289 | $i++; |
| 1298 | 1290 | } |
| 1299 | 1291 | $squelette = preg_replace_callback( |
| 1300 | 1292 | ',\\\\([#[()\]{}<>]),', |
| 1301 | - fn($a) => "$inerte-" . ord($a[1]) . '-', |
|
| 1293 | + fn($a) => "$inerte-".ord($a[1]).'-', |
|
| 1302 | 1294 | $squelette, |
| 1303 | 1295 | -1, |
| 1304 | 1296 | $esc |
@@ -1314,7 +1306,7 @@ discard block |
||
| 1314 | 1306 | // Phraser le squelette, selon sa grammaire |
| 1315 | 1307 | |
| 1316 | 1308 | $boucles = []; |
| 1317 | - $f = charger_fonction('phraser_' . $gram, 'public'); |
|
| 1309 | + $f = charger_fonction('phraser_'.$gram, 'public'); |
|
| 1318 | 1310 | |
| 1319 | 1311 | $squelette = $f($squelette, '', $boucles, $descr); |
| 1320 | 1312 | |
@@ -1330,7 +1322,7 @@ discard block |
||
| 1330 | 1322 | ); |
| 1331 | 1323 | $boucles[$i]->descr['squelette'] = preg_replace_callback( |
| 1332 | 1324 | ",$inerte-(\d+)-,", |
| 1333 | - fn($a) => '\\\\' . chr($a[1]), |
|
| 1325 | + fn($a) => '\\\\'.chr($a[1]), |
|
| 1334 | 1326 | $boucle->descr['squelette'] |
| 1335 | 1327 | ); |
| 1336 | 1328 | } |
@@ -1341,19 +1333,19 @@ discard block |
||
| 1341 | 1333 | include_spip('public/decompiler'); |
| 1342 | 1334 | foreach ($boucles as $id => $boucle) { |
| 1343 | 1335 | if ($id) { |
| 1344 | - $decomp = "\n/* BOUCLE " . |
|
| 1345 | - $boucle->type_requete . |
|
| 1346 | - ' ' . |
|
| 1347 | - str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')) . |
|
| 1348 | - ($boucle->debug ? "\n *\n * " . implode("\n * ", $boucle->debug) . "\n" : '') . |
|
| 1336 | + $decomp = "\n/* BOUCLE ". |
|
| 1337 | + $boucle->type_requete. |
|
| 1338 | + ' '. |
|
| 1339 | + str_replace('*/', '* /', public_decompiler($boucle, $gram, 0, 'criteres')). |
|
| 1340 | + ($boucle->debug ? "\n *\n * ".implode("\n * ", $boucle->debug)."\n" : ''). |
|
| 1349 | 1341 | " */\n"; |
| 1350 | 1342 | } else { |
| 1351 | - $decomp = ("\n/*\n" . |
|
| 1343 | + $decomp = ("\n/*\n". |
|
| 1352 | 1344 | str_replace('*/', '* /', public_decompiler($squelette, $gram)) |
| 1353 | 1345 | . "\n*/"); |
| 1354 | 1346 | } |
| 1355 | - $boucles[$id]->return = $decomp . $boucle->return; |
|
| 1356 | - $GLOBALS['debug_objets']['code'][$nom . $id] = $boucle->return; |
|
| 1347 | + $boucles[$id]->return = $decomp.$boucle->return; |
|
| 1348 | + $GLOBALS['debug_objets']['code'][$nom.$id] = $boucle->return; |
|
| 1357 | 1349 | } |
| 1358 | 1350 | } |
| 1359 | 1351 | |
@@ -1376,7 +1368,7 @@ discard block |
||
| 1376 | 1368 | } |
| 1377 | 1369 | } |
| 1378 | 1370 | foreach ($boucles as $id => $boucle) { |
| 1379 | - $GLOBALS['debug_objets']['boucle'][$nom . $id] = $boucle; |
|
| 1371 | + $GLOBALS['debug_objets']['boucle'][$nom.$id] = $boucle; |
|
| 1380 | 1372 | } |
| 1381 | 1373 | $descr['documents'] = compile_inclure_doublons($squelette); |
| 1382 | 1374 | |
@@ -1467,8 +1459,7 @@ discard block |
||
| 1467 | 1459 | } else { |
| 1468 | 1460 | $boucles[$id]->type_requete = false; |
| 1469 | 1461 | $boucle = $boucles[$id]; |
| 1470 | - $x = (!$boucle->sql_serveur ? '' : |
|
| 1471 | - ($boucle->sql_serveur . ':')) . |
|
| 1462 | + $x = (!$boucle->sql_serveur ? '' : ($boucle->sql_serveur.':')). |
|
| 1472 | 1463 | $type; |
| 1473 | 1464 | $msg = [ |
| 1474 | 1465 | 'zbug_table_inconnue', |
@@ -1558,13 +1549,13 @@ discard block |
||
| 1558 | 1549 | if ( |
| 1559 | 1550 | // fonction de boucle avec serveur & table |
| 1560 | 1551 | (!$serveur or |
| 1561 | - ((!function_exists($f = 'boucle_' . $serveur . '_' . $table)) |
|
| 1562 | - and (!function_exists($f = $f . '_dist')) |
|
| 1552 | + ((!function_exists($f = 'boucle_'.$serveur.'_'.$table)) |
|
| 1553 | + and (!function_exists($f = $f.'_dist')) |
|
| 1563 | 1554 | ) |
| 1564 | 1555 | ) |
| 1565 | 1556 | // fonction de boucle avec table |
| 1566 | - and (!function_exists($f = 'boucle_' . $table)) |
|
| 1567 | - and (!function_exists($f = $f . '_dist')) |
|
| 1557 | + and (!function_exists($f = 'boucle_'.$table)) |
|
| 1558 | + and (!function_exists($f = $f.'_dist')) |
|
| 1568 | 1559 | ) { |
| 1569 | 1560 | // fonction de boucle standard |
| 1570 | 1561 | if (!function_exists($f = 'boucle_DEFAUT')) { |
@@ -1572,20 +1563,20 @@ discard block |
||
| 1572 | 1563 | } |
| 1573 | 1564 | } |
| 1574 | 1565 | |
| 1575 | - $req = "\n\n\tstatic \$command = array();\n\t" . |
|
| 1576 | - "static \$connect;\n\t" . |
|
| 1577 | - "\$command['connect'] = \$connect = " . |
|
| 1578 | - _q($boucle->sql_serveur) . |
|
| 1579 | - ';' . |
|
| 1566 | + $req = "\n\n\tstatic \$command = array();\n\t". |
|
| 1567 | + "static \$connect;\n\t". |
|
| 1568 | + "\$command['connect'] = \$connect = ". |
|
| 1569 | + _q($boucle->sql_serveur). |
|
| 1570 | + ';'. |
|
| 1580 | 1571 | $f($id, $boucles); |
| 1581 | 1572 | } else { |
| 1582 | 1573 | $req = ("\n\treturn '';"); |
| 1583 | 1574 | } |
| 1584 | 1575 | |
| 1585 | 1576 | $boucles[$id]->return = |
| 1586 | - "\n\nfunction BOUCLE" . strtr($id, '-', '_') . $nom . |
|
| 1587 | - '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {' . |
|
| 1588 | - $req . |
|
| 1577 | + "\n\nfunction BOUCLE".strtr($id, '-', '_').$nom. |
|
| 1578 | + '(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {'. |
|
| 1579 | + $req. |
|
| 1589 | 1580 | "\n}\n"; |
| 1590 | 1581 | } |
| 1591 | 1582 | |
@@ -1595,7 +1586,7 @@ discard block |
||
| 1595 | 1586 | return false; |
| 1596 | 1587 | } |
| 1597 | 1588 | |
| 1598 | - $principal = "\nfunction " . $nom . '($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { |
|
| 1589 | + $principal = "\nfunction ".$nom.'($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { |
|
| 1599 | 1590 | ' |
| 1600 | 1591 | // reporter de maniere securisee les doublons inclus |
| 1601 | 1592 | . ' |
@@ -1603,15 +1594,15 @@ discard block |
||
| 1603 | 1594 | $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); |
| 1604 | 1595 | |
| 1605 | 1596 | $connect = ' . |
| 1606 | - _q($connect) . '; |
|
| 1597 | + _q($connect).'; |
|
| 1607 | 1598 | $page = ' . |
| 1608 | 1599 | // ATTENTION, le calcul de l'expression $corps affectera $Cache |
| 1609 | 1600 | // c'est pourquoi on l'affecte a la variable auxiliaire $page. |
| 1610 | 1601 | // avant de referencer $Cache |
| 1611 | - $corps . '; |
|
| 1602 | + $corps.'; |
|
| 1612 | 1603 | |
| 1613 | 1604 | return analyse_resultat_skel(' . var_export($nom, true) |
| 1614 | - . ', $Cache, $page, ' . var_export($sourcefile, true) . '); |
|
| 1605 | + . ', $Cache, $page, '.var_export($sourcefile, true).'); |
|
| 1615 | 1606 | }'; |
| 1616 | 1607 | |
| 1617 | 1608 | $secondes = spip_timer('calcul_skel'); |
@@ -1625,10 +1616,10 @@ discard block |
||
| 1625 | 1616 | $code->return = ' |
| 1626 | 1617 | // |
| 1627 | 1618 | // Fonction principale du squelette ' . |
| 1628 | - $sourcefile . |
|
| 1629 | - ($connect ? " pour $connect" : '') . |
|
| 1630 | - (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes") . |
|
| 1631 | - "\n//\n" . |
|
| 1619 | + $sourcefile. |
|
| 1620 | + ($connect ? " pour $connect" : ''). |
|
| 1621 | + (!CODE_COMMENTE ? '' : "\n// Temps de compilation total: $secondes"). |
|
| 1622 | + "\n//\n". |
|
| 1632 | 1623 | $principal; |
| 1633 | 1624 | |
| 1634 | 1625 | $boucles[''] = $code; |
@@ -1680,7 +1671,7 @@ discard block |
||
| 1680 | 1671 | **/ |
| 1681 | 1672 | function requeteur_data_dist(&$boucles, &$boucle, &$id) { |
| 1682 | 1673 | include_spip('iterateur/data'); |
| 1683 | - if ($h = charger_fonction($boucle->type_requete . '_to_array', 'inc', true)) { |
|
| 1674 | + if ($h = charger_fonction($boucle->type_requete.'_to_array', 'inc', true)) { |
|
| 1684 | 1675 | $g = charger_fonction('data', 'iterateur'); |
| 1685 | 1676 | $boucles[$id] = $g($boucle); |
| 1686 | 1677 | // from[0] stocke le type de data (rss, yql, ...) |