3 if($this->etat("mod") == "pages" && $this->etat("controller") == "admin"){
4 $this->add_js_file($this->path("mw_path")."libs/tiny_mce/tiny_mce.js");
5 $this->add_js_file($this->path("mw_path")."libs/tiny_mce/plugins/tinybrowser/tb_tinymce.js.php");
8 if(!function_exists("datetime2timestamp")) :
9 function datetime2timestamp($string){
10 list($date, $time) = explode(" ", $string);
11 list($year, $month, $day) = explode("-", $date);
12 list($hour, $minute, $second) = explode(":", $time);
13 $timestamp = mktime($hour, $minute, $second, $month, $day, $year);
18 if(!function_exists("pages_arbo_navig_lis")) :
19 function pages_arbo_navig_lis($env, $arbo, $ariane = array()){
22 if($path_item = array_shift($ariane)){
23 foreach($arbo["subs"] as $page){
24 $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";
25 if($path_item["id"] == $page["id"]){
26 if($sub_content = pages_arbo_navig_lis($env, $page, $ariane)){
36 foreach($arbo["subs"] as $page){
37 $content .= "<li><a href=\"".$env->url("pages/view/page", array("id" => $page["id"]))."\">".$page["title"]."</a></li>\n";
45 if(!function_exists("pages_arbo_edit_select_options")) :
46 function pages_arbo_edit_select_options($arbo, $id_page, $id_parent, $indent_increment = "", $indent = ""){
47 $arbo["id"] = $arbo["id"] ? $arbo["id"] : "";
50 ." value=\"".$arbo["id"]."\""
51 .(isset($id_parent) && ($arbo["id"] == $id_parent) ? " selected=\"selected\"" : "")
53 .$indent.($arbo["id"] ? $arbo["title"] : "Aucune")
56 $indent .= $indent_increment;
57 foreach($arbo["subs"] as $i => $sub){
58 if(!isset($id_page) || $id_page != $sub["id"]){
59 $content .= pages_arbo_edit_select_options($sub, $id_page, $id_parent, $indent_increment, $indent);
67 if(!function_exists("pages_arbo_list_select_options")) :
68 function pages_arbo_list_select_options($env, $etat, $arbo, $current_page_id, $indent_increment = "", $indent = ""){
69 $arbo["id"] = isset($arbo["id"]) ? $arbo["id"] : "";
72 ." value=\"".$env->url($etat, array("parent" => $arbo["id"]))."\""
73 .(isset($current_page_id) && ($arbo["id"] == $current_page_id) ? " selected=\"selected\"" : "")
75 .$indent.($arbo["id"] ? $arbo["title"] : "Racine des pages")
78 $indent .= $indent_increment;
79 foreach($arbo["subs"] as $i => $sub){
80 $content .= pages_arbo_list_select_options($env, $etat, $sub, $current_page_id, $indent_increment, $indent);
87 if(!function_exists("pages_arbo_start_select_options")) :
88 function pages_arbo_start_select_options($env, $arbo, $current_start_action, $current_start_action_params, $indent_increment = "", $indent = ""){
89 $arbo["id"] = isset($arbo["id"]) ? $arbo["id"] : "";
93 ." value=\"".$arbo["id"]."\""
94 .( isset($current_start_action)
95 && ($current_start_action == "pages/view/page")
96 && isset($current_start_action_params["id"])
97 && ($arbo["id"] == $current_start_action_params["id"])
99 " selected=\"selected\""
103 .$indent.$arbo["title"]
107 $indent .= $indent_increment;
108 $indent .= " ";
109 foreach($arbo["subs"] as $i => $sub){
110 $content .= pages_arbo_start_select_options($env, $sub, $current_start_action, $current_start_action_params, $indent_increment, $indent);