@@ -20,13 +20,13 @@ discard block |
||
| 20 | 20 | * deprecie, ne plus utiliser |
| 21 | 21 | * |
| 22 | 22 | */ |
| 23 | -function exec_fond_monobloc_dist(){ |
|
| 23 | +function exec_fond_monobloc_dist() { |
|
| 24 | 24 | |
| 25 | 25 | // pas d'autorisation |
| 26 | 26 | // c'est au fond de les gerer avec #AUTORISER, et de renvoyer un fond vide le cas echeant |
| 27 | 27 | // qui declenchera un minipres acces interdit |
| 28 | 28 | $exec = _request('exec'); |
| 29 | - $fond = trim(recuperer_fond("prive/exec/$exec",$_REQUEST)); |
|
| 29 | + $fond = trim(recuperer_fond("prive/exec/$exec", $_REQUEST)); |
|
| 30 | 30 | if (!$fond) { |
| 31 | 31 | include_spip('inc/minipres'); |
| 32 | 32 | echo minipres(); |
@@ -38,33 +38,33 @@ discard block |
||
| 38 | 38 | $extra = ""; |
| 39 | 39 | |
| 40 | 40 | // recuperer le titre dans le premier hn de la page |
| 41 | - if (preg_match(",<h[1-6][^>]*>(.+)</h[1-6]>,Uims",$fond,$match)){ |
|
| 41 | + if (preg_match(",<h[1-6][^>]*>(.+)</h[1-6]>,Uims", $fond, $match)) { |
|
| 42 | 42 | $titre = $match[1]; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // recuperer la hierarchie (au-dessus du contenu) |
| 46 | - if (preg_match(",<!--#hierarchie-->.+<!--/#hierarchie-->,Uims",$fond,$match)){ |
|
| 46 | + if (preg_match(",<!--#hierarchie-->.+<!--/#hierarchie-->,Uims", $fond, $match)) { |
|
| 47 | 47 | $hierarchie = $match[0]; |
| 48 | - $fond = str_replace($hierarchie,"",$fond); |
|
| 48 | + $fond = str_replace($hierarchie, "", $fond); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | // recuperer la navigation (colonne de gauche) |
| 52 | - if (preg_match(",<!--#navigation-->.+<!--/#navigation-->,Uims",$fond,$match)){ |
|
| 52 | + if (preg_match(",<!--#navigation-->.+<!--/#navigation-->,Uims", $fond, $match)) { |
|
| 53 | 53 | $navigation = $match[0]; |
| 54 | - $fond = str_replace($navigation,"",$fond); |
|
| 54 | + $fond = str_replace($navigation, "", $fond); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | // recuperer les extras (colonne de droite) |
| 58 | - if (preg_match(",<!--#extra-->.+<!--/#extra-->,Uims",$fond,$match)){ |
|
| 58 | + if (preg_match(",<!--#extra-->.+<!--/#extra-->,Uims", $fond, $match)) { |
|
| 59 | 59 | $extra = $match[0]; |
| 60 | - $fond = str_replace($extra,"",$fond); |
|
| 60 | + $fond = str_replace($extra, "", $fond); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini |
| 64 | - $commencer_page = charger_fonction('commencer_page','inc'); |
|
| 64 | + $commencer_page = charger_fonction('commencer_page', 'inc'); |
|
| 65 | 65 | echo $commencer_page($titre); |
| 66 | 66 | |
| 67 | - if ($hierarchie){ |
|
| 67 | + if ($hierarchie) { |
|
| 68 | 68 | echo debut_grand_cadre(true); |
| 69 | 69 | echo pipeline( |
| 70 | 70 | 'affiche_hierarchie', |
@@ -78,27 +78,27 @@ discard block |
||
| 78 | 78 | echo fin_grand_cadre(true); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - echo debut_gauche("exec_$exec",true); |
|
| 81 | + echo debut_gauche("exec_$exec", true); |
|
| 82 | 82 | |
| 83 | 83 | $contexte = array('exec'=>$exec); |
| 84 | - if ($objet_exec = trouver_objet_exec($exec)){ |
|
| 84 | + if ($objet_exec = trouver_objet_exec($exec)) { |
|
| 85 | 85 | $id = $objet_exec['id_table_objet']; |
| 86 | 86 | if (_request($id)) |
| 87 | 87 | $contexte[$id] = _request($id); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | echo $navigation; |
| 91 | - echo pipeline('affiche_gauche',array('args'=>$contexte,'data'=>'')); |
|
| 91 | + echo pipeline('affiche_gauche', array('args'=>$contexte, 'data'=>'')); |
|
| 92 | 92 | |
| 93 | - echo creer_colonne_droite("exec_$exec",true); |
|
| 93 | + echo creer_colonne_droite("exec_$exec", true); |
|
| 94 | 94 | echo $extra; |
| 95 | - echo pipeline('affiche_droite',array('args'=>$contexte,'data'=>'')); |
|
| 95 | + echo pipeline('affiche_droite', array('args'=>$contexte, 'data'=>'')); |
|
| 96 | 96 | |
| 97 | - echo debut_droite("exec_$exec",true); |
|
| 97 | + echo debut_droite("exec_$exec", true); |
|
| 98 | 98 | echo $fond; |
| 99 | - echo pipeline('affiche_milieu',array('args'=>$contexte,'data'=>'')); |
|
| 99 | + echo pipeline('affiche_milieu', array('args'=>$contexte, 'data'=>'')); |
|
| 100 | 100 | |
| 101 | - echo fin_gauche(),fin_page(); |
|
| 101 | + echo fin_gauche(), fin_page(); |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | include_spip('inc/texte'); |
| 16 | 16 | |
| 17 | 17 | // http://doc.spip.org/@exec_rechercher_dist |
| 18 | -function exec_rechercher_dist(){ |
|
| 18 | +function exec_rechercher_dist() { |
|
| 19 | 19 | $id = intval(_request('id')); |
| 20 | 20 | $exclus = intval(_request('exclus')); |
| 21 | 21 | $rac = spip_htmlentities(_request('rac')); |
@@ -28,41 +28,41 @@ discard block |
||
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | // http://doc.spip.org/@exec_rechercher_args |
| 31 | -function exec_rechercher_args($id, $type, $exclus, $rac, $do){ |
|
| 31 | +function exec_rechercher_args($id, $type, $exclus, $rac, $do) { |
|
| 32 | 32 | if (!$do) $do = 'aff'; |
| 33 | 33 | |
| 34 | 34 | $where = preg_split(",\s+,", $type); |
| 35 | - if ($where){ |
|
| 36 | - foreach ($where as $k => $v){ |
|
| 37 | - $where[$k] = "'%" . substr(str_replace("%", "\%", sql_quote($v,'','string')), 1, -1) . "%'"; |
|
| 35 | + if ($where) { |
|
| 36 | + foreach ($where as $k => $v) { |
|
| 37 | + $where[$k] = "'%".substr(str_replace("%", "\%", sql_quote($v, '', 'string')), 1, -1)."%'"; |
|
| 38 | 38 | } |
| 39 | - $where_titre = ("(titre LIKE " . join(" AND titre LIKE ", $where) . ")"); |
|
| 40 | - $where_desc = ("(descriptif LIKE " . join(" AND descriptif LIKE ", $where) . ")"); |
|
| 41 | - $where_id = ("(id_rubrique = " . intval($type) . ")"); |
|
| 39 | + $where_titre = ("(titre LIKE ".join(" AND titre LIKE ", $where).")"); |
|
| 40 | + $where_desc = ("(descriptif LIKE ".join(" AND descriptif LIKE ", $where).")"); |
|
| 41 | + $where_id = ("(id_rubrique = ".intval($type).")"); |
|
| 42 | 42 | } else { |
| 43 | 43 | $where_titre = " 1=2"; |
| 44 | 44 | $where_desc = " 1=2"; |
| 45 | 45 | $where_id = " 1=2"; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if ($exclus){ |
|
| 48 | + if ($exclus) { |
|
| 49 | 49 | include_spip('inc/rubriques'); |
| 50 | - $where_exclus = " AND " . sql_in('id_rubrique', calcul_branche_in($exclus), 'NOT'); |
|
| 50 | + $where_exclus = " AND ".sql_in('id_rubrique', calcul_branche_in($exclus), 'NOT'); |
|
| 51 | 51 | } else $where_exclus = ''; |
| 52 | 52 | |
| 53 | 53 | $res = sql_select("id_rubrique, id_parent, titre", "spip_rubriques", "$where_id$where_exclus"); |
| 54 | 54 | |
| 55 | 55 | $points = $rub = array(); |
| 56 | 56 | |
| 57 | - while ($row = sql_fetch($res)){ |
|
| 57 | + while ($row = sql_fetch($res)) { |
|
| 58 | 58 | $id_rubrique = $row["id_rubrique"]; |
| 59 | 59 | $rub[$id_rubrique]["titre"] = typo($row["titre"]); |
| 60 | 60 | $rub[$id_rubrique]["id_parent"] = $row["id_parent"]; |
| 61 | - $points[$id_rubrique] = $points[$id_rubrique]+3; |
|
| 61 | + $points[$id_rubrique] = $points[$id_rubrique] + 3; |
|
| 62 | 62 | } |
| 63 | 63 | $res = sql_select("id_rubrique, id_parent, titre", "spip_rubriques", "$where_titre$where_exclus"); |
| 64 | 64 | |
| 65 | - while ($row = sql_fetch($res)){ |
|
| 65 | + while ($row = sql_fetch($res)) { |
|
| 66 | 66 | $id_rubrique = $row["id_rubrique"]; |
| 67 | 67 | $rub[$id_rubrique]["titre"] = typo($row["titre"]); |
| 68 | 68 | $rub[$id_rubrique]["id_parent"] = $row["id_parent"]; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | $res = sql_select("id_rubrique, id_parent, titre", "spip_rubriques", "$where_desc$where_exclus"); |
| 74 | 74 | |
| 75 | - while ($row = sql_fetch($res)){ |
|
| 75 | + while ($row = sql_fetch($res)) { |
|
| 76 | 76 | $id_rubrique = $row["id_rubrique"]; |
| 77 | 77 | $rub[$id_rubrique]["titre"] = typo($row["titre"]); |
| 78 | 78 | $rub[$id_rubrique]["id_parent"] = $row["id_parent"]; |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | else $points[$id_rubrique] = 0; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if ($points){ |
|
| 84 | + if ($points) { |
|
| 85 | 85 | arsort($points); |
| 86 | - $style = " style='background-image: url(" . chemin_image('secteur-12.png') . ")'"; |
|
| 87 | - foreach ($rub as $k => $v){ |
|
| 86 | + $style = " style='background-image: url(".chemin_image('secteur-12.png').")'"; |
|
| 87 | + foreach ($rub as $k => $v) { |
|
| 88 | 88 | $rub[$k]['atts'] = ($v["id_parent"] ? $style : '') |
| 89 | 89 | . " class='petite-rubrique'"; |
| 90 | 90 | } |
@@ -99,21 +99,21 @@ discard block |
||
| 99 | 99 | // ==> attention a composer le message d'erreur avec au moins 2 balises |
| 100 | 100 | |
| 101 | 101 | // http://doc.spip.org/@proposer_item |
| 102 | -function proposer_item($ids, $titles, $rac, $type, $do){ |
|
| 102 | +function proposer_item($ids, $titles, $rac, $type, $do) { |
|
| 103 | 103 | |
| 104 | 104 | if (!$ids) |
| 105 | 105 | return "<br /><br /><div style='padding: 5px; color: red;'><b>" |
| 106 | 106 | . spip_htmlentities($type) |
| 107 | - . "</b> : " . _T('avis_aucun_resultat') . "</div>"; |
|
| 107 | + . "</b> : "._T('avis_aucun_resultat')."</div>"; |
|
| 108 | 108 | |
| 109 | 109 | $ret = ''; |
| 110 | 110 | $info = generer_url_ecrire('informer', "type=rubrique&rac=$rac&id="); |
| 111 | 111 | |
| 112 | - $onClick = "aff_selection(this.firstChild.title,'$rac" . "_selection','$info', event)"; |
|
| 112 | + $onClick = "aff_selection(this.firstChild.title,'$rac"."_selection','$info', event)"; |
|
| 113 | 113 | |
| 114 | 114 | $ondbClick = "$do(this.firstChild.firstChild.nodeValue,this.firstChild.title,'selection_rubrique', 'id_parent');"; |
| 115 | 115 | |
| 116 | - foreach ($ids as $id => $bof){ |
|
| 116 | + foreach ($ids as $id => $bof) { |
|
| 117 | 117 | |
| 118 | 118 | $titre = strtr(str_replace("'", "’", str_replace('"', """, textebrut($titles[$id]["titre"]))), "\n\r", " "); |
| 119 | 119 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | $fond = _request('exec'); |
| 17 | -$GLOBALS['delais'] = 0;// pas de cache ! |
|
| 17 | +$GLOBALS['delais'] = 0; // pas de cache ! |
|
| 18 | 18 | // Securite |
| 19 | 19 | if (strstr($fond, '/')) { |
| 20 | 20 | if (!include_spip('inc/autoriser') |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | // quelques inclusions et ini prealables |
| 31 | 31 | include_spip('inc/commencer_page'); |
| 32 | 32 | |
| 33 | -function shutdown_error(){ |
|
| 33 | +function shutdown_error() { |
|
| 34 | 34 | |
| 35 | 35 | // si on arrive ici avec un tampon non ferme : erreur fatale |
| 36 | 36 | /* if (ob_get_level()){ |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | * La fonction ne fait rien, c'est l'inclusion du fichier qui declenche le traitement |
| 62 | 62 | * |
| 63 | 63 | */ |
| 64 | -function exec_fond_dist(){ |
|
| 64 | +function exec_fond_dist() { |
|
| 65 | 65 | |
| 66 | 66 | } |
| 67 | 67 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | // si jamais la liste des plugins actifs change, il faut faire un refresh du hit |
| 21 | 21 | // pour etre sur que les bons fichiers seront charges lors de l'install |
| 22 | 22 | include_spip('inc/plugin'); |
| 23 | - if (actualise_plugins_actifs()){ |
|
| 23 | + if (actualise_plugins_actifs()) { |
|
| 24 | 24 | include_spip('inc/headers'); |
| 25 | 25 | redirige_par_entete(self()); |
| 26 | 26 | } |
@@ -28,13 +28,13 @@ discard block |
||
| 28 | 28 | include_spip('inc/presentation'); |
| 29 | 29 | include_spip('inc/filtres_boites'); |
| 30 | 30 | $commencer_page = charger_fonction('commencer_page', 'inc'); |
| 31 | - echo $commencer_page('','','','',true,false,false); |
|
| 31 | + echo $commencer_page('', '', '', '', true, false, false); |
|
| 32 | 32 | |
| 33 | 33 | echo debut_grand_cadre(true); |
| 34 | - echo boite_ouvrir(_T('info_message_technique'),'notice'); |
|
| 34 | + echo boite_ouvrir(_T('info_message_technique'), 'notice'); |
|
| 35 | 35 | echo "<p>"._T('info_procedure_maj_version')."</p>", |
| 36 | 36 | "<p>"._T('info_administrateur_site_01')."</p>"; |
| 37 | - echo bouton_action(_T('bouton_mettre_a_jour_base'),generer_url_ecrire("upgrade","reinstall=non")); |
|
| 37 | + echo bouton_action(_T('bouton_mettre_a_jour_base'), generer_url_ecrire("upgrade", "reinstall=non")); |
|
| 38 | 38 | echo boite_fermer(); |
| 39 | 39 | // masquer les erreurs sql sur cette page car proviennent de la base pas a jour ! |
| 40 | 40 | echo '<style type="text/css">#debug-nav {display: none;}</style>'; |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | |
| 30 | 30 | $selectionner = charger_fonction('selectionner', 'inc'); |
| 31 | 31 | |
| 32 | - $r = $selectionner($id, "choix_parent", $exclus, $rac, $type!='breve', $do); |
|
| 32 | + $r = $selectionner($id, "choix_parent", $exclus, $rac, $type != 'breve', $do); |
|
| 33 | 33 | } else $r = ''; |
| 34 | 34 | ajax_retour($r); |
| 35 | 35 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | include_spip('inc/securiser_action'); |
| 21 | 21 | |
| 22 | 22 | // http://doc.spip.org/@exec_admin_plugin_dist |
| 23 | -function exec_admin_plugin_dist($retour='') { |
|
| 23 | +function exec_admin_plugin_dist($retour = '') { |
|
| 24 | 24 | |
| 25 | 25 | if (!autoriser('configurer', '_plugins')) { |
| 26 | 26 | include_spip('inc/minipres'); |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | // si jamais la liste des plugins actifs change, il faut faire un refresh du hit |
| 32 | 32 | // pour etre sur que les bons fichiers seront charges lors de l'install |
| 33 | 33 | $new = actualise_plugins_actifs(); |
| 34 | - if ($new AND _request('actualise')<2) { |
|
| 34 | + if ($new AND _request('actualise') < 2) { |
|
| 35 | 35 | include_spip('inc/headers'); |
| 36 | - redirige_par_entete(parametre_url(self(),'actualise',_request('actualise')+1,'&')); |
|
| 36 | + redirige_par_entete(parametre_url(self(), 'actualise', _request('actualise') + 1, '&')); |
|
| 37 | 37 | } |
| 38 | 38 | else { |
| 39 | 39 | admin_plug_args(_request('voir'), _request('erreur'), _request('format')); |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | $commencer_page = charger_fonction('commencer_page', 'inc'); |
| 53 | 53 | echo $commencer_page(_T('icone_admin_plugin'), "configuration", "plugin"); |
| 54 | 54 | |
| 55 | - echo debut_gauche('plugin',true); |
|
| 56 | - echo recuperer_fond('prive/squelettes/navigation/configurer',array('exec'=>'admin_plugin')); |
|
| 55 | + echo debut_gauche('plugin', true); |
|
| 56 | + echo recuperer_fond('prive/squelettes/navigation/configurer', array('exec'=>'admin_plugin')); |
|
| 57 | 57 | |
| 58 | 58 | echo pipeline('affiche_gauche', |
| 59 | 59 | array( |
@@ -63,12 +63,12 @@ discard block |
||
| 63 | 63 | ); |
| 64 | 64 | |
| 65 | 65 | echo debut_droite('plugin', true); |
| 66 | - echo gros_titre(_T('icone_admin_plugin'),'',false); |
|
| 66 | + echo gros_titre(_T('icone_admin_plugin'), '', false); |
|
| 67 | 67 | |
| 68 | 68 | // Barre d'onglets de premier niveau |
| 69 | 69 | echo barre_onglets("plugins", "plugins_actifs"); |
| 70 | 70 | // Barre d'onglets de second niveau |
| 71 | - $onglet2 = $quoi=='actifs' ? 'plugins_actifs' : 'admin_plugin'; |
|
| 71 | + $onglet2 = $quoi == 'actifs' ? 'plugins_actifs' : 'admin_plugin'; |
|
| 72 | 72 | echo debut_onglet('onglets_simple second'); |
| 73 | 73 | echo onglet(_T('plugins_tous_liste'), generer_url_ecrire("admin_plugin", "voir=tous"), 'admin_plugin', $onglet2); |
| 74 | 74 | echo onglet(_T('plugins_actifs_liste'), generer_url_ecrire("admin_plugin"), 'plugins_actifs', $onglet2); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | // message d'erreur au retour d'une operation |
| 78 | 78 | if ($erreur) |
| 79 | 79 | echo "<div class='error'>$erreur</div>"; |
| 80 | - if ($erreur_activation){ |
|
| 80 | + if ($erreur_activation) { |
|
| 81 | 81 | echo "<div class='error'>$erreur_activation</div>"; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | // Les affichages se basent sur le repertoire, pas sur le nom |
| 89 | 89 | $actifs = liste_chemin_plugin($actifs, ''); |
| 90 | 90 | if (defined('_DIR_PLUGINS_SUPPL')) |
| 91 | - $lcpas = liste_chemin_plugin($lcpa,_DIR_PLUGINS_SUPPL); |
|
| 91 | + $lcpas = liste_chemin_plugin($lcpa, _DIR_PLUGINS_SUPPL); |
|
| 92 | 92 | $lcpa = liste_chemin_plugin($lcpa); |
| 93 | 93 | |
| 94 | 94 | // on installe les plugins maintenant, |
@@ -96,15 +96,15 @@ discard block |
||
| 96 | 96 | plugin_installes_meta(); |
| 97 | 97 | |
| 98 | 98 | echo "<div class='liste-plugins formulaire_spip'>"; |
| 99 | - echo debut_cadre_trait_couleur('plugin-24.png',true,'',_T('plugins_liste'), 'plugins'); |
|
| 99 | + echo debut_cadre_trait_couleur('plugin-24.png', true, '', _T('plugins_liste'), 'plugins'); |
|
| 100 | 100 | |
| 101 | - if ($quoi!=='actifs'){ |
|
| 101 | + if ($quoi !== 'actifs') { |
|
| 102 | 102 | $lpf = liste_plugin_files(); |
| 103 | 103 | if ($lpf) |
| 104 | 104 | echo "<p>"._T('texte_presente_plugin')."</p>"; |
| 105 | 105 | else { |
| 106 | 106 | if (!@is_dir(_DIR_PLUGINS)) |
| 107 | - echo "<p>"._T('plugin_info_automatique_ftp',array('rep'=>joli_repertoire(_DIR_PLUGINS))) |
|
| 107 | + echo "<p>"._T('plugin_info_automatique_ftp', array('rep'=>joli_repertoire(_DIR_PLUGINS))) |
|
| 108 | 108 | . " — "._T('plugin_info_automatique_creer')."</p>"; |
| 109 | 109 | } |
| 110 | 110 | $lcpaffiche = $lpf; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $lcpaffichesup = $lcpas; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - if ($quoi=='actifs' OR $lpf){ |
|
| 122 | + if ($quoi == 'actifs' OR $lpf) { |
|
| 123 | 123 | $nb = count($lcpa); |
| 124 | 124 | if (defined('_DIR_PLUGINS_SUPPL')) |
| 125 | 125 | $nb += count($lcpas); |
@@ -128,13 +128,13 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | if (empty($format)) |
| 130 | 130 | $format = 'liste'; |
| 131 | - elseif (!in_array($format,array('liste','repertoires'))) |
|
| 131 | + elseif (!in_array($format, array('liste', 'repertoires'))) |
|
| 132 | 132 | $format = 'repertoires'; |
| 133 | 133 | |
| 134 | - $afficher = charger_fonction("afficher_$format",'plugins'); |
|
| 135 | - $corps = $afficher(self(),$lcpaffiche, $lcpa, $actifs); |
|
| 134 | + $afficher = charger_fonction("afficher_$format", 'plugins'); |
|
| 135 | + $corps = $afficher(self(), $lcpaffiche, $lcpa, $actifs); |
|
| 136 | 136 | if (defined('_DIR_PLUGINS_SUPPL')) |
| 137 | - $corps .= $afficher(self(),$lcpaffichesup, $lcpas, $actifs, _DIR_PLUGINS_SUPPL); |
|
| 137 | + $corps .= $afficher(self(), $lcpaffichesup, $lcpas, $actifs, _DIR_PLUGINS_SUPPL); |
|
| 138 | 138 | |
| 139 | 139 | if ($corps) |
| 140 | 140 | $corps .= "\n<div class='boutons' style='display:none;'>" |
@@ -142,11 +142,11 @@ discard block |
||
| 142 | 142 | ."' />" |
| 143 | 143 | . "</div>"; |
| 144 | 144 | |
| 145 | - echo redirige_action_post('activer_plugins','activer','admin_plugin','', $corps); |
|
| 145 | + echo redirige_action_post('activer_plugins', 'activer', 'admin_plugin', '', $corps); |
|
| 146 | 146 | |
| 147 | 147 | echo fin_cadre_trait_couleur(true); |
| 148 | 148 | |
| 149 | - if ($quoi=='actifs') |
|
| 149 | + if ($quoi == 'actifs') |
|
| 150 | 150 | echo affiche_les_plugins_verrouilles($actifs); |
| 151 | 151 | echo "</div>"; |
| 152 | 152 | |
@@ -190,15 +190,15 @@ discard block |
||
| 190 | 190 | { |
| 191 | 191 | if ((!$liste = liste_plugin_files(_DIR_PLUGINS_DIST))) return ''; |
| 192 | 192 | |
| 193 | - $afficher = charger_fonction("afficher_liste",'plugins'); |
|
| 193 | + $afficher = charger_fonction("afficher_liste", 'plugins'); |
|
| 194 | 194 | $liste = $afficher(self(), $liste, array(), $actifs, _DIR_PLUGINS_DIST); |
| 195 | 195 | |
| 196 | 196 | return |
| 197 | 197 | "<div id='plugins_dist'>" |
| 198 | - . debut_cadre_trait_couleur('',true,'',_T('plugins_liste_dist'), 'liste_plugins_dist') |
|
| 198 | + . debut_cadre_trait_couleur('', true, '', _T('plugins_liste_dist'), 'liste_plugins_dist') |
|
| 199 | 199 | . "<p>" |
| 200 | 200 | . _T('plugin_info_plugins_dist_1', array('plugins_dist' => joli_repertoire(_DIR_PLUGINS_DIST))) |
| 201 | - . '<br />'. _T('plugin_info_plugins_dist_2') |
|
| 201 | + . '<br />'._T('plugin_info_plugins_dist_2') |
|
| 202 | 202 | . "</p>" |
| 203 | 203 | . $liste |
| 204 | 204 | . fin_cadre_trait_couleur(true) |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | * |
| 211 | 211 | * @return <type> |
| 212 | 212 | */ |
| 213 | -function afficher_librairies(){ |
|
| 213 | +function afficher_librairies() { |
|
| 214 | 214 | |
| 215 | 215 | if (!$libs = liste_librairies()) return ''; |
| 216 | 216 | ksort($libs); |
@@ -16,22 +16,22 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | // http://doc.spip.org/@debutElement |
| 18 | 18 | function debutElement($phraseur, $name, $attrs) |
| 19 | -{ xml_debutElement($this, $name, $attrs);} |
|
| 19 | +{ xml_debutElement($this, $name, $attrs); } |
|
| 20 | 20 | |
| 21 | 21 | // http://doc.spip.org/@finElement |
| 22 | 22 | function finElement($phraseur, $name) |
| 23 | -{ xml_finElement($this, $name);} |
|
| 23 | +{ xml_finElement($this, $name); } |
|
| 24 | 24 | |
| 25 | 25 | // http://doc.spip.org/@textElement |
| 26 | 26 | function textElement($phraseur, $data) |
| 27 | -{ xml_textElement($this, $data);} |
|
| 27 | +{ xml_textElement($this, $data); } |
|
| 28 | 28 | |
| 29 | 29 | function piElement($phraseur, $target, $data) |
| 30 | -{ xml_PiElement($this, $target, $data);} |
|
| 30 | +{ xml_PiElement($this, $target, $data); } |
|
| 31 | 31 | |
| 32 | 32 | // http://doc.spip.org/@defautElement |
| 33 | 33 | function defaultElement($phraseur, $data) |
| 34 | -{ xml_defaultElement($this, $data);} |
|
| 34 | +{ xml_defaultElement($this, $data); } |
|
| 35 | 35 | |
| 36 | 36 | // http://doc.spip.org/@phraserTout |
| 37 | 37 | function phraserTout($phraseur, $data) |
@@ -52,14 +52,14 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // http://doc.spip.org/@xml_indenter_dist |
| 55 | -function xml_indenter_dist($page, $apply=false) |
|
| 55 | +function xml_indenter_dist($page, $apply = false) |
|
| 56 | 56 | { |
| 57 | 57 | $sax = charger_fonction('sax', 'xml'); |
| 58 | 58 | $f = new IndenteurXML(); |
| 59 | 59 | $sax($page, $apply, $f); |
| 60 | - if (!$f->err) return $f->entete . $f->res; |
|
| 61 | - spip_log("indentation impossible " . count($f->err) . " erreurs de validation"); |
|
| 62 | - return $f->entete . $f->page; |
|
| 60 | + if (!$f->err) return $f->entete.$f->res; |
|
| 61 | + spip_log("indentation impossible ".count($f->err)." erreurs de validation"); |
|
| 62 | + return $f->entete.$f->page; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | ?> |
@@ -20,14 +20,14 @@ discard block |
||
| 20 | 20 | * @param string $texte |
| 21 | 21 | * @return string |
| 22 | 22 | */ |
| 23 | -function xml_entites_html($texte){ |
|
| 23 | +function xml_entites_html($texte) { |
|
| 24 | 24 | if (!is_string($texte) OR !$texte |
| 25 | - OR strpbrk($texte, "&\"'<>")==false |
|
| 25 | + OR strpbrk($texte, "&\"'<>") == false |
|
| 26 | 26 | ) return $texte; |
| 27 | 27 | |
| 28 | 28 | if (!function_exists('spip_htmlspecialchars')) |
| 29 | 29 | include_spip("inc/filtres_mini"); |
| 30 | - $texte = spip_htmlspecialchars($texte,ENT_QUOTES); |
|
| 30 | + $texte = spip_htmlspecialchars($texte, ENT_QUOTES); |
|
| 31 | 31 | return $texte; |
| 32 | 32 | } |
| 33 | 33 | |
@@ -40,40 +40,40 @@ discard block |
||
| 40 | 40 | // espace initial signifie: deja integree au resultat |
| 41 | 41 | if ($t[0] != ' ') |
| 42 | 42 | { |
| 43 | - $phraseur->res .= '<' . $t . '>'; |
|
| 44 | - $phraseur->ouvrant[$depth] = ' ' . $t; |
|
| 43 | + $phraseur->res .= '<'.$t.'>'; |
|
| 44 | + $phraseur->ouvrant[$depth] = ' '.$t; |
|
| 45 | 45 | } |
| 46 | 46 | $t = $phraseur->contenu[$depth]; |
| 47 | 47 | // n'indenter que s'il y a un separateur avant |
| 48 | - $phraseur->res .= preg_replace("/[\n\t ]+$/", "\n$depth", $t); |
|
| 48 | + $phraseur->res .= preg_replace("/[\n\t ]+$/", "\n$depth", $t); |
|
| 49 | 49 | $phraseur->contenu[$depth] = ""; |
| 50 | 50 | $att = ''; |
| 51 | 51 | $sep = ' '; |
| 52 | 52 | foreach ($attrs as $k => $v) { |
| 53 | 53 | $delim = strpos($v, "'") === false ? "'" : '"'; |
| 54 | 54 | $val = xml_entites_html($v); |
| 55 | - $att .= $sep . $k . "=" . $delim |
|
| 55 | + $att .= $sep.$k."=".$delim |
|
| 56 | 56 | . ($delim !== '"' ? str_replace('"', '"', $val) : $val) |
| 57 | 57 | . $delim; |
| 58 | 58 | $sep = "\n $depth"; |
| 59 | 59 | } |
| 60 | 60 | $phraseur->depth .= ' '; |
| 61 | 61 | $phraseur->contenu[$phraseur->depth] = ""; |
| 62 | - $phraseur->ouvrant[$phraseur->depth] = $name . $att; |
|
| 62 | + $phraseur->ouvrant[$phraseur->depth] = $name.$att; |
|
| 63 | 63 | $phraseur->reperes[$phraseur->depth] = xml_get_current_line_number($phraseur->sax); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | // http://doc.spip.org/@xml_finElement |
| 67 | -function xml_finElement($phraseur, $name, $fusion_bal=false) |
|
| 67 | +function xml_finElement($phraseur, $name, $fusion_bal = false) |
|
| 68 | 68 | { |
| 69 | 69 | $ouv = $phraseur->ouvrant[$phraseur->depth]; |
| 70 | 70 | |
| 71 | 71 | if ($ouv[0] != ' ') |
| 72 | - $phraseur->ouvrant[$phraseur->depth] = ' ' . $ouv; |
|
| 73 | - else $ouv= ""; |
|
| 72 | + $phraseur->ouvrant[$phraseur->depth] = ' '.$ouv; |
|
| 73 | + else $ouv = ""; |
|
| 74 | 74 | $t = $phraseur->contenu[$phraseur->depth]; |
| 75 | 75 | $phraseur->depth = substr($phraseur->depth, 2); |
| 76 | - $t = preg_replace("/[\n\t ]+$/", "\n" . $phraseur->depth, $t); |
|
| 76 | + $t = preg_replace("/[\n\t ]+$/", "\n".$phraseur->depth, $t); |
|
| 77 | 77 | |
| 78 | 78 | // fusion <balise></balise> en <balise />. |
| 79 | 79 | // ATTENTION, certains clients http croient que fusion ==> pas d'atttributs |
@@ -82,16 +82,16 @@ discard block |
||
| 82 | 82 | // (param fusion_bal) |
| 83 | 83 | |
| 84 | 84 | if ($t || (($ouv != $name) AND !$fusion_bal)) |
| 85 | - $phraseur->res .= ($ouv ? ('<' . $ouv . '>') : '') . $t . "</" . $name . ">"; |
|
| 85 | + $phraseur->res .= ($ouv ? ('<'.$ouv.'>') : '').$t."</".$name.">"; |
|
| 86 | 86 | else |
| 87 | - $phraseur->res .= ($ouv ? ('<' . $ouv . ' />') : ("</" . $name . ">")); |
|
| 87 | + $phraseur->res .= ($ouv ? ('<'.$ouv.' />') : ("</".$name.">")); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | // http://doc.spip.org/@xml_textElement |
| 91 | 91 | function xml_textElement($phraseur, $data) |
| 92 | 92 | { |
| 93 | 93 | $depth = $phraseur->depth; |
| 94 | - $phraseur->contenu[$depth] .= preg_match('/^script/',$phraseur->ouvrant[$depth]) |
|
| 94 | + $phraseur->contenu[$depth] .= preg_match('/^script/', $phraseur->ouvrant[$depth]) |
|
| 95 | 95 | ? $data |
| 96 | 96 | : xml_entites_html($data); |
| 97 | 97 | } |
@@ -117,43 +117,42 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | $depth = $phraseur->depth; |
| 119 | 119 | |
| 120 | - if (!isset($phraseur->contenu[$depth])) $phraseur->contenu[$depth]=''; |
|
| 120 | + if (!isset($phraseur->contenu[$depth])) $phraseur->contenu[$depth] = ''; |
|
| 121 | 121 | $phraseur->contenu[$depth] .= $data; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | // http://doc.spip.org/@xml_parsestring |
| 125 | 125 | function xml_parsestring($phraseur, $data) |
| 126 | 126 | { |
| 127 | - $phraseur->contenu[$phraseur->depth] =''; |
|
| 127 | + $phraseur->contenu[$phraseur->depth] = ''; |
|
| 128 | 128 | |
| 129 | 129 | if (!xml_parse($phraseur->sax, $data, true)) { |
| 130 | 130 | coordonnees_erreur($phraseur, |
| 131 | 131 | xml_error_string(xml_get_error_code($phraseur->sax)) |
| 132 | - . "<br />\n" . |
|
| 133 | - (!$phraseur->depth ? '' : |
|
| 134 | - ('(' . |
|
| 135 | - _T('erreur_balise_non_fermee') . |
|
| 136 | - " <tt>" . |
|
| 137 | - $phraseur->ouvrant[$phraseur->depth] . |
|
| 138 | - "</tt> " . |
|
| 139 | - _T('ligne') . |
|
| 140 | - " " . |
|
| 141 | - $phraseur->reperes[$phraseur->depth] . |
|
| 142 | - ") <br />\n" ))); |
|
| 132 | + . "<br />\n". |
|
| 133 | + (!$phraseur->depth ? '' : ('('. |
|
| 134 | + _T('erreur_balise_non_fermee'). |
|
| 135 | + " <tt>". |
|
| 136 | + $phraseur->ouvrant[$phraseur->depth]. |
|
| 137 | + "</tt> ". |
|
| 138 | + _T('ligne'). |
|
| 139 | + " ". |
|
| 140 | + $phraseur->reperes[$phraseur->depth]. |
|
| 141 | + ") <br />\n"))); |
|
| 143 | 142 | } |
| 144 | 143 | } |
| 145 | 144 | |
| 146 | 145 | // http://doc.spip.org/@coordonnees_erreur |
| 147 | 146 | function coordonnees_erreur($phraseur, $msg) |
| 148 | 147 | { |
| 149 | - $entete_length = substr_count($phraseur->entete,"\n"); |
|
| 148 | + $entete_length = substr_count($phraseur->entete, "\n"); |
|
| 150 | 149 | $phraseur->err[] = array($msg, |
| 151 | 150 | xml_get_current_line_number($phraseur->sax) + $entete_length, |
| 152 | 151 | xml_get_current_column_number($phraseur->sax)); |
| 153 | 152 | } |
| 154 | 153 | |
| 155 | 154 | // http://doc.spip.org/@xml_sax_dist |
| 156 | -function xml_sax_dist($page, $apply=false, $phraseur=NULL, $doctype='', $charset=null) |
|
| 155 | +function xml_sax_dist($page, $apply = false, $phraseur = NULL, $doctype = '', $charset = null) |
|
| 157 | 156 | { |
| 158 | 157 | if (is_null($charset)) |
| 159 | 158 | $charset = $GLOBALS['meta']['charset']; |
@@ -173,12 +172,12 @@ discard block |
||
| 173 | 172 | // et escamoter le doctype que sax mange en php5 mais pas en php4 |
| 174 | 173 | if (!$doctype) { |
| 175 | 174 | if (!$r = analyser_doctype($page)) { |
| 176 | - $page = _MESSAGE_DOCTYPE . _DOCTYPE_ECRIRE |
|
| 175 | + $page = _MESSAGE_DOCTYPE._DOCTYPE_ECRIRE |
|
| 177 | 176 | . preg_replace(_REGEXP_DOCTYPE, '', $page); |
| 178 | - $r = analyser_doctype($page); |
|
| 177 | + $r = analyser_doctype($page); |
|
| 179 | 178 | } |
| 180 | 179 | list($entete, $avail, $grammaire, $rotlvl) = array_pad($r, 4, null); |
| 181 | - $page = substr($page,strlen($entete)); |
|
| 180 | + $page = substr($page, strlen($entete)); |
|
| 182 | 181 | } else { |
| 183 | 182 | $avail = 'SYSTEM'; |
| 184 | 183 | $grammaire = $doctype; |
@@ -232,7 +231,7 @@ discard block |
||
| 232 | 231 | // sinon on se rabat sur ce qu'en connait SPIP en standard. |
| 233 | 232 | |
| 234 | 233 | // http://doc.spip.org/@sax_bug |
| 235 | -function sax_bug($data, $dtc, $charset=null) |
|
| 234 | +function sax_bug($data, $dtc, $charset = null) |
|
| 236 | 235 | { |
| 237 | 236 | if (is_null($charset)) |
| 238 | 237 | $charset = $GLOBALS['meta']['charset']; |
@@ -240,7 +239,7 @@ discard block |
||
| 240 | 239 | if ($dtc) { |
| 241 | 240 | $trans = array(); |
| 242 | 241 | |
| 243 | - foreach($dtc->entites as $k => $v) { |
|
| 242 | + foreach ($dtc->entites as $k => $v) { |
|
| 244 | 243 | if (!strpos(" amp lt gt quot ", $k)) |
| 245 | 244 | $trans["&$k;"] = $v; |
| 246 | 245 | } |
@@ -268,16 +267,16 @@ discard block |
||
| 268 | 267 | _DOCTYPE_RSS, |
| 269 | 268 | 'rss-0.91.dtd'); |
| 270 | 269 | else { |
| 271 | - $dtd = $topelement . '.dtd'; |
|
| 270 | + $dtd = $topelement.'.dtd'; |
|
| 272 | 271 | $f = find_in_path($dtd); |
| 273 | 272 | if (file_exists($f)) |
| 274 | 273 | return array($entete, 'SYSTEM', $f, $dtd); |
| 275 | 274 | } |
| 276 | 275 | } |
| 277 | - spip_log("Dtd pas vu pour " . substr($data, 0, 100)); |
|
| 276 | + spip_log("Dtd pas vu pour ".substr($data, 0, 100)); |
|
| 278 | 277 | return array(); |
| 279 | 278 | } |
| 280 | - list($entete,, $topelement, $avail,$suite) = $page; |
|
| 279 | + list($entete,, $topelement, $avail, $suite) = $page; |
|
| 281 | 280 | |
| 282 | 281 | if (!preg_match('/^"([^"]*)"\s*(.*)$/', $suite, $r)) |
| 283 | 282 | if (!preg_match("/^'([^']*)'\s*(.*)$/", $suite, $r)) |
@@ -23,11 +23,11 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | if (!($p = isset($this->dtc->elements[$name]))) { |
| 25 | 25 | if ($p = strpos($name, ':')) { |
| 26 | - $name = substr($name, $p+1); |
|
| 26 | + $name = substr($name, $p + 1); |
|
| 27 | 27 | $p = isset($this->dtc->elements[$name]); |
| 28 | 28 | } |
| 29 | 29 | if (!$p) { |
| 30 | - coordonnees_erreur($this," <b>$name</b> : " |
|
| 30 | + coordonnees_erreur($this, " <b>$name</b> : " |
|
| 31 | 31 | . _T('zxml_inconnu_balise')); |
| 32 | 32 | return; |
| 33 | 33 | } |
@@ -45,21 +45,21 @@ discard block |
||
| 45 | 45 | # spip_log("rejeton $name fils " . @join(',',$fils)); |
| 46 | 46 | if (!($p = @in_array($name, $fils))) { |
| 47 | 47 | if ($p = strpos($name, ':')) { |
| 48 | - $p = substr($name, $p+1); |
|
| 48 | + $p = substr($name, $p + 1); |
|
| 49 | 49 | $p = @in_array($p, $fils); |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | if (!$p) { |
| 53 | - $bons_peres = @join ('</b>, <b>', $this->dtc->peres[$name]); |
|
| 53 | + $bons_peres = @join('</b>, <b>', $this->dtc->peres[$name]); |
|
| 54 | 54 | coordonnees_erreur($this, " <b>$name</b> " |
| 55 | 55 | . _T('zxml_non_fils') |
| 56 | 56 | . ' <b>' |
| 57 | 57 | . $pere |
| 58 | 58 | . '</b>' |
| 59 | 59 | . (!$bons_peres ? '' |
| 60 | - : ('<p style="font-size: 80%"> '._T('zxml_mais_de').' <b>'. $bons_peres . '</b></p>'))); |
|
| 61 | - } else if ($this->dtc->regles[$pere][0]=='/') { |
|
| 62 | - $frat = substr($depth,2); |
|
| 60 | + : ('<p style="font-size: 80%"> '._T('zxml_mais_de').' <b>'.$bons_peres.'</b></p>'))); |
|
| 61 | + } else if ($this->dtc->regles[$pere][0] == '/') { |
|
| 62 | + $frat = substr($depth, 2); |
|
| 63 | 63 | if (!isset($this->fratrie[$frat])) { |
| 64 | 64 | $this->fratrie[$frat] = ''; |
| 65 | 65 | } |
@@ -69,8 +69,8 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | // Init de la suite des balises a memoriser si regle difficile |
| 72 | - if ($this->dtc->regles[$name][0]=='/') |
|
| 73 | - $this->fratrie[$depth]=''; |
|
| 72 | + if ($this->dtc->regles[$name][0] == '/') |
|
| 73 | + $this->fratrie[$depth] = ''; |
|
| 74 | 74 | if (isset($this->dtc->attributs[$name])) { |
| 75 | 75 | foreach ($this->dtc->attributs[$name] as $n => $v) |
| 76 | 76 | { if (($v[1] == '#REQUIRED') AND (!isset($attrs[$n]))) |
@@ -87,16 +87,16 @@ discard block |
||
| 87 | 87 | { |
| 88 | 88 | // Si la balise est inconnue, eviter d'insister |
| 89 | 89 | if (!isset($this->dtc->attributs[$bal])) |
| 90 | - return ; |
|
| 90 | + return; |
|
| 91 | 91 | |
| 92 | 92 | $a = $this->dtc->attributs[$bal]; |
| 93 | 93 | if (!isset($a[$name])) { |
| 94 | - $bons = join(', ',array_keys($a)); |
|
| 94 | + $bons = join(', ', array_keys($a)); |
|
| 95 | 95 | if ($bons) |
| 96 | - $bons = " title=' " . |
|
| 97 | - _T('zxml_connus_attributs') . |
|
| 98 | - ' : ' . |
|
| 99 | - $bons . |
|
| 96 | + $bons = " title=' ". |
|
| 97 | + _T('zxml_connus_attributs'). |
|
| 98 | + ' : '. |
|
| 99 | + $bons. |
|
| 100 | 100 | "'"; |
| 101 | 101 | $bons .= " style='font-weight: bold'"; |
| 102 | 102 | coordonnees_erreur($this, " <b>$name</b> " |
@@ -104,11 +104,11 @@ discard block |
||
| 104 | 104 | . " <a$bons>$bal</a> (" |
| 105 | 105 | . _T('zxml_survoler') |
| 106 | 106 | . ")"); |
| 107 | - } else{ |
|
| 108 | - $type = $a[$name][0]; |
|
| 107 | + } else { |
|
| 108 | + $type = $a[$name][0]; |
|
| 109 | 109 | if (!preg_match('/^\w+$/', $type)) |
| 110 | 110 | $this->valider_motif($phraseur, $name, $val, $bal, $type); |
| 111 | - else if (method_exists($this, $f = 'validerAttribut_' . $type)) |
|
| 111 | + else if (method_exists($this, $f = 'validerAttribut_'.$type)) |
|
| 112 | 112 | $this->$f($phraseur, $name, $val, $bal); |
| 113 | 113 | # else spip_log("$type type d'attribut inconnu"); |
| 114 | 114 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | function validerAttribut_ID($phraseur, $name, $val, $bal) |
| 129 | 129 | { |
| 130 | 130 | if (isset($this->ids[$val])) { |
| 131 | - list($l,$c) = $this->ids[$val]; |
|
| 131 | + list($l, $c) = $this->ids[$val]; |
|
| 132 | 132 | coordonnees_erreur($this, " <p><b>$val</b> " |
| 133 | 133 | . _T('zxml_valeur_attribut') |
| 134 | 134 | . " <b>$name</b> " |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | . " <b>$bal</b> " |
| 166 | 166 | . _T('zxml_non_conforme') |
| 167 | 167 | . "</p><p>" |
| 168 | - . "<b>" . $motif . "</b>"); |
|
| 168 | + . "<b>".$motif."</b>"); |
|
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | function valider_idref($nom, $ligne, $col) |
| 174 | 174 | { |
| 175 | 175 | if (!isset($this->ids[$nom])) |
| 176 | - $this->err[]= array(" <p><b>$nom</b> " . _T('zxml_inconnu_id'), $ligne, $col); |
|
| 176 | + $this->err[] = array(" <p><b>$nom</b> "._T('zxml_inconnu_id'), $ligne, $col); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | // http://doc.spip.org/@valider_passe2 |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | } |
| 187 | 187 | foreach ($this->idrefss as $idref) { |
| 188 | 188 | list($noms, $ligne, $col) = $idref; |
| 189 | - foreach(preg_split('/\s+/', $noms) as $nom) |
|
| 189 | + foreach (preg_split('/\s+/', $noms) as $nom) |
|
| 190 | 190 | $this->valider_idref($nom, $ligne, $col); |
| 191 | 191 | } |
| 192 | 192 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | |
| 201 | 201 | if ($f = $this->process['debut']) $f($this, $name, $attrs); |
| 202 | 202 | $depth = $this->depth; |
| 203 | - $this->debuts[$depth] = strlen($this->res); |
|
| 203 | + $this->debuts[$depth] = strlen($this->res); |
|
| 204 | 204 | foreach ($attrs as $k => $v) { |
| 205 | 205 | $this->validerAttribut($phraseur, $k, $v, $name); |
| 206 | 206 | } |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $k = $this->debuts[$depth]; |
| 218 | 218 | |
| 219 | 219 | $regle = $this->dtc->regles[$name]; |
| 220 | - $vide = ($regle == 'EMPTY'); |
|
| 220 | + $vide = ($regle == 'EMPTY'); |
|
| 221 | 221 | // controler que les balises devant etre vides le sont |
| 222 | 222 | if ($vide) { |
| 223 | 223 | if ($n <> ($k + $c)) |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | . _T('zxml_vide_balise')); |
| 233 | 233 | } |
| 234 | 234 | } else { |
| 235 | - $f = $this->fratrie[substr($depth,2)]; |
|
| 235 | + $f = $this->fratrie[substr($depth, 2)]; |
|
| 236 | 236 | if (!preg_match($regle, $f)) { |
| 237 | 237 | coordonnees_erreur($this, |
| 238 | 238 | " <p>\n<b>$name</b> " |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $d = $this->ouvrant[$d]; |
| 256 | 256 | preg_match('/^\s*(\S+)/', $d, $m); |
| 257 | 257 | if ($this->dtc->pcdata[$m[1]]) { |
| 258 | - coordonnees_erreur($this, " <p><b>". $m[1] . "</b> " |
|
| 258 | + coordonnees_erreur($this, " <p><b>".$m[1]."</b> " |
|
| 259 | 259 | . _T('zxml_nonvide_balise') // message a affiner |
| 260 | 260 | ); |
| 261 | 261 | } |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | if (!preg_match('/^<!--/', $data) |
| 282 | 282 | AND (preg_match_all('/&([^;]*)?/', $data, $r, PREG_SET_ORDER))) |
| 283 | 283 | foreach ($r as $m) { |
| 284 | - list($t,$e) = $m; |
|
| 284 | + list($t, $e) = $m; |
|
| 285 | 285 | if (!isset($this->dtc->entites[$e])) |
| 286 | 286 | coordonnees_erreur($this, " <b>$e</b> " |
| 287 | 287 | . _T('zxml_inconnu_entite') |
@@ -298,15 +298,15 @@ discard block |
||
| 298 | 298 | { |
| 299 | 299 | xml_parsestring($this, $data); |
| 300 | 300 | |
| 301 | - if (!$this->dtc OR preg_match(',^' . _MESSAGE_DOCTYPE . ',', $data)) { |
|
| 302 | - $this->err[]= array('DOCTYPE ?', 0, 0); |
|
| 301 | + if (!$this->dtc OR preg_match(',^'._MESSAGE_DOCTYPE.',', $data)) { |
|
| 302 | + $this->err[] = array('DOCTYPE ?', 0, 0); |
|
| 303 | 303 | } else { |
| 304 | 304 | $this->valider_passe2($this); |
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | // Init |
| 309 | -function ValidateurXML($process=array()) { |
|
| 309 | +function ValidateurXML($process = array()) { |
|
| 310 | 310 | if (is_array($process)) $this->process = $process; |
| 311 | 311 | } |
| 312 | 312 | |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | var $contenu = array(); |
| 327 | 327 | var $ouvrant = array(); |
| 328 | 328 | var $reperes = array(); |
| 329 | - var $process = array( |
|
| 329 | + var $process = array( |
|
| 330 | 330 | 'debut' => 'xml_debutElement', |
| 331 | 331 | 'fin' => 'xml_finElement', |
| 332 | 332 | 'text' => 'xml_textElement', |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | // ayant comme entrees des sous-tableaux [message, ligne, colonne] |
| 340 | 340 | |
| 341 | 341 | // http://doc.spip.org/@xml_valider_dist |
| 342 | -function xml_valider_dist($page, $apply=false, $process=false, $doctype='', $charset=null) |
|
| 342 | +function xml_valider_dist($page, $apply = false, $process = false, $doctype = '', $charset = null) |
|
| 343 | 343 | { |
| 344 | 344 | $f = new ValidateurXML($process); |
| 345 | 345 | $sax = charger_fonction('sax', 'xml'); |