correction notices et modifs css
[mw_pages] / app / data / modules / xml / mw_data_pages.php
index 9ea3f70..bde8ba1 100644 (file)
@@ -4,7 +4,7 @@
 
     function page_ariane($id, $ariane = array()){
       if($page = $this->page($id)){
-        if($page["id_parent"]) $ariane = $this->page_ariane($page["id_parent"], $ariane);
+        if(isset($page["id_parent"]) && $page["id_parent"]) $ariane = $this->page_ariane($page["id_parent"], $ariane);
         $ariane[] = $page;
         return $ariane;
       }
@@ -38,7 +38,7 @@
             if(isset($id_parent)){
               $MATCH = (
                    ($id_parent && isset($v_rst["id_parent"]) && ($id_parent == $v_rst["id_parent"]))
-                || ($id_parent == "" && !$v_rst["id_parent"])
+                || ($id_parent == "" && (!isset($v_rst["id_parent"]) || !$v_rst["id_parent"]))
               );
             }
             if($MATCH){
 
     function set_page($id, $params, $RAZ = false){
       if($page = $this->page($id)){
-        $id_parent = isset($params["id_parent"]) ? $params["id_parent"] : ($RAZ ? null : $page["id_parent"]);
+        $id_parent = isset($params["id_parent"]) ? $params["id_parent"] : ($RAZ ? null : (isset($page["id_parent"]) ? $page["id_parent"] : null));
         $title = isset($params["title"]) ? $params["title"] : ($RAZ ? null : $page["title"]);
         $content = isset($params["content"]) ? $params["content"] : ($RAZ ? null : $page["content"]);
         $user = isset($params["user"]) ? $params["user"] : null;