diff --git a/.gitattributes b/.gitattributes
index 274a485bc454d4db08934ac56f7059a0ca4c3875..7c6716be8bcfa573d5b7204db05bcef2b72b4497 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -10,7 +10,6 @@ action/tourner.php -text
 action/verifier_documents_brises.php -text
 base/medias.php -text
 base/typedoc.php -text
-exec/portfolio.php -text
 formulaires/changer_fichier_document.html -text
 formulaires/changer_fichier_document.php -text
 formulaires/configurer_documents.html -text
@@ -21,7 +20,6 @@ formulaires/illustrer_document.html -text
 formulaires/illustrer_document.php -text
 formulaires/inc-colonne_documents.html -text
 formulaires/inc-lister_archive_jointe.html -text
-formulaires/inc-portfolio_documents.html -text
 formulaires/inc-upload_document.html -text
 formulaires/joindre_document.html -text
 formulaires/joindre_document.php -text
@@ -82,17 +80,20 @@ modeles/document_case.html -text
 modeles/document_case_fonctions.php -text
 modeles/document_desc.html -text
 /plugin.xml -text
-prive/bouton/inc-supprimer-orphelins.html -text
 prive/contenu/portfolio_document.html -text
 prive/editer/colonne_document.html -text
 prive/editer/document_popup.html -text
-prive/galerie.html -text
-prive/inc-ajouter-documents.html -text
-prive/inc-galerie.html -text
 prive/infos/document.html -text
 prive/squelettes/contenu/document_edit.html -text
+prive/squelettes/contenu/mediatheque.html -text
+prive/squelettes/inclure/ajouter-documents.html -text
+prive/squelettes/inclure/bouton-supprimer-orphelins.html -text
 prive/squelettes/inclure/document_infos.html -text
+prive/squelettes/inclure/mediatheque-galerie.html -text
+prive/squelettes/inclure/mediatheque-navigation.html -text
+prive/squelettes/inclure/portfolio-documents.html -text
 prive/squelettes/navigation/document_edit.html -text
+prive/squelettes/top/mediatheque.html -text
 prive/style_prive_plugin_medias.html -text
 prive/themes/spip/images/document-16.png -text
 prive/themes/spip/images/document-24.png -text
