From 34a694008a559c68a9e05d15d75399193af8c8fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= <jahvascriptmaniac+github@free.fr>
Date: Sun, 17 Oct 2010 11:57:00 +0200
Subject: [PATCH] =?UTF-8?q?Modules=20pour=20le=20site=20de=20l'association?=
 =?UTF-8?q?=20Th=C3=A9odore=20Dubois.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 cms2/code/TODO                                |  6 +-
 cms2/code/document.php5                       | 42 +++++++++
 cms2/modules/accueil/accueil.php5             |  3 +-
 cms2/modules/biographie/biographie.php5       | 31 +++++++
 cms2/modules/biographie/include.php5          |  5 +
 cms2/modules/concerts/concerts.php5           | 92 +++++++++++++++++++
 cms2/modules/concerts/include.php5            |  5 +
 cms2/modules/contact/contact.php5             | 37 ++++++++
 cms2/modules/contact/devenir_membre.php5      | 31 +++++++
 cms2/modules/contact/include.php5             |  6 ++
 .../enregistrements/enregistrements.php5      | 70 ++++++++++++++
 cms2/modules/enregistrements/include.php5     |  5 +
 cms2/modules/galerie/galerie.php5             | 14 +--
 cms2/modules/include.php5                     |  8 ++
 cms2/modules/interpretes/include.php5         |  5 +
 cms2/modules/interpretes/interpretes.php5     | 58 ++++++++++++
 cms2/modules/liens/include.php5               |  5 +
 cms2/modules/liens/liens.php5                 | 38 ++++++++
 cms2/modules/partitions/include.php5          |  5 +
 cms2/modules/partitions/partitions.php5       | 61 ++++++++++++
 cms2/modules/photo/include.php5               |  5 +
 cms2/modules/photo/photo.php5                 | 71 ++++++++++++++
 22 files changed, 587 insertions(+), 16 deletions(-)
 create mode 100644 cms2/modules/biographie/biographie.php5
 create mode 100644 cms2/modules/biographie/include.php5
 create mode 100644 cms2/modules/concerts/concerts.php5
 create mode 100644 cms2/modules/concerts/include.php5
 create mode 100644 cms2/modules/contact/contact.php5
 create mode 100644 cms2/modules/contact/devenir_membre.php5
 create mode 100644 cms2/modules/contact/include.php5
 create mode 100644 cms2/modules/enregistrements/enregistrements.php5
 create mode 100644 cms2/modules/enregistrements/include.php5
 create mode 100644 cms2/modules/interpretes/include.php5
 create mode 100644 cms2/modules/interpretes/interpretes.php5
 create mode 100644 cms2/modules/liens/include.php5
 create mode 100644 cms2/modules/liens/liens.php5
 create mode 100644 cms2/modules/partitions/include.php5
 create mode 100644 cms2/modules/partitions/partitions.php5
 create mode 100644 cms2/modules/photo/include.php5
 create mode 100644 cms2/modules/photo/photo.php5

diff --git a/cms2/code/TODO b/cms2/code/TODO
index be0cbad..91d9263 100644
--- a/cms2/code/TODO
+++ b/cms2/code/TODO
@@ -17,16 +17,18 @@
    Nouveautés : les pages ont un bouton 'afficher dans les nouveautés' qui active dans_nouveautés et met à jour date_nouvautés. Et un bouton
    supprimer des nouveautés qui désactive dans_nouveautés.
    Biographie : text_rich + liste photos.
