@@ -17,38 +17,38 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * Exec de la page de destruction des tables de SPIP |
| 25 | 25 | **/ |
| 26 | 26 | function exec_base_delete_all_dist() { |
| 27 | - include_spip('inc/autoriser'); |
|
| 28 | - if (!autoriser('detruire')) { |
|
| 29 | - include_spip('inc/minipres'); |
|
| 30 | - echo minipres(); |
|
| 31 | - } else { |
|
| 32 | - include_spip('base/dump'); |
|
| 33 | - $res = base_lister_toutes_tables('', array(), array(), true); |
|
| 34 | - if (!$res) { |
|
| 35 | - include_spip('inc/minipres'); |
|
| 36 | - spip_log("Erreur base de donnees"); |
|
| 37 | - echo minipres(_T('info_travaux_titre'), |
|
| 38 | - _T('titre_probleme_technique') . "<p><tt>" . sql_errno() . " " . sql_error() . "</tt></p>"); |
|
| 39 | - } else { |
|
| 40 | - $res = base_saisie_tables('delete', $res); |
|
| 41 | - include_spip('inc/headers'); |
|
| 42 | - $res = "\n<ol style='text-align:left'><li>\n" . |
|
| 43 | - join("</li>\n<li>", $res) . |
|
| 44 | - '</li></ol>'; |
|
| 45 | - $admin = charger_fonction('admin', 'inc'); |
|
| 46 | - $res = $admin('delete_all', _T('titre_page_delete_all'), $res); |
|
| 47 | - if (!$res) { |
|
| 48 | - redirige_url_ecrire('install', ''); |
|
| 49 | - } else { |
|
| 50 | - echo $res; |
|
| 51 | - } |
|
| 52 | - } |
|
| 53 | - } |
|
| 27 | + include_spip('inc/autoriser'); |
|
| 28 | + if (!autoriser('detruire')) { |
|
| 29 | + include_spip('inc/minipres'); |
|
| 30 | + echo minipres(); |
|
| 31 | + } else { |
|
| 32 | + include_spip('base/dump'); |
|
| 33 | + $res = base_lister_toutes_tables('', array(), array(), true); |
|
| 34 | + if (!$res) { |
|
| 35 | + include_spip('inc/minipres'); |
|
| 36 | + spip_log("Erreur base de donnees"); |
|
| 37 | + echo minipres(_T('info_travaux_titre'), |
|
| 38 | + _T('titre_probleme_technique') . "<p><tt>" . sql_errno() . " " . sql_error() . "</tt></p>"); |
|
| 39 | + } else { |
|
| 40 | + $res = base_saisie_tables('delete', $res); |
|
| 41 | + include_spip('inc/headers'); |
|
| 42 | + $res = "\n<ol style='text-align:left'><li>\n" . |
|
| 43 | + join("</li>\n<li>", $res) . |
|
| 44 | + '</li></ol>'; |
|
| 45 | + $admin = charger_fonction('admin', 'inc'); |
|
| 46 | + $res = $admin('delete_all', _T('titre_page_delete_all'), $res); |
|
| 47 | + if (!$res) { |
|
| 48 | + redirige_url_ecrire('install', ''); |
|
| 49 | + } else { |
|
| 50 | + echo $res; |
|
| 51 | + } |
|
| 52 | + } |
|
| 53 | + } |
|
| 54 | 54 | } |
@@ -35,12 +35,12 @@ |
||
| 35 | 35 | include_spip('inc/minipres'); |
| 36 | 36 | spip_log("Erreur base de donnees"); |
| 37 | 37 | echo minipres(_T('info_travaux_titre'), |
| 38 | - _T('titre_probleme_technique') . "<p><tt>" . sql_errno() . " " . sql_error() . "</tt></p>"); |
|
| 38 | + _T('titre_probleme_technique')."<p><tt>".sql_errno()." ".sql_error()."</tt></p>"); |
|
| 39 | 39 | } else { |
| 40 | 40 | $res = base_saisie_tables('delete', $res); |
| 41 | 41 | include_spip('inc/headers'); |
| 42 | - $res = "\n<ol style='text-align:left'><li>\n" . |
|
| 43 | - join("</li>\n<li>", $res) . |
|
| 42 | + $res = "\n<ol style='text-align:left'><li>\n". |
|
| 43 | + join("</li>\n<li>", $res). |
|
| 44 | 44 | '</li></ol>'; |
| 45 | 45 | $admin = charger_fonction('admin', 'inc'); |
| 46 | 46 | $res = $admin('delete_all', _T('titre_page_delete_all'), $res); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * @package SPIP\Core\Rubriques |
| 17 | 17 | **/ |
| 18 | 18 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 19 | - return; |
|
| 19 | + return; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | include_spip('inc/actions'); |
@@ -28,21 +28,21 @@ discard block |
||
| 28 | 28 | * @uses ajax_retour() |
| 29 | 29 | **/ |
| 30 | 30 | function exec_selectionner_dist() { |
| 31 | - $id = intval(_request('id')); |
|
| 32 | - $exclus = intval(_request('exclus')); |
|
| 33 | - $type = _request('type'); |
|
| 34 | - $rac = _request('racine'); |
|
| 35 | - $do = _request('do'); |
|
| 36 | - if (preg_match('/^\w*$/', $do)) { |
|
| 37 | - if (!$do) { |
|
| 38 | - $do = 'aff'; |
|
| 39 | - } |
|
| 31 | + $id = intval(_request('id')); |
|
| 32 | + $exclus = intval(_request('exclus')); |
|
| 33 | + $type = _request('type'); |
|
| 34 | + $rac = _request('racine'); |
|
| 35 | + $do = _request('do'); |
|
| 36 | + if (preg_match('/^\w*$/', $do)) { |
|
| 37 | + if (!$do) { |
|
| 38 | + $do = 'aff'; |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - $selectionner = charger_fonction('selectionner', 'inc'); |
|
| 41 | + $selectionner = charger_fonction('selectionner', 'inc'); |
|
| 42 | 42 | |
| 43 | - $r = $selectionner($id, "choix_parent", $exclus, $rac, $type != 'breve', $do); |
|
| 44 | - } else { |
|
| 45 | - $r = ''; |
|
| 46 | - } |
|
| 47 | - ajax_retour($r); |
|
| 43 | + $r = $selectionner($id, "choix_parent", $exclus, $rac, $type != 'breve', $do); |
|
| 44 | + } else { |
|
| 45 | + $r = ''; |
|
| 46 | + } |
|
| 47 | + ajax_retour($r); |
|
| 48 | 48 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | include_spip('inc/actions'); |
@@ -29,20 +29,20 @@ discard block |
||
| 29 | 29 | * @uses ajax_retour() |
| 30 | 30 | **/ |
| 31 | 31 | function exec_informer_dist() { |
| 32 | - $id = intval(_request('id')); |
|
| 33 | - $col = intval(_request('col')); |
|
| 34 | - $exclus = intval(_request('exclus')); |
|
| 35 | - $do = _request('do'); |
|
| 32 | + $id = intval(_request('id')); |
|
| 33 | + $col = intval(_request('col')); |
|
| 34 | + $exclus = intval(_request('exclus')); |
|
| 35 | + $do = _request('do'); |
|
| 36 | 36 | |
| 37 | - if (preg_match('/^\w*$/', $do)) { |
|
| 38 | - if (!$do) { |
|
| 39 | - $do = 'aff'; |
|
| 40 | - } |
|
| 37 | + if (preg_match('/^\w*$/', $do)) { |
|
| 38 | + if (!$do) { |
|
| 39 | + $do = 'aff'; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - $informer = charger_fonction('informer', 'inc'); |
|
| 43 | - $res = $informer($id, $col, $exclus, _request('rac'), _request('type'), $do); |
|
| 44 | - } else { |
|
| 45 | - $res = ''; |
|
| 46 | - } |
|
| 47 | - ajax_retour($res); |
|
| 42 | + $informer = charger_fonction('informer', 'inc'); |
|
| 43 | + $res = $informer($id, $col, $exclus, _request('rac'), _request('type'), $do); |
|
| 44 | + } else { |
|
| 45 | + $res = ''; |
|
| 46 | + } |
|
| 47 | + ajax_retour($res); |
|
| 48 | 48 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | include_spip('inc/actions'); |
@@ -30,63 +30,63 @@ discard block |
||
| 30 | 30 | **/ |
| 31 | 31 | function exec_upgrade_dist() { |
| 32 | 32 | |
| 33 | - if (!_FILE_CONNECT) { |
|
| 34 | - redirige_url_ecrire("install"); |
|
| 35 | - } |
|
| 33 | + if (!_FILE_CONNECT) { |
|
| 34 | + redirige_url_ecrire("install"); |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - // Si reinstallation necessaire, message ad hoc |
|
| 38 | - if (_request('reinstall') == 'oui') { |
|
| 39 | - include_spip('inc/minipres'); |
|
| 40 | - $r = minipres(_T('titre_page_upgrade'), |
|
| 41 | - "<p><b>" |
|
| 42 | - . _T('texte_nouvelle_version_spip_1') |
|
| 43 | - . "</b><p> " |
|
| 44 | - . _T('texte_nouvelle_version_spip_2', |
|
| 45 | - array('connect' => '<tt>' . _FILE_CONNECT . '</tt>')) |
|
| 46 | - . generer_form_ecrire('upgrade', "<input type='hidden' name='reinstall' value='non' />", '', |
|
| 47 | - _T('bouton_relancer_installation'))); |
|
| 48 | - echo $r; |
|
| 49 | - } elseif (_request('fin')) { |
|
| 50 | - include_spip('inc/plugin'); |
|
| 51 | - actualise_plugins_actifs(); |
|
| 52 | - include_spip('inc/headers'); |
|
| 53 | - $res = generer_url_ecrire('admin_plugin', 'var_mode=recalcul'); |
|
| 54 | - echo redirige_formulaire($res); |
|
| 55 | - } else { |
|
| 37 | + // Si reinstallation necessaire, message ad hoc |
|
| 38 | + if (_request('reinstall') == 'oui') { |
|
| 39 | + include_spip('inc/minipres'); |
|
| 40 | + $r = minipres(_T('titre_page_upgrade'), |
|
| 41 | + "<p><b>" |
|
| 42 | + . _T('texte_nouvelle_version_spip_1') |
|
| 43 | + . "</b><p> " |
|
| 44 | + . _T('texte_nouvelle_version_spip_2', |
|
| 45 | + array('connect' => '<tt>' . _FILE_CONNECT . '</tt>')) |
|
| 46 | + . generer_form_ecrire('upgrade', "<input type='hidden' name='reinstall' value='non' />", '', |
|
| 47 | + _T('bouton_relancer_installation'))); |
|
| 48 | + echo $r; |
|
| 49 | + } elseif (_request('fin')) { |
|
| 50 | + include_spip('inc/plugin'); |
|
| 51 | + actualise_plugins_actifs(); |
|
| 52 | + include_spip('inc/headers'); |
|
| 53 | + $res = generer_url_ecrire('admin_plugin', 'var_mode=recalcul'); |
|
| 54 | + echo redirige_formulaire($res); |
|
| 55 | + } else { |
|
| 56 | 56 | |
| 57 | - if (!isset($GLOBALS['meta']['version_installee'])) { |
|
| 58 | - $GLOBALS['meta']['version_installee'] = 0.0; |
|
| 59 | - } else { |
|
| 60 | - $GLOBALS['meta']['version_installee'] = |
|
| 61 | - (double)str_replace(',', '.', $GLOBALS['meta']['version_installee']); |
|
| 62 | - } |
|
| 63 | - # NB: str_replace car, sur club-internet, il semble que version_installe soit |
|
| 64 | - # enregistree au format '1,812' et non '1.812' |
|
| 57 | + if (!isset($GLOBALS['meta']['version_installee'])) { |
|
| 58 | + $GLOBALS['meta']['version_installee'] = 0.0; |
|
| 59 | + } else { |
|
| 60 | + $GLOBALS['meta']['version_installee'] = |
|
| 61 | + (double)str_replace(',', '.', $GLOBALS['meta']['version_installee']); |
|
| 62 | + } |
|
| 63 | + # NB: str_replace car, sur club-internet, il semble que version_installe soit |
|
| 64 | + # enregistree au format '1,812' et non '1.812' |
|
| 65 | 65 | |
| 66 | - // Erreur downgrade |
|
| 67 | - // (cas de double installation de fichiers SPIP sur une meme base) |
|
| 68 | - if ($GLOBALS['spip_version_base'] < $GLOBALS['meta']['version_installee']) { |
|
| 69 | - $commentaire = _T('info_mise_a_niveau_base_2'); |
|
| 70 | - } // Commentaire standard upgrade |
|
| 71 | - else { |
|
| 72 | - $commentaire = _T('texte_mise_a_niveau_base_1'); |
|
| 73 | - } |
|
| 66 | + // Erreur downgrade |
|
| 67 | + // (cas de double installation de fichiers SPIP sur une meme base) |
|
| 68 | + if ($GLOBALS['spip_version_base'] < $GLOBALS['meta']['version_installee']) { |
|
| 69 | + $commentaire = _T('info_mise_a_niveau_base_2'); |
|
| 70 | + } // Commentaire standard upgrade |
|
| 71 | + else { |
|
| 72 | + $commentaire = _T('texte_mise_a_niveau_base_1'); |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - $commentaire .= "<br />[" . $GLOBALS['meta']['version_installee'] . "/" . $GLOBALS['spip_version_base'] . "]"; |
|
| 75 | + $commentaire .= "<br />[" . $GLOBALS['meta']['version_installee'] . "/" . $GLOBALS['spip_version_base'] . "]"; |
|
| 76 | 76 | |
| 77 | - $_POST['reinstall'] = 'non'; // pour copy_request dans admin |
|
| 78 | - include_spip('inc/headers'); |
|
| 79 | - $admin = charger_fonction('admin', 'inc'); |
|
| 80 | - $res = $admin('upgrade', _T('info_mise_a_niveau_base'), $commentaire); |
|
| 81 | - if ($res) { |
|
| 82 | - echo $res; |
|
| 83 | - } else { |
|
| 84 | - // effacer les alea pour forcer leur relecture |
|
| 85 | - // si jamais ils ont change pendant l'upgrade |
|
| 86 | - unset($GLOBALS['meta']['alea_ephemere']); |
|
| 87 | - unset($GLOBALS['meta']['alea_ephemere_ancien']); |
|
| 88 | - $res = redirige_action_auteur('purger', 'cache', 'upgrade', 'fin=oui', true); |
|
| 89 | - echo redirige_formulaire($res); |
|
| 90 | - } |
|
| 91 | - } |
|
| 77 | + $_POST['reinstall'] = 'non'; // pour copy_request dans admin |
|
| 78 | + include_spip('inc/headers'); |
|
| 79 | + $admin = charger_fonction('admin', 'inc'); |
|
| 80 | + $res = $admin('upgrade', _T('info_mise_a_niveau_base'), $commentaire); |
|
| 81 | + if ($res) { |
|
| 82 | + echo $res; |
|
| 83 | + } else { |
|
| 84 | + // effacer les alea pour forcer leur relecture |
|
| 85 | + // si jamais ils ont change pendant l'upgrade |
|
| 86 | + unset($GLOBALS['meta']['alea_ephemere']); |
|
| 87 | + unset($GLOBALS['meta']['alea_ephemere_ancien']); |
|
| 88 | + $res = redirige_action_auteur('purger', 'cache', 'upgrade', 'fin=oui', true); |
|
| 89 | + echo redirige_formulaire($res); |
|
| 90 | + } |
|
| 91 | + } |
|
| 92 | 92 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | . _T('texte_nouvelle_version_spip_1') |
| 43 | 43 | . "</b><p> " |
| 44 | 44 | . _T('texte_nouvelle_version_spip_2', |
| 45 | - array('connect' => '<tt>' . _FILE_CONNECT . '</tt>')) |
|
| 45 | + array('connect' => '<tt>'._FILE_CONNECT.'</tt>')) |
|
| 46 | 46 | . generer_form_ecrire('upgrade', "<input type='hidden' name='reinstall' value='non' />", '', |
| 47 | 47 | _T('bouton_relancer_installation'))); |
| 48 | 48 | echo $r; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $GLOBALS['meta']['version_installee'] = 0.0; |
| 59 | 59 | } else { |
| 60 | 60 | $GLOBALS['meta']['version_installee'] = |
| 61 | - (double)str_replace(',', '.', $GLOBALS['meta']['version_installee']); |
|
| 61 | + (double) str_replace(',', '.', $GLOBALS['meta']['version_installee']); |
|
| 62 | 62 | } |
| 63 | 63 | # NB: str_replace car, sur club-internet, il semble que version_installe soit |
| 64 | 64 | # enregistree au format '1,812' et non '1.812' |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $commentaire = _T('texte_mise_a_niveau_base_1'); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - $commentaire .= "<br />[" . $GLOBALS['meta']['version_installee'] . "/" . $GLOBALS['spip_version_base'] . "]"; |
|
| 75 | + $commentaire .= "<br />[".$GLOBALS['meta']['version_installee']."/".$GLOBALS['spip_version_base']."]"; |
|
| 76 | 76 | |
| 77 | 77 | $_POST['reinstall'] = 'non'; // pour copy_request dans admin |
| 78 | 78 | include_spip('inc/headers'); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | 23 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 24 | - return; |
|
| 24 | + return; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
@@ -29,29 +29,29 @@ discard block |
||
| 29 | 29 | * Demander à mettre à jour la base de données |
| 30 | 30 | */ |
| 31 | 31 | function exec_demande_mise_a_jour_dist() { |
| 32 | - // on fait la verif du path avant tout, |
|
| 33 | - // et l'installation des qu'on est dans la colonne principale |
|
| 34 | - // si jamais la liste des plugins actifs change, il faut faire un refresh du hit |
|
| 35 | - // pour etre sur que les bons fichiers seront charges lors de l'install |
|
| 36 | - include_spip('inc/plugin'); |
|
| 37 | - if (actualise_plugins_actifs()) { |
|
| 38 | - include_spip('inc/headers'); |
|
| 39 | - redirige_par_entete(self()); |
|
| 40 | - } |
|
| 41 | - |
|
| 42 | - include_spip('inc/presentation'); |
|
| 43 | - include_spip('inc/filtres_boites'); |
|
| 44 | - $commencer_page = charger_fonction('commencer_page', 'inc'); |
|
| 45 | - echo $commencer_page('', '', '', '', true, false, false); |
|
| 46 | - |
|
| 47 | - echo debut_grand_cadre(true); |
|
| 48 | - echo boite_ouvrir(_T('info_message_technique'), 'notice'); |
|
| 49 | - echo "<p>" . _T('info_procedure_maj_version') . "</p>", |
|
| 50 | - "<p>" . _T('info_administrateur_site_01') . "</p>"; |
|
| 51 | - echo bouton_action(_T('bouton_mettre_a_jour_base'), generer_url_ecrire("upgrade", "reinstall=non")); |
|
| 52 | - echo boite_fermer(); |
|
| 53 | - // masquer les erreurs sql sur cette page car proviennent de la base pas a jour ! |
|
| 54 | - echo '<style type="text/css">#debug-nav {display: none;}</style>'; |
|
| 55 | - echo fin_grand_cadre(true); |
|
| 56 | - echo fin_page(); |
|
| 32 | + // on fait la verif du path avant tout, |
|
| 33 | + // et l'installation des qu'on est dans la colonne principale |
|
| 34 | + // si jamais la liste des plugins actifs change, il faut faire un refresh du hit |
|
| 35 | + // pour etre sur que les bons fichiers seront charges lors de l'install |
|
| 36 | + include_spip('inc/plugin'); |
|
| 37 | + if (actualise_plugins_actifs()) { |
|
| 38 | + include_spip('inc/headers'); |
|
| 39 | + redirige_par_entete(self()); |
|
| 40 | + } |
|
| 41 | + |
|
| 42 | + include_spip('inc/presentation'); |
|
| 43 | + include_spip('inc/filtres_boites'); |
|
| 44 | + $commencer_page = charger_fonction('commencer_page', 'inc'); |
|
| 45 | + echo $commencer_page('', '', '', '', true, false, false); |
|
| 46 | + |
|
| 47 | + echo debut_grand_cadre(true); |
|
| 48 | + echo boite_ouvrir(_T('info_message_technique'), 'notice'); |
|
| 49 | + echo "<p>" . _T('info_procedure_maj_version') . "</p>", |
|
| 50 | + "<p>" . _T('info_administrateur_site_01') . "</p>"; |
|
| 51 | + echo bouton_action(_T('bouton_mettre_a_jour_base'), generer_url_ecrire("upgrade", "reinstall=non")); |
|
| 52 | + echo boite_fermer(); |
|
| 53 | + // masquer les erreurs sql sur cette page car proviennent de la base pas a jour ! |
|
| 54 | + echo '<style type="text/css">#debug-nav {display: none;}</style>'; |
|
| 55 | + echo fin_grand_cadre(true); |
|
| 56 | + echo fin_page(); |
|
| 57 | 57 | } |
@@ -46,8 +46,8 @@ |
||
| 46 | 46 | |
| 47 | 47 | echo debut_grand_cadre(true); |
| 48 | 48 | echo boite_ouvrir(_T('info_message_technique'), 'notice'); |
| 49 | - echo "<p>" . _T('info_procedure_maj_version') . "</p>", |
|
| 50 | - "<p>" . _T('info_administrateur_site_01') . "</p>"; |
|
| 49 | + echo "<p>"._T('info_procedure_maj_version')."</p>", |
|
| 50 | + "<p>"._T('info_administrateur_site_01')."</p>"; |
|
| 51 | 51 | echo bouton_action(_T('bouton_mettre_a_jour_base'), generer_url_ecrire("upgrade", "reinstall=non")); |
| 52 | 52 | echo boite_fermer(); |
| 53 | 53 | // masquer les erreurs sql sur cette page car proviennent de la base pas a jour ! |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | 25 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 26 | - return; |
|
| 26 | + return; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
@@ -31,24 +31,24 @@ discard block |
||
| 31 | 31 | * Réparer la base de données |
| 32 | 32 | */ |
| 33 | 33 | function exec_base_repair_dist() { |
| 34 | - $ok = false; |
|
| 35 | - if (!spip_connect()) { |
|
| 36 | - $message = _T('titre_probleme_technique'); |
|
| 37 | - } else { |
|
| 38 | - $version_sql = sql_version(); |
|
| 39 | - if (!$version_sql) { |
|
| 40 | - $message = _T('avis_erreur_connexion_mysql'); |
|
| 41 | - } else { |
|
| 42 | - $message = _T('texte_requetes_echouent'); |
|
| 43 | - $ok = true; |
|
| 44 | - } |
|
| 45 | - $action = _T('texte_tenter_reparation'); |
|
| 46 | - } |
|
| 47 | - if ($ok) { |
|
| 48 | - $admin = charger_fonction('admin', 'inc'); |
|
| 49 | - echo $admin('repair', $action, $message, true); |
|
| 50 | - } else { |
|
| 51 | - include_spip('inc/minipres'); |
|
| 52 | - echo minipres(_T('titre_reparation'), "<p>$message</p>"); |
|
| 53 | - } |
|
| 34 | + $ok = false; |
|
| 35 | + if (!spip_connect()) { |
|
| 36 | + $message = _T('titre_probleme_technique'); |
|
| 37 | + } else { |
|
| 38 | + $version_sql = sql_version(); |
|
| 39 | + if (!$version_sql) { |
|
| 40 | + $message = _T('avis_erreur_connexion_mysql'); |
|
| 41 | + } else { |
|
| 42 | + $message = _T('texte_requetes_echouent'); |
|
| 43 | + $ok = true; |
|
| 44 | + } |
|
| 45 | + $action = _T('texte_tenter_reparation'); |
|
| 46 | + } |
|
| 47 | + if ($ok) { |
|
| 48 | + $admin = charger_fonction('admin', 'inc'); |
|
| 49 | + echo $admin('repair', $action, $message, true); |
|
| 50 | + } else { |
|
| 51 | + include_spip('inc/minipres'); |
|
| 52 | + echo minipres(_T('titre_reparation'), "<p>$message</p>"); |
|
| 53 | + } |
|
| 54 | 54 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | 23 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 24 | - return; |
|
| 24 | + return; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
@@ -29,15 +29,15 @@ discard block |
||
| 29 | 29 | $GLOBALS['delais'] = 0;// pas de cache ! |
| 30 | 30 | // Securite |
| 31 | 31 | if (strstr($fond, '/')) { |
| 32 | - if (!include_spip('inc/autoriser') |
|
| 33 | - or !autoriser('webmestre') |
|
| 34 | - ) { |
|
| 35 | - include_spip('inc/minipres'); |
|
| 36 | - echo minipres(); |
|
| 37 | - exit; |
|
| 38 | - } |
|
| 32 | + if (!include_spip('inc/autoriser') |
|
| 33 | + or !autoriser('webmestre') |
|
| 34 | + ) { |
|
| 35 | + include_spip('inc/minipres'); |
|
| 36 | + echo minipres(); |
|
| 37 | + exit; |
|
| 38 | + } |
|
| 39 | 39 | } else { |
| 40 | - $fond = "prive/squelettes/$fond"; |
|
| 40 | + $fond = "prive/squelettes/$fond"; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | // quelques inclusions et ini prealables |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | * @todo supprimer cette fonction vide ? |
| 50 | 50 | **/ |
| 51 | 51 | function shutdown_error() { |
| 52 | - // si on arrive ici avec un tampon non ferme : erreur fatale |
|
| 53 | - /* if (ob_get_level()){ |
|
| 52 | + // si on arrive ici avec un tampon non ferme : erreur fatale |
|
| 53 | + /* if (ob_get_level()){ |
|
| 54 | 54 | // envoyer tous les tampons |
| 55 | 55 | while (ob_get_level()) |
| 56 | 56 | ob_end_flush(); |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | $fond = _request('exec'); |
| 29 | -$GLOBALS['delais'] = 0;// pas de cache ! |
|
| 29 | +$GLOBALS['delais'] = 0; // pas de cache ! |
|
| 30 | 30 | // Securite |
| 31 | 31 | if (strstr($fond, '/')) { |
| 32 | 32 | if (!include_spip('inc/autoriser') |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | 25 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 26 | - return; |
|
| 26 | + return; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -43,83 +43,83 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | function exec_fond_monobloc_dist() { |
| 45 | 45 | |
| 46 | - // pas d'autorisation |
|
| 47 | - // c'est au fond de les gerer avec #AUTORISER, et de renvoyer un fond vide le cas echeant |
|
| 48 | - // qui declenchera un minipres acces interdit |
|
| 49 | - $exec = _request('exec'); |
|
| 50 | - $fond = trim(recuperer_fond("prive/exec/$exec", $_REQUEST)); |
|
| 51 | - if (!$fond) { |
|
| 52 | - include_spip('inc/minipres'); |
|
| 53 | - echo minipres(); |
|
| 54 | - } else { |
|
| 55 | - |
|
| 56 | - $titre = "exec_$exec"; |
|
| 57 | - $hierarchie = ""; |
|
| 58 | - $navigation = ""; |
|
| 59 | - $extra = ""; |
|
| 60 | - |
|
| 61 | - // recuperer le titre dans le premier hn de la page |
|
| 62 | - if (preg_match(",<h[1-6][^>]*>(.+)</h[1-6]>,Uims", $fond, $match)) { |
|
| 63 | - $titre = $match[1]; |
|
| 64 | - } |
|
| 65 | - |
|
| 66 | - // recuperer la hierarchie (au-dessus du contenu) |
|
| 67 | - if (preg_match(",<!--#hierarchie-->.+<!--/#hierarchie-->,Uims", $fond, $match)) { |
|
| 68 | - $hierarchie = $match[0]; |
|
| 69 | - $fond = str_replace($hierarchie, "", $fond); |
|
| 70 | - } |
|
| 71 | - |
|
| 72 | - // recuperer la navigation (colonne de gauche) |
|
| 73 | - if (preg_match(",<!--#navigation-->.+<!--/#navigation-->,Uims", $fond, $match)) { |
|
| 74 | - $navigation = $match[0]; |
|
| 75 | - $fond = str_replace($navigation, "", $fond); |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - // recuperer les extras (colonne de droite) |
|
| 79 | - if (preg_match(",<!--#extra-->.+<!--/#extra-->,Uims", $fond, $match)) { |
|
| 80 | - $extra = $match[0]; |
|
| 81 | - $fond = str_replace($extra, "", $fond); |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini |
|
| 85 | - $commencer_page = charger_fonction('commencer_page', 'inc'); |
|
| 86 | - echo $commencer_page($titre); |
|
| 87 | - |
|
| 88 | - if ($hierarchie) { |
|
| 89 | - echo debut_grand_cadre(true); |
|
| 90 | - echo pipeline( |
|
| 91 | - 'affiche_hierarchie', |
|
| 92 | - array( |
|
| 93 | - 'args' => array( |
|
| 94 | - 'exec' => $exec |
|
| 95 | - ), |
|
| 96 | - 'data' => $hierarchie |
|
| 97 | - ) |
|
| 98 | - ); |
|
| 99 | - echo fin_grand_cadre(true); |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - echo debut_gauche("exec_$exec", true); |
|
| 103 | - |
|
| 104 | - $contexte = array('exec' => $exec); |
|
| 105 | - if ($objet_exec = trouver_objet_exec($exec)) { |
|
| 106 | - $id = $objet_exec['id_table_objet']; |
|
| 107 | - if (_request($id)) { |
|
| 108 | - $contexte[$id] = _request($id); |
|
| 109 | - } |
|
| 110 | - } |
|
| 111 | - |
|
| 112 | - echo $navigation; |
|
| 113 | - echo pipeline('affiche_gauche', array('args' => $contexte, 'data' => '')); |
|
| 114 | - |
|
| 115 | - echo creer_colonne_droite("exec_$exec", true); |
|
| 116 | - echo $extra; |
|
| 117 | - echo pipeline('affiche_droite', array('args' => $contexte, 'data' => '')); |
|
| 118 | - |
|
| 119 | - echo debut_droite("exec_$exec", true); |
|
| 120 | - echo $fond; |
|
| 121 | - echo pipeline('affiche_milieu', array('args' => $contexte, 'data' => '')); |
|
| 122 | - |
|
| 123 | - echo fin_gauche(), fin_page(); |
|
| 124 | - } |
|
| 46 | + // pas d'autorisation |
|
| 47 | + // c'est au fond de les gerer avec #AUTORISER, et de renvoyer un fond vide le cas echeant |
|
| 48 | + // qui declenchera un minipres acces interdit |
|
| 49 | + $exec = _request('exec'); |
|
| 50 | + $fond = trim(recuperer_fond("prive/exec/$exec", $_REQUEST)); |
|
| 51 | + if (!$fond) { |
|
| 52 | + include_spip('inc/minipres'); |
|
| 53 | + echo minipres(); |
|
| 54 | + } else { |
|
| 55 | + |
|
| 56 | + $titre = "exec_$exec"; |
|
| 57 | + $hierarchie = ""; |
|
| 58 | + $navigation = ""; |
|
| 59 | + $extra = ""; |
|
| 60 | + |
|
| 61 | + // recuperer le titre dans le premier hn de la page |
|
| 62 | + if (preg_match(",<h[1-6][^>]*>(.+)</h[1-6]>,Uims", $fond, $match)) { |
|
| 63 | + $titre = $match[1]; |
|
| 64 | + } |
|
| 65 | + |
|
| 66 | + // recuperer la hierarchie (au-dessus du contenu) |
|
| 67 | + if (preg_match(",<!--#hierarchie-->.+<!--/#hierarchie-->,Uims", $fond, $match)) { |
|
| 68 | + $hierarchie = $match[0]; |
|
| 69 | + $fond = str_replace($hierarchie, "", $fond); |
|
| 70 | + } |
|
| 71 | + |
|
| 72 | + // recuperer la navigation (colonne de gauche) |
|
| 73 | + if (preg_match(",<!--#navigation-->.+<!--/#navigation-->,Uims", $fond, $match)) { |
|
| 74 | + $navigation = $match[0]; |
|
| 75 | + $fond = str_replace($navigation, "", $fond); |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + // recuperer les extras (colonne de droite) |
|
| 79 | + if (preg_match(",<!--#extra-->.+<!--/#extra-->,Uims", $fond, $match)) { |
|
| 80 | + $extra = $match[0]; |
|
| 81 | + $fond = str_replace($extra, "", $fond); |
|
| 82 | + } |
|
| 83 | + |
|
| 84 | + include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini |
|
| 85 | + $commencer_page = charger_fonction('commencer_page', 'inc'); |
|
| 86 | + echo $commencer_page($titre); |
|
| 87 | + |
|
| 88 | + if ($hierarchie) { |
|
| 89 | + echo debut_grand_cadre(true); |
|
| 90 | + echo pipeline( |
|
| 91 | + 'affiche_hierarchie', |
|
| 92 | + array( |
|
| 93 | + 'args' => array( |
|
| 94 | + 'exec' => $exec |
|
| 95 | + ), |
|
| 96 | + 'data' => $hierarchie |
|
| 97 | + ) |
|
| 98 | + ); |
|
| 99 | + echo fin_grand_cadre(true); |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + echo debut_gauche("exec_$exec", true); |
|
| 103 | + |
|
| 104 | + $contexte = array('exec' => $exec); |
|
| 105 | + if ($objet_exec = trouver_objet_exec($exec)) { |
|
| 106 | + $id = $objet_exec['id_table_objet']; |
|
| 107 | + if (_request($id)) { |
|
| 108 | + $contexte[$id] = _request($id); |
|
| 109 | + } |
|
| 110 | + } |
|
| 111 | + |
|
| 112 | + echo $navigation; |
|
| 113 | + echo pipeline('affiche_gauche', array('args' => $contexte, 'data' => '')); |
|
| 114 | + |
|
| 115 | + echo creer_colonne_droite("exec_$exec", true); |
|
| 116 | + echo $extra; |
|
| 117 | + echo pipeline('affiche_droite', array('args' => $contexte, 'data' => '')); |
|
| 118 | + |
|
| 119 | + echo debut_droite("exec_$exec", true); |
|
| 120 | + echo $fond; |
|
| 121 | + echo pipeline('affiche_milieu', array('args' => $contexte, 'data' => '')); |
|
| 122 | + |
|
| 123 | + echo fin_gauche(), fin_page(); |
|
| 124 | + } |
|
| 125 | 125 | } |
@@ -139,11 +139,11 @@ discard block |
||
| 139 | 139 | if ($quoi !== 'actifs') { |
| 140 | 140 | $lpf = liste_plugin_files(); |
| 141 | 141 | if ($lpf) { |
| 142 | - echo "<p>" . _T('texte_presente_plugin') . "</p>"; |
|
| 142 | + echo "<p>"._T('texte_presente_plugin')."</p>"; |
|
| 143 | 143 | } else { |
| 144 | 144 | if (!@is_dir(_DIR_PLUGINS)) { |
| 145 | - echo "<p>" . _T('plugin_info_automatique_ftp', array('rep' => joli_repertoire(_DIR_PLUGINS))) |
|
| 146 | - . " — " . _T('plugin_info_automatique_creer') . "</p>"; |
|
| 145 | + echo "<p>"._T('plugin_info_automatique_ftp', array('rep' => joli_repertoire(_DIR_PLUGINS))) |
|
| 146 | + . " — "._T('plugin_info_automatique_creer')."</p>"; |
|
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | $lcpaffiche = $lpf; |
@@ -164,8 +164,8 @@ discard block |
||
| 164 | 164 | if (defined('_DIR_PLUGINS_SUPPL')) { |
| 165 | 165 | $nb += count($lcpas); |
| 166 | 166 | } |
| 167 | - echo "<h3>" . sinon(singulier_ou_pluriel($nb, 'plugins_actif_un', 'plugins_actifs', 'count'), |
|
| 168 | - _T('plugins_actif_aucun')) . "</h3>"; |
|
| 167 | + echo "<h3>".sinon(singulier_ou_pluriel($nb, 'plugins_actif_un', 'plugins_actifs', 'count'), |
|
| 168 | + _T('plugins_actif_aucun'))."</h3>"; |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | if (empty($format)) { |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | if ($corps) { |
| 184 | 184 | $corps .= "\n<div class='boutons' style='display:none;'>" |
| 185 | - . "<input type='submit' class='submit save' value='" . _T('bouton_enregistrer') |
|
| 185 | + . "<input type='submit' class='submit save' value='"._T('bouton_enregistrer') |
|
| 186 | 186 | . "' />" |
| 187 | 187 | . "</div>"; |
| 188 | 188 | } |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | . debut_cadre_trait_couleur('', true, '', _T('plugins_liste_dist'), 'liste_plugins_dist') |
| 256 | 256 | . "<p>" |
| 257 | 257 | . _T('plugin_info_plugins_dist_1', array('plugins_dist' => joli_repertoire(_DIR_PLUGINS_DIST))) |
| 258 | - . '<br />' . _T('plugin_info_plugins_dist_2') |
|
| 258 | + . '<br />'._T('plugin_info_plugins_dist_2') |
|
| 259 | 259 | . "</p>" |
| 260 | 260 | . $liste |
| 261 | 261 | . fin_cadre_trait_couleur(true) |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $res = debut_cadre_enfonce('', true, '', _T('plugin_librairies_installees')); |
| 279 | 279 | $res .= '<dl>'; |
| 280 | 280 | foreach ($libs as $lib => $rep) { |
| 281 | - $res .= "<dt>$lib</dt><dd>" . joli_repertoire($rep) . "</dd>\n"; |
|
| 281 | + $res .= "<dt>$lib</dt><dd>".joli_repertoire($rep)."</dd>\n"; |
|
| 282 | 282 | } |
| 283 | 283 | $res .= '</dl>'; |
| 284 | 284 | $res .= fin_cadre_enfonce(true); |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | function liste_librairies() { |
| 297 | 297 | $libs = array(); |
| 298 | 298 | foreach (array_reverse(creer_chemin()) as $d) { |
| 299 | - if (is_dir($dir = $d . 'lib/') |
|
| 299 | + if (is_dir($dir = $d.'lib/') |
|
| 300 | 300 | and $t = opendir($dir) |
| 301 | 301 | ) { |
| 302 | 302 | while (($f = readdir($t)) !== false) { |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | include_spip('inc/config'); |
@@ -37,26 +37,26 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | function exec_admin_plugin_dist($retour = '') { |
| 39 | 39 | |
| 40 | - if (!autoriser('configurer', '_plugins')) { |
|
| 41 | - include_spip('inc/minipres'); |
|
| 42 | - echo minipres(); |
|
| 43 | - } else { |
|
| 44 | - // on fait la verif du path avant tout, |
|
| 45 | - // et l'installation des qu'on est dans la colonne principale |
|
| 46 | - // si jamais la liste des plugins actifs change, il faut faire un refresh du hit |
|
| 47 | - // pour etre sur que les bons fichiers seront charges lors de l'install |
|
| 48 | - $new = actualise_plugins_actifs(); |
|
| 49 | - if ($new and _request('actualise') < 2) { |
|
| 50 | - include_spip('inc/headers'); |
|
| 51 | - if (isset($GLOBALS['fichier_php_compile_recent'])) { |
|
| 52 | - // attendre eventuellement l'invalidation du cache opcode |
|
| 53 | - spip_attend_invalidation_opcode_cache($GLOBALS['fichier_php_compile_recent']); |
|
| 54 | - } |
|
| 55 | - redirige_par_entete(parametre_url(self(), 'actualise', _request('actualise') + 1, '&')); |
|
| 56 | - } else { |
|
| 57 | - admin_plug_args(_request('voir'), _request('erreur'), _request('format')); |
|
| 58 | - } |
|
| 59 | - } |
|
| 40 | + if (!autoriser('configurer', '_plugins')) { |
|
| 41 | + include_spip('inc/minipres'); |
|
| 42 | + echo minipres(); |
|
| 43 | + } else { |
|
| 44 | + // on fait la verif du path avant tout, |
|
| 45 | + // et l'installation des qu'on est dans la colonne principale |
|
| 46 | + // si jamais la liste des plugins actifs change, il faut faire un refresh du hit |
|
| 47 | + // pour etre sur que les bons fichiers seront charges lors de l'install |
|
| 48 | + $new = actualise_plugins_actifs(); |
|
| 49 | + if ($new and _request('actualise') < 2) { |
|
| 50 | + include_spip('inc/headers'); |
|
| 51 | + if (isset($GLOBALS['fichier_php_compile_recent'])) { |
|
| 52 | + // attendre eventuellement l'invalidation du cache opcode |
|
| 53 | + spip_attend_invalidation_opcode_cache($GLOBALS['fichier_php_compile_recent']); |
|
| 54 | + } |
|
| 55 | + redirige_par_entete(parametre_url(self(), 'actualise', _request('actualise') + 1, '&')); |
|
| 56 | + } else { |
|
| 57 | + admin_plug_args(_request('voir'), _request('erreur'), _request('format')); |
|
| 58 | + } |
|
| 59 | + } |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -81,126 +81,126 @@ discard block |
||
| 81 | 81 | * Format d'affichage (liste ou arborescence) |
| 82 | 82 | **/ |
| 83 | 83 | function admin_plug_args($quoi, $erreur, $format) { |
| 84 | - if (!$quoi) { |
|
| 85 | - $quoi = 'actifs'; |
|
| 86 | - } |
|
| 87 | - // empecher l'affichage des erreurs dans le bandeau, on le donne ensuite |
|
| 88 | - // format brut par plugin |
|
| 89 | - $GLOBALS['erreurs_activation_raw'] = plugin_donne_erreurs(true, false); |
|
| 90 | - // format resume mis en forme |
|
| 91 | - $erreur_activation = plugin_donne_erreurs(); |
|
| 92 | - $commencer_page = charger_fonction('commencer_page', 'inc'); |
|
| 93 | - echo $commencer_page(_T('icone_admin_plugin'), "configuration", "plugin"); |
|
| 94 | - |
|
| 95 | - echo debut_gauche('plugin', true); |
|
| 96 | - echo recuperer_fond('prive/squelettes/navigation/configurer', array('exec' => 'admin_plugin')); |
|
| 97 | - |
|
| 98 | - echo pipeline('affiche_gauche', |
|
| 99 | - array( |
|
| 100 | - 'args' => array('exec' => 'admin_plugin'), |
|
| 101 | - 'data' => afficher_librairies() |
|
| 102 | - ) |
|
| 103 | - ); |
|
| 104 | - |
|
| 105 | - echo debut_droite('plugin', true); |
|
| 106 | - echo gros_titre(_T('icone_admin_plugin'), '', false); |
|
| 107 | - |
|
| 108 | - // Barre d'onglets de premier niveau |
|
| 109 | - echo barre_onglets("plugins", "plugins_actifs"); |
|
| 110 | - // Barre d'onglets de second niveau |
|
| 111 | - $onglet2 = $quoi == 'actifs' ? 'plugins_actifs' : 'admin_plugin'; |
|
| 112 | - echo debut_onglet('onglets_simple second'); |
|
| 113 | - echo onglet(_T('plugins_tous_liste'), generer_url_ecrire("admin_plugin", "voir=tous"), 'admin_plugin', $onglet2); |
|
| 114 | - echo onglet(_T('plugins_actifs_liste'), generer_url_ecrire("admin_plugin"), 'plugins_actifs', $onglet2); |
|
| 115 | - echo fin_onglet(); |
|
| 116 | - |
|
| 117 | - // message d'erreur au retour d'une operation |
|
| 118 | - if ($erreur) { |
|
| 119 | - echo "<div class='error'>$erreur</div>"; |
|
| 120 | - } |
|
| 121 | - if ($erreur_activation) { |
|
| 122 | - echo "<div class='error'>$erreur_activation</div>"; |
|
| 123 | - } |
|
| 124 | - |
|
| 125 | - // la mise a jour de cette meta a ete faite par ecrire_plugin_actifs |
|
| 126 | - $actifs = unserialize($GLOBALS['meta']['plugin']); |
|
| 127 | - $lcpa = $actifs + unserialize($GLOBALS['meta']['plugin_attente']); |
|
| 128 | - |
|
| 129 | - // Les affichages se basent sur le repertoire, pas sur le nom |
|
| 130 | - $actifs = liste_chemin_plugin($actifs, ''); |
|
| 131 | - if (defined('_DIR_PLUGINS_SUPPL')) { |
|
| 132 | - $lcpas = liste_chemin_plugin($lcpa, _DIR_PLUGINS_SUPPL); |
|
| 133 | - } |
|
| 134 | - $lcpa = liste_chemin_plugin($lcpa); |
|
| 135 | - |
|
| 136 | - // on installe les plugins maintenant, |
|
| 137 | - // cela permet aux scripts d'install de faire des affichages (moches...) |
|
| 138 | - plugin_installes_meta(); |
|
| 139 | - |
|
| 140 | - echo "<div class='liste-plugins formulaire_spip'>"; |
|
| 141 | - echo debut_cadre_trait_couleur('plugin-24.png', true, '', _T('plugins_liste'), 'plugins'); |
|
| 142 | - |
|
| 143 | - if ($quoi !== 'actifs') { |
|
| 144 | - $lpf = liste_plugin_files(); |
|
| 145 | - if ($lpf) { |
|
| 146 | - echo "<p>" . _T('texte_presente_plugin') . "</p>"; |
|
| 147 | - } else { |
|
| 148 | - if (!@is_dir(_DIR_PLUGINS)) { |
|
| 149 | - echo "<p>" . _T('plugin_info_automatique_ftp', array('rep' => joli_repertoire(_DIR_PLUGINS))) |
|
| 150 | - . " — " . _T('plugin_info_automatique_creer') . "</p>"; |
|
| 151 | - } |
|
| 152 | - } |
|
| 153 | - $lcpaffiche = $lpf; |
|
| 154 | - if (defined('_DIR_PLUGINS_SUPPL')) { |
|
| 155 | - $lcpaffichesup = liste_plugin_files(_DIR_PLUGINS_SUPPL); |
|
| 156 | - } |
|
| 157 | - } else { |
|
| 158 | - // la liste |
|
| 159 | - // $quoi=='actifs' |
|
| 160 | - $lcpaffiche = $lcpa; |
|
| 161 | - if (defined('_DIR_PLUGINS_SUPPL')) { |
|
| 162 | - $lcpaffichesup = $lcpas; |
|
| 163 | - } |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - if ($quoi == 'actifs' or $lpf) { |
|
| 167 | - $nb = count($lcpa); |
|
| 168 | - if (defined('_DIR_PLUGINS_SUPPL')) { |
|
| 169 | - $nb += count($lcpas); |
|
| 170 | - } |
|
| 171 | - echo "<h3>" . sinon(singulier_ou_pluriel($nb, 'plugins_actif_un', 'plugins_actifs', 'count'), |
|
| 172 | - _T('plugins_actif_aucun')) . "</h3>"; |
|
| 173 | - } |
|
| 174 | - |
|
| 175 | - if (empty($format)) { |
|
| 176 | - $format = 'liste'; |
|
| 177 | - } elseif (!in_array($format, array('liste', 'repertoires'))) { |
|
| 178 | - $format = 'repertoires'; |
|
| 179 | - } |
|
| 180 | - |
|
| 181 | - $afficher = charger_fonction("afficher_$format", 'plugins'); |
|
| 182 | - $corps = $afficher(self(), $lcpaffiche, $lcpa, $actifs); |
|
| 183 | - if (defined('_DIR_PLUGINS_SUPPL')) { |
|
| 184 | - $corps .= $afficher(self(), $lcpaffichesup, $lcpas, $actifs, _DIR_PLUGINS_SUPPL); |
|
| 185 | - } |
|
| 186 | - |
|
| 187 | - if ($corps) { |
|
| 188 | - $corps .= "\n<div class='boutons' style='display:none;'>" |
|
| 189 | - . "<input type='submit' class='submit save' value='" . _T('bouton_enregistrer') |
|
| 190 | - . "' />" |
|
| 191 | - . "</div>"; |
|
| 192 | - } |
|
| 193 | - |
|
| 194 | - echo redirige_action_post('activer_plugins', 'activer', 'admin_plugin', '', $corps); |
|
| 195 | - |
|
| 196 | - echo fin_cadre_trait_couleur(true); |
|
| 197 | - |
|
| 198 | - if ($quoi == 'actifs') { |
|
| 199 | - echo affiche_les_plugins_verrouilles($actifs); |
|
| 200 | - } |
|
| 201 | - echo "</div>"; |
|
| 202 | - |
|
| 203 | - echo http_script(" |
|
| 84 | + if (!$quoi) { |
|
| 85 | + $quoi = 'actifs'; |
|
| 86 | + } |
|
| 87 | + // empecher l'affichage des erreurs dans le bandeau, on le donne ensuite |
|
| 88 | + // format brut par plugin |
|
| 89 | + $GLOBALS['erreurs_activation_raw'] = plugin_donne_erreurs(true, false); |
|
| 90 | + // format resume mis en forme |
|
| 91 | + $erreur_activation = plugin_donne_erreurs(); |
|
| 92 | + $commencer_page = charger_fonction('commencer_page', 'inc'); |
|
| 93 | + echo $commencer_page(_T('icone_admin_plugin'), "configuration", "plugin"); |
|
| 94 | + |
|
| 95 | + echo debut_gauche('plugin', true); |
|
| 96 | + echo recuperer_fond('prive/squelettes/navigation/configurer', array('exec' => 'admin_plugin')); |
|
| 97 | + |
|
| 98 | + echo pipeline('affiche_gauche', |
|
| 99 | + array( |
|
| 100 | + 'args' => array('exec' => 'admin_plugin'), |
|
| 101 | + 'data' => afficher_librairies() |
|
| 102 | + ) |
|
| 103 | + ); |
|
| 104 | + |
|
| 105 | + echo debut_droite('plugin', true); |
|
| 106 | + echo gros_titre(_T('icone_admin_plugin'), '', false); |
|
| 107 | + |
|
| 108 | + // Barre d'onglets de premier niveau |
|
| 109 | + echo barre_onglets("plugins", "plugins_actifs"); |
|
| 110 | + // Barre d'onglets de second niveau |
|
| 111 | + $onglet2 = $quoi == 'actifs' ? 'plugins_actifs' : 'admin_plugin'; |
|
| 112 | + echo debut_onglet('onglets_simple second'); |
|
| 113 | + echo onglet(_T('plugins_tous_liste'), generer_url_ecrire("admin_plugin", "voir=tous"), 'admin_plugin', $onglet2); |
|
| 114 | + echo onglet(_T('plugins_actifs_liste'), generer_url_ecrire("admin_plugin"), 'plugins_actifs', $onglet2); |
|
| 115 | + echo fin_onglet(); |
|
| 116 | + |
|
| 117 | + // message d'erreur au retour d'une operation |
|
| 118 | + if ($erreur) { |
|
| 119 | + echo "<div class='error'>$erreur</div>"; |
|
| 120 | + } |
|
| 121 | + if ($erreur_activation) { |
|
| 122 | + echo "<div class='error'>$erreur_activation</div>"; |
|
| 123 | + } |
|
| 124 | + |
|
| 125 | + // la mise a jour de cette meta a ete faite par ecrire_plugin_actifs |
|
| 126 | + $actifs = unserialize($GLOBALS['meta']['plugin']); |
|
| 127 | + $lcpa = $actifs + unserialize($GLOBALS['meta']['plugin_attente']); |
|
| 128 | + |
|
| 129 | + // Les affichages se basent sur le repertoire, pas sur le nom |
|
| 130 | + $actifs = liste_chemin_plugin($actifs, ''); |
|
| 131 | + if (defined('_DIR_PLUGINS_SUPPL')) { |
|
| 132 | + $lcpas = liste_chemin_plugin($lcpa, _DIR_PLUGINS_SUPPL); |
|
| 133 | + } |
|
| 134 | + $lcpa = liste_chemin_plugin($lcpa); |
|
| 135 | + |
|
| 136 | + // on installe les plugins maintenant, |
|
| 137 | + // cela permet aux scripts d'install de faire des affichages (moches...) |
|
| 138 | + plugin_installes_meta(); |
|
| 139 | + |
|
| 140 | + echo "<div class='liste-plugins formulaire_spip'>"; |
|
| 141 | + echo debut_cadre_trait_couleur('plugin-24.png', true, '', _T('plugins_liste'), 'plugins'); |
|
| 142 | + |
|
| 143 | + if ($quoi !== 'actifs') { |
|
| 144 | + $lpf = liste_plugin_files(); |
|
| 145 | + if ($lpf) { |
|
| 146 | + echo "<p>" . _T('texte_presente_plugin') . "</p>"; |
|
| 147 | + } else { |
|
| 148 | + if (!@is_dir(_DIR_PLUGINS)) { |
|
| 149 | + echo "<p>" . _T('plugin_info_automatique_ftp', array('rep' => joli_repertoire(_DIR_PLUGINS))) |
|
| 150 | + . " — " . _T('plugin_info_automatique_creer') . "</p>"; |
|
| 151 | + } |
|
| 152 | + } |
|
| 153 | + $lcpaffiche = $lpf; |
|
| 154 | + if (defined('_DIR_PLUGINS_SUPPL')) { |
|
| 155 | + $lcpaffichesup = liste_plugin_files(_DIR_PLUGINS_SUPPL); |
|
| 156 | + } |
|
| 157 | + } else { |
|
| 158 | + // la liste |
|
| 159 | + // $quoi=='actifs' |
|
| 160 | + $lcpaffiche = $lcpa; |
|
| 161 | + if (defined('_DIR_PLUGINS_SUPPL')) { |
|
| 162 | + $lcpaffichesup = $lcpas; |
|
| 163 | + } |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + if ($quoi == 'actifs' or $lpf) { |
|
| 167 | + $nb = count($lcpa); |
|
| 168 | + if (defined('_DIR_PLUGINS_SUPPL')) { |
|
| 169 | + $nb += count($lcpas); |
|
| 170 | + } |
|
| 171 | + echo "<h3>" . sinon(singulier_ou_pluriel($nb, 'plugins_actif_un', 'plugins_actifs', 'count'), |
|
| 172 | + _T('plugins_actif_aucun')) . "</h3>"; |
|
| 173 | + } |
|
| 174 | + |
|
| 175 | + if (empty($format)) { |
|
| 176 | + $format = 'liste'; |
|
| 177 | + } elseif (!in_array($format, array('liste', 'repertoires'))) { |
|
| 178 | + $format = 'repertoires'; |
|
| 179 | + } |
|
| 180 | + |
|
| 181 | + $afficher = charger_fonction("afficher_$format", 'plugins'); |
|
| 182 | + $corps = $afficher(self(), $lcpaffiche, $lcpa, $actifs); |
|
| 183 | + if (defined('_DIR_PLUGINS_SUPPL')) { |
|
| 184 | + $corps .= $afficher(self(), $lcpaffichesup, $lcpas, $actifs, _DIR_PLUGINS_SUPPL); |
|
| 185 | + } |
|
| 186 | + |
|
| 187 | + if ($corps) { |
|
| 188 | + $corps .= "\n<div class='boutons' style='display:none;'>" |
|
| 189 | + . "<input type='submit' class='submit save' value='" . _T('bouton_enregistrer') |
|
| 190 | + . "' />" |
|
| 191 | + . "</div>"; |
|
| 192 | + } |
|
| 193 | + |
|
| 194 | + echo redirige_action_post('activer_plugins', 'activer', 'admin_plugin', '', $corps); |
|
| 195 | + |
|
| 196 | + echo fin_cadre_trait_couleur(true); |
|
| 197 | + |
|
| 198 | + if ($quoi == 'actifs') { |
|
| 199 | + echo affiche_les_plugins_verrouilles($actifs); |
|
| 200 | + } |
|
| 201 | + echo "</div>"; |
|
| 202 | + |
|
| 203 | + echo http_script(" |
|
| 204 | 204 | jQuery(function(){ |
| 205 | 205 | jQuery('.plugins li.item a[rel=info]').click(function(){ |
| 206 | 206 | var li = jQuery(this).parents('li').eq(0); |
@@ -226,14 +226,14 @@ discard block |
||
| 226 | 226 | }); |
| 227 | 227 | "); |
| 228 | 228 | |
| 229 | - echo pipeline('affiche_milieu', |
|
| 230 | - array( |
|
| 231 | - 'args' => array('exec' => 'admin_plugin'), |
|
| 232 | - 'data' => '' |
|
| 233 | - ) |
|
| 234 | - ); |
|
| 229 | + echo pipeline('affiche_milieu', |
|
| 230 | + array( |
|
| 231 | + 'args' => array('exec' => 'admin_plugin'), |
|
| 232 | + 'data' => '' |
|
| 233 | + ) |
|
| 234 | + ); |
|
| 235 | 235 | |
| 236 | - echo fin_gauche(), fin_page(); |
|
| 236 | + echo fin_gauche(), fin_page(); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | /** |
@@ -247,23 +247,23 @@ discard block |
||
| 247 | 247 | * Code HTML |
| 248 | 248 | **/ |
| 249 | 249 | function affiche_les_plugins_verrouilles($actifs) { |
| 250 | - if ((!$liste = liste_plugin_files(_DIR_PLUGINS_DIST))) { |
|
| 251 | - return ''; |
|
| 252 | - } |
|
| 253 | - |
|
| 254 | - $afficher = charger_fonction("afficher_liste", 'plugins'); |
|
| 255 | - $liste = $afficher(self(), $liste, array(), $actifs, _DIR_PLUGINS_DIST); |
|
| 256 | - |
|
| 257 | - return |
|
| 258 | - "<div id='plugins_dist'>" |
|
| 259 | - . debut_cadre_trait_couleur('', true, '', _T('plugins_liste_dist'), 'liste_plugins_dist') |
|
| 260 | - . "<p>" |
|
| 261 | - . _T('plugin_info_plugins_dist_1', array('plugins_dist' => joli_repertoire(_DIR_PLUGINS_DIST))) |
|
| 262 | - . '<br />' . _T('plugin_info_plugins_dist_2') |
|
| 263 | - . "</p>" |
|
| 264 | - . $liste |
|
| 265 | - . fin_cadre_trait_couleur(true) |
|
| 266 | - . "</div>\n"; |
|
| 250 | + if ((!$liste = liste_plugin_files(_DIR_PLUGINS_DIST))) { |
|
| 251 | + return ''; |
|
| 252 | + } |
|
| 253 | + |
|
| 254 | + $afficher = charger_fonction("afficher_liste", 'plugins'); |
|
| 255 | + $liste = $afficher(self(), $liste, array(), $actifs, _DIR_PLUGINS_DIST); |
|
| 256 | + |
|
| 257 | + return |
|
| 258 | + "<div id='plugins_dist'>" |
|
| 259 | + . debut_cadre_trait_couleur('', true, '', _T('plugins_liste_dist'), 'liste_plugins_dist') |
|
| 260 | + . "<p>" |
|
| 261 | + . _T('plugin_info_plugins_dist_1', array('plugins_dist' => joli_repertoire(_DIR_PLUGINS_DIST))) |
|
| 262 | + . '<br />' . _T('plugin_info_plugins_dist_2') |
|
| 263 | + . "</p>" |
|
| 264 | + . $liste |
|
| 265 | + . fin_cadre_trait_couleur(true) |
|
| 266 | + . "</div>\n"; |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | /** |
@@ -275,19 +275,19 @@ discard block |
||
| 275 | 275 | */ |
| 276 | 276 | function afficher_librairies() { |
| 277 | 277 | |
| 278 | - if (!$libs = liste_librairies()) { |
|
| 279 | - return ''; |
|
| 280 | - } |
|
| 281 | - ksort($libs); |
|
| 282 | - $res = debut_cadre_enfonce('', true, '', _T('plugin_librairies_installees')); |
|
| 283 | - $res .= '<dl>'; |
|
| 284 | - foreach ($libs as $lib => $rep) { |
|
| 285 | - $res .= "<dt>$lib</dt><dd>" . joli_repertoire($rep) . "</dd>\n"; |
|
| 286 | - } |
|
| 287 | - $res .= '</dl>'; |
|
| 288 | - $res .= fin_cadre_enfonce(true); |
|
| 289 | - |
|
| 290 | - return $res; |
|
| 278 | + if (!$libs = liste_librairies()) { |
|
| 279 | + return ''; |
|
| 280 | + } |
|
| 281 | + ksort($libs); |
|
| 282 | + $res = debut_cadre_enfonce('', true, '', _T('plugin_librairies_installees')); |
|
| 283 | + $res .= '<dl>'; |
|
| 284 | + foreach ($libs as $lib => $rep) { |
|
| 285 | + $res .= "<dt>$lib</dt><dd>" . joli_repertoire($rep) . "</dd>\n"; |
|
| 286 | + } |
|
| 287 | + $res .= '</dl>'; |
|
| 288 | + $res .= fin_cadre_enfonce(true); |
|
| 289 | + |
|
| 290 | + return $res; |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | |
@@ -298,20 +298,20 @@ discard block |
||
| 298 | 298 | * Tableau (nom de la lib => repertoire , ...) |
| 299 | 299 | */ |
| 300 | 300 | function liste_librairies() { |
| 301 | - $libs = array(); |
|
| 302 | - foreach (array_reverse(creer_chemin()) as $d) { |
|
| 303 | - if (is_dir($dir = $d . 'lib/') |
|
| 304 | - and $t = opendir($dir) |
|
| 305 | - ) { |
|
| 306 | - while (($f = readdir($t)) !== false) { |
|
| 307 | - if ($f[0] != '.' |
|
| 308 | - and is_dir("$dir/$f") |
|
| 309 | - ) { |
|
| 310 | - $libs[$f] = $dir; |
|
| 311 | - } |
|
| 312 | - } |
|
| 313 | - } |
|
| 314 | - } |
|
| 315 | - |
|
| 316 | - return $libs; |
|
| 301 | + $libs = array(); |
|
| 302 | + foreach (array_reverse(creer_chemin()) as $d) { |
|
| 303 | + if (is_dir($dir = $d . 'lib/') |
|
| 304 | + and $t = opendir($dir) |
|
| 305 | + ) { |
|
| 306 | + while (($f = readdir($t)) !== false) { |
|
| 307 | + if ($f[0] != '.' |
|
| 308 | + and is_dir("$dir/$f") |
|
| 309 | + ) { |
|
| 310 | + $libs[$f] = $dir; |
|
| 311 | + } |
|
| 312 | + } |
|
| 313 | + } |
|
| 314 | + } |
|
| 315 | + |
|
| 316 | + return $libs; |
|
| 317 | 317 | } |