Changeset 96500 in spip-zone
- Timestamp:
- Apr 7, 2016, 8:11:24 AM (5 years ago)
- Location:
- _plugins_/identite_extra/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/identite_extra/trunk/balise/identite_.php
r96051 r96500 1 1 <?php 2 2 3 if (!defined('_ECRIRE_INC_VERSION')) return; 3 if (!defined('_ECRIRE_INC_VERSION')) { 4 return; 5 } 4 6 5 7 function balise_IDENTITE_($p) { 6 7 8 $cfg = $GLOBALS['identite_extra']; 8 9 … … 14 15 erreur_squelette($msg, $p); 15 16 $p->interdire_scripts = false; 17 16 18 return $p; 17 } elseif ( !in_array($champ, $cfg)) {19 } elseif (!in_array($champ, $cfg)) { 18 20 $msg = array('zbug_balise_inexistante', array('balise' => $nom, 'from' => 'identite_extra')); 19 21 erreur_squelette($msg, $p); 20 22 $p->interdire_scripts = false; 23 21 24 return $p; 22 25 } else { 23 26 $p->code = 'lire_config("identite_extra/' . $champ .'")'; 24 27 $p->interdire_scripts = false; 28 25 29 return $p; 26 30 } -
_plugins_/identite_extra/trunk/identite_extra_administrations.php
r96051 r96500 1 1 <?php 2 2 3 if (!defined('_ECRIRE_INC_VERSION')) return; 3 if (!defined('_ECRIRE_INC_VERSION')) { 4 return; 5 } 4 6 5 7 include_spip('inc/meta'); 6 8 include_spip('base/create'); 7 9 8 function identite_extra_upgrade($nom_meta_base_version, $version_cible){ 9 10 function identite_extra_upgrade($nom_meta_base_version, $version_cible) { 10 11 include_spip('base/upgrade'); 11 12 $maj = array(); … … 15 16 16 17 function identite_extra_vider_tables($nom_meta_base_version) { 17 18 18 // on efface la meta de configuration du plugin 19 19 effacer_meta('identite_extra'); -
_plugins_/identite_extra/trunk/identite_extra_ieconfig.php
r96051 r96500 1 1 <?php 2 2 3 if (!defined('_ECRIRE_INC_VERSION')) return; 3 if (!defined('_ECRIRE_INC_VERSION')) { 4 return; 5 } 4 6 5 7 //proposer l'export de la config via le plugin ieconfig 6 function identite_extra_ieconfig_metas($table){ 7 8 if (isset($GLOBALS['identite_extra']) AND is_array($GLOBALS['identite_extra'])) { 8 function identite_extra_ieconfig_metas($table) { 9 if (isset($GLOBALS['identite_extra']) and is_array($GLOBALS['identite_extra'])) { 9 10 $table['identite_extra']['titre'] = _T('identite_extra:identite_extra');; 10 11 $table['identite_extra']['icone'] = 'identite_extra-16.png'; 11 12 $table['identite_extra']['metas_brutes'] = 'identite_extra'; 12 13 } 13 14 14 15 return $table; 15 16 } 16 17 18 ?> -
_plugins_/identite_extra/trunk/identite_extra_options.php
r96051 r96500 1 1 <?php 2 2 3 if (!defined('_ECRIRE_INC_VERSION')) return; 3 if (!defined('_ECRIRE_INC_VERSION')) { 4 return; 5 } 4 6 5 7 // Des champs par défaut pour identite extra 6 if (!isset($GLOBALS['identite_extra'])) 7 $GLOBALS['identite_extra'] = array('nom_organisation','telephone', 'adresse', 'ville', 'code_postal','region','pays'); 8 if (!isset($GLOBALS['identite_extra'])) { 9 $GLOBALS['identite_extra'] = array('nom_organisation', 'telephone', 'adresse', 'ville', 'code_postal', 'region','pays'); 10 } 8 11 -
_plugins_/identite_extra/trunk/identite_extra_pipelines.php
r96064 r96500 1 1 <?php 2 2 3 if (!defined('_ECRIRE_INC_VERSION')) 3 if (!defined('_ECRIRE_INC_VERSION')) { 4 4 return; 5 } 5 6 6 7 /** … … 15 16 */ 16 17 function identite_extra_formulaire_fond($flux) { 17 18 18 # formulaire : configurer_identite 19 if ( $flux['args']['form'] == 'configurer_identite' 20 AND ( $p = strpos($flux['data'], '<!--extra-->') ) 21 AND isset( $GLOBALS['identite_extra'] ) 22 AND is_array( $GLOBALS['identite_extra'] ) ) { 23 24 $ajout = recuperer_fond("prive/formulaires/configurer_identite_extra", $flux['args']['contexte'] ); 19 if ( 20 $flux['args']['form'] == 'configurer_identite' 21 and ($p = strpos($flux['data'], '<!--extra-->')) 22 and isset($GLOBALS['identite_extra']) 23 and is_array($GLOBALS['identite_extra']) 24 ) { 25 $ajout = recuperer_fond("prive/formulaires/configurer_identite_extra", $flux['args']['contexte']); 25 26 $flux['data'] = substr_replace($flux['data'], $ajout, $p, 0); 26 27 } 27 28 28 29 return $flux; 29 30 } … … 31 32 // Charger les valeurs déjà existantes dans la méta 32 33 function identite_extra_formulaire_charger($flux) { 33 34 34 # formulaire : configurer_identite 35 35 if ( $flux['args']['form'] == 'configurer_identite' ) { 36 37 36 $valeurs = array(); 38 foreach ($GLOBALS['identite_extra'] as $k) 37 38 foreach ($GLOBALS['identite_extra'] as $k) { 39 39 $valeurs['identite_extra'][$k] = lire_config('identite_extra/' . $k, ''); 40 41 $flux['data'] = array_merge($flux['data'],$valeurs); 40 } 41 42 $flux['data'] = array_merge($flux['data'], $valeurs); 42 43 } 44 43 45 return $flux; 44 46 } … … 47 49 // Mettre à jour la méta 48 50 function identite_extra_formulaire_traiter($flux) { 49 50 51 # formulaire : configurer_identite 51 if ( $flux['args']['form'] == 'configurer_identite' AND $config = _request('identite_extra') ) 52 ecrire_config('identite_extra', $config); 52 if ($flux['args']['form'] == 'configurer_identite' and $config = _request('identite_extra')) { 53 ecrire_config('identite_extra', $config); 54 } 53 55 54 56 return $flux; -
_plugins_/identite_extra/trunk/lang/identite_extra_fr.php
r96051 r96500 2 2 3 3 /* FICHIER DE LANG FR */ 4 if (!defined('_ECRIRE_INC_VERSION')) return; 4 if (!defined('_ECRIRE_INC_VERSION')) { 5 return; 6 } 5 7 6 8 $GLOBALS[$GLOBALS['idx_lang']] = array( 7 8 9 'identite_extra' => 'Identité extra', 9 10 10 11 //valeurs par défaut 11 'nom_organisation' => 'Nom de l \'organisation',12 'nom_organisation' => 'Nom de l’organisation', 12 13 'telephone' => 'Téléphone', 13 14 'adresse' => 'Adresse', … … 17 18 'pays' => 'Pays', 18 19 'zbug_balise_champ_non_defini' => 'champ non defini @balise@', 19 20 20 ); -
_plugins_/identite_extra/trunk/lang/paquet-identite_extra_fr.php
r96051 r96500 1 1 <?php 2 2 3 if (!defined('_ECRIRE_INC_VERSION')) return; 3 if (!defined('_ECRIRE_INC_VERSION')) { 4 return; 5 } 4 6 5 7 $GLOBALS[$GLOBALS['idx_lang']] = array( 6 7 //8 8 'identite_extra_titre' => 'Identité extra', 9 9 'identite_extra_description' => 'Déclarez vos champs supplémentaires dans <em>mes_options.php</em>. Une fois saisies dans <em>?exec=configurer_identite</em>, les valeurs sont accessibles dans vos squelettes via <code>#CONFIG{identite_extra/telephone}</code>.' , 10 10 'identite_extra_slogan' => 'Étendre facilement le formulaire Identité du site', 11 12 11 ); 13 ?> -
_plugins_/identite_extra/trunk/lang/plugin-identite_extra_fr.php
r96051 r96500 2 2 3 3 /* FICHIER DE LANG FR */ 4 if (!defined('_ECRIRE_INC_VERSION')) return; 4 if (!defined('_ECRIRE_INC_VERSION')) { 5 return; 6 } 5 7 6 8 $GLOBALS[$GLOBALS['idx_lang']] = array( 7 8 9 'zbug_balise_champ_non_defini' => 'champ non defini @balise@', 9 10 10 ); 11 ?> -
_plugins_/identite_extra/trunk/prive/formulaires/configurer_identite_extra.html
r96064 r96500 8 8 <[(#GET{div,li}) ]class="editer editer_[(#CLE)][ (#ENV{erreur/#CLE}|oui)erreur]"> 9 9 <label for="#CLE">[(#VAL{identite_extra:#CLE}|_T|ucfirst)]</label> 10 [<span class= 'erreur_message'>(#ENV{erreurs/#CLE})</span>]11 <input type= 'text' class='text' name='identite_extra[#CLE]' id='#CLE'value="#ENV{identite_extra/#CLE, #VALEUR}" />10 [<span class="erreur_message">(#ENV{erreurs/#CLE})</span>] 11 <input type="text" class="text" name="identite_extra[#CLE]" id="#CLE" value="#ENV{identite_extra/#CLE, #VALEUR}" /> 12 12 </[(#GET{div,li})]> 13 13 </BOUCLE_data>
Note: See TracChangeset
for help on using the changeset viewer.