Changeset 94525 in spip-zone
- Timestamp:
- Jan 10, 2016, 8:11:32 AM (5 years ago)
- Location:
- _plugins_/selection_objets/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/selection_objets/trunk/inc/exceptions.php
r94524 r94525 1 1 <?php 2 2 3 if (!defined("_ECRIRE_INC_VERSION")) return; 3 if (!defined("_ECRIRE_INC_VERSION")) 4 return; 4 5 5 6 /*Les exceptions*/ 6 function inc_exceptions_dist($filtrer=''){ 7 $exceptions=array( 8 'objet'=>array('site'=>'syndic','syndic'=>'syndic'), 9 'titre'=>array( 10 'auteur'=>'nom', 11 'site'=>'nom_site', 12 'syndic'=>'nom_site', 13 ), 14 ); 15 $retour=$exceptions; 16 if($filtrer)$retour=$exceptions[$filtrer]; 17 return $retour; 7 function inc_exceptions_dist($filtrer = '') { 8 $exceptions = array( 9 'objet' => array( 10 'site' => 'syndic', 11 'syndic' => 'syndic' 12 ), 13 'titre' => array( 14 'auteur' => 'nom', 15 'site' => 'nom_site', 16 'syndic' => 'nom_site', 17 ), 18 ); 19 $retour = $exceptions; 20 if ($filtrer) 21 $retour = $exceptions[$filtrer]; 22 return $retour; 18 23 } 19 20 24 ?> -
_plugins_/selection_objets/trunk/inc/verifier_ordre.php
r94524 r94525 1 1 <?php 2 2 3 if (!defined("_ECRIRE_INC_VERSION")) return; 4 function inc_verifier_ordre_dist($where){ 5 $sql = sql_select("id_selection_objet","spip_selection_objets", $where,'', "ordre,id_selection_objet"); 6 $ordre = 0; 7 8 // on vérifie l'ordre des objets déjà enregistrés et on corrige si beselection_objetin 9 10 while ($row = sql_fetch($sql)) { 11 $ordre++; 12 $where = array( 13 'id_selection_objet='.$row['id_selection_objet'], 14 ); 3 if (!defined("_ECRIRE_INC_VERSION")) 4 return; 5 function inc_verifier_ordre_dist($where) { 6 $sql = sql_select("id_selection_objet", "spip_selection_objets", $where, '', "ordre,id_selection_objet"); 7 $ordre = 0; 15 8 16 sql_updateq("spip_selection_objets",array("ordre" => $ordre),$where) ; 17 } 18 19 include_spip('inc/invalideur'); 20 suivre_invalideur("id='selection_objet/$id_selection_objet'"); 21 return $ordre; 9 // on vérifie l'ordre des objets déjà enregistrés et on corrige si beselection_objetin 10 11 while ($row = sql_fetch($sql)) { 12 $ordre++; 13 $where = array('id_selection_objet=' . $row['id_selection_objet'], ); 14 15 sql_updateq("spip_selection_objets", array("ordre" => $ordre), $where); 16 } 17 18 include_spip('inc/invalideur'); 19 suivre_invalideur("id='selection_objet/$id_selection_objet'"); 20 return $ordre; 22 21 } 23 24 22 ?> -
_plugins_/selection_objets/trunk/modeles_so/selection_interface_tr.html
r74900 r94525 1 1 #CACHE{0} 2 #SET{tables,#ENV{tables,#VAL|lister_tables_objets_sql}} 3 <td> 4 [(#ENV{compteur_boucle}|!={1}|oui) 5 <div><a class="select" href="[(#URL_ACTION_AUTEUR{ranger,remonter_ordre-[(#ENV{langue})]-[(#ID_SELECTION_OBJET)]-#ORDRE-[(#OBJET_DEST)]-[(#ENV{id_objet_dest})]}|parametre_url{load,prive/objets/liste/inc-selection_interface})]#selection_objets"><img src="#CHEMIN{prive/themes/spip/images/fleche-haut.gif}" /></a></div> 6 ] 7 [(#ENV{compteur_boucle}|!={#ENV{total_boucle}}|oui) 8 <div><a class="select" href="[(#URL_ACTION_AUTEUR{ranger,descendre_ordre-[(#ENV{langue})]-[(#ID_SELECTION_OBJET)]-#ORDRE-[(#OBJET_DEST)]-[(#ENV{id_objet_dest})]}|parametre_url{load,prive/objets/liste/inc-selection_interface})]#selection_objets"><img src="#CHEMIN{prive/themes/spip/images/fleche-bas.gif}" /></a></div> 9 ] 10 11 </td> 12 <td class='statut'>[(#STATUT|puce_statut{selection_objet,#ID_SELECTION_OBJET})]</td> 13 <td class="titre"> 14 #SET{objet,#OBJET} 15 [(#OBJET|=={document}|oui)#SET{objet,document_edit}] 16 [(#SET{id,id_#OBJET})] 17 [(#OBJET|=={site}|oui) 18 #SET{id,id_syndic} 19 ] 20 [<a class="select" href="[(#URL_ECRIRE{#GET{objet}}|parametre_url{#GET{id},#ID_OBJET})]">(#ENV{logo_objet}|image_reduire{25}|sinon{#ENV{logo_objet}|image_reduire{25}|inserer_attribut{class,spip_logos}}) </a>] 21 <a href="[(#URL_ECRIRE{#GET{objet}}|parametre_url{#GET{id},#ID_OBJET})]">[(#TITRE|sinon{#OBJET|info_objet{#ID_OBJET,#ENV{champ_titre}}})]</a> 22 #SET{table,#OBJET|table_objet_sql} 23 [<div>((#GET{tables}|table_valeur{#GET{table}}|table_valeur{texte_objet}|_T))</div>] 24 </td> 25 <td class="type_lien">[(#TYPE_LIEN|nom_type{#OBJET_DEST})]</td> 26 <td class="date">[(#DATE|affdate)]</td> 27 <td class="id_objet"><b style="white-space: nowrap;">N°[(#ID_OBJET|>{0}|?{#ID_OBJET,#ID_SELECTION_OBJET})]</b></td> 28 <td> 29 [(#AUTORISER{modifier,selection_objet,#ID_SELECTION_OBJET}) 30 [(#ID_SELECTION_OBJET|afficher_qui_edite{selection_objet}|non) 31 [(#URL_ECRIRE{selection_objet_edit,id_selection_objet=#ID_SELECTION_OBJET}|icone_verticale{<:selection_objet:icone_modifier_selection_objet:>,objet})] 32 ] 33 ] 34 </td> 35 <td> 36 <a href="[(#URL_ACTION_AUTEUR{ranger,supprimer_ordre-[(#ENV{langue})]-[(#ID_SELECTION_OBJET)]-#ORDRE-[(#OBJET_DEST)]-[(#ENV{id_objet_dest})]}|parametre_url{load,prive/objets/liste/inc-selection_interface})]#selection_objets" class="select"><img src="#CHEMIN{prive/themes/spip/images/item-remove.png}" alt="X" /></a> 37 </td> 2 #SET{tables,#ENV{tables,#VAL|lister_tables_objets_sql}} 3 <td> 4 [(#ENV{compteur_boucle}|!={1}|oui) 5 <div> 6 <a class="select" href="[(#URL_ACTION_AUTEUR{ranger,remonter_ordre-[(#ENV{langue})]-[(#ID_SELECTION_OBJET)]-#ORDRE-[(#OBJET_DEST)]-[(#ENV{id_objet_dest})]}|parametre_url{load,prive/objets/liste/inc-selection_interface})]#selection_objets"><img src="#CHEMIN{prive/themes/spip/images/fleche-haut.gif}" /></a> 7 </div> 8 ] 9 [(#ENV{compteur_boucle}|!={#ENV{total_boucle}}|oui) 10 <div> 11 <a class="select" href="[(#URL_ACTION_AUTEUR{ranger,descendre_ordre-[(#ENV{langue})]-[(#ID_SELECTION_OBJET)]-#ORDRE-[(#OBJET_DEST)]-[(#ENV{id_objet_dest})]}|parametre_url{load,prive/objets/liste/inc-selection_interface})]#selection_objets"><img src="#CHEMIN{prive/themes/spip/images/fleche-bas.gif}" /></a> 12 </div> 13 ] 14 </td> 15 <td class='statut'>[(#STATUT|puce_statut{selection_objet,#ID_SELECTION_OBJET})]</td> 16 <td class="titre"> #SET{objet,#OBJET} 17 [(#OBJET|=={document}|oui)#SET{objet,document_edit}] 18 [(#SET{id,id_#OBJET})] 19 [(#OBJET|=={site}|oui) 20 #SET{id,id_syndic} 21 ] 22 [<a class="select" href="[(#URL_ECRIRE{#GET{objet}}|parametre_url{#GET{id},#ID_OBJET})]">(#ENV{logo_objet}|image_reduire{25}|sinon{#ENV{logo_objet}|image_reduire{25}|inserer_attribut{class,spip_logos}}) </a>] <a href="[(#URL_ECRIRE{#GET{objet}}|parametre_url{#GET{id},#ID_OBJET})]">[(#TITRE|sinon{#OBJET|info_objet{#ID_OBJET,#ENV{champ_titre}}})]</a> #SET{table,#OBJET|table_objet_sql} 23 [ 24 <div> 25 ((#GET{tables}|table_valeur{#GET{table}}|table_valeur{texte_objet}|_T)) 26 </div>] 27 </td> 28 <td class="type_lien">[(#TYPE_LIEN|nom_type{#OBJET_DEST})]</td> 29 <td class="date">[(#DATE|affdate)]</td> 30 <td class="id_objet"><b style="white-space: nowrap;">N°[(#ID_OBJET|>{0}|?{#ID_OBJET,#ID_SELECTION_OBJET})]</b></td> 31 <td> 32 [(#AUTORISER{modifier,selection_objet,#ID_SELECTION_OBJET}) 33 [(#ID_SELECTION_OBJET|afficher_qui_edite{selection_objet}|non) 34 [(#URL_ECRIRE{selection_objet_edit,id_selection_objet=#ID_SELECTION_OBJET}|icone_verticale{<:selection_objet:icone_modifier_selection_objet:>,objet})] 35 ] 36 ] 37 </td> 38 <td><a href="[(#URL_ACTION_AUTEUR{ranger,supprimer_ordre-[(#ENV{langue})]-[(#ID_SELECTION_OBJET)]-#ORDRE-[(#OBJET_DEST)]-[(#ENV{id_objet_dest})]}|parametre_url{load,prive/objets/liste/inc-selection_interface})]#selection_objets" class="select"><img src="#CHEMIN{prive/themes/spip/images/item-remove.png}" alt="X" /></a> 39 </td> 38 40 39 -
_plugins_/selection_objets/trunk/selection_objet_administrations.php
r94524 r94525 6 6 */ 7 7 8 if (!defined('_ECRIRE_INC_VERSION')) return;9 8 if (!defined('_ECRIRE_INC_VERSION')) 9 return; 10 10 11 11 /** … … 15 15 * - insérer du pre-contenu, 16 16 * - installer des valeurs de configuration, 17 * - mettre à jour la structure SQL 18 **/17 * - mettre à jour la structure SQL 18 **/ 19 19 function selection_objet_upgrade($nom_meta_base_version, $version_cible) { 20 20 $maj = array(); 21 21 22 $maj['create'] = array(array('maj_tables', array('spip_selection_objets'))); 23 $maj['0.1.0'] = array(array('maj_tables', array('spip_selection_objets'))); 24 $maj['0.2.0'] = array(array('maj_tables', array('spip_selection_objets'))); 25 $maj['0.2.1'] = array(array('maj_tables', array('spip_selection_objets'))); 26 $maj['0.2.2'] = array(array('maj_tables', array('spip_selection_objets'))); 27 $maj['0.2.3'] = array(array('maj_tables', array('spip_selection_objets'))); 28 $maj['0.2.4'] = array(array('maj_tables', array('spip_selection_objets'))); 29 $maj['0.3.0'] = array(array('maj_tables', array('spip_selection_objets'))); 30 $maj['0.4.0'] = array(array('maj_tables', array('spip_selection_objets'))); 31 $maj['0.5.0'] = array(array('maj_tables', array('spip_selection_objets'))); 32 $maj['0.5.1'] = array( 33 array('sql_alter', "TABLE spip_selection_objets ADD KEY (id_objet)"), 34 array('sql_alter', "TABLE spip_selection_objets ADD KEY (id_objet_dest)"), 35 array('sql_alter', "TABLE spip_selection_objets ADD KEY (objet)"), 36 array('sql_alter', "TABLE spip_selection_objets ADD KEY (objet_dest)"), 37 ); 22 $maj['create'] = array( array( 23 'maj_tables', 24 array('spip_selection_objets') 25 )); 26 $maj['0.1.0'] = array( array( 27 'maj_tables', 28 array('spip_selection_objets') 29 )); 30 $maj['0.2.0'] = array( array( 31 'maj_tables', 32 array('spip_selection_objets') 33 )); 34 $maj['0.2.1'] = array( array( 35 'maj_tables', 36 array('spip_selection_objets') 37 )); 38 $maj['0.2.2'] = array( array( 39 'maj_tables', 40 array('spip_selection_objets') 41 )); 42 $maj['0.2.3'] = array( array( 43 'maj_tables', 44 array('spip_selection_objets') 45 )); 46 $maj['0.2.4'] = array( array( 47 'maj_tables', 48 array('spip_selection_objets') 49 )); 50 $maj['0.3.0'] = array( array( 51 'maj_tables', 52 array('spip_selection_objets') 53 )); 54 $maj['0.4.0'] = array( array( 55 'maj_tables', 56 array('spip_selection_objets') 57 )); 58 $maj['0.5.0'] = array( array( 59 'maj_tables', 60 array('spip_selection_objets') 61 )); 62 $maj['0.5.1'] = array( 63 array( 64 'sql_alter', 65 "TABLE spip_selection_objets ADD KEY (id_objet)" 66 ), 67 array( 68 'sql_alter', 69 "TABLE spip_selection_objets ADD KEY (id_objet_dest)" 70 ), 71 array( 72 'sql_alter', 73 "TABLE spip_selection_objets ADD KEY (objet)" 74 ), 75 array( 76 'sql_alter', 77 "TABLE spip_selection_objets ADD KEY (objet_dest)" 78 ), 79 ); 38 80 39 40 41 81 include_spip('base/upgrade'); 42 82 maj_plugin($nom_meta_base_version, $version_cible, $maj); 43 83 } 44 45 84 46 85 /** … … 48 87 * Vous devez : 49 88 * - nettoyer toutes les données ajoutées par le plugin et selection_objetn utilisation 50 * - supprimer les tables et les champs créés par le plugin. 51 **/89 * - supprimer les tables et les champs créés par le plugin. 90 **/ 52 91 function selection_objet_vider_tables($nom_meta_base_version) { 53 92 # quelques exemples … … 59 98 60 99 # Nettoyer les versionnages et forums 61 sql_delete("spip_versions", 62 sql_delete("spip_versions_fragments", 63 sql_delete("spip_forum", 100 sql_delete("spip_versions", sql_in("objet", array('abuselection_objetbjet'))); 101 sql_delete("spip_versions_fragments", sql_in("objet", array('abuselection_objetbjet'))); 102 sql_delete("spip_forum", sql_in("objet", array('abuselection_objetbjet'))); 64 103 65 104 effacer_meta($nom_meta_base_version); 66 105 } 67 68 106 ?>
Note: See TracChangeset
for help on using the changeset viewer.