X-Git-Url: http://git.dj3c1t.com/?a=blobdiff_plain;f=out%2Fdist%2Ffunctions.php;h=f96e4b8865c00116c87516d001c18072dc80b655;hb=b9e49ae2f84dc32a0775dae39080aa02cf9ca60b;hp=eae629a7528bd28e8abadc72c149bb387c4cd1f3;hpb=90a1f9524e4bffa5d9d518d6dfb760f85a6c6d28;p=mw_pages diff --git a/out/dist/functions.php b/out/dist/functions.php index eae629a..f96e4b8 100644 --- a/out/dist/functions.php +++ b/out/dist/functions.php @@ -1,8 +1,8 @@ url("pages/view/page", array("id" => $page["id"]))."\">".$page["title"]."\n"; - if($path_item["id"] == $page["id"]) - { if($sub_content = pages_arbo_navig_lis($env, $page, $ariane)) - { $content .= + function pages_arbo_navig_lis($env, $arbo, $ariane = array()){ + $content = ""; + if($arbo["subs"]){ + if($path_item = array_shift($ariane)){ + foreach($arbo["subs"] as $page){ + $content .= "url("pages/view/page", array("id" => $page["id"]))."\">".$page["title"]."\n"; + if($path_item["id"] == $page["id"]){ + if($sub_content = pages_arbo_navig_lis($env, $page, $ariane)){ + $content .= "\n"; @@ -27,9 +27,9 @@ } } } - else - { foreach($arbo["subs"] as $page) - { $content .= "
  • url("pages/view/page", array("id" => $page["id"]))."\">".$page["title"]."
  • \n"; + else{ + foreach($arbo["subs"] as $page){ + $content .= "
  • url("pages/view/page", array("id" => $page["id"]))."\">".$page["title"]."
  • \n"; } } } @@ -38,8 +38,8 @@ endif; if(!function_exists("pages_arbo_edit_select_options")) : - function pages_arbo_edit_select_options($arbo, $id_page, $id_parent, $indent_increment = "", $indent = "") - { $arbo["id"] = $arbo["id"] ? $arbo["id"] : ""; + function pages_arbo_edit_select_options($arbo, $id_page, $id_parent, $indent_increment = "", $indent = ""){ + $arbo["id"] = $arbo["id"] ? $arbo["id"] : ""; $content = "" .$indent.($arbo["id"] ? $arbo["title"] : "Aucune") .""; - if($arbo["subs"]) - { $indent .= $indent_increment; - foreach($arbo["subs"] as $i => $sub) - { if(!isset($id_page) || $id_page != $sub["id"]) - { $content .= pages_arbo_edit_select_options($sub, $id_page, $id_parent, $indent_increment, $indent); + if($arbo["subs"]){ + $indent .= $indent_increment; + foreach($arbo["subs"] as $i => $sub){ + if(!isset($id_page) || $id_page != $sub["id"]){ + $content .= pages_arbo_edit_select_options($sub, $id_page, $id_parent, $indent_increment, $indent); } } } @@ -60,8 +60,8 @@ endif; if(!function_exists("pages_arbo_list_select_options")) : - function pages_arbo_list_select_options($env, $etat, $arbo, $current_page_id, $indent_increment = "", $indent = "") - { $arbo["id"] = isset($arbo["id"]) ? $arbo["id"] : ""; + function pages_arbo_list_select_options($env, $etat, $arbo, $current_page_id, $indent_increment = "", $indent = ""){ + $arbo["id"] = isset($arbo["id"]) ? $arbo["id"] : ""; $content = "url($etat, array("parent" => $arbo["id"]))."\"" @@ -69,10 +69,10 @@ .">" .$indent.($arbo["id"] ? $arbo["title"] : "Racine des pages") .""; - if($arbo["subs"]) - { $indent .= $indent_increment; - foreach($arbo["subs"] as $i => $sub) - { $content .= pages_arbo_list_select_options($env, $etat, $sub, $current_page_id, $indent_increment, $indent); + if($arbo["subs"]){ + $indent .= $indent_increment; + foreach($arbo["subs"] as $i => $sub){ + $content .= pages_arbo_list_select_options($env, $etat, $sub, $current_page_id, $indent_increment, $indent); } } return $content; @@ -80,10 +80,10 @@ endif; if(!function_exists("pages_arbo_start_select_options")) : - function pages_arbo_start_select_options($env, $arbo, $current_start_action, $current_start_action_params, $indent_increment = "", $indent = "") - { $arbo["id"] = isset($arbo["id"]) ? $arbo["id"] : ""; - if($arbo["id"]) - { $content = + function pages_arbo_start_select_options($env, $arbo, $current_start_action, $current_start_action_params, $indent_increment = "", $indent = ""){ + $arbo["id"] = isset($arbo["id"]) ? $arbo["id"] : ""; + if($arbo["id"]){ + $content = ""; } - if($arbo["subs"]) - { $indent .= $indent_increment; + if($arbo["subs"]){ + $indent .= $indent_increment; $indent .= "  "; - foreach($arbo["subs"] as $i => $sub) - { $content .= pages_arbo_start_select_options($env, $sub, $current_start_action, $current_start_action_params, $indent_increment, $indent); + foreach($arbo["subs"] as $i => $sub){ + $content .= pages_arbo_start_select_options($env, $sub, $current_start_action, $current_start_action_params, $indent_increment, $indent); } } return $content;