-   Concerts : liste [ date du concert, lieu, text_rich ].
+   Concerts : liste [ année : liste de [ date du concert, lieu, text_rich, liste de photos, liste d'articles de presse ] ].
    Partitions : liste [ nom du morceau, text_rich, file_pdf, liste liens vers enregistrements ].
-   Enregistrements : liste [ nom du morceau, text_rich, file_audio, (auto : liens vers partitions) ].
+   Enregistrements : liste [ nom du morceau, text_rich, liste [ file_audio, bool complet_ou_partiel ], liens vers partitions, liens vers interprètes ].
    Interprètes : liste [ nom interprète(s), text_rich, liens vers enregistrements ].
    Liens : liste [titre, text_rich, lien].
    Contact : text_rich, lien "dvenir membre".
    |- Devenir membre : text_rich.
 - squelette 1h
    + barre de navigation latérale 1h
+- Remplissage de la BDD 2h
 - css pour le site 2h
+- Amélioration de la modification 2h
    ==== OK.
 - authentification 3h
 - if_perm() 3h
diff --git a/cms2/code/document.php5 b/cms2/code/document.php5
index f442da2..e92276f 100644
--- a/cms2/code/document.php5
+++ b/cms2/code/document.php5
@@ -344,6 +344,46 @@ function fn_serialize_img_file($input) {
 }
 
 
+// file_pdf
+function fn_w_r_file_pdf($d, $cell) {
+	return $d->img(toString($cell));
+}
+
+function fn_w_w_file_pdf($d, $cell) {
+	$f = $d->form($d->url());
+	fn_w_r_img_file($f, $cell);
+	$f->input_file($cell->name_for_set());
+	return $f;
+}
+
+function fn_serialize_file_pdf($input) {
+	// Doit gérer le stockage de l'image dans un dossier,
+	// la création de la miniature et renvoyer le chemin vers l'image.
+	// TODO !!! comment faire ?
+	return $input;
+}
+
+// file_audio
+function fn_w_r_file_audio($d, $cell) {
+	return $d->img(toString($cell));
+}
+
+function fn_w_w_file_audio($d, $cell) {
+	$f = $d->form($d->url());
+	fn_w_r_img_file($f, $cell);
+	$f->input_file($cell->name_for_set());
+	return $f;
+}
+
+function fn_serialize_file_audio($input) {
+	// Doit gérer le stockage de l'image dans un dossier,
+	// la création de la miniature et renvoyer le chemin vers l'image.
+	// TODO !!! comment faire ?
+	return $input;
+}
+
+
+
 // date
 function fn_w_r_date($d, $cell) {
 	// affichage localisé.
@@ -375,6 +415,8 @@ Module::add_type("text_nix");
 Module::add_type("text_rich");
 Module::add_type("bool");
 Module::add_type("img_file");
+Module::add_type("file_pdf");
+Module::add_type("file_audio");
 Module::add_type("date");
 
 ?>
\ No newline at end of file
diff --git a/cms2/modules/accueil/accueil.php5 b/cms2/modules/accueil/accueil.php5
index 4a121bc..2e8c79c 100644
--- a/cms2/modules/accueil/accueil.php5
+++ b/cms2/modules/accueil/accueil.php5
@@ -4,7 +4,6 @@ class mAccueil extends mPage {
 	public static function info($module) {
 		Module::ressources_statiques("c_style");
 		Module::ressources_dynamiques("h_page");
-		Module::attribut("titre", "text_line", "Accueil");
 		Module::attribut("titre_presentation", "text_line", "L'association");
 		Module::attribut("texte_presentation", "text_rich", "");
 		Module::attribut("publier", "bool", "true");
@@ -15,7 +14,7 @@ class mAccueil extends mPage {
 	}
 	
 	public function res_h_page($d) {
-		$d->w_en_tete($this->titre, $this->description); // En-tête standard.
+		$d->w_en_tete($this->titre_presentation, $this->texte_presentation); // En-tête standard.
 		
 		mPage::page_systeme("nouveautes")->rendu($d);
 		
diff --git a/cms2/modules/biographie/biographie.php5 b/cms2/modules/biographie/biographie.php5
new file mode 100644
index 0000000..3ff0ff0
--- /dev/null
+++ b/cms2/modules/biographie/biographie.php5
@@ -0,0 +1,31 @@
+<?php
+
+class mBiographie extends mPage {
+	public static function info($module) {
+		Module::ressources_statiques("c_style");
+		Module::ressources_dynamiques("h_page");
+		Module::attribut("titre", "text_line", "Biographie");
+		Module::type_liens("enfants", "mPhoto");
+		Module::attribut("texte_bio", "text_rich", "");
+		Module::attribut("publier", "bool", "true");
+	}
+	
+	public function res_c_style() {
+		niy("res_c_style");
+	}
+	
+	public function res_h_page($d) {
+		$d->w_en_tete($this->titre, $this->texte_bio); // En-tête standard.
+		
+		$d->article()->w_liste($this->enfants(true, "-date_creation"), create_function('$e, $li', '
+				$a = $li->a($e->url());
+				$e->rendu("h_miniature", $a);
+			'));
+		
+		return $d;
+	}
+}
+
+Module::add_module("mBiographie");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/biographie/include.php5 b/cms2/modules/biographie/include.php5
new file mode 100644
index 0000000..2b859dd
--- /dev/null
+++ b/cms2/modules/biographie/include.php5
@@ -0,0 +1,5 @@
+<?php
+
+require_once(dirname(__FILE__) . "/biographie.php5");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/concerts/concerts.php5 b/cms2/modules/concerts/concerts.php5
new file mode 100644
index 0000000..8abbdf7
--- /dev/null
+++ b/cms2/modules/concerts/concerts.php5
@@ -0,0 +1,92 @@
+<?php
+
+class mConcerts extends mPage {
+	public static function info($module) {
+		Module::ressources_statiques("c_style");
+		Module::ressources_dynamiques("h_page");
+		Module::attribut("titre", "text_line", "Concerts");
+		Module::attribut("description", "text_line", "");
+		Module::attribut("publier", "bool", "true");
+		Module::type_liens("enfants", "mConcertsAnnee");
+	}
+	
+	public function res_c_style() {
+		niy("res_c_style");
+	}
+	
+	public function res_h_page($d) {
+		$d->w_en_tete($this->titre, $this->description); // En-tête standard.
+		
+		$d->article()->w_liste($this->enfants(true, "-date_creation"), create_function('$e, $li', '
+				return $li->a($e->url())->text($e->titre);
+			'));
+		
+		return $d;
+	}
+}
+
+class mConcertsAnnee extends mPage {
+	public static function info($module) {
+		Module::ressources_statiques("c_style");
+		Module::ressources_dynamiques("h_page");
+		Module::attribut("titre", "text_line", "2010");
+		Module::attribut("publier", "bool", "true");
+		Module::type_liens("enfants", "mConcertsConcert");
+	}
+	
+	public function res_c_style() {
+		niy("res_c_style");
+	}
+	
+	public function res_h_page($d) {
+		$d->w_titre($this->titre); // En-tête standard.
+		
+		$d->article()->w_liste($this->enfants(true, "-date_creation"), create_function('$e, $li', '
+				$e->rendu("h_page", $d);
+			'));
+		
+		return $d;
+	}
+}
+
+class mConcertsConcert extends mPage {
+	public static function info($module) {
+		Module::ressources_statiques("c_style");
+		Module::ressources_dynamiques("h_page");
+		Module::attribut("date", "text_line", "15 Décembre 2010");
+		Module::attribut("lieu", "text_line", "");
+		Module::attribut("commentaire", "text_rich", "");
+		Module::attribut("publier", "bool", "true");
+		Module::type_liens("photos", "mPhoto");
+	}
+	
+	public function res_c_style() {
+		niy("res_c_style");
+	}
+	
+	public function res_h_page($d) {
+		$d->hx()->text("Date : ");
+		$d->w_field($this->date);
+		
+		$d->text("Lieu : ");
+		$d->w_field($this->lieu);
+		
+		$d->w_field($this->commentaire);
+		
+		// TODO : enfants catégorie photos
+		$d->hx("Photos du concert :");
+		$d->article()->w_liste($this->enfants(true, "-date_creation"), create_function('$e, $li', '
+				$e->rendu("h_miniature", $d);
+			'));
+
+		// TODO : articles de presse.
+		
+		return $d;
+	}
+}
+
+Module::add_module("mConcerts");
+Module::add_module("mConcertsAnnee");
+Module::add_module("mConcertsConcert");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/concerts/include.php5 b/cms2/modules/concerts/include.php5
new file mode 100644
index 0000000..fc738fa
--- /dev/null
+++ b/cms2/modules/concerts/include.php5
@@ -0,0 +1,5 @@
+<?php
+
+require_once(dirname(__FILE__) . "/concerts.php5");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/contact/contact.php5 b/cms2/modules/contact/contact.php5
new file mode 100644
index 0000000..4cf2d99
--- /dev/null
+++ b/cms2/modules/contact/contact.php5
@@ -0,0 +1,37 @@
+<?php
+
+class mContacts extends mPage {
+	public static function info($module) {
+		Module::ressources_statiques("c_style");
+		Module::ressources_dynamiques("h_page");
+		Module::attribut("titre", "text_line", "Contact");
+		Module::attribut("publier", "bool", "true");
+		Module::type_liens("enfants", "mContactsContact");
+	}
+	
+	public function res_c_style() {
+		niy("res_c_style");
+	}
+	
+	public function res_h_page($d) {
+		$d->w_titre($this->titre);
+		
+		$d->article()->w_liste($this->enfants(true, "-date_creation"), create_function('$e, $li', '
+				$li->a($e->cible)->text($e->texte);
+			'));
+		
+		return $d;
+	}
+}
+
+class mContactsContact extends mPage {
+	public static function info($module) {
+		Module::attribut("texte", "text_line", "Texte du lien");
+		Module::attribut("cible", "text_rich", "http://www.example.com/");
+	}
+}
+
+Module::add_module("mContacts");
+Module::add_module("mContactsContact");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/contact/devenir_membre.php5 b/cms2/modules/contact/devenir_membre.php5
new file mode 100644
index 0000000..45abba1
--- /dev/null
+++ b/cms2/modules/contact/devenir_membre.php5
@@ -0,0 +1,31 @@
+<?php
+
+class mDevenirMembre extends mPage {
+	public static function info($module) {
+		Module::ressources_statiques("c_style");
+		Module::ressources_dynamiques("h_page");
+		Module::attribut("titre", "text_line", "Biographie");
+		Module::type_liens("enfants", "mPhoto");
+		Module::attribut("texte_dm", "text_rich", "");
+		Module::attribut("publier", "bool", "true");
+	}
+	
+	public function res_c_style() {
+		niy("res_c_style");
+	}
+	
+	public function res_h_page($d) {
+		$d->w_en_tete($this->titre, $this->texte_dm); // En-tête standard.
+		
+		$d->article()->w_liste($this->enfants(true, "-date_creation"), create_function('$e, $li', '
+				$a = $li->a($e->url());
+				$e->rendu("h_miniature", $a);
+			'));
+		
+		return $d;
+	}
+}
+
+Module::add_module("mDevenirMembre");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/contact/include.php5 b/cms2/modules/contact/include.php5
new file mode 100644
index 0000000..f8f9152
--- /dev/null
+++ b/cms2/modules/contact/include.php5
@@ -0,0 +1,6 @@
+<?php
+
+require_once(dirname(__FILE__) . "/contact.php5");
+require_once(dirname(__FILE__) . "/devenir_membre.php5");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/enregistrements/enregistrements.php5 b/cms2/modules/enregistrements/enregistrements.php5
new file mode 100644
index 0000000..8f64ce9
--- /dev/null
+++ b/cms2/modules/enregistrements/enregistrements.php5
@@ -0,0 +1,70 @@
+<?php
+
+class mEnregistrements extends mPage {
+	public static function info($module) {
+		Module::ressources_statiques("c_style");
+		Module::ressources_dynamiques("h_page");
+		Module::attribut("titre", "text_line", "Partitions");
+		Module::attribut("description", "text_line", "");
+		Module::attribut("publier", "bool", "true");
+		Module::type_liens("enfants", "mEnregistrementsEnregistrement");
+	}
+	
+	public function res_c_style() {
+		niy("res_c_style");
+	}
+	
+	public function res_h_page($d) {
+		$d->w_en_tete($this->titre, $this->description); // En-tête standard.
+		
+		$d->article()->w_liste($this->enfants(true, "-date_creation"), create_function('$e, $li', '
+				$e->rendu("h_page", $d);
+			'));
+		
+		return $d;
+	}
+}
+
+class mEnregistrementsEnregistrement extends mPage {
+	public static function info($module) {
+		Module::ressources_statiques("c_style");
+		Module::ressources_dynamiques("h_page");
+		Module::attribut("titre", "text_line", "Nom du morceau");
+		Module::attribut("commentaire", "text_rich", "");
+		Module::attribut("publier", "bool", "true");
+		Module::attribut("enregistrement", "file_audio", "");
+		Module::attribut("complet", "bool", "true");
+		Module::type_liens("partitions", "mPartitionsPartition");
+		Module::type_liens("interpretes", "mInterpretesInterprete");
+	}
+	
+	public function res_c_style() {
+		niy("res_c_style");
+	}
+	
+	public function res_h_page($d) {
+		$d->w_en_tete($this->titre, $this->commentaire);
+		
+		$d->w_field($this->enregistrement);
+		$d->w_field($this->complet);
+		
+		// TODO : enfants catégorie partitions
+		$d->hx("Partitions de ce morceau :");
+		$d->article()->w_liste($this->enfants(true, "-date_creation"), create_function('$e, $li', '
+				$li->a($e->url())->text($e->titre);
+			'));
+
+		// TODO : enfants catégorie interpretes
+		$d->hx("Interprètes :");
+		$d->article()->w_liste($this->enfants(true, "-date_creation"), create_function('$e, $li', '
+				$li->a($e->url())->text($e->titre);
+			'));
+		
+		return $d;
+	}
+}
+
+Module::add_module("mEnregistrements");
+Module::add_module("mEnregistrementsEnregistrement");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/enregistrements/include.php5 b/cms2/modules/enregistrements/include.php5
new file mode 100644
index 0000000..c71ce0f
--- /dev/null
+++ b/cms2/modules/enregistrements/include.php5
@@ -0,0 +1,5 @@
+<?php
+
+require_once(dirname(__FILE__) . "/enregistrements.php5");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/galerie/galerie.php5 b/cms2/modules/galerie/galerie.php5
index 061e1ee..f529daf 100644
--- a/cms2/modules/galerie/galerie.php5
+++ b/cms2/modules/galerie/galerie.php5
@@ -95,22 +95,12 @@ class mGaleriePhoto extends mGalerieBase {
 	
 	public static function info($module) {
 		Module::ressources_statiques("c_style");
-		Module::ressources_dynamiques(new Inherit(get_parent_class()), "i_grande i_image i_miniature");
+		Module::ressources_dynamiques(new Inherit(get_parent_class()));
+		Module::ressources_dynamiques("i_grande i_image i_miniature");
 		Module::attribut(new Inherit(get_parent_class()));
 		Module::attribut("image", "img_file", "");
 	}
 	
-	public function set_titre($titre) {
-		// set url quand on set titre !
-		// TODO : valeur initiale pour l'url !
-		niy("GaleriePhoto::set_titre($titre)");
-	}
-
-	public function set_image($fichier_image) {
-		// Faire la miniature et l'image de taille "normale".
-		niy("GaleriePhoto::set_image");
-	}
-	
 	public function res_c_style() {
 		niy("GaleriePhoto::res_c_style");
 	}
diff --git a/cms2/modules/include.php5 b/cms2/modules/include.php5
index fdcc9fe..3b5b903 100644
--- a/cms2/modules/include.php5
+++ b/cms2/modules/include.php5
@@ -4,6 +4,14 @@
 require_once(dirname(__FILE__) . "/../code/module.php5");
 require_once(dirname(__FILE__) . "/../code/page.php5");
 
+require_once(dirname(__FILE__) . "/accueil/include.php5");
+require_once(dirname(__FILE__) . "/concerts/include.php5");
+require_once(dirname(__FILE__) . "/biographie/include.php5");
+require_once(dirname(__FILE__) . "/partitions/include.php5");
+require_once(dirname(__FILE__) . "/enregistrements/include.php5");
+require_once(dirname(__FILE__) . "/interpretes/include.php5");
+require_once(dirname(__FILE__) . "/liens/include.php5");
+require_once(dirname(__FILE__) . "/contact/include.php5");
 require_once(dirname(__FILE__) . "/galerie/include.php5");
 require_once(dirname(__FILE__) . "/admin/include.php5");
 require_once(dirname(__FILE__) . "/squelette/include.php5");
diff --git a/cms2/modules/interpretes/include.php5 b/cms2/modules/interpretes/include.php5
new file mode 100644
index 0000000..5d3869e
--- /dev/null
+++ b/cms2/modules/interpretes/include.php5
@@ -0,0 +1,5 @@
+<?php
+
+require_once(dirname(__FILE__) . "/interpretes.php5");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/interpretes/interpretes.php5 b/cms2/modules/interpretes/interpretes.php5
new file mode 100644
index 0000000..3f1493c
--- /dev/null
+++ b/cms2/modules/interpretes/interpretes.php5
@@ -0,0 +1,58 @@
+<?php
+
+class mInterpretes extends mPage {
+	public static function info($module) {
+		Module::ressources_statiques("c_style");
+		Module::ressources_dynamiques("h_page");
+		Module::attribut("titre", "text_line", "Partitions");
+		Module::attribut("description", "text_line", "");
+		Module::attribut("publier", "bool", "true");
+		Module::type_liens("enfants", "mPartitionsPartition");
+	}
+	
+	public function res_c_style() {
+		niy("res_c_style");
+	}
+	
+	public function res_h_page($d) {
+		$d->w_en_tete($this->titre, $this->description); // En-tête standard.
+		
+		$d->article()->w_liste($this->enfants(true, "-date_creation"), create_function('$e, $li', '
+				$e->rendu("h_page", $d);
+			'));
+		
+		return $d;
+	}
+}
+
+class mInterpretesInterprete extends mPage {
+	public static function info($module) {
+		Module::ressources_statiques("c_style");
+		Module::ressources_dynamiques("h_page");
+		Module::attribut("titre", "text_line", "Nom de l'interprète");
+		Module::attribut("commentaire", "text_rich", "");
+		Module::attribut("publier", "bool", "true");
+		Module::type_liens("enregistrements", "mEnregistrementsEnregistrement");
+	}
+	
+	public function res_c_style() {
+		niy("res_c_style");
+	}
+	
+	public function res_h_page($d) {
+		$d->w_en_tete($this->titre, $this->commentaire);
+		
+		// TODO : enfants catégorie enregistrements
+		$d->hx("Enregistrements faits par cet interprète :");
+		$d->article()->w_liste($this->enfants(true, "-date_creation"), create_function('$e, $li', '
+				$li->a($e->url())->text($e->titre);
+			'));
+
+		return $d;
+	}
+}
+
+Module::add_module("mInterpretes");
+Module::add_module("mInterpretesInterprete");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/liens/include.php5 b/cms2/modules/liens/include.php5
new file mode 100644
index 0000000..cecef85
--- /dev/null
+++ b/cms2/modules/liens/include.php5
@@ -0,0 +1,5 @@
+<?php
+
+require_once(dirname(__FILE__) . "/liens.php5");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/liens/liens.php5 b/cms2/modules/liens/liens.php5
new file mode 100644
index 0000000..6fa7229
--- /dev/null
+++ b/cms2/modules/liens/liens.php5
@@ -0,0 +1,38 @@
+<?php
+
+class mLiens extends mPage {
+	public static function info($module) {
+		Module::ressources_statiques("c_style");
+		Module::ressources_dynamiques("h_page");
+		Module::attribut("titre", "text_line", "Liens");
+		Module::attribut("description", "text_line", "Liens utiles.");
+		Module::attribut("publier", "bool", "true");
+		Module::type_liens("enfants", "mLiensLien");
+	}
+	
+	public function res_c_style() {
+		niy("res_c_style");
+	}
+	
+	public function res_h_page($d) {
+		$d->w_en_tete($this->titre, $this->description); // En-tête standard.
+		
+		$d->article()->w_liste($this->enfants(true, "-date_creation"), create_function('$e, $li', '
+				$li->a($e->cible)->text($e->texte);
+			'));
+		
+		return $d;
+	}
+}
+
+class mLiensLien extends mPage {
+	public static function info($module) {
+		Module::attribut("texte", "text_line", "Texte du lien");
+		Module::attribut("cible", "text_rich", "http://www.example.com/");
+	}
+}
+
+Module::add_module("mLiens");
+Module::add_module("mLiensLien");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/partitions/include.php5 b/cms2/modules/partitions/include.php5
new file mode 100644
index 0000000..666f449
--- /dev/null
+++ b/cms2/modules/partitions/include.php5
@@ -0,0 +1,5 @@
+<?php
+
+require_once(dirname(__FILE__) . "/partitions.php5");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/partitions/partitions.php5 b/cms2/modules/partitions/partitions.php5
new file mode 100644
index 0000000..803fc4d
--- /dev/null
+++ b/cms2/modules/partitions/partitions.php5
@@ -0,0 +1,61 @@
+<?php
+
+class mPartitions extends mPage {
+	public static function info($module) {
+		Module::ressources_statiques("c_style");
+		Module::ressources_dynamiques("h_page");
+		Module::attribut("titre", "text_line", "Partitions");
+		Module::attribut("description", "text_line", "");
+		Module::attribut("publier", "bool", "true");
+		Module::type_liens("enfants", "mPartitionsPartition");
+	}
+	
+	public function res_c_style() {
+		niy("res_c_style");
+	}
+	
+	public function res_h_page($d) {
+		$d->w_en_tete($this->titre, $this->description); // En-tête standard.
+		
+		$d->article()->w_liste($this->enfants(true, "-date_creation"), create_function('$e, $li', '
+				$e->rendu("h_page", $d);
+			'));
+		
+		return $d;
+	}
+}
+
+class mPartitionsPartition extends mPage {
+	public static function info($module) {
+		Module::ressources_statiques("c_style");
+		Module::ressources_dynamiques("h_page");
+		Module::attribut("titre", "text_line", "Nom du morceau");
+		Module::attribut("commentaire", "text_rich", "");
+		Module::attribut("publier", "bool", "true");
+		Module::attribut("partition", "file_pdf", "");
+		Module::type_liens("enregistrements", "mEnregistrementsEnregistrement");
+	}
+	
+	public function res_c_style() {
+		niy("res_c_style");
+	}
+	
+	public function res_h_page($d) {
+		$d->w_en_tete($this->titre, $this->commentaire);
+		
+		$d->w_field($this->partition);
+		
+		// TODO : enfants catégorie enregistrements
+		$d->hx("Enregistrements de ce morceau :");
+		$d->article()->w_liste($this->enfants(true, "-date_creation"), create_function('$e, $li', '
+				$li->a($e->url())->text($e->titre);
+			'));
+
+		return $d;
+	}
+}
+
+Module::add_module("mPartitions");
+Module::add_module("mPartitionsPartition");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/photo/include.php5 b/cms2/modules/photo/include.php5
new file mode 100644
index 0000000..e0ccff8
--- /dev/null
+++ b/cms2/modules/photo/include.php5
@@ -0,0 +1,5 @@
+<?php
+
+require_once(dirname(__FILE__) . "/photo.php5");
+
+?>
\ No newline at end of file
diff --git a/cms2/modules/photo/photo.php5 b/cms2/modules/photo/photo.php5
new file mode 100644
index 0000000..11b1767
--- /dev/null
+++ b/cms2/modules/photo/photo.php5
@@ -0,0 +1,71 @@
+<?php
+
+class mPhoto {
+	public static function info($module) {
+		Module::ressources_statiques("c_style");
+		Module::ressources_dynamiques("h_page i_grande i_image i_miniature");
+		Module::attribut("titre", "text_line", $cvars['texte_titre']);
+		Module::attribut("description", "text_rich", "");
+		Module::attribut("publier", "bool", "true");
+		Module::attribut("image", "img_file", "");
+	}
+	
+	public function res_c_style() {
+		niy("GaleriePhoto::res_c_style");
+	}
+	
+	public function res_h_page($d) {
+		$d->w_en_tete($this->titre, toString($this->description)); // En-tête standard.
+		$d->w_img_file_desc($this->image, $this->description);
+		return $d;
+	}
+	
+	public function res_h_mini_miniature($d) {
+		$d->img($this->description, $this->i_image);
+		return $d;
+	}
+
+	// ===============================
+	
+	public static function creer_miniature($chemin_fs, $largeur_max, $hauteur_max) {
+		$chemin_fs_dest = tempnam(dirname($chemin_fs), "img");
+		if ($chemin_fs_dest === false) return false; // TODO : return Erreur::...(...);
+		
+		/* TODO : utiliser imagealphablending si nécessaire... http://www.php.net/manual/fr/function.imagecreatefrompng.php#85754 */
+		$image = imagecreatefromjpeg($chemin_fs); // ... formpng()
+		$largeur = imageSX($image);
+		$hauteur = imageSY($image);
+		if ($largeur < $largeur_max && $hauteur < $hauteur_max) {
+			$largeur_miniature = $largeur;
+			$hauteur_miniature = $hauteur;
+		} else if ($largeur / $hauteur < $largeur_max / $hauteur_max) { // limité par la hauteur.
+			$largeur_miniature = $largeur_max;
+			$hauteur_miniature = $hauteur * $largeur_miniature/$largeur;
+		} else { // limité par la largeur
+			$hauteur_miniature = $hauteur_max;
+			$largeur_miniature = $largeur * $hauteur_miniature/$hauteur;
+		}
+		$miniature = ImageCreateTrueColor($largeur_miniature, $hauteur_miniature); // miniatures de tailles différentes
+		//var_dump($largeur_miniature, $hauteur_miniature, $largeur, $hauteur);
+		imagecopyresampled(
+			$miniature,         // image destination
+			$image,             // image source
+			0,                  // x destination
+			0,                  // y destination
+			0,                  // x source
+			0,                  // y source
+			$largeur_miniature, // largeur destination
+			$hauteur_miniature, // hauteur destination
+			$largeur,           // largeur source
+			$hauteur            // hauteur source
+		);
+		imagedestroy($image); // On libère la mémoire le plus tôt possible.
+		imagejpeg($miniature, $chemin_fs_dest);
+		imagedestroy($miniature);
+		return $chemin_fs_dest;
+	}
+}
+
+Module::add_module("mPhoto");
+
+?>
\ No newline at end of file