-@import url("../../../../../../../app/out/default/css/actions/admin.css");
+textarea.tinymce{
+ width: 100%;
+}
\ No newline at end of file
-ul.pages_menu{
+/* ------------------------------------------------- ARIANE */
+
+.page_ariane{
+ border-bottom: dashed 1px #d5d5d5;
+}
+
+.page_ariane:after{
+ content: "";
+ display: table;
+ clear: both;
+}
+
+.page_ariane li{
+ float: left;
+ padding-right: 5px;
+ font-size: 0.8em;
+}
+
+.page_ariane li a{
+ padding-left: 5px;
+ font-size: 1.1em;
+}
+
+.page_ariane li:first-child a{
+ padding-left: 0px;
+}
+
+.page_ariane li:before{
+ content: ">";
+}
+
+.page_ariane li:first-child:before{
+ content: "";
+}
+
+/* ------------------------------------------------- SOUS PAGES */
+
+nav.sous_pages{
+ margin-bottom: 1em;
+}
+
+nav.sous_pages ul{
list-style-type: none;
margin: 5px 20px 5px 10px;
padding: 0;
}
-ul.pages_menu ul{
+nav.sous_pages ul ul{
list-style-type: none;
margin: 0 0 0 20px;
padding: 0;
}
-ul.pages_menu li{
+nav.sous_pages ul li{
margin: 1px 0;
padding: 0;
border-bottom: solid 1px #e5e5e5;
}
-ul.pages_menu li a{
+nav.sous_pages ul li a{
display: block;
line-height: 2em;
padding: 0 1em;
background-color: #f5f5f5;
}
-ul.pages_menu li a:hover{
+nav.sous_pages ul li a:hover{
color: #000066;
background-color: #f1f1f1;
}
+
+/* ------------------------------------------------- PAGE */
+
+article .page_content hr{
+ border: none;
+ border-top: dashed 1px #c0c0c0;
+}
+
+article .page_content pre{
+ margin: 5px;
+ border: solid 1px #e1e1e1;
+ background-color: #f6faff;
+ padding: 10px;
+ border-radius: 3px;
+ overflow: auto;
+}
+
+article .page_content ul li{
+ margin-left: 15px;
+}
+
+article .page_content h1{
+ font-size: 1.8em;
+}
+
+article .page_content h2{
+ font-size: 1.6em;
+ border-bottom: solid 1px #e5e5e5;
+ padding-bottom: 0;
+ margin: 1.2em 0;
+}
+
+article .page_content h3{
+ font-size: 1.4em;
+}
+
+article .page_content h4{
+ font-size: 1.2em;
+}
+
+article .page_content h5{
+ font-size: 1em;
+}
+
+article .page_content h6{
+ font-size: 1em;
+}
<?php
+ if($this->etat("mod") == "pages" && $this->etat("controller") == "admin"){
+ $this->add_js_file($this->path("mw_path")."libs/tiny_mce/tiny_mce.js");
+ $this->add_js_file($this->path("mw_path")."libs/tiny_mce/plugins/tinybrowser/tb_tinymce.js.php");
+ }
+
if(!function_exists("datetime2timestamp")) :
function datetime2timestamp($string){
list($date, $time) = explode(" ", $string);
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+<!doctype html>
+<html>
<head>
- <?php require $this->out_file("views/head.php"); ?>
+<?php require $this->out_file("views/head.php"); ?>
</head>
<body>
- <div id="header">
+ <header id="main_header">
<div class="content">
<?php require $this->out_file("views/header.php"); ?>
</div>
- </div>
-
- <div id="menu_top">
- <div class="content">
-<?php if($this->out_config("navig_menu_top")) require $this->out_file("views/top_menu.php"); ?>
- </div>
- </div>
-
- <div class="clear"><!-- --></div>
+ </header>
<div id="main">
<div class="content">
<div id="center"<?php echo $this->out_config("colonne") ? "" : " class=\"no_colonne\""; ?>>
<?php require $this->out_file("views/messages.php"); ?>
-<?php
-
- if($this->out_file_exists($layout["content"])) :
-
-?>
-
-<?php
-
- require $this->out_file($layout["content"]);
- endif;
-
-?>
-
+<?php if($layout["content"] && $this->out_file_exists($layout["content"])) require $this->out_file($layout["content"]); ?>
</div>
- <div class="clear"><!-- --></div>
-
</div>
</div>
- <div id="footer">
+ <footer id="main_footer">
<div class="content">
<?php require $this->out_file("views/footer.php"); ?>
</div>
- </div>
+ </footer>
</body>
-</html>
\ No newline at end of file
+</html>
<h2>Nouvelle page</h2>
-<ul class="admin">
+<ul class="buttons">
<li><a href="<?php echo $this->url("pages/admin"); ?>">Retour à la liste des pages</a></li>
</ul>
<form name="page_form" action="<?php echo $this->url("pages/admin/add"); ?>" method="post">
- <ul class="form">
- <li>
- <p>
- Titre :
- <input type="text" size="50" name="title" id="title" value="<?php echo $this->out["page"]["title"]; ?>" />
- </p>
- </li>
- <li>
- <p>
- Page parente :
- <select name="id_parent">
- <?php echo pages_arbo_edit_select_options($this->out["arbo"], null, $this->out["page"]["id_parent"], " "); ?>
- </select>
- </p>
- </li>
- <li>
- <textarea class="tinymce" cols="60" rows="10" name="content" id="content"><?php echo htmlspecialchars($this->out["page"]["content"]); ?></textarea>
- </li>
- <li class="buttons">
- <input type="submit" value="Ajouter" />
- </li>
- </ul>
+ <fieldset>
+ <ul>
+ <li>
+ <label>Titre</label>
+ <div class="form_input">
+ <input type="text" size="50" name="title" id="title" value="<?php echo $this->out["page"]["title"]; ?>" />
+ </div>
+ </li>
+ <li>
+ <label>Page parente</label>
+ <div class="form_input">
+ <select name="id_parent">
+ <?php echo pages_arbo_edit_select_options($this->out["arbo"], null, $this->out["page"]["id_parent"], " "); ?>
+ </select>
+ </div>
+ </li>
+ <li>
+ <textarea class="tinymce" cols="60" rows="10" name="content" id="content"><?php echo htmlspecialchars($this->out["page"]["content"]); ?></textarea>
+ </li>
+ <li>
+ <div class="form_buttons">
+ <input type="submit" value="Ajouter" />
+ </div>
+ </li>
+ </ul>
+ </fieldset>
</form>
\ No newline at end of file
<h2>Modifier une page</h2>
-<ul class="admin">
+<ul class="buttons">
<li><a href="<?php echo $this->url("pages/admin"); ?>">Retour à la liste des pages</a></li>
</ul>
<form name="page_form" action="<?php echo $this->url("pages/admin/edit", array("id" => $this->out["page"]["id"])); ?>" method="post">
- <ul class="form">
- <li>
- <p>
- Titre :
- <input type="text" size="50" name="title" id="title" value="<?php echo $this->out["page"]["title"]; ?>" />
- </p>
- </li>
- <li>
- <p>
- Page parente :
- <select name="id_parent">
- <?php echo pages_arbo_edit_select_options($this->out["arbo"], $this->out["page"]["id"], $this->out["page"]["id_parent"], " "); ?>
- </select>
- </p>
- </li>
- <li>
- <textarea class="tinymce" cols="60" rows="10" name="content" id="content"><?php echo htmlspecialchars($this->out["page"]["content"]); ?></textarea>
- </li>
- <li class="buttons">
- <input type="submit" value="Enregistrer" />
- </li>
- </ul>
+ <fieldset>
+ <ul>
+ <li>
+ <label>Titre</label>
+ <div class="form_input">
+ <input type="text" size="50" name="title" id="title" value="<?php echo $this->out["page"]["title"]; ?>" />
+ </div>
+ </li>
+ <li>
+ <label>Page parente</label>
+ <div class="form_input">
+ <select name="id_parent">
+ <?php echo pages_arbo_edit_select_options($this->out["arbo"], $this->out["page"]["id"], $this->out["page"]["id_parent"], " "); ?>
+ </select>
+ </div>
+ </li>
+ <li>
+ <textarea class="tinymce" cols="60" rows="10" name="content" id="content"><?php echo htmlspecialchars($this->out["page"]["content"]); ?></textarea>
+ </li>
+ <li>
+ <div class="form_buttons">
+ <input type="submit" value="Enregistrer" />
+ </div>
+ </li>
+ </ul>
+ </fieldset>
</form>
\ No newline at end of file
<h2>Pages</h2>
-<ul class="admin">
- <li><a class="add" href="<?php echo $this->url("pages/admin/add"); ?>">Nouvelle page</a></li>
-</ul>
-
<form name="accueil_form" action="<?php echo $this->url("pages/admin/set_accueil"); ?>" method="post">
-<ul class="admin">
- <li>Page d'accueil du site</li>
- <li>
- <select name="id">
- <option value=""<?php echo $this->config("start_action") ? "" : " selected=\"selected\""; ?>>Page par défaut du site</option>
- <?php echo pages_arbo_start_select_options($this, $this->out["arbo"], $this->config("start_action"), $this->config("start_action_params"), " "); ?>
- </select>
- </li>
- <li class="buttons">
- <input type="submit" value="Enregistrer" />
- </li>
-</ul>
+ <fieldset>
+ <ul>
+ <li>
+ <label for="id">Page d'accueil du site</label>
+ <div class="form_input">
+ <select id="id" name="id">
+ <option value=""<?php echo $this->config("start_action") ? "" : " selected=\"selected\""; ?>>Page par défaut du site</option>
+ <?php echo pages_arbo_start_select_options($this, $this->out["arbo"], $this->config("start_action"), $this->config("start_action_params"), " "); ?>
+ </select>
+ <input type="submit" value="Enregistrer" />
+ </div>
+ </li>
+ </ul>
+ </fieldset>
</form>
-<ul class="admin">
+<ul class="buttons">
+ <li><a class="add" href="<?php echo $this->url("pages/admin/add"); ?>">Nouvelle page</a></li>
+</ul>
+
+<ul class="filters">
<li>Page parente</li>
<li>
<select onchange="document.location=this.options[this.selectedIndex].value;">
-<?php
-
- if($this->out["arbo"]) :
- $current_page_id = isset($_GET[$this->param("id")]) ? $_GET[$this->param("id")] : null;
-
-?>
-<ul class="pages_menu">
+<?php if($this->out["arbo"]) : $current_page_id = isset($_GET[$this->param("id")]) ? $_GET[$this->param("id")] : null; ?>
+<ul class="menu">
<?php echo pages_arbo_navig_lis($this, $this->out["arbo"], $this->out["ariane"]); ?>
</ul>
<?php endif; ?>
-<h2>
-<?php $k = 0; foreach($this->out["ariane"] as $page) : if($k < count($this->out["ariane"]) - 1) : ?>
- <?php if($k > 0) : ?>
- »
- <?php endif; ?>
- <a href="<?php echo $this->url("pages/view/page", array("id" => $page["id"])); ?>"><?php echo $page["title"]; ?></a>
-<?php $k++; endif; endforeach; ?>
- <?php if($k > 0) : ?>
- »
- <?php endif; ?>
- <?php echo $this->out["page"]["title"]; ?>
-</h2>
-
-<?php if($this->out["pages"]["list"]) : ?>
-<ul class="pages_menu">
-<?php foreach($this->out["pages"]["list"] as $page) : ?>
- <li><a href="<?php echo $this->url("pages/view/page", array("id" => $page["id"])); ?>"><?php echo $page["title"]; ?></a></li>
-<?php endforeach; ?>
-</ul>
-<?php endif; ?>
-
-<div>
- <?php echo $this->out["page"]["content"]; ?>
-</div>
+<article>
+ <header>
+ <ul class="page_ariane">
+ <?php foreach($this->out["ariane"] as $page) : ?>
+ <li><a href="<?php echo $this->url("pages/view/page", array("id" => $page["id"])); ?>"><?php echo $page["title"]; ?></a></li>
+ <?php endforeach; ?>
+ </ul>
+ <h1><?php echo $this->out["page"]["title"]; ?></h1>
+ <?php if($this->out["pages"]["list"]) : ?>
+ <nav class="sous_pages">
+ <ul class="pages_menu">
+ <?php foreach($this->out["pages"]["list"] as $page) : ?>
+ <li><a href="<?php echo $this->url("pages/view/page", array("id" => $page["id"])); ?>"><?php echo $page["title"]; ?></a></li>
+ <?php endforeach; ?>
+ </ul>
+ </nav>
+ <?php endif; ?>
+ </header>
+ <div class="page_content">
+ <?php echo $this->out["page"]["content"]; ?>
+ </div>
+</article>
$data = $env->data();
if(
(
- $pages = $data->pages(
+ $arbo = $data->pages_arbo(
array(
- "id_parent" => "",
- "enabled" => 1,
- "order_by" => "position",
- "order" => "ASC"
+ "enabled" => 1,
+ "order_by" => "position",
+ "order" => "ASC"
)
)
) !== false
){
- foreach($pages["list"] as $id_page => $page){
+ $this->_set_links($env, "menu_top", $arbo);
+ }
+ return true;
+ }
+
+ function _set_links($env, $parent, $arbo){
+ if($arbo["subs"]){
+ foreach($arbo["subs"] as $page){
$env->set_link(
- "menu_top/mw_page_".$id_page,
- $env->url("pages/view/page", array("id" => $id_page)),
+ $parent."/mw_page_".$page["id"],
+ $env->url("pages/view/page", array("id" => $page["id"])),
$page["title"],
$page["position"]
);
+ $this->_set_links($env, $parent."/mw_page_".$page["id"], $page);
}
}
- return true;
}
function enable($env){