diff --git a/action/changer_mode_document.php b/action/changer_mode_document.php index 036b4755ba7efa2c6b66ba0d3eda43ffb854ef22..545f70cc715c1172751cc84509715a3e87d53cf1 100644 --- a/action/changer_mode_document.php +++ b/action/changer_mode_document.php @@ -18,6 +18,8 @@ if (!defined("_ECRIRE_INC_VERSION")) return; * * http://doc.spip.org/@action_changer_mode_document_dist * + * @param int $id_document + * @param string $mode * @return void */ function action_changer_mode_document_dist($id_document=null, $mode=null){ @@ -33,18 +35,20 @@ function action_changer_mode_document_dist($id_document=null, $mode=null){ } } - if ($id_document) + if ($id_document + AND include_spip('inc/autoriser') + AND autoriser('modifier','document',$id_document)) action_changer_mode_document_post($id_document, $mode); } // http://doc.spip.org/@action_changer_mode_document_post -function action_changer_mode_document_post($id_document, $mode) -{ +function action_changer_mode_document_post($id_document, $mode){ // - id_document le doc a modifier // - mode le mode a lui donner if ($id_document = intval($id_document) AND in_array($mode, array('vignette', 'image', 'document'))) { - sql_updateq('spip_documents', array('mode'=>$mode), 'id_document='.$id_document); + include_spip('action/editer_document'); + document_modifier($id_document,array('mode'=>$mode)); } } ?> diff --git a/modeles/document_case.html b/modeles/document_case.html index 270dfd178b22605241c971d16db3b016e36cf91d..5340cc5a0df98bbb328d64101a080311b3209342 100644 --- a/modeles/document_case.html +++ b/modeles/document_case.html @@ -5,7 +5,6 @@ Distribue sous licence GPL ] -#CACHE{3600*100} <BOUCLE_docslies(DOCUMENTS documents_liens types_documents){id_document}{id_objet}{objet}{statut?}> <div class="item #MODE" id="doc#ID_DOCUMENT"> <h3 class="titrem">[<span class="fichier">(#FICHIER*|basename)</span>] diff --git a/paquet.xml b/paquet.xml index 617ee12346b84151d88528a5a038e846c9bedff7..c91a856c9d4b87fec866713a50e2a6dfa5a17604 100644 --- a/paquet.xml +++ b/paquet.xml @@ -1,7 +1,7 @@ <paquet prefix="medias" categorie="multimedia" - version="2.7.7" + version="2.7.8" etat="test" compatibilite="[3.0.0-alpha2;[" logo="prive/themes/spip/images/portfolio-32.png"