Juste du formatage

svn/root/tags/v1.4.2
rastapopoulos@spip.org 7 years ago
parent 89ebe14f5a
commit 46e39d9052

@ -1,9 +1,10 @@
<?php
if (!defined('_ECRIRE_INC_VERSION')) return;
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
function balise_IDENTITE_($p) {
$cfg = $GLOBALS['identite_extra'];
$nom = $p->nom_champ;
@ -13,15 +14,18 @@ function balise_IDENTITE_($p) {
$msg = array('zbug_balise_sans_argument', array('balise' => ' IDENTITE_'));
erreur_squelette($msg, $p);
$p->interdire_scripts = false;
return $p;
} elseif ( !in_array($champ, $cfg) ) {
} elseif (!in_array($champ, $cfg)) {
$msg = array('zbug_balise_inexistante', array('balise' => $nom, 'from' => 'identite_extra'));
erreur_squelette($msg, $p);
$p->interdire_scripts = false;
return $p;
} else {
$p->code = 'lire_config("identite_extra/' . $champ .'")';
$p->interdire_scripts = false;
return $p;
}
}
}

@ -1,12 +1,13 @@
<?php
if (!defined('_ECRIRE_INC_VERSION')) return;
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
include_spip('inc/meta');
include_spip('base/create');
function identite_extra_upgrade($nom_meta_base_version, $version_cible){
function identite_extra_upgrade($nom_meta_base_version, $version_cible) {
include_spip('base/upgrade');
$maj = array();
@ -14,10 +15,9 @@ function identite_extra_upgrade($nom_meta_base_version, $version_cible){
}
function identite_extra_vider_tables($nom_meta_base_version) {
// on efface la meta de configuration du plugin
effacer_meta('identite_extra');
// Supprimer la meta de version du plugin
effacer_meta($nom_meta_base_version);
}
}

@ -1,18 +1,16 @@
<?php
if (!defined('_ECRIRE_INC_VERSION')) return;
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
//proposer l'export de la config via le plugin ieconfig
function identite_extra_ieconfig_metas($table){
if (isset($GLOBALS['identite_extra']) AND is_array($GLOBALS['identite_extra'])) {
function identite_extra_ieconfig_metas($table) {
if (isset($GLOBALS['identite_extra']) and is_array($GLOBALS['identite_extra'])) {
$table['identite_extra']['titre'] = _T('identite_extra:identite_extra');;
$table['identite_extra']['icone'] = 'identite_extra-16.png';
$table['identite_extra']['metas_brutes'] = 'identite_extra';
}
return $table;
}
?>

@ -1,8 +1,11 @@
<?php
if (!defined('_ECRIRE_INC_VERSION')) return;
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
// Des champs par défaut pour identite extra
if (!isset($GLOBALS['identite_extra']))
$GLOBALS['identite_extra'] = array('nom_organisation','telephone', 'adresse', 'ville', 'code_postal','region','pays');
if (!isset($GLOBALS['identite_extra'])) {
$GLOBALS['identite_extra'] = array('nom_organisation', 'telephone', 'adresse', 'ville', 'code_postal', 'region','pays');
}

@ -1,7 +1,8 @@
<?php
if (!defined('_ECRIRE_INC_VERSION'))
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
/**
* Ajouter des champs supplémentaires sur configurer_identite
@ -14,42 +15,43 @@ if (!defined('_ECRIRE_INC_VERSION'))
* @return array
*/
function identite_extra_formulaire_fond($flux) {
# formulaire : configurer_identite
if ( $flux['args']['form'] == 'configurer_identite'
AND ( $p = strpos($flux['data'], '<!--extra-->') )
AND isset( $GLOBALS['identite_extra'] )
AND is_array( $GLOBALS['identite_extra'] ) ) {
$ajout = recuperer_fond("prive/formulaires/configurer_identite_extra", $flux['args']['contexte'] );
if (
$flux['args']['form'] == 'configurer_identite'
and ($p = strpos($flux['data'], '<!--extra-->'))
and isset($GLOBALS['identite_extra'])
and is_array($GLOBALS['identite_extra'])
) {
$ajout = recuperer_fond("prive/formulaires/configurer_identite_extra", $flux['args']['contexte']);
$flux['data'] = substr_replace($flux['data'], $ajout, $p, 0);
}
return $flux;
}
// Charger les valeurs déjà existantes dans la méta
function identite_extra_formulaire_charger($flux) {
# formulaire : configurer_identite
if ( $flux['args']['form'] == 'configurer_identite' ) {
$valeurs = array();
foreach ($GLOBALS['identite_extra'] as $k)
foreach ($GLOBALS['identite_extra'] as $k) {
$valeurs['identite_extra'][$k] = lire_config('identite_extra/' . $k, '');
$flux['data'] = array_merge($flux['data'],$valeurs);
}
$flux['data'] = array_merge($flux['data'], $valeurs);
}
return $flux;
}
// Mettre à jour la méta
function identite_extra_formulaire_traiter($flux) {
# formulaire : configurer_identite
if ( $flux['args']['form'] == 'configurer_identite' AND $config = _request('identite_extra') )
ecrire_config('identite_extra', $config);
if ($flux['args']['form'] == 'configurer_identite' and $config = _request('identite_extra')) {
ecrire_config('identite_extra', $config);
}
return $flux;
}

@ -1,14 +1,15 @@
<?php
/* FICHIER DE LANG FR */
if (!defined('_ECRIRE_INC_VERSION')) return;
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
$GLOBALS[$GLOBALS['idx_lang']] = array(
'identite_extra' => 'Identité extra',
//valeurs par défaut
'nom_organisation' => 'Nom de l\'organisation',
'nom_organisation' => 'Nom de lorganisation',
'telephone' => 'Téléphone',
'adresse' => 'Adresse',
'ville' => 'Ville',
@ -16,5 +17,4 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
'region' => 'Région',
'pays' => 'Pays',
'zbug_balise_champ_non_defini' => 'champ non defini @balise@',
);
);

@ -1,13 +1,11 @@
<?php
if (!defined('_ECRIRE_INC_VERSION')) return;
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
$GLOBALS[$GLOBALS['idx_lang']] = array(
//
'identite_extra_titre' => 'Identité extra',
'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>.' ,
'identite_extra_slogan' => 'Étendre facilement le formulaire Identité du site',
);
?>

@ -1,11 +1,10 @@
<?php
/* FICHIER DE LANG FR */
if (!defined('_ECRIRE_INC_VERSION')) return;
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
$GLOBALS[$GLOBALS['idx_lang']] = array(
'zbug_balise_champ_non_defini' => 'champ non defini @balise@',
);
?>

@ -7,8 +7,8 @@
<BOUCLE_data(DATA){source table,#ENV{identite_extra}}>
<[(#GET{div,li}) ]class="editer editer_[(#CLE)][ (#ENV{erreur/#CLE}|oui)erreur]">
<label for="#CLE">[(#VAL{identite_extra:#CLE}|_T|ucfirst)]</label>
[<span class='erreur_message'>(#ENV{erreurs/#CLE})</span>]
<input type='text' class='text' name='identite_extra[#CLE]' id='#CLE' value="#ENV{identite_extra/#CLE, #VALEUR}" />
[<span class="erreur_message">(#ENV{erreurs/#CLE})</span>]
<input type="text" class="text" name="identite_extra[#CLE]" id="#CLE" value="#ENV{identite_extra/#CLE, #VALEUR}" />
</[(#GET{div,li})]>
</BOUCLE_data>
</[(#GET{div,ul})]>

Loading…
Cancel
Save