Browse Source

la page mediatheque passe en squelette complet,

l'upload de doc depuis cette page passe aussi en ajax, avec ajaxReload('documents') au retour
nettoyage/reorganisation des inclusion ajax
3.0
cedric@yterium.com 12 years ago
parent
commit
a11c08ec4a
  1. 13
      .gitattributes
  2. 46
      exec/portfolio.php
  3. 2
      formulaires/joindre_document.php
  4. 2
      plugin.xml
  5. 4
      prive/contenu/portfolio_document.html
  6. 9
      prive/galerie.html
  7. 6
      prive/squelettes/contenu/document_edit.html
  8. 11
      prive/squelettes/contenu/mediatheque.html
  9. 0
      prive/squelettes/inclure/ajouter-documents.html
  10. 0
      prive/squelettes/inclure/bouton-supprimer-orphelins.html
  11. 64
      prive/squelettes/inclure/mediatheque-galerie.html
  12. 67
      prive/squelettes/inclure/mediatheque-navigation.html
  13. 0
      prive/squelettes/inclure/portfolio-documents.html
  14. 2
      prive/squelettes/top/mediatheque.html

13
.gitattributes vendored

@ -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

46
exec/portfolio.php

@ -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();
}
?>

2
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>";

2
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="" />

4
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'>

9
prive/galerie.html

@ -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}>

6
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>

11
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>
]

0
prive/inc-ajouter-documents.html → prive/squelettes/inclure/ajouter-documents.html

0
prive/bouton/inc-supprimer-orphelins.html → prive/squelettes/inclure/bouton-supprimer-orphelins.html

64
prive/inc-galerie.html → 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-->

67
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}>

0
formulaires/inc-portfolio_documents.html → prive/squelettes/inclure/portfolio-documents.html

2
prive/squelettes/top/mediatheque.html

@ -0,0 +1,2 @@
<h1><:medias:documents:></h1>
<?php $GLOBALS['pleine_largeur']=true; ?>
Loading…
Cancel
Save