Déplacement de l'en-tête et du pied de page vers squelette.
This commit is contained in:
parent
3e101d22be
commit
3e62897e66
|
@ -3,18 +3,11 @@
|
||||||
// Tous les chemins pour les include sont relatifs à __cms__ .
|
// Tous les chemins pour les include sont relatifs à __cms__ .
|
||||||
chdir(dirname(__FILE__));
|
chdir(dirname(__FILE__));
|
||||||
|
|
||||||
require_once("util.php");
|
|
||||||
require_once("path.php");
|
|
||||||
require_once("controleur/page.php");
|
require_once("controleur/page.php");
|
||||||
|
|
||||||
require_once("types/galerie.php");
|
|
||||||
require_once("types/galerie-periode.php");
|
|
||||||
require_once("types/galerie-evenement.php");
|
|
||||||
require_once("types/galerie-photo.php");
|
|
||||||
|
|
||||||
class CMS {
|
class CMS {
|
||||||
public static function affiche($chemin, $action = "afficher", $params=null) {
|
public static function affiche($chemin, $params) {
|
||||||
if (is_null($params)) $params = array();
|
$action = $params["action"];
|
||||||
|
|
||||||
$p = Page::_new($chemin);
|
$p = Page::_new($chemin);
|
||||||
|
|
||||||
|
@ -28,27 +21,5 @@ class CMS {
|
||||||
$p->affiche();
|
$p->affiche();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function en_tete($titre) {
|
|
||||||
return
|
|
||||||
'<!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">
|
|
||||||
<head>
|
|
||||||
<title>' . $titre . '</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Language" content="fr" />
|
|
||||||
<link href="../style.css" rel="stylesheet" type="text/css" /><!-- TODO : chemin incorrect -->
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>' . $titre . '</h1>';
|
|
||||||
// <meta name="keywords" lang="fr" content="motcle1,mocle2" />
|
|
||||||
// <meta name="description" content="Description de ma page web." />
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function pied() {
|
|
||||||
return
|
|
||||||
' </body>
|
|
||||||
</html>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
require_once("util.php");
|
require_once("util.php");
|
||||||
require_once("config.php");
|
require_once("config.php");
|
||||||
|
require_once("cms.php");
|
||||||
|
require_once("squelette.php");
|
||||||
require_once("controleur/chemin_page.php");
|
require_once("controleur/chemin_page.php");
|
||||||
|
|
||||||
// Protocole : http://site/actualités/?nouveau=Le%20titre
|
// Protocole : http://site/actualités/?nouveau=Le%20titre
|
||||||
|
@ -148,9 +150,7 @@ class Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function affiche() {
|
public function affiche() {
|
||||||
echo CMS::en_tete($this->chemin->get()) // TODO
|
echo Squelette::enrober($this, $this->vue());
|
||||||
. $this->vue()
|
|
||||||
. CMS::pied();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
36
__cms__/squelette.php
Normal file
36
__cms__/squelette.php
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once("util.php");
|
||||||
|
require_once("path.php");
|
||||||
|
require_once("controleur/page.php");
|
||||||
|
|
||||||
|
class Squelette {
|
||||||
|
public static function enrober($page, $contenu) {
|
||||||
|
return ''
|
||||||
|
. Squelette::en_tete($page)
|
||||||
|
. $contenu
|
||||||
|
. Squelette::pied($page);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function en_tete($page) {
|
||||||
|
return
|
||||||
|
'<!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">
|
||||||
|
<head>
|
||||||
|
<title>' . $page->get_prop("titre") . '</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<meta http-equiv="Content-Language" content="fr" />
|
||||||
|
<link href="../style.css" rel="stylesheet" type="text/css" /><!-- TODO : chemin incorrect -->
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>' . $page->get_prop("titre") . '</h1>';
|
||||||
|
// <meta name="keywords" lang="fr" content="motcle1,mocle2" />
|
||||||
|
// <meta name="description" content="Description de ma page web." />
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function pied() {
|
||||||
|
return
|
||||||
|
' </body>
|
||||||
|
</html>';
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user