From 426183cddef34f6e1091ea9a020a5563cb7c8251 Mon Sep 17 00:00:00 2001 From: blr21560 Date: Fri, 1 Nov 2013 16:38:49 +0100 Subject: [PATCH] =?UTF-8?q?suppression=20de=20index.php=20et=20du=20param?= =?UTF-8?q?=C3=A8tre=20d'activation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ConstCategoriesPage.php | 1 - _public.php | 8 ---- _widgets.php | 4 -- index.php | 84 ----------------------------------------- locales/fr/main.po | 12 ------ 5 files changed, 109 deletions(-) delete mode 100644 index.php diff --git a/ConstCategoriesPage.php b/ConstCategoriesPage.php index c10e2f4..e33edff 100644 --- a/ConstCategoriesPage.php +++ b/ConstCategoriesPage.php @@ -16,5 +16,4 @@ class ConstCategoriesPage { const VERSION = '0.1'; const NS = 'CategoriesPage'; const PARAM = 'CategoriesPage'; - const PLUGIN_IS_ACTIVE = 'categoriespage_active'; } diff --git a/_public.php b/_public.php index 3977ab0..9c334da 100644 --- a/_public.php +++ b/_public.php @@ -19,15 +19,7 @@ class publicCategoriesPage { public static function main() { - require_once 'ConstCategoriesPage.php'; - $core = $GLOBALS['core']; - $ns = $core->blog->settings->addNamespace(ConstCategoriesPage::NS); - - // If categoriesPage is not active we stop here : - if (!$ns->get(ConstCategoriesPage::PLUGIN_IS_ACTIVE)) { - return; - } require_once '/_widgets.php'; // Adds news Categories' templates tags : diff --git a/_widgets.php b/_widgets.php index 9926c1c..85cf503 100644 --- a/_widgets.php +++ b/_widgets.php @@ -23,10 +23,6 @@ class widgetsCategoriesPage { public static function main() { require_once 'ConstCategoriesPage.php'; $core = $GLOBALS['core']; - $ns = $core->blog->settings->addNamespace(ConstCategoriesPage::NS); - if (!$ns->get(ConstCategoriesPage::PLUGIN_IS_ACTIVE)) { - return; - } $core->addBehavior('initWidgets', array('widgetsCategoriesPage', 'initWidgets')); } diff --git a/index.php b/index.php deleted file mode 100644 index 0c034e1..0000000 --- a/index.php +++ /dev/null @@ -1,84 +0,0 @@ -blog->settings->addNameSpace( ConstCategoriesPage::NS); - if ( $ns->get(ConstCategoriesPage::PLUGIN_IS_ACTIVE) === null) { - try { - $ns->put( ConstCategoriesPage::PLUGIN_IS_ACTIVE, false, 'boolean'); - - # Url de base - $p_url = 'plugin.php?p='.ConstCategoriesPage::PARAM; - http::redirect($p_url); - } - catch (Exception $e) { - $core->error->add($e->getMessage()); - } - } - - $active = $ns->get( ConstCategoriesPage::PLUGIN_IS_ACTIVE); - $msg = ''; - if (!empty($_POST['saveconfig'])) { - try { - $active = (empty($_POST['active'])) ? false : true; - $ns->put( ConstCategoriesPage::PLUGIN_IS_ACTIVE, $active,'boolean'); - $core->blog->triggerBlog(); - $msg = dcPage::success( __('Configuration successfully updated.'), true, false, false); - } - catch (Exception $e) { - $core->error->add($e->getMessage()); - } - } - $page_title = __('Categories Page'); - echo ' - - - '. $page_title.' - -' . - dcPage::breadcrumb( - array( - html::escapeHTML($core->blog->name) => '', - ''.$page_title.'' => '' - )).$msg. -'
-
-
-

'. __('Plugin config').'

-

- -

-
-

- '. - $core->formNonce(). - ' -

-
-
- -'; -} -} diff --git a/locales/fr/main.po b/locales/fr/main.po index 49cdc0d..040d4b2 100644 --- a/locales/fr/main.po +++ b/locales/fr/main.po @@ -24,15 +24,3 @@ msgstr "Activer la page des catégories" msgid "Categories" msgstr "Catégories" - -msgid "Configuration successfully updated." -msgstr "La configuration a été mise à jour" - -msgid "Plugin config" -msgstr "Configuration du plugin" - -msgid "Enable categoriesMode" -msgstr "Activation du plugin" - -msgid "Save configuration" -msgstr "Sauvegarde de la configuration"