@@ -1,6 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 3 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 4 | + return; |
|
| 5 | +} |
|
| 4 | 6 | |
| 5 | 7 | include_spip('inc/actions'); |
| 6 | 8 | // http://doc.spip.org/@exec_info_plugin_dist |
@@ -12,12 +14,14 @@ discard block |
||
| 12 | 14 | $plug = _DIR_RACINE . _request('plugin'); |
| 13 | 15 | $get_infos = charger_fonction('get_infos','plugins'); |
| 14 | 16 | $dir = ""; |
| 15 | - if (strncmp($plug,_DIR_PLUGINS,strlen(_DIR_PLUGINS))==0) |
|
| 16 | - $dir = _DIR_PLUGINS; |
|
| 17 | - elseif (strncmp($plug,_DIR_PLUGINS_DIST,strlen(_DIR_PLUGINS_DIST))==0) |
|
| 18 | - $dir = _DIR_PLUGINS_DIST; |
|
| 19 | - if ($dir) |
|
| 20 | - $plug = substr($plug,strlen($dir)); |
|
| 17 | + if (strncmp($plug,_DIR_PLUGINS,strlen(_DIR_PLUGINS))==0) { |
|
| 18 | + $dir = _DIR_PLUGINS; |
|
| 19 | + } elseif (strncmp($plug,_DIR_PLUGINS_DIST,strlen(_DIR_PLUGINS_DIST))==0) { |
|
| 20 | + $dir = _DIR_PLUGINS_DIST; |
|
| 21 | + } |
|
| 22 | + if ($dir) { |
|
| 23 | + $plug = substr($plug,strlen($dir)); |
|
| 24 | + } |
|
| 21 | 25 | $info = $get_infos($plug,false,$dir); |
| 22 | 26 | $afficher_plugin = charger_fonction("afficher_plugin","plugins"); |
| 23 | 27 | ajax_retour(affiche_bloc_plugin($plug, $info, $dir)); |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | /* |
| 16 | 18 | * REMARQUE IMPORTANTE : SECURITE |
@@ -26,13 +28,13 @@ discard block |
||
| 26 | 28 | function exec_base_repair_dist() |
| 27 | 29 | { |
| 28 | 30 | $ok = false; |
| 29 | - if (!spip_connect()) |
|
| 30 | - $message = _T('titre_probleme_technique'); |
|
| 31 | - else { |
|
| 31 | + if (!spip_connect()) { |
|
| 32 | + $message = _T('titre_probleme_technique'); |
|
| 33 | + } else { |
|
| 32 | 34 | $version_sql = sql_version(); |
| 33 | - if (!$version_sql) |
|
| 34 | - $message = _T('avis_erreur_connexion_mysql'); |
|
| 35 | - else { |
|
| 35 | + if (!$version_sql) { |
|
| 36 | + $message = _T('avis_erreur_connexion_mysql'); |
|
| 37 | + } else { |
|
| 36 | 38 | $message = _T('texte_requetes_echouent'); |
| 37 | 39 | $ok = true; |
| 38 | 40 | } |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | include_spip('inc/presentation'); |
| 16 | 18 | |
@@ -29,15 +31,15 @@ discard block |
||
| 29 | 31 | AND $d['statut_textes_instituer']) { |
| 30 | 32 | $prim = id_table_objet($type); |
| 31 | 33 | $id = intval($id); |
| 32 | - if (isset($d['field']['id_rubrique'])) |
|
| 33 | - $select = "id_rubrique,statut"; |
|
| 34 | - else |
|
| 35 | - $select = "0 as id_rubrique,statut"; |
|
| 34 | + if (isset($d['field']['id_rubrique'])) { |
|
| 35 | + $select = "id_rubrique,statut"; |
|
| 36 | + } else { |
|
| 37 | + $select = "0 as id_rubrique,statut"; |
|
| 38 | + } |
|
| 36 | 39 | $r = sql_fetsel($select, $table_objet_sql, "$prim=$id"); |
| 37 | 40 | $statut = $r['statut']; |
| 38 | 41 | $id_rubrique = $r['id_rubrique']; |
| 39 | - } |
|
| 40 | - else { |
|
| 42 | + } else { |
|
| 41 | 43 | $id_rubrique = intval($id); |
| 42 | 44 | $statut = 'prop'; // arbitraire |
| 43 | 45 | } |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | /** |
| 16 | 18 | * Un exec generique qui utilise le fond homonyme de l'exec demande |
@@ -83,8 +85,9 @@ discard block |
||
| 83 | 85 | $contexte = array('exec'=>$exec); |
| 84 | 86 | if ($objet_exec = trouver_objet_exec($exec)){ |
| 85 | 87 | $id = $objet_exec['id_table_objet']; |
| 86 | - if (_request($id)) |
|
| 87 | - $contexte[$id] = _request($id); |
|
| 88 | + if (_request($id)) { |
|
| 89 | + $contexte[$id] = _request($id); |
|
| 90 | + } |
|
| 88 | 91 | } |
| 89 | 92 | |
| 90 | 93 | echo $navigation; |
@@ -9,7 +9,9 @@ discard block |
||
| 9 | 9 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 10 | 10 | \***************************************************************************/ |
| 11 | 11 | |
| 12 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 12 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 13 | + return; |
|
| 14 | +} |
|
| 13 | 15 | |
| 14 | 16 | include_spip('inc/actions'); |
| 15 | 17 | include_spip('inc/texte'); |
@@ -21,15 +23,19 @@ discard block |
||
| 21 | 23 | $rac = spip_htmlentities(_request('rac')); |
| 22 | 24 | $type = _request('type'); |
| 23 | 25 | $do = _request('do'); |
| 24 | - if (preg_match('/^\w*$/', $do)) |
|
| 25 | - $r = exec_rechercher_args($id, $type, $exclus, $rac, $do); |
|
| 26 | - else $r = ''; |
|
| 26 | + if (preg_match('/^\w*$/', $do)) { |
|
| 27 | + $r = exec_rechercher_args($id, $type, $exclus, $rac, $do); |
|
| 28 | + } else { |
|
| 29 | + $r = ''; |
|
| 30 | + } |
|
| 27 | 31 | ajax_retour($r); |
| 28 | 32 | } |
| 29 | 33 | |
| 30 | 34 | // http://doc.spip.org/@exec_rechercher_args |
| 31 | 35 | function exec_rechercher_args($id, $type, $exclus, $rac, $do){ |
| 32 | - if (!$do) $do = 'aff'; |
|
| 36 | + if (!$do) { |
|
| 37 | + $do = 'aff'; |
|
| 38 | + } |
|
| 33 | 39 | |
| 34 | 40 | $where = preg_split(",\s+,", $type); |
| 35 | 41 | if ($where){ |
@@ -48,7 +54,9 @@ discard block |
||
| 48 | 54 | if ($exclus){ |
| 49 | 55 | include_spip('inc/rubriques'); |
| 50 | 56 | $where_exclus = " AND " . sql_in('id_rubrique', calcul_branche_in($exclus), 'NOT'); |
| 51 | - } else $where_exclus = ''; |
|
| 57 | + } else { |
|
| 58 | + $where_exclus = ''; |
|
| 59 | + } |
|
| 52 | 60 | |
| 53 | 61 | $res = sql_select("id_rubrique, id_parent, titre", "spip_rubriques", "$where_id$where_exclus"); |
| 54 | 62 | |
@@ -66,9 +74,11 @@ discard block |
||
| 66 | 74 | $id_rubrique = $row["id_rubrique"]; |
| 67 | 75 | $rub[$id_rubrique]["titre"] = typo($row["titre"]); |
| 68 | 76 | $rub[$id_rubrique]["id_parent"] = $row["id_parent"]; |
| 69 | - if (isset($points[$id_rubrique])) |
|
| 70 | - $points[$id_rubrique] += 2; |
|
| 71 | - else $points[$id_rubrique] = 0; |
|
| 77 | + if (isset($points[$id_rubrique])) { |
|
| 78 | + $points[$id_rubrique] += 2; |
|
| 79 | + } else { |
|
| 80 | + $points[$id_rubrique] = 0; |
|
| 81 | + } |
|
| 72 | 82 | } |
| 73 | 83 | $res = sql_select("id_rubrique, id_parent, titre", "spip_rubriques", "$where_desc$where_exclus"); |
| 74 | 84 | |
@@ -76,9 +86,11 @@ discard block |
||
| 76 | 86 | $id_rubrique = $row["id_rubrique"]; |
| 77 | 87 | $rub[$id_rubrique]["titre"] = typo($row["titre"]); |
| 78 | 88 | $rub[$id_rubrique]["id_parent"] = $row["id_parent"]; |
| 79 | - if (isset($points[$id_rubrique])) |
|
| 80 | - $points[$id_rubrique] += 1; |
|
| 81 | - else $points[$id_rubrique] = 0; |
|
| 89 | + if (isset($points[$id_rubrique])) { |
|
| 90 | + $points[$id_rubrique] += 1; |
|
| 91 | + } else { |
|
| 92 | + $points[$id_rubrique] = 0; |
|
| 93 | + } |
|
| 82 | 94 | } |
| 83 | 95 | |
| 84 | 96 | if ($points){ |
@@ -101,10 +113,11 @@ discard block |
||
| 101 | 113 | // http://doc.spip.org/@proposer_item |
| 102 | 114 | function proposer_item($ids, $titles, $rac, $type, $do){ |
| 103 | 115 | |
| 104 | - if (!$ids) |
|
| 105 | - return "<br /><br /><div style='padding: 5px; color: red;'><b>" |
|
| 116 | + if (!$ids) { |
|
| 117 | + return "<br /><br /><div style='padding: 5px; color: red;'><b>" |
|
| 106 | 118 | . spip_htmlentities($type) |
| 107 | 119 | . "</b> : " . _T('avis_aucun_resultat') . "</div>"; |
| 120 | + } |
|
| 108 | 121 | |
| 109 | 122 | $ret = ''; |
| 110 | 123 | $info = generer_url_ecrire('informer', "type=rubrique&rac=$rac&id="); |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | |
| 16 | 18 | $fond = _request('exec'); |
@@ -23,9 +25,9 @@ discard block |
||
| 23 | 25 | echo minipres(); |
| 24 | 26 | exit; |
| 25 | 27 | } |
| 26 | -} |
|
| 27 | -else |
|
| 28 | +} else { |
|
| 28 | 29 | $fond = "prive/squelettes/$fond"; |
| 30 | +} |
|
| 29 | 31 | |
| 30 | 32 | // quelques inclusions et ini prealables |
| 31 | 33 | include_spip('inc/commencer_page'); |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | # afficher les sous-rubriques d'une rubrique (composant du mini-navigateur) |
| 16 | 18 | |
@@ -25,11 +27,15 @@ discard block |
||
| 25 | 27 | $col = intval(_request('col')); |
| 26 | 28 | $do = _request('do'); |
| 27 | 29 | if (preg_match('/^\w*$/', $do)) { |
| 28 | - if (!$do) $do = 'aff'; |
|
| 30 | + if (!$do) { |
|
| 31 | + $do = 'aff'; |
|
| 32 | + } |
|
| 29 | 33 | |
| 30 | 34 | $plonger = charger_fonction('plonger', 'inc'); |
| 31 | 35 | $r = $plonger($id, spip_htmlentities($rac), array(), $col, $exclus, $do); |
| 32 | - } else $r = ''; |
|
| 36 | + } else { |
|
| 37 | + $r = ''; |
|
| 38 | + } |
|
| 33 | 39 | |
| 34 | 40 | ajax_retour($r); |
| 35 | 41 | } |
@@ -10,7 +10,9 @@ |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | |
| 16 | 18 | // http://doc.spip.org/@exec_demande_mise_a_jour_dist |
@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
| 11 | 11 | \***************************************************************************/ |
| 12 | 12 | |
| 13 | -if (!defined('_ECRIRE_INC_VERSION')) return; |
|
| 13 | +if (!defined('_ECRIRE_INC_VERSION')) { |
|
| 14 | + return; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | include_spip('inc/actions'); |
| 16 | 18 | |
@@ -25,12 +27,16 @@ discard block |
||
| 25 | 27 | $rac = _request('racine'); |
| 26 | 28 | $do = _request('do'); |
| 27 | 29 | if (preg_match('/^\w*$/', $do)) { |
| 28 | - if (!$do) $do = 'aff'; |
|
| 30 | + if (!$do) { |
|
| 31 | + $do = 'aff'; |
|
| 32 | + } |
|
| 29 | 33 | |
| 30 | 34 | $selectionner = charger_fonction('selectionner', 'inc'); |
| 31 | 35 | |
| 32 | 36 | $r = $selectionner($id, "choix_parent", $exclus, $rac, $type!='breve', $do); |
| 33 | - } else $r = ''; |
|
| 37 | + } else { |
|
| 38 | + $r = ''; |
|
| 39 | + } |
|
| 34 | 40 | ajax_retour($r); |
| 35 | 41 | } |
| 36 | 42 | ?> |