Changeset 65343 in spip-zone
- Timestamp:
- Aug 27, 2012, 12:58:36 PM (9 years ago)
- Location:
- _plugins_/Association/Associaspip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/Association/Associaspip/association_options.php
r65117 r65343 114 114 $res = ''; 115 115 if ($html_tag) { 116 $res = '<'.$html_tag.' class="'. (($civilite || $preno nm)?'n':'fn') .'">';116 $res = '<'.$html_tag.' class="'. (($civilite || $prenom)?'n':'fn') .'">'; 117 117 } 118 118 if ($GLOBALS['association_metas']['civilite']=='on' && $civilite) { … … 681 681 function recuperer_iextras($ObjetEtendu) 682 682 { 683 $ChampsExtrasGeres = @unserialize(str_replace('O:10:"ChampExtra"', 'a', $GLOBALS['meta']['iextras'])); // "iextras (interface)" stocke la liste des champs geres dans un meta. Ce meta est un tableau d'objets (un par champ extra) manipules par "cextras (core)". Il n'est helas pas evident d'utiliser ces methodes car l'API n'est pas assez documente... Mais en transformant l'objet-PHP an tableau-PHP on a ce dont on a besoin...684 if ( !is_array($ChampsExtrasGeres) )685 return array(); // fin : Champs Extras 2 non installe ou pas d'objet etendu.686 683 $champsExtrasVoulus = array(); 687 foreach ($ChampsExtrasGeres as $ChampExtra) { 688 if ($ChampExtra['table']==$ObjetEtendu) // c'est un champ extra de la 'table' ou du '_type' d'objet qui nous interesse 689 $champsExtrasVoulus[$ChampExtra['champ']] = $ChampExtra['label']; 684 if (test_plugin_actif('IEXTRAS')) { // le plugin "Interfaces pour ChampsExtras2" est installe et active : on peut donc utiliser les methodes/fonctions natives... 685 include_spip('inc/iextras'); // charger les fonctions de l'interface/gestionnaire (ce fichier charge les methode du core/API) 686 $ChampsExtrasGeres = iextras_get_extras_par_table(); // C'est un tableau des differents "objets etendus" (i.e. tables principaux SPIP sans prefixe et au singulier -- par exemple la table 'spip_asso_membres' correspond a l'objet 'asso_membre') comme cle. 687 foreach ($ChampsExtrasGeres[$ObjetEtendu] as $$ChampExtraRang => $ChampExtraInfos ) { // Pour chaque objet, le tableau a une entree texte de cle "id_objet" et autant d'entrees tableau de cles numerotees automatiquement (a partir de 0) qu'il y a de champs extras definis. Chaque champ extra defini est un tableau avec les cle=>type suivants : "table"=>string, "champ"=>string, "label"=>string, "precisions"=>string, "obligatoire"=>string, "verifier"=>bool, "verifier_options"=>array, "rechercher"=>string, "enum"=>string, "type"=>string, "sql"=>string, "traitements"=>string, "saisie_externe"=>bool, "saisie_parametres"]=>array("explication"=>string, "attention"=>string, "class"=> string, "li_class"]=>string,) 688 if ( is_array($ChampExtraInfos) 689 $champsExtrasVoulus[$ChampExtraInfos['champ']] = _TT($ChampExtraInfos['label']); // _TT est defini dans cextras_balises.php 690 } 691 } else { // le plugin "Interfaces pour ChampsExtras2" n'est pas actif :-S Mais peut-etre a-t-il ete installe ? 692 $ChampsExtrasGeres = @unserialize(str_replace('O:10:"ChampExtra"', 'a', $GLOBALS['meta']['iextras'])); // "iextras (interface)" stocke la liste des champs geres dans un meta. Ce meta est un tableau d'objets "ChampExtra" (un par champ extra) manipules par "cextras (core)". On converti chaque objet en tableau 693 if ( !is_array($ChampsExtrasGeres) ) 694 return array(); // fin : ChampsExtras2 non installe ou pas d'objet etendu. 695 $TT = function_exists('_T_ou_typo') ? '_T_ou_typo' : 'T' ; // Noter que les <multi>...</multi> et <:xx:> sont aussi traites par propre() et typo() : http://contrib.spip.net/PointsEntreeIncTexte 696 foreach ($ChampsExtrasGeres as $ChampExtra) { // Chaque champ extra defini est un tableau avec les cle=>type suivants (les cles commencant par "_" initialisent des methodes de meme nom sans le prefixe) : "table"=>string, "champ"=>string, "label"=>string, "precisions"=>string, "obligatoire"=>string, "verifier"=>bool, "verifier_options"=>array, "rechercher"=>string, "enum"=>string, "type"=>string, "sql"=>string, "traitements"=>string, "_id"=>string, "_type"=>string, "_objet"=>string, "_table_sql"=>string, "saisie_externe"=>bool, "saisie_parametres"]=>array("explication"=>string, "attention"=>string, "class"=> string, "li_class"]=>string,) 697 if ($ChampExtra['table']==$ObjetEtendu) // c'est un champ extra de la 'table' ou du '_type' d'objet qui nous interesse 698 $champsExtrasVoulus[$ChampExtra['champ']] = $TT($ChampExtra['label']); 699 } 690 700 } 691 701 return $champsExtrasVoulus; -
_plugins_/Association/Associaspip/inc/choisir_mbr_nom.html
r59464 r65343 45 45 <option></option> 46 46 <BOUCLE_choix2membre(ASSO_MEMBRES) {statut_interne?IN #ENV{statut_interne}}{categorie?IN #ENV{categories}} {par #ENV{tri_id,nom_famille,prenom}} > 47 <option value="#ID_AUTEUR"[ (#ENV{valeur_id}|=={#ID_AUTEUR}|oui)selected="selected"]>#NOM_FAMILLE [(#META{/association/prenom}|oui),#PRENOM [((#SEXE))] ]</option>47 <option value="#ID_AUTEUR"[ (#ENV{valeur_id}|=={#ID_AUTEUR}|oui)selected="selected"]>#NOM_FAMILLE[, (#META{/association/prenom}|oui) #PRENOM [((#SEXE))] ]</option> 48 48 </BOUCLE_choix2membre> 49 49 </select>
Note: See TracChangeset
for help on using the changeset viewer.