Changeset 7357
- Timestamp:
- 01/29/13 11:56:23 (7 years ago)
- Location:
- plugins_spip/media_collections
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins_spip/media_collections/collections_pipelines.php
r7353 r7357 7 7 8 8 if (!defined('_ECRIRE_INC_VERSION')) return; 9 10 11 /*12 * Un fichier de pipelines permet de regrouper13 * les fonctions de branchement de votre plugin14 * sur des pipelines existants.15 */16 17 18 9 19 10 /** … … 109 100 return $flux; 110 101 } 111 112 /**113 * Insertion dans le pipeline diogene_objets (plugin Diogene)114 *115 * On ajoute les champs qui peuvent être pris en compte pour les collections116 *117 * @param array $flux Un tableau des champs déjà ajouté118 * @return array $flux Le tableau modifié119 */120 function collections_diogene_objets($flux){121 $flux['collection']['diogene_max'] = 1;122 $flux['collection']['ss_rubrique'] = 1;123 if(defined('_DIR_PLUGIN_DIOGENE_SPIPICIOUS')){124 $flux['collection']['champs_sup']['spipicious'] = _T('diogene_spipicious:tags_spipicious');125 }126 if(defined('_DIR_PLUGIN_DIOGENE_MOTS')){127 $flux['collection']['champs_sup']['mots'] = _T('diogene_mots:form_legend');128 }129 if(defined('_DIR_PLUGIN_DIOGENE_GERER_AUTEURS')){130 $flux['collection']['champs_sup']['auteurs'] = _T('diogene_gerer_auteurs:label_cfg_ajout_auteurs');131 }132 return $flux;133 }134 135 102 136 103 /** … … 180 147 return $flux; 181 148 } 149 150 /** 151 * Insertion dans le pipeline diogene_objets (plugin Diogene) 152 * 153 * On ajoute les champs qui peuvent être pris en compte pour les collections 154 * 155 * @param array $flux Un tableau des champs déjà ajouté 156 * @return array $flux Le tableau modifié 157 */ 158 function collections_diogene_objets($flux){ 159 $flux['collection']['diogene_max'] = 1; 160 $flux['collection']['ss_rubrique'] = 1; 161 if(defined('_DIR_PLUGIN_DIOGENE_SPIPICIOUS')){ 162 $flux['collection']['champs_sup']['spipicious'] = _T('diogene_spipicious:tags_spipicious'); 163 } 164 if(defined('_DIR_PLUGIN_DIOGENE_MOTS')){ 165 $flux['collection']['champs_sup']['mots'] = _T('diogene_mots:form_legend'); 166 } 167 if(defined('_DIR_PLUGIN_DIOGENE_GERER_AUTEURS')){ 168 $flux['collection']['champs_sup']['auteurs'] = _T('diogene_gerer_auteurs:label_cfg_ajout_auteurs'); 169 } 170 171 $flux['emballe_media']['champs_sup']['collection'] = _T('collection:diogene_champ_collection'); 172 return $flux; 173 } 174 175 /** 176 * Insertion dans le pipeline diogene_ajouter_saisies (plugin Diogene) 177 * On ajoute simplement le selecteur de collections dans le formulaire 178 * 179 * @param array $flux Le contexte d'environnement 180 */ 181 function collections_diogene_ajouter_saisies($flux){ 182 if(is_array(unserialize($flux['args']['champs_ajoutes'])) && in_array('collection',unserialize($flux['args']['champs_ajoutes']))){ 183 $flux['data'] .= recuperer_fond('formulaires/diogene_ajouter_medias_collection',$flux['args']['contexte']); 184 } 185 return $flux; 186 } 187 188 /** 189 * Insertion dans le pipeline diogene_traiter (plugin Diogene) 190 * On ajoute la collection dans les champs à enregistrer 191 * 192 * @param array $flux Le contexte d'environnement 193 */ 194 function collections_diogene_traiter($flux){ 195 if(($id_collection = _request('id_collection')) && is_numeric($flux['args']['id_objet']) && ($flux['args']['id_objet'] > 0)){ 196 if(is_numeric($id_collection)){ 197 include_spip('action/editer_liens'); 198 if (autoriser('modifier', 'article', $flux['args']['id_objet'])) { 199 objet_associer(array('collection' => $id_collection), array('article' => $flux['args']['id_objet'])); 200 } 201 } 202 } 203 return $flux; 204 } 182 205 ?> -
plugins_spip/media_collections/lang/collection_en.php
r7352 r7357 19 19 // D 20 20 'description_page_collections' => 'All the website\'s collections.', 21 'diogene_champ_collection' => 'Add to collection', 21 22 22 23 // E … … 49 50 50 51 // L 52 'label_choix_collection' => 'Link to the collection', 51 53 'label_collections_ajouter' => 'Add to the collection', 52 54 'label_date' => 'Date', … … 60 62 'label_type' => 'Use', 61 63 'label_type_defaut' => 'Default use', 64 'legende_collection' => 'Collections', 62 65 'legende_medias_collection_ajouter' => 'Add medias', 63 66 'legende_medias_collection_supprimer' => 'Delete medias', -
plugins_spip/media_collections/lang/collection_fr.php
r7352 r7357 19 19 // D 20 20 'description_page_collections' => 'L\'ensemble des collections du site.', 21 'diogene_champ_collection' => 'Ajout à une collection', 21 22 22 23 // E … … 49 50 50 51 // L 52 'label_choix_collection' => 'Lier à la collection', 51 53 'label_collections_ajouter' => 'Ajouter à la collection', 52 54 'label_date' => 'Date', … … 60 62 'label_type' => 'Usage', 61 63 'label_type_defaut' => 'Usage par défaut', 64 'legende_collection' => 'Collections', 62 65 'legende_medias_collection_ajouter' => 'Ajouter des médias', 63 66 'legende_medias_collection_supprimer' => 'Supprimer des médias', -
plugins_spip/media_collections/paquet.xml
r7354 r7357 2 2 prefix="collections" 3 3 categorie="edition" 4 version="1.3. 1"4 version="1.3.2" 5 5 etat="test" 6 6 compatibilite="[3.0.5;3.0.*]" … … 34 34 <pipeline nom="optimiser_base_disparus" inclure="collections_pipelines.php" /> 35 35 <pipeline nom="diogene_objets" inclure="collections_pipelines.php" /> 36 <pipeline nom="diogene_ajouter_saisies" inclure="collections_pipelines.php" /> 37 <pipeline nom="diogene_traiter" inclure="collections_pipelines.php" /> 36 38 <pipeline nom="formulaire_traiter" inclure="collections_pipelines.php" /> 37 39 <pipeline nom="insert_head_css" inclure="collections_pipelines.php" /> -
plugins_spip/media_collections/saisies/collections.html
r7288 r7357 2 2 [(#SET{valeur,[(#ENV*{valeur}|is_array|?{[(#ENV*{valeur})],[(#ENV*{valeur}|explode{','})]})]})] 3 3 ] 4 <select name="#ENV{nom}[(#ENV{multiple}|?{\[\]})]" id="champ_[(#ENV{nom}|saisie_nom2classe)]"[ class="(#ENV{class})"][(#ENV{multiple}|oui) multiple="multiple" size="#ENV{size,10}"][ disabled="(#ENV{disable})"]> 5 [(#ENV{cacher_option_intro}|ou{#ENV{multiple}}|non) 4 #SET{collections_deja,#ARRAY} 5 <BOUCLE_collections_deja(COLLECTIONS){id_article}> 6 #SET{collections_deja,#ARRAY|push{#ID_COLLECTION}} 7 </BOUCLE_collections_deja> 8 <select name="#ENV{nom}" id="champ_[(#ENV{nom}|saisie_nom2classe)]"[ class="(#ENV{class})"][ disabled="(#ENV{disable})"]> 9 [(#ENV{cacher_option_intro}|non) 6 10 <option value="">[(#ENV{option_intro})]</option>] 7 <BOUCLE_collections(COLLECTIONS){par num titre, titre}{recherche?}{tout}> 8 [(#ENV{multiple}|oui) 9 <option value="#ID_COLLECTION"[(#ID_COLLECTION|in_array{#ENV{valeur_forcee,#GET{valeur,#ENV{defaut,#ARRAY}}}}|oui) selected="selected"]>#TITRE</option>] 10 [(#ENV{multiple}|non) 11 <option value="#ID_COLLECTION"[(#ID_COLLECTION|=={#ENV{valeur_forcee,#ENV{valeur,#ENV{defaut}}}}|oui) selected="selected"]>#TITRE</option>] 11 <B_collections> 12 <optgroup label="<:collection:optgroup_collections_votre|attribut_html:>"> 13 <BOUCLE_collections(COLLECTIONS){id_auteur=#SESSION{id_auteur}}{par num titre,titre}{doublons}> 14 [(#GENRE|in_array{#ENV{_genres,#PIPELINE{collections_liste_genres}|array_keys}}|?{ 15 <option value="#ID_COLLECTION"[(#ID_COLLECTION|in_array{#GET{collections_deja}}|oui)disabled="disabled"][(#ID_COLLECTION|=={#ENV{valeur_forcee,#ENV{valeur,#ENV{defaut}}}}|oui) selected="selected"]>#TITRE</option>, 16 <option value="#ID_COLLECTION" disabled="disabled">#TITRE (<:collection:option_erreur_genre{genre=#GENRE}:>)</option> 17 })] 12 18 </BOUCLE_collections> 19 </optgroup> 20 </B_collections> 21 <B_collections_coop> 22 <optgroup label="<:collection:optgroup_collections_autres|attribut_html:>"> 23 <BOUCLE_collections_coop(COLLECTIONS){type_collection = coop}{genre IN #ENV{_genres,#PIPELINE{collections_liste_genres}|array_keys}}{par num titre,titre}{doublons}> 24 <option value="#ID_COLLECTION"[(#ID_COLLECTION|in_array{#GET{collections_deja}}|oui)disabled="disabled"][(#ID_COLLECTION|=={#ENV{valeur_forcee,#ENV{valeur,#ENV{defaut}}}}|oui) selected="selected"]>#TITRE</option> 25 </BOUCLE_collections_coop> 26 </optgroup> 27 </B_collections_coop> 13 28 </select>
Note: See TracChangeset
for help on using the changeset viewer.