3 if(!function_exists("datetime2timestamp")) :
4 function datetime2timestamp($string){
5 list($date, $time) = explode(" ", $string);
6 list($year, $month, $day) = explode("-", $date);
7 list($hour, $minute, $second) = explode(":", $time);
8 $timestamp = mktime($hour, $minute, $second, $month, $day, $year);
13 if(!function_exists("pages_arbo_navig_lis")) :
14 function pages_arbo_navig_lis($env, $arbo, $ariane = array()){
17 if($path_item = array_shift($ariane)){
18 foreach($arbo["subs"] as $page){
19 $content .= "<li".($path_item["id"] == $page["id"] ? " class=\"current\"" : "")."><a href=\"".$env->url("pages/view/page", array("id" => $page["id"]))."\">".$page["title"]."</a></li>\n";
20 if($path_item["id"] == $page["id"]){
21 if($sub_content = pages_arbo_navig_lis($env, $page, $ariane)){
31 foreach($arbo["subs"] as $page){
32 $content .= "<li><a href=\"".$env->url("pages/view/page", array("id" => $page["id"]))."\">".$page["title"]."</a></li>\n";
40 if(!function_exists("pages_arbo_edit_select_options")) :
41 function pages_arbo_edit_select_options($arbo, $id_page, $id_parent, $indent_increment = "", $indent = ""){
42 $arbo["id"] = $arbo["id"] ? $arbo["id"] : "";
45 ." value=\"".$arbo["id"]."\""
46 .(isset($id_parent) && ($arbo["id"] == $id_parent) ? " selected=\"selected\"" : "")
48 .$indent.($arbo["id"] ? $arbo["title"] : "Aucune")
51 $indent .= $indent_increment;
52 foreach($arbo["subs"] as $i => $sub){
53 if(!isset($id_page) || $id_page != $sub["id"]){
54 $content .= pages_arbo_edit_select_options($sub, $id_page, $id_parent, $indent_increment, $indent);
62 if(!function_exists("pages_arbo_list_select_options")) :
63 function pages_arbo_list_select_options($env, $etat, $arbo, $current_page_id, $indent_increment = "", $indent = ""){
64 $arbo["id"] = isset($arbo["id"]) ? $arbo["id"] : "";
67 ." value=\"".$env->url($etat, array("parent" => $arbo["id"]))."\""
68 .(isset($current_page_id) && ($arbo["id"] == $current_page_id) ? " selected=\"selected\"" : "")
70 .$indent.($arbo["id"] ? $arbo["title"] : "Racine des pages")
73 $indent .= $indent_increment;
74 foreach($arbo["subs"] as $i => $sub){
75 $content .= pages_arbo_list_select_options($env, $etat, $sub, $current_page_id, $indent_increment, $indent);
82 if(!function_exists("pages_arbo_start_select_options")) :
83 function pages_arbo_start_select_options($env, $arbo, $current_start_action, $current_start_action_params, $indent_increment = "", $indent = ""){
84 $arbo["id"] = isset($arbo["id"]) ? $arbo["id"] : "";
88 ." value=\"".$arbo["id"]."\""
89 .( isset($current_start_action)
90 && ($current_start_action == "pages/view/page")
91 && isset($current_start_action_params["id"])
92 && ($arbo["id"] == $current_start_action_params["id"])
94 " selected=\"selected\""
98 .$indent.$arbo["title"]
102 $indent .= $indent_increment;
103 $indent .= " ";
104 foreach($arbo["subs"] as $i => $sub){
105 $content .= pages_arbo_start_select_options($env, $sub, $current_start_action, $current_start_action_params, $indent_increment, $indent);