Changeset 93483 in spip-zone
- Timestamp:
- Dec 9, 2015, 4:07:59 PM (5 years ago)
- Location:
- _plugins_/selection_objets/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/selection_objets/trunk/base/selection_objet.php
r75172 r93483 27 27 $tables['spip_selection_objets'] = array( 28 28 'type' => 'selection_objet', 29 'principale' => "oui", 30 'table_objet_surnoms' => array('selectionobjet'), // table_objet('selection_objet') => 'selection_objets' 29 'principale' => "oui", 30 'table_objet_surnoms' => array('selectionobjet'), // table_objet('selection_objet') => 'selection_objets' 31 31 'field'=> array( 32 32 "id_selection_objet" => "bigint(21) NOT NULL", … … 39 39 "objet_dest" => "varchar(100) NOT NULL", 40 40 "ordre" => "bigint(21) NOT NULL", 41 "ordre_objet" => "bigint(21) NOT NULL", 42 "date" => "datetime NOT NULL DEFAULT '0000-00-00 00:00:00'", 43 "statut" => "varchar(20) DEFAULT '0' NOT NULL", 41 "ordre_objet" => "bigint(21) NOT NULL", 42 "date" => "datetime NOT NULL DEFAULT '0000-00-00 00:00:00'", 43 "statut" => "varchar(20) DEFAULT '0' NOT NULL", 44 44 "lang" => "VARCHAR(10) NOT NULL DEFAULT ''", 45 "langue_choisie" => "VARCHAR(3) DEFAULT 'non'", 46 "type_lien" => "VARCHAR(100) NOT NULL DEFAULT ''", 45 "langue_choisie" => "VARCHAR(3) DEFAULT 'non'", 46 "type_lien" => "VARCHAR(100) NOT NULL DEFAULT ''", 47 47 "maj" => "TIMESTAMP" 48 48 ), 49 49 'key' => array( 50 "PRIMARY KEY" => "id_selection_objet", 51 52 "KEY id_objet_dest" => "id_objet_dest", 53 "KEY objet" => "objet", 54 "KEY objet_dest" => "objet_dest", 55 "KEY lang" => "lang", 50 "PRIMARY KEY" => "id_selection_objet", 51 "KEY id_objet" => "id_objet", 52 "KEY id_objet_dest" => "id_objet_dest", 53 "KEY objet" => "objet", 54 "KEY objet_dest" => "objet_dest", 55 "KEY lang" => "lang", 56 56 "KEY statut" => "statut", 57 57 58 58 ), 59 59 'titre' => "titre AS titre, lang AS lang", … … 73 73 'publie' => 'publie', 74 74 'previsu' => 'publie,prop', 75 'post_date' => 'date', 75 'post_date' => 'date', 76 76 'exception' => array('statut','tout') 77 77 ) 78 78 ), 79 'texte_changer_statut' => 'selection_objet:texte_changer_statut_objet', 80 81 79 'texte_changer_statut' => 'selection_objet:texte_changer_statut_objet', 82 80 ); 83 81 … … 85 83 } 86 84 87 88 89 ?> -
_plugins_/selection_objets/trunk/inc/exceptions.php
r69297 r93483 18 18 } 19 19 20 ?> -
_plugins_/selection_objets/trunk/inc/verifier_ordre.php
r70454 r93483 22 22 } 23 23 24 ?> -
_plugins_/selection_objets/trunk/recherche_objet_fonctions.php
r73237 r93483 50 50 return $data; 51 51 } 52 53 ?> -
_plugins_/selection_objets/trunk/selection_objet_administrations.php
r75172 r93483 1 1 <?php 2 2 /** 3 * Plugin S ignaler des abus4 * (c) 2012 My Chacra3 * Plugin Sélection d'objets 4 * (c) 2012 Rainer Müller 5 5 * Licence GNU/GPL 6 6 */ … … 11 11 /** 12 12 * Fonction d'installation du plugin et de mise à jour. 13 * Vous pouvez :14 * - créer la structure SQL,15 * - insérer du pre-contenu,16 * - installer des valeurs de configuration,17 * - mettre à jour la structure SQL18 13 **/ 19 14 function selection_objet_upgrade($nom_meta_base_version, $version_cible) { … … 22 17 $maj['create'] = array(array('maj_tables', array('spip_selection_objets'))); 23 18 $maj['0.1.0'] = array(array('maj_tables', array('spip_selection_objets'))); 24 25 26 27 28 29 30 31 32 33 34 35 36 37 19 $maj['0.2.0'] = array(array('maj_tables', array('spip_selection_objets'))); 20 $maj['0.2.1'] = array(array('maj_tables', array('spip_selection_objets'))); 21 $maj['0.2.2'] = array(array('maj_tables', array('spip_selection_objets'))); 22 $maj['0.2.3'] = array(array('maj_tables', array('spip_selection_objets'))); 23 $maj['0.2.4'] = array(array('maj_tables', array('spip_selection_objets'))); 24 $maj['0.3.0'] = array(array('maj_tables', array('spip_selection_objets'))); 25 $maj['0.4.0'] = array(array('maj_tables', array('spip_selection_objets'))); 26 $maj['0.5.0'] = array(array('maj_tables', array('spip_selection_objets'))); 27 $maj['0.5.1'] = array( 28 array('sql_alter', "TABLE spip_selection_objets ADD KEY (id_objet)"), 29 array('sql_alter', "TABLE spip_selection_objets ADD KEY (id_objet_dest)"), 30 array('sql_alter', "TABLE spip_selection_objets ADD KEY (objet)"), 31 array('sql_alter', "TABLE spip_selection_objets ADD KEY (objet_dest)"), 32 ); 38 33 39 40 41 34 include_spip('base/upgrade'); 42 35 maj_plugin($nom_meta_base_version, $version_cible, $maj); … … 46 39 /** 47 40 * Fonction de désinstallation du plugin. 48 * Vous devez :49 * - nettoyer toutes les données ajoutées par le plugin et selection_objetn utilisation50 * - supprimer les tables et les champs créés par le plugin.51 41 **/ 52 42 function selection_objet_vider_tables($nom_meta_base_version) { 53 # quelques exemples54 # (que vous pouvez supprimer !)55 # sql_drop_table("spip_xx");56 # sql_drop_table("spip_xx_liens");57 58 43 sql_drop_table("spip_selection_objets"); 59 44 60 45 # Nettoyer les versionnages et forums 61 sql_delete("spip_versions", sql_in("objet", array(' abuselection_objetbjet')));62 sql_delete("spip_versions_fragments", sql_in("objet", array(' abuselection_objetbjet')));63 sql_delete("spip_forum", sql_in("objet", array(' abuselection_objetbjet')));46 sql_delete("spip_versions", sql_in("objet", array('selection_objet'))); 47 sql_delete("spip_versions_fragments", sql_in("objet", array('selection_objet'))); 48 sql_delete("spip_forum", sql_in("objet", array('selection_objet'))); 64 49 65 50 effacer_meta($nom_meta_base_version); 66 51 } 67 52 68 ?> -
_plugins_/selection_objets/trunk/selection_objet_autorisations.php
r67410 r93483 1 1 <?php 2 2 /** 3 * Plugin Selection d 'objets3 * Plugin Selection d'objets 4 4 * (c) 2012 Rainer Müller 5 5 * Licence GNU/GPL … … 16 16 function selection_objet_autoriser(){} 17 17 18 19 /* Exemple20 function autoriser_configurer_selection_objet_dist($faire, $type, $id, $qui, $opt) {21 // type est un objet (la plupart du temps) ou une chose.22 // autoriser('configurer', '_selection_objet') => $type = 'selection_objet'23 // au choix24 return autoriser('webmestre', $type, $id, $qui, $opt); // seulement les webmestres25 return autoriser('configurer', '', $id, $qui, $opt); // seulement les administrateurs complets26 return $qui['statut'] == '0minirezo'; // seulement les administrateurs (même les restreints)27 // ...28 }29 */30 31 18 // ----------------- 32 19 // Objet selection_objets 33 20 34 35 36 37 21 // creer 38 function autoriser_ objet_creer_dist($faire, $type, $id, $qui, $opt) {22 function autoriser_selectionobjet_creer_dist($faire, $type, $id, $qui, $opt) { 39 23 return in_array($qui['statut'], array('0minirezo', '1comite')); 40 24 } 41 25 42 26 // voir les fiches completes 43 function autoriser_ objet_voir_dist($faire, $type, $id, $qui, $opt) {27 function autoriser_selectionobjet_voir_dist($faire, $type, $id, $qui, $opt) { 44 28 return true; 45 29 } 46 30 47 31 // modifier 48 function autoriser_ objet_modifier_dist($faire, $type, $id, $qui, $opt) {32 function autoriser_selectionobjet_modifier_dist($faire, $type, $id, $qui, $opt) { 49 33 return $qui['statut'] == '0minirezo'; 50 34 } 51 35 52 36 // supprimer 53 function autoriser_ objet_supprimer_dist($faire, $type, $id, $qui, $opt) {37 function autoriser_selectionobjet_supprimer_dist($faire, $type, $id, $qui, $opt) { 54 38 return $qui['statut'] == '0minirezo' AND !$qui['restreint']; 55 39 } 56 40 57 41 58 59 60 ?> -
_plugins_/selection_objets/trunk/selection_objet_pipelines.php
r74900 r93483 100 100 $types_lien=lire_config('selection_objet/type_liens',array()); 101 101 $flux['data']['type_liens']=''; 102 if (is_array($types_lien)) { 102 103 foreach ($types_lien as $key => $value) { 103 104 if($key)$flux['data']['type_liens'].="$key,$value\n"; 104 105 } 106 } 105 107 106 108 } … … 152 154 function types_liaisons2array($type){ 153 155 $tableau = array(); 154 $lignes = explode("\n",$type);156 $lignes = array_filter(explode("\n",$type)); 155 157 foreach ($lignes as $l){ 156 158 $donnees= explode(',',$l); … … 163 165 return $tableau; 164 166 } 165 ?> 167
Note: See TracChangeset
for help on using the changeset viewer.