diff --git a/exec/portfolio.php b/exec/portfolio.php
deleted file mode 100644
index 8bb68993b617e4220f3f86a966982ca46cbd5382..0000000000000000000000000000000000000000
--- a/exec/portfolio.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-
-/***************************************************************************\
- *  SPIP, Systeme de publication pour l'internet                           *
- *                                                                         *
- *  Copyright (c) 2001-2011                                                *
- *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
- *                                                                         *
- *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
- *  Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne.   *
-\***************************************************************************/
-
-if (!defined("_ECRIRE_INC_VERSION")) return;
-
-
-include_spip('inc/presentation');
-
-function exec_portfolio(){
-	if (!autoriser('administrer','portfolio',0)) {
-		include_spip('inc/minipres');
-		echo minipres();
-		exit;
-	}
-
-	if (defined('_AJAX') AND _AJAX){
-		$contexte = array_merge(array('editable'=>0),$_GET);
-		$res = /*formulaire_recherche('portfolio').*/recuperer_fond('prive/galerie',$contexte);
-
-		include_spip('inc/actions');
-		ajax_retour($res);
-		return;
-	}
-	
-	$commencer_page = charger_fonction('commencer_page','inc');
-	echo $commencer_page(_T('medias:documents'));
-	
-	echo gros_titre(_T('medias:documents'),'',false);
-	echo debut_grand_cadre(true);
-	
-	echo formulaire_recherche('portfolio');
-	echo recuperer_fond('prive/galerie',$_GET);
-
-	echo fin_grand_cadre(true),fin_page();
-}
-
-?>
\ No newline at end of file
diff --git a/formulaires/joindre_document.php b/formulaires/joindre_document.php
index 3bdc29af56c065a382948da386eedf0c92e2ff95..69f25c3401d5111bf8355475dd4f365cca505387 100644
--- a/formulaires/joindre_document.php
+++ b/formulaires/joindre_document.php
@@ -188,7 +188,7 @@ function formulaires_joindre_document_traiter_dist($id_document='new',$id_objet=
 			$res['message_erreur'] = implode('<br />',$messages_erreur);
 		if ($nb_docs){
 			$sel = "#doc".implode(",#doc",$sel);
-			$js = "if (window.jQuery) jQuery(function(){ajaxReload('portfolio');});";
+			$js = "if (window.jQuery) jQuery(function(){ajaxReload('documents');});";
 			if ($nb_docs==1)
 				$js .= "setTimeout(function(){if (window.jQuery) jQuery('#doc$ancre a.editbox').get(0).focus();},30);";
 			$js = "<script type='text/javascript'>$js</script>";
diff --git a/plugin.xml b/plugin.xml
index 0475f7058db94df294e1853578abea592f552d15..90ff390a0c56461e3921c26028ebdd7255b73ec4 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -57,7 +57,7 @@
 	<bouton id='documents' parent='bando_edition'>
 		<titre>medias:documents</titre>
 		<icone>images/portfolio-16.png</icone>
-		<url>portfolio</url>
+		<url>mediatheque</url>
 	</bouton>
 
 	<chemin dir="" />
diff --git a/prive/contenu/portfolio_document.html b/prive/contenu/portfolio_document.html
index c1ffa1513862f3c19c1c0db3da91e9d4296f0062..455cc1f56250b9b386ec72718a01ef3360bf80a0 100644
--- a/prive/contenu/portfolio_document.html
+++ b/prive/contenu/portfolio_document.html
@@ -6,10 +6,10 @@
 
 ]
 [
-(#INCLURE{fond=formulaires/inc-portfolio_documents}{env}{ajax=portfolio})
+(#INCLURE{fond=prive/squelettes/inclure/portfolio-documents}{env}{ajax=documents})
 ]
 [
-(#INCLURE{fond=prive/inc-ajouter-documents}{env}{ajax})
+(#INCLURE{fond=prive/squelettes/inclure/ajouter-documents}{env}{ajax})
 ]
 [<script type="text/javascript" src='(#CHEMIN{javascript/jquery.MultiFile.js})'></script>
 <script type='text/javascript'>
diff --git a/prive/galerie.html b/prive/galerie.html
deleted file mode 100644
index de18177cd92ed0e4f67992fecde323505dfe337e..0000000000000000000000000000000000000000
--- a/prive/galerie.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<div class='nettoyeur' style="width:600px;"></div>
-[(#ENV{editable,' '}|oui)
-[<script type="text/javascript" src='(#CHEMIN{javascript/jquery.MultiFile.js})'></script>]
-<script type='text/javascript'>
-jQuery.MultiFile();
-onAjaxLoad(function(){jQuery.MultiFile();});
-</script>
-]
-<INCLURE{fond=prive/inc-galerie}{media}{ajax}{env}>
diff --git a/prive/squelettes/contenu/document_edit.html b/prive/squelettes/contenu/document_edit.html
index 249fb14c908d6c8e5e40cdb321362ee172aaf555..b8b6738d2b45ab82590a56ca8fdaf9c6ff936e9f 100644
--- a/prive/squelettes/contenu/document_edit.html
+++ b/prive/squelettes/contenu/document_edit.html
@@ -1,8 +1,8 @@
-[(#ID_DOCUMENT|interdire_acces)]
-[(#AUTORISER{modifier,document,#ID_DOCUMENT}|interdire_acces)]
+[(#ID_DOCUMENT|sinon_interdire_acces)]
+[(#AUTORISER{modifier,document,#ID_DOCUMENT}|sinon_interdire_acces)]
 <div class='cadre-formulaire-editer'>
 <div class="entete-formulaire">
-	[(#ENV{redirect}|sinon{#URL_ECRIRE{portfolio}}|icone_verticale{<:icone_retour:>,document,'',left})]
+	[(#ENV{redirect}|sinon{#URL_ECRIRE{mediatheque}}|icone_verticale{<:icone_retour:>,document,'',left})]
 	[<:medias:info_modifier_document:>
 	<h1>(#INFO_TITRE{document,#ID_DOCUMENT}|sinon{#INFO_FICHIER*{document,#ID_DOCUMENT}})</h1>]
 </div>
diff --git a/prive/squelettes/contenu/mediatheque.html b/prive/squelettes/contenu/mediatheque.html
new file mode 100644
index 0000000000000000000000000000000000000000..d25d6076f547459055fc76214924f45e5d9a931f
--- /dev/null
+++ b/prive/squelettes/contenu/mediatheque.html
@@ -0,0 +1,11 @@
+[(#AUTORISER{administrer,mediatheque}|sinon_interdire_acces)]
+#FORMULAIRE_RECHERCHE_ECRIRE{#URL_ECRIRE{mediatheque}}
+<div class='nettoyeur'></div>
+[(#ENV{editable,' '}|oui)
+<INCLURE{fond=prive/squelettes/inclure/mediatheque-navigation}{media}{ajax}{env}>
+[<script type="text/javascript" src='(#CHEMIN{javascript/jquery.MultiFile.js})'></script>]
+<script type='text/javascript'>
+jQuery.MultiFile();
+onAjaxLoad(function(){jQuery.MultiFile();});
+</script>
+]
\ No newline at end of file
diff --git a/prive/inc-ajouter-documents.html b/prive/squelettes/inclure/ajouter-documents.html
similarity index 100%
rename from prive/inc-ajouter-documents.html
rename to prive/squelettes/inclure/ajouter-documents.html
diff --git a/prive/bouton/inc-supprimer-orphelins.html b/prive/squelettes/inclure/bouton-supprimer-orphelins.html
similarity index 100%
rename from prive/bouton/inc-supprimer-orphelins.html
rename to prive/squelettes/inclure/bouton-supprimer-orphelins.html
diff --git a/prive/inc-galerie.html b/prive/squelettes/inclure/mediatheque-galerie.html
similarity index 56%
rename from prive/inc-galerie.html
rename to prive/squelettes/inclure/mediatheque-galerie.html
index 317fac521d6f7c8556e3a22721dbdc446a0784ab..73fcee8a719724523e53b8417df2cf2ac628c608 100644
--- a/prive/inc-galerie.html
+++ b/prive/squelettes/inclure/mediatheque-galerie.html
@@ -1,67 +1,5 @@
-#SET{self,#SELF|parametre_url{debut_galerie,''}}
-#SET{self,#GET{self}|parametre_url{extension,''}}
 #SET{editable,#ENV{editable,' '}|oui}
 
-<div class='onglets_simple'>
-<ul class='medias'>
-[<li>(#GET{self}|parametre_url{media,''}|lien_ou_expose{<:medias:tous_les_medias:>,#ENV{media,''}|=={''},ajax})</li>]
-<BOUCLE_medias(DOCUMENTS){id_rubrique ?}{id_article ?}{id_breve ?}{id_document ?}{recherche ?}{statut==.*}{compteur types_documents, media}{media IN image,audio,video,file}>
-[<li class='#MEDIA'>(#GET{self}|parametre_url{media,#MEDIA}|lien_ou_expose{#VAL{medias:media_}|concat{#MEDIA}|_T|concat{' (',#COMPTEUR{types_documents},')'},#ENV{media}|=={#MEDIA},ajax})</li>]
-</BOUCLE_medias>
-</ul>
-<div class='nettoyeur'></div>
-</div>
-
-[(#ENV{id_document}|oui)
-<a class='annule_filtre' href='[(#GET{self}|parametre_url{id_document,''})]' title="<:medias:tout_voir|attribut_html:>">[(#CHEMIN{images/annuler-recherche.png}|balise_img|inserer_attribut{alt,<:medias:tout_voir:>})]</a>
-]
-
-<div class='onglets_simple second'>
-<ul class='statut'>
-[<li class='first'>(#GET{self}|parametre_url{statut,''}|lien_ou_expose{<:medias:documents_tous:>,#ENV{statut,.*}|=={.*},ajax})</li>]
-[<li>(#GET{self}|parametre_url{statut,publie}|lien_ou_expose{<:medias:documents_publies:>,#ENV{statut}|=={publie},ajax})</li>]
-[<li>(#GET{self}|parametre_url{statut,prepa|poubelle}|lien_ou_expose{<:medias:documents_non_publies:>,#ENV{statut}|=={prepa|poubelle},ajax})</li>]
-</ul>
-
-<ul class='distant'>
-[<li class='first'>(#GET{self}|parametre_url{distant,''}|lien_ou_expose{<:medias:documents_tous:>,#ENV{distant,''}|=={''},ajax})</li>]
-[<li>(#GET{self}|parametre_url{distant,'oui'}|lien_ou_expose{<:medias:documents_distants:>,#ENV{distant,''}|=={'oui'},ajax})</li>]
-[<li>(#GET{self}|parametre_url{distant,'non'}|lien_ou_expose{<:medias:documents_locaux:>,#ENV{distant,''}|=={'non'},ajax})</li>]
-</ul>
-
-<ul class='brises'>
-[<li class='first'>(#GET{self}|parametre_url{brise|orphelins,''}|lien_ou_expose{<:medias:documents_tous:>,#ENV{brise,0}|non|et{#ENV{orphelins,0}|non},ajax})</li>]
-[<li>(#GET{self}|parametre_url{brise,''}|parametre_url{orphelins,1}|lien_ou_expose{<:medias:documents_orphelins:>,#ENV{orphelins,0}|=={1},ajax})</li>]
-[<li>(#GET{self}|parametre_url{brise,1}|parametre_url{orphelins,''}|lien_ou_expose{<:medias:documents_brises:>,#ENV{brise,0}|=={1},ajax})</li>]
-</ul>
-
-<ul class='sanstitre'>
-[<li class='first'>(#GET{self}|parametre_url{sanstitre,''}|lien_ou_expose{<:medias:documents_tous:>,#ENV{sanstitre,''}|=={''},ajax})</li>]
-[<li>(#GET{self}|parametre_url{sanstitre,'1'}|lien_ou_expose{<:info_sans_titre:>,#ENV{sanstitre,''}|=={'1'},ajax})</li>]
-</ul>
-<div class='nettoyeur'></div>
-</div>
-
-[(#GET{editable})
-<div class='actions'>
-[(#ENV{brise,0}|oui)
-[(#URL_ACTION_AUTEUR{verifier_documents_brises,'1',#GET{self}}|lien_ou_expose{<:medias:verifier_documents_brises:>,0,ajax})]
-]
-[
-(#INCLURE{fond=prive/inc-ajouter-documents}{env}{ajax})
-]
-</div>]
-
-<B_types>
-<ul class='choix-type'>
-<BOUCLE_types(TYPES_DOCUMENTS){media=#ENV{media,''}}>
-<BOUCLE_compte(DOCUMENTS){id_rubrique ?}{id_article ?}{id_breve ?}{id_document ?}{recherche ?}{statut==.*}{extension} />
-[(#TOTAL_BOUCLE|oui)[<li>(#GET{self}|parametre_url{extension,#EXTENSION}|lien_ou_expose{#TITRE|concat{' (',#TOTAL_BOUCLE,')'},#ENV{extension}|=={#EXTENSION},ajax})<span> | </span></li>]]
-<//B_compte>
-</BOUCLE_types>
-</ul>
-</B_types>
-
 <div class="galerie[ media-(#ENV{media,''})]">
 	<B_galerie>
 	
@@ -152,7 +90,7 @@
 	<h2>[(#VAL{medias:aucun_}|concat{#ENV{media,document}}|_T)]</h2>
 	<//B_galerie>
 	[(#ENV{orphelins}|et{#AUTORISER{supprimer,orphelins,'',#SESSION{id_auteur}}})
-	[(#INCLURE{fond=prive/bouton/inc-supprimer-orphelins,env,nb_orphelins=#GET{nb_orphelins}})]
+	[(#INCLURE{fond=prive/squelettes/inclure/bouton-supprimer-orphelins,env,nb_orphelins=#GET{nb_orphelins}})]
 	]
 	</B_docs_supprimables>
 </div><!--#galerie-->
diff --git a/prive/squelettes/inclure/mediatheque-navigation.html b/prive/squelettes/inclure/mediatheque-navigation.html
new file mode 100644
index 0000000000000000000000000000000000000000..c4d938f38766a7fb2d4b4cae927d26aaf6fc6801
--- /dev/null
+++ b/prive/squelettes/inclure/mediatheque-navigation.html
@@ -0,0 +1,67 @@
+#SET{self,#SELF|parametre_url{debut_galerie,''}}
+#SET{self,#GET{self}|parametre_url{extension,''}}
+#SET{editable,#ENV{editable,' '}|oui}
+
+<div class='onglets_simple'>
+<ul class='medias'>
+[<li>(#GET{self}|parametre_url{media,''}|lien_ou_expose{<:medias:tous_les_medias:>,#ENV{media,''}|=={''},ajax})</li>]
+<BOUCLE_medias(DATA){liste image,audio,video,file}>
+	<BOUCLE_comptem(DOCUMENTS){id_rubrique ?}{id_article ?}{id_breve ?}{id_document ?}{recherche ?}{statut==.*}{media=#VALEUR} />
+	[<li class='#MEDIA'>(#GET{self}|parametre_url{media,#VALEUR}|lien_ou_expose{#VAL{medias:media_}|concat{#VALEUR}|_T|concat{' (',#TOTAL_BOUCLE,')'},#ENV{media}|=={#VALEUR},ajax})</li>]
+	<//B_comptem>
+</BOUCLE_medias>
+</ul>
+<div class='nettoyeur'></div>
+</div>
+
+[(#ENV{id_document}|oui)
+<a class='annule_filtre' href='[(#GET{self}|parametre_url{id_document,''})]' title="<:medias:tout_voir|attribut_html:>">[(#CHEMIN{images/annuler-recherche.png}|balise_img|inserer_attribut{alt,<:medias:tout_voir:>})]</a>
+]
+
+<div class='onglets_simple second'>
+<ul class='statut'>
+[<li class='first'>(#GET{self}|parametre_url{statut,''}|lien_ou_expose{<:medias:documents_tous:>,#ENV{statut,.*}|=={.*},ajax})</li>]
+[<li>(#GET{self}|parametre_url{statut,publie}|lien_ou_expose{<:medias:documents_publies:>,#ENV{statut}|=={publie},ajax})</li>]
+[<li>(#GET{self}|parametre_url{statut,prepa|poubelle}|lien_ou_expose{<:medias:documents_non_publies:>,#ENV{statut}|=={prepa|poubelle},ajax})</li>]
+</ul>
+
+<ul class='distant'>
+[<li class='first'>(#GET{self}|parametre_url{distant,''}|lien_ou_expose{<:medias:documents_tous:>,#ENV{distant,''}|=={''},ajax})</li>]
+[<li>(#GET{self}|parametre_url{distant,'oui'}|lien_ou_expose{<:medias:documents_distants:>,#ENV{distant,''}|=={'oui'},ajax})</li>]
+[<li>(#GET{self}|parametre_url{distant,'non'}|lien_ou_expose{<:medias:documents_locaux:>,#ENV{distant,''}|=={'non'},ajax})</li>]
+</ul>
+
+<ul class='brises'>
+[<li class='first'>(#GET{self}|parametre_url{brise|orphelins,''}|lien_ou_expose{<:medias:documents_tous:>,#ENV{brise,0}|non|et{#ENV{orphelins,0}|non},ajax})</li>]
+[<li>(#GET{self}|parametre_url{brise,''}|parametre_url{orphelins,1}|lien_ou_expose{<:medias:documents_orphelins:>,#ENV{orphelins,0}|=={1},ajax})</li>]
+[<li>(#GET{self}|parametre_url{brise,1}|parametre_url{orphelins,''}|lien_ou_expose{<:medias:documents_brises:>,#ENV{brise,0}|=={1},ajax})</li>]
+</ul>
+
+<ul class='sanstitre'>
+[<li class='first'>(#GET{self}|parametre_url{sanstitre,''}|lien_ou_expose{<:medias:documents_tous:>,#ENV{sanstitre,''}|=={''},ajax})</li>]
+[<li>(#GET{self}|parametre_url{sanstitre,'1'}|lien_ou_expose{<:info_sans_titre:>,#ENV{sanstitre,''}|=={'1'},ajax})</li>]
+</ul>
+<div class='nettoyeur'></div>
+</div>
+
+[(#GET{editable})
+<div class='actions'>
+[(#ENV{brise,0}|oui)
+[(#URL_ACTION_AUTEUR{verifier_documents_brises,'1',#GET{self}}|lien_ou_expose{<:medias:verifier_documents_brises:>,0,ajax})]
+]
+[
+(#INCLURE{fond=prive/squelettes/inclure/ajouter-documents}{env}{ajax})
+]
+</div>]
+
+<B_types>
+<ul class='choix-type'>
+<BOUCLE_types(TYPES_DOCUMENTS){media=#ENV{media,''}}>
+<BOUCLE_compte(DOCUMENTS){id_rubrique ?}{id_article ?}{id_breve ?}{id_document ?}{recherche ?}{statut==.*}{extension} />
+[(#TOTAL_BOUCLE|oui)[<li>(#GET{self}|parametre_url{extension,#EXTENSION}|lien_ou_expose{#TITRE|concat{' (',#TOTAL_BOUCLE,')'},#ENV{extension}|=={#EXTENSION},ajax})<span> | </span></li>]]
+<//B_compte>
+</BOUCLE_types>
+</ul>
+</B_types>
+
+<INCLURE{fond=prive/squelettes/inclure/mediatheque-galerie,ajax=documents,env}>
\ No newline at end of file
diff --git a/formulaires/inc-portfolio_documents.html b/prive/squelettes/inclure/portfolio-documents.html
similarity index 100%
rename from formulaires/inc-portfolio_documents.html
rename to prive/squelettes/inclure/portfolio-documents.html
diff --git a/prive/squelettes/top/mediatheque.html b/prive/squelettes/top/mediatheque.html
new file mode 100644
index 0000000000000000000000000000000000000000..80a377adbbbf2ee38323e330c62d739189065d44
--- /dev/null
+++ b/prive/squelettes/top/mediatheque.html
@@ -0,0 +1,2 @@
+<h1><:medias:documents:></h1>
+<?php $GLOBALS['pleine_largeur']=true; ?>
\ No newline at end of file