From 3f8c725ca153602b34e9f2f01ba3aff4c313affc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Tue, 3 Aug 2010 03:18:07 +0200 Subject: [PATCH] =?UTF-8?q?Enfin=20quelque=20chose=20=C3=A0=20l'=C3=A9cran?= =?UTF-8?q?=20!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __cms__/code/cms/cms.php | 19 ++++++++++++++----- .../code/modules/galerie/galerie-index.php | 4 ++-- __cms__/code/modules/modules.php | 1 + 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/__cms__/code/cms/cms.php b/__cms__/code/cms/cms.php index aaed92d..2224b7c 100644 --- a/__cms__/code/cms/cms.php +++ b/__cms__/code/cms/cms.php @@ -10,13 +10,22 @@ class CMS { // TODO : appeller Modules::action($chemin, $action, $paramètres); $chemin = new Chemin($chemin_str); - $noms_params = Modules::get_module($chemin); - $noms_params["get_post"][] = "action"; + $module = Modules::get_module($chemin); + $paramètres = array("action" => "vue"); - // récupérer $noms_params dans $_GET, $_POST et $_FILE ==> $paramètres + foreach ($module["get_post"] as $param) { + if (isset($_GET[$param])) $paramètres[$param] = $_GET[$param]; + if (isset($_POST[$param])) $paramètres[$param] = $_POST[$param]; + } + foreach ($module["post"] as $param) { + if (isset($_POST[$param])) $paramètres[$param] = $_POST[$param]; + } + foreach ($module["file"] as $param) { + if (isset($_FILE[$param])) $paramètres[$param] = $_FILE[$param]; + } + $action = $paramètres["action"]; - Modules::action($chemin, $action, $paramètres); - echo "OK."; + echo Modules::action($chemin, $action, $paramètres); } } diff --git a/__cms__/code/modules/galerie/galerie-index.php b/__cms__/code/modules/galerie/galerie-index.php index 1fba57a..c86be33 100644 --- a/__cms__/code/modules/galerie/galerie-index.php +++ b/__cms__/code/modules/galerie/galerie-index.php @@ -22,9 +22,9 @@ class GalerieIndex { } if (isset($paramètres["vue"])) { - self::vue($chemin, $paramètres["vue"]); + return self::vue($chemin, $paramètres["vue"]); } else { - self::vue($chemin); + return self::vue($chemin); } } } diff --git a/__cms__/code/modules/modules.php b/__cms__/code/modules/modules.php index d389eea..410937c 100644 --- a/__cms__/code/modules/modules.php +++ b/__cms__/code/modules/modules.php @@ -10,6 +10,7 @@ class Modules { "post" => qw($post), "file" => qw($file) ); + self::$liste_modules[$type]["get_post"][] = "action"; // Toujours présent. } public static function get_module($chemin) {