Changeset 51855 in spip-zone


Ignore:
Timestamp:
Sep 26, 2011, 2:37:54 PM (8 years ago)
Author:
kent1@…
Message:

Amélioration des pipelines et de la prise en compte de la médiathèque

On passe en version 0.5.0

Location:
_plugins_/getID3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/getID3/getid3_pipelines.php

    r41320 r51855  
    2121        $id_document = $flux['args']['id'];
    2222        if(in_array($flux['args']['type'],array('case_document'))){
    23                 $son = array("mp3","ogg","flac","aiff","aif","wav");
    24                 $document = sql_fetsel("docs.extension,docs.distant,L.objet,L.id_objet", "spip_documents AS docs INNER JOIN spip_documents_liens AS L ON L.id_document=docs.id_document","L.id_document=".sql_quote($id_document));
     23                $son_recup_id3 = array("mp3","ogg","flac","aiff","aif","wav","m4a","oga");
     24                $document = sql_fetsel("docs.extension,docs.distant,L.objet,L.id_objet", "spip_documents AS docs INNER JOIN spip_documents_liens AS L ON L.id_document=docs.id_document","L.id_document=".intval($id_document));
    2525                $extension = $document['extension'];
    2626                $type = $document['objet'];
    2727                $id = $document['id_objet'];
    28                 if(in_array($extension,$son) && ($document['distant'] == 'non')){
     28                if(in_array($extension,$son_recup_id3) && ($document['distant'] == 'non')){
    2929                        $infos_son = charger_fonction('infos_son', 'inc');
    3030                        $flux['data'] .= $infos_son($id,$id_document,$type,$extension);
    31                 }else if(in_array($extension,$son) && ($document['distant'] == 'oui')){
     31                }else if(in_array($extension,$son_recup_id3) && ($document['distant'] == 'oui')){
    3232                        $flux['data'] .= '<p>'._T('getid3:message_infos_document_distant').'</p>';
    3333                }
     
    4646        $id_document = $flux['args']['id_objet'];
    4747        $son_modif_id3 = array("mp3");
    48         $son_recup_id3 = array("mp3","ogg","flac","aiff","aif","wav");
     48        $son_recup_id3 = array("mp3","ogg","flac","aiff","aif","wav","m4a","oga");
    4949        $extensions_vignettes = array("png","gif","jpg");
    5050        $conf_id3 = lire_config('getid3/reecriture_tags',array());
     
    155155function getid3_document_desc_actions($flux){
    156156        $infos = sql_fetsel('distant,extension','spip_documents','id_document='.intval($flux['args']['id_document']));
    157         if(($infos['distant'] == 'non') && in_array($infos['extension'],array('mp3','ogg','flac','mpc'))){
     157        $son_recup_id3 = array("mp3","ogg","flac","aiff","aif","wav","m4a","oga");
     158        $son_modif_id3 = lire_config('getid3_write',array('mp3'));
     159        $id_document = $flux['args']['id_document'];
     160        if(($infos['distant'] == 'non') && in_array($infos['extension'],$son_modif_id3)){
    158161                $redirect = self();
    159                 $url = parametre_url(generer_url_ecrire('document_id3_editer','id_document='.$flux['args']['id_document']),'redirect',$redirect);
     162                $url = parametre_url(generer_url_ecrire('document_id3_editer','id_document='.intval($id_document)),'redirect',$redirect);
    160163                $texte = _T('getid3:lien_modifier_id3');
    161164                if($flux['args']['position'] == 'galerie'){
     
    164167                        $flux['data'] .= "<span class='sep'> | </span><a href='$url'>$texte</a>";
    165168                }
    166         }       
     169        }if(($infos['distant'] == 'non') && in_array($infos['extension'],$son_recup_id3)){
     170                $texte2 = _T('getid3:recuperer_infos');
     171                $action2 = generer_action_auteur('getid3_infos', "0/article/$id_document", $redirect);
     172                $flux['data'] .= "<span class='sep'> | </span><a href='$action2'>$texte2</a>";
     173        }
    167174        return $flux;
    168175}
  • _plugins_/getID3/plugin.xml

    r43836 r51855  
    22        <nom>GetId3</nom>
    33        <auteur>
    4         BoOz (booz@rezo.net) & Kent1 (kent1@arscenic.info)
     4        BoOz (booz@rezo.net) & kent1 (kent1@arscenic.info)
    55        </auteur>
    66        <icon>images/id3v2.png</icon>
    7         <licence>(c) 2008-2010 GPL</licence>
     7        <licence>(c) 2008-2011 GPL</licence>
    88        <version>
    9         0.4.7
     9        0.5.0
    1010        </version>
    1111        <version_base>
Note: See TracChangeset for help on using the changeset viewer.