
commit
b10fa5a9c1
22 changed files with 1257 additions and 0 deletions
@ -0,0 +1,22 @@
|
||||
* text=auto !eol |
||||
action/iextras.php -text |
||||
base/iextras.php -text |
||||
exec/conversion_extras.php -text |
||||
exec/iextras.php -text |
||||
exec/iextras_edit.php -text |
||||
formulaires/editer_champ_extra.html -text |
||||
formulaires/editer_champ_extra.php -text |
||||
images/iextras-16.png -text |
||||
images/iextras-24.png -text |
||||
images/iextras-64.png -text |
||||
inc/iextras.php -text |
||||
inc/iextras_autoriser.php -text |
||||
lang/iextras_en.php -text |
||||
lang/iextras_fr.php -text |
||||
lang/iextras_it.php -text |
||||
/plugin.xml -text |
||||
prive/contenu/champs_extras.html -text |
||||
prive/contenu/champs_extras_possibles.html -text |
||||
prive/editer/champs_extras.html -text |
||||
prive/infos/champs_extras.html -text |
||||
prive/style_prive_plugin_iextras.html -text |
@ -0,0 +1,183 @@
|
||||
<?php |
||||
|
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
|
||||
function action_iextras_dist() { |
||||
$securiser_action = charger_fonction('securiser_action', 'inc'); |
||||
$arg = $securiser_action(); |
||||
|
||||
// droits |
||||
include_spip('inc/autoriser'); |
||||
if (!autoriser('configurer', 'iextra')) { |
||||
include_spip('inc/minipres'); |
||||
echo minipres(); |
||||
exit; |
||||
} |
||||
|
||||
@list($arg, $id_extra_ou_table, $champ) = explode ('/', $arg); |
||||
|
||||
// actions possibles |
||||
if (!in_array($arg, array( |
||||
'monter_extra', |
||||
'descendre_extra', |
||||
'supprimer_extra', |
||||
'desassocier_extra', |
||||
'associer_champ', |
||||
'supprimer_champ'))){ |
||||
include_spip('inc/minipres'); |
||||
echo minipres(_T('iextras:erreur_action',array("action"=>$arg))); |
||||
exit; |
||||
} |
||||
|
||||
// cas de monter |
||||
if (($arg == 'monter_extra') and $id_extra = $id_extra_ou_table){ |
||||
action_monter_champ_extra($id_extra); |
||||
} |
||||
|
||||
// cas de descente |
||||
if (($arg == 'descendre_extra') and $id_extra = $id_extra_ou_table){ |
||||
action_descendre_champ_extra($id_extra); |
||||
} |
||||
|
||||
// cas de suppression |
||||
if (($arg == 'supprimer_extra') and $id_extra = $id_extra_ou_table){ |
||||
action_supprimer_champ_extra($id_extra); |
||||
} |
||||
|
||||
// cas de desassociation |
||||
if (($arg == 'desassocier_extra') and $id_extra = $id_extra_ou_table){ |
||||
action_desassocier_champ_extra($id_extra); |
||||
} |
||||
|
||||
// cas de l'association d'un champ existant |
||||
if (($arg == 'associer_champ') and ($table = $id_extra_ou_table) and $champ){ |
||||
$extra_id = action_associer_champ_sql_comme_champ_extra($table, $champ); |
||||
} |
||||
|
||||
// cas de la suppression d'un champ existant |
||||
if (($arg == 'supprimer_champ') and ($table = $id_extra_ou_table) and $champ){ |
||||
action_supprimer_champ_sql($table, $champ); |
||||
} |
||||
} |
||||
|
||||
|
||||
// remonter d'un cran un champ extra |
||||
function action_monter_champ_extra($extra_id) { |
||||
include_spip('inc/iextras'); |
||||
$extras = iextras_get_extras_tries_par_table(); |
||||
foreach($extras as $i=>$extra) { |
||||
if ($extra->get_id() == $extra_id) { |
||||
extras_log("Remonter le champ $extra->table/$extra->champ par auteur ".$GLOBALS['auteur_session']['id_auteur']); |
||||
|
||||
if ($i !== 0) { |
||||
unset($extras[$i]); |
||||
array_splice($extras, $i-1, 0, array($extra)); |
||||
iextras_set_extras($extras); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// descendre d'un cran un champ extra |
||||
function action_descendre_champ_extra($extra_id) { |
||||
include_spip('inc/iextras'); |
||||
$extras = iextras_get_extras_tries_par_table(); |
||||
$total = count($extras); |
||||
foreach($extras as $i=>$extra) { |
||||
if ($extra->get_id() == $extra_id) { |
||||
extras_log("Descendre le champ $extra->table/$extra->champ par auteur ".$GLOBALS['auteur_session']['id_auteur']); |
||||
|
||||
if ($i+1 !== $total) { |
||||
unset($extras[$i]); |
||||
array_splice($extras, $i+1, 0, array($extra)); |
||||
iextras_set_extras($extras); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// suppression d'un champ extra donne |
||||
function action_supprimer_champ_extra($extra_id) { |
||||
include_spip('inc/iextras'); |
||||
$extras = iextras_get_extras(); |
||||
foreach($extras as $i=>$extra) { |
||||
if ($extra->get_id() == $extra_id) { |
||||
extras_log("Suppression d'un champ par auteur ".$GLOBALS['auteur_session']['id_auteur'],true); |
||||
extras_log($extra, true); |
||||
|
||||
include_spip('inc/cextras_gerer'); |
||||
vider_champs_extras($extra); |
||||
|
||||
unset($extras[$i]); |
||||
iextras_set_extras($extras); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// desassocier un champ extra |
||||
// (ne plus le gerer avec le plugin champ extra |
||||
// mais ne pas le supprimer de la base de donnee) |
||||
function action_desassocier_champ_extra($extra_id) { |
||||
include_spip('inc/iextras'); |
||||
$extras = iextras_get_extras(); |
||||
foreach($extras as $i=>$extra) { |
||||
if ($extra->get_id() == $extra_id) { |
||||
extras_log("Desassociation du champ $extra->table/$extra->champ par auteur ".$GLOBALS['auteur_session']['id_auteur'],true); |
||||
|
||||
unset($extras[$i]); |
||||
iextras_set_extras($extras); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// definir un champ SQL existant comme un champ extra a prendre |
||||
// en compte par ce plugin |
||||
function action_associer_champ_sql_comme_champ_extra($table, $champ){ |
||||
// recuperer la description du champ |
||||
include_spip('inc/cextras_gerer'); |
||||
include_spip('inc/iextras'); |
||||
$champs = extras_champs_anormaux(); |
||||
if (isset($champs[$table][$champ])) { |
||||
$sql = $champs[$table][$champ]; |
||||
// creer un champ extra avec ce champ |
||||
$extra = new ChampExtra(array( |
||||
'table' => objet_type($table), |
||||
'champ' => $champ, |
||||
'label' => 'label_'.$champ, |
||||
'type' => 'ligne', |
||||
'sql' => $sql, |
||||
)); |
||||
// penser a creer une fonction pour ajouter et supprimer un champ... |
||||
// ajout du champ |
||||
extras_log("Ajout d'un champ deja existant par auteur ".$GLOBALS['auteur_session']['id_auteur'],true); |
||||
extras_log($extra, true); |
||||
|
||||
$extras = iextras_get_extras(); |
||||
$extras[] = $extra; |
||||
iextras_set_extras($extras); |
||||
|
||||
// retourner extra_id |
||||
return $extra->get_id(); |
||||
} |
||||
} |
||||
|
||||
// suppression de la base d'un champ d'une table donnee. |
||||
function action_supprimer_champ_sql($table, $champ) { |
||||
// recuperer les descriptions |
||||
// pour verifier que le champ n'est pas declare par quelqu'un |
||||
include_spip('inc/cextras_gerer'); |
||||
$champs = extras_champs_anormaux(); |
||||
if (isset($champs[$table][$champ])) { |
||||
// suppression |
||||
extras_log("Suppression du champ $table/$champ par auteur ".$GLOBALS['auteur_session']['id_auteur'],true); |
||||
|
||||
$table = table_objet_sql($table); |
||||
sql_alter("TABLE $table DROP ".$champ); |
||||
} |
||||
} |
||||
|
||||
?> |
@ -0,0 +1,19 @@
|
||||
<?php |
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
|
||||
function iextras_declarer_champs_extras($champs=array()) { |
||||
include_spip('inc/iextras'); |
||||
|
||||
// lors du renouvellement de l'alea, au demarrage de SPIP |
||||
// les chemins de plugins ne sont pas encore connus. |
||||
// il faut se mefier et charger tout de meme la fonction, sinon page blanche. |
||||
if (!function_exists('iextras_get_extras')) { |
||||
include_once(dirname(__file__).'/../inc/iextras.php'); |
||||
} |
||||
|
||||
// recuperer le tableau de champ et les ajouter. |
||||
$extras = iextras_get_extras(); |
||||
$champs = array_merge($champs, $extras); |
||||
return $champs; |
||||
} |
||||
?> |
@ -0,0 +1,130 @@
|
||||
<?php |
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
|
||||
include_spip('inc/presentation'); |
||||
|
||||
function exec_conversion_extras_dist(){ |
||||
global $spip_lang_right; |
||||
// si pas autorise : message d'erreur |
||||
if (!autoriser('configurer', 'conversion_extras')) { |
||||
include_spip('inc/minipres'); |
||||
echo minipres(); |
||||
die(); |
||||
} |
||||
|
||||
// pipeline d'initialisation |
||||
pipeline('exec_init', array('args'=>array('exec'=>'conversion_extras'),'data'=>'')); |
||||
|
||||
// entetes |
||||
$commencer_page = charger_fonction('commencer_page', 'inc'); |
||||
echo $commencer_page(_T('iextras:titre_page_conversion_extras'), "configuration", "configuration"); |
||||
|
||||
// titre |
||||
echo "<br /><br /><br />\n"; // outch que c'est vilain ! |
||||
echo gros_titre(_T('iextras:titre_conversion_extras'),'', false); |
||||
|
||||
// barre d'onglets |
||||
echo barre_onglets("configuration", "iextras"); |
||||
|
||||
// colonne gauche |
||||
echo debut_gauche('', true); |
||||
echo pipeline('affiche_gauche', array('args'=>array('exec'=>'conversion_extras'),'data'=>'')); |
||||
|
||||
// colonne droite |
||||
echo creer_colonne_droite('', true); |
||||
echo pipeline('affiche_droite', array('args'=>array('exec'=>'conversion_extras'),'data'=>'')); |
||||
|
||||
// centre |
||||
echo debut_droite('', true); |
||||
|
||||
// contenu |
||||
include_spip('inc/iextras'); |
||||
include_spip('inc/cextras_gerer'); |
||||
|
||||
if (!is_array($GLOBALS['champs_extra'])) |
||||
die ('Rien a convertir'); |
||||
|
||||
foreach ($GLOBALS['champs_extra'] as $type => $ext) { |
||||
echo "<h2>$type</h2>\n"; |
||||
echo "<dl>"; |
||||
|
||||
foreach ($ext as $extra => $def) { |
||||
echo "<dt>$extra</dt>\n"; |
||||
|
||||
echo "<dd>$def</dd>\n"; |
||||
echo "<dd>"; |
||||
|
||||
$vals = iextras_a_convertir($type, $extra); |
||||
if ($vals) { |
||||
if (_request('convertir') == "$type-$extra" |
||||
AND preg_match(',^[a-z0-9_]+$,i', _request('extra_dest')) |
||||
AND $s = sql_select(_request('extra_dest'), 'spip_'.table_objet($type)) |
||||
) { |
||||
iextras_convertir($type, $extra); |
||||
} |
||||
else { |
||||
echo count($vals)." $type ($extra) "._L("à convertir : veuillez indiquer le nom du champ extra2 où recopier les données"); |
||||
echo "<form action='".parametre_url(self(), 'convertir', '')."' method='post'> |
||||
<input type='hidden' name='convertir' value='$type-$extra' /> |
||||
<input type='text' name='extra_dest' value='' /> |
||||
<input type='submit' value='Convertir' /> |
||||
</form>\n"; |
||||
} |
||||
|
||||
} else |
||||
echo sprintf(_L("%s (%s) : rien à convertir."),$type,$extra); |
||||
echo "</dd>\n"; |
||||
|
||||
} |
||||
|
||||
echo "</dl>\n"; |
||||
|
||||
} |
||||
|
||||
// fin contenu |
||||
|
||||
echo pipeline('affiche_milieu', array('args'=>array('exec'=>'conversion_extras'),'data'=>'')); |
||||
|
||||
echo fin_gauche(), fin_page(); |
||||
} |
||||
|
||||
// items a convertir |
||||
function iextras_a_convertir($type, $extra) { |
||||
$s = sql_select(id_table_objet($type)." AS id,extra", 'spip_'.table_objet($type), "extra LIKE ".sql_quote("%$extra%")); |
||||
$vals = array(); |
||||
while ($t = sql_fetch($s)) { |
||||
if (is_array($e = @unserialize($t['extra'])) |
||||
AND strlen($val = $e[$extra])) |
||||
$vals[$t['id']] = $e[$extra]; |
||||
} |
||||
return $vals; |
||||
} |
||||
|
||||
// Effectuer la conversion |
||||
function iextras_convertir($type, $extra) { |
||||
$s = sql_select(id_table_objet($type)." AS id,extra", 'spip_'.table_objet($type), "extra LIKE ".sql_quote("%$extra%")); |
||||
|
||||
$extra2 = _request('extra_dest'); |
||||
$cpt = 0; |
||||
while ($t = sql_fetch($s)) { |
||||
if (is_array($e = @unserialize($t['extra'])) |
||||
AND strlen($val = $e[$extra])) { |
||||
unset($e[$extra]); |
||||
if (count($e)) |
||||
$e = serialize($e); |
||||
else |
||||
$e = ''; |
||||
|
||||
sql_updateq('spip_'.table_objet($type), |
||||
array('extra'=>$e,$extra2 => $val), |
||||
id_table_objet($type) .'='. $t['id'] |
||||
); |
||||
|
||||
$cpt++; |
||||
} |
||||
} |
||||
|
||||
echo $cpt." $type ($extra) convertis"; |
||||
} |
||||
|
||||
?> |
@ -0,0 +1,73 @@
|
||||
<?php |
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
|
||||
include_spip('inc/presentation'); |
||||
|
||||
function exec_iextras_dist(){ |
||||
global $spip_lang_right; |
||||
// si pas autorise : message d'erreur |
||||
if (!autoriser('configurer', 'iextras')) { |
||||
include_spip('inc/minipres'); |
||||
echo minipres(); |
||||
die(); |
||||
} |
||||
|
||||
// pipeline d'initialisation |
||||
pipeline('exec_init', array('args'=>array('exec'=>'iextras'),'data'=>'')); |
||||
|
||||
// entetes |
||||
$commencer_page = charger_fonction('commencer_page', 'inc'); |
||||
echo $commencer_page(_T('iextras:titre_page_iextras'), "configuration", "configuration"); |
||||
|
||||
// titre |
||||
echo "<br /><br /><br />\n"; // outch que c'est vilain ! |
||||
echo gros_titre(_T('iextras:titre_iextras'),'', false); |
||||
|
||||
// barre d'onglets |
||||
echo barre_onglets("configuration", "iextras"); |
||||
|
||||
// colonne gauche |
||||
echo debut_gauche('', true); |
||||
echo cadre_champs_extras_infos(); |
||||
echo pipeline('affiche_gauche', array('args'=>array('exec'=>'iextras'),'data'=>'')); |
||||
|
||||
// colonne droite |
||||
echo creer_colonne_droite('', true); |
||||
echo pipeline('affiche_droite', array('args'=>array('exec'=>'iextras'),'data'=>'')); |
||||
|
||||
// centre |
||||
echo debut_droite('', true); |
||||
|
||||
// contenu |
||||
include_spip('inc/iextras'); |
||||
include_spip('inc/cextras_gerer'); |
||||
echo recuperer_fond('prive/contenu/champs_extras', array( |
||||
'extras'=>iextras_get_extras_par_table(), |
||||
'noms_tables'=>cextras_objets_valides() |
||||
)); |
||||
echo recuperer_fond('prive/contenu/champs_extras_possibles', array( |
||||
'extras'=>extras_champs_utilisables(), |
||||
'noms_tables'=>cextras_objets_valides() |
||||
)); |
||||
|
||||
echo icone_inline(_T('iextras:icone_creer_champ_extra'), generer_url_ecrire("iextras_edit"), find_in_path("images/iextras-24.png"), "creer.gif", $spip_lang_right); |
||||
// fin contenu |
||||
|
||||
echo pipeline('affiche_milieu', array('args'=>array('exec'=>'iextras'),'data'=>'')); |
||||
|
||||
echo fin_gauche(), fin_page(); |
||||
} |
||||
|
||||
// afficher les informations de la page |
||||
function cadre_champs_extras_infos() { |
||||
$boite = pipeline ('boite_infos', array('data' => '', |
||||
'args' => array( |
||||
'type'=>'champs_extras', |
||||
) |
||||
)); |
||||
|
||||
if ($boite) |
||||
return debut_boite_info(true) . $boite . fin_boite_info(true); |
||||
} |
||||
|
||||
?> |
@ -0,0 +1,54 @@
|
||||
<?php |
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
|
||||
include_spip('inc/presentation'); |
||||
|
||||
function exec_iextras_edit_dist(){ |
||||
|
||||
// si pas autorise : message d'erreur |
||||
if (!autoriser('configurer', 'iextras')) { |
||||
include_spip('inc/minipres'); |
||||
echo minipres(); |
||||
die(); |
||||
} |
||||
|
||||
// pipeline d'initialisation |
||||
pipeline('exec_init', array('args'=>array('exec'=>'iextras_edit'),'data'=>'')); |
||||
|
||||
// entetes |
||||
$commencer_page = charger_fonction('commencer_page', 'inc'); |
||||
echo $commencer_page(_T('iextras:titre_page_iextras'), "configuration", "configuration"); |
||||
|
||||
// titre |
||||
echo "<br /><br /><br />\n"; // outch que c'est vilain ! |
||||
echo gros_titre(_T('iextras:titre_iextras'),'', false); |
||||
|
||||
// barre d'onglets |
||||
echo barre_onglets("configuration", "iextras"); |
||||
|
||||
// colonne gauche |
||||
echo debut_gauche('', true); |
||||
echo pipeline('affiche_gauche', array('args'=>array('exec'=>'iextras_edit'),'data'=>'')); |
||||
|
||||
// colonne droite |
||||
echo creer_colonne_droite('', true); |
||||
echo pipeline('affiche_droite', array('args'=>array('exec'=>'iextras_edit'),'data'=>'')); |
||||
|
||||
// centre |
||||
echo debut_droite('', true); |
||||
|
||||
// contenu |
||||
$extra_id = _request('extra_id'); |
||||
$extra_id = $extra_id ? $extra_id : 'new' ; |
||||
echo recuperer_fond('prive/editer/champs_extras', array( |
||||
'extra_id' => $extra_id, |
||||
'titre' => $extra_id=='new' ? _T('iextras:info_nouveau_champ_extra') : _T('iextras:info_modifier_champ_extra'), |
||||
'redirect' => generer_url_ecrire("iextras"), |
||||
'icone_retour' => icone_inline(_T('icone_retour'), generer_url_ecrire('iextras'), find_in_path("images/iextras-24.png"), "rien.gif",$GLOBALS['spip_lang_left']), |
||||
)); |
||||
|
||||
echo pipeline('affiche_milieu', array('args'=>array('exec'=>'iextras_edit'),'data'=>'')); |
||||
|
||||
echo fin_gauche(), fin_page(); |
||||
} |
||||
?> |
@ -0,0 +1,102 @@
|
||||
<div class="formulaire_spip formulaire_editer formulaire_#FORM"> |
||||
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>] |
||||
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>] |
||||
<BOUCLE_si_editable(CONDITION){si #ENV{editable}}> |
||||
<form method='post' action='#ENV{action}'><div> |
||||
#ACTION_FORMULAIRE{#ENV{action}} |
||||
<input type='hidden' name='extra_id' value='#ENV{extra_id}' /> |
||||
|
||||
#SET{disable,#ENV{new}|?{'',oui}} |
||||
<fieldset> |
||||
<h3 class='legend'><:iextras:legend_declaration:></h3> |
||||
<ul> |
||||
[(#SAISIE{input,champ, |
||||
label=<:iextras:label_champ:>, |
||||
explication=<:iextras:caracteres_autorises_champ:>, |
||||
obligatoire=oui, |
||||
disable_avec_post=#GET{disable}})] |
||||
|
||||
[(#SAISIE{selection,table, |
||||
label=<:iextras:label_table:>, |
||||
obligatoire=oui, |
||||
disable_avec_post=#GET{disable}, |
||||
datas=[(#VAL|cextras_objets_valides_boucle_pour)]})] |
||||
|
||||
[(#SAISIE{input,label, |
||||
label=<:iextras:label_label:>, |
||||
explication=<:iextras:precisions_pour_label:>, |
||||
obligatoire=oui})] |
||||
[(#SAISIE{selection_par_groupe,type, |
||||
label=<:iextras:label_type:>, |
||||
obligatoire=oui, |
||||
explication=<:iextras:precisions_pour_type:>, |
||||
datas=[(#VAL|cextras_types_formulaires)]})] |
||||
|
||||
#SET{defaut,",-vide- |
||||
1,valeur 1 |
||||
2,valeur 2"} |
||||
[(#SAISIE{textarea,enum, |
||||
label=<:iextras:label_enum:>, |
||||
explication=<:iextras:precisions_pour_enum:>, |
||||
rows=3, |
||||
defaut=#GET{defaut}})] |
||||
|
||||
</ul> |
||||
</fieldset> |
||||
|
||||
<fieldset> |
||||
<h3 class='legend'><:iextras:legend_options_techniques:></h3> |
||||
<ul> |
||||
[(#SAISIE{oui_non,obligatoire, |
||||
label=<:iextras:label_obligatoire:>, |
||||
obligatoire=oui})] |
||||
|
||||
[(#SAISIE{oui_non,rechercher, |
||||
label=<:iextras:label_rechercher:>, |
||||
explication=<:iextras:precisions_pour_rechercher:>})] |
||||
|
||||
[(#SAISIE{input,sql, |
||||
label=<:iextras:label_sql:>, |
||||
obligatoire=oui, |
||||
disable_avec_post=#GET{disable}})] |
||||
|
||||
[(#SAISIE{radio,traitements, |
||||
label=<:iextras:label_traitements:>, |
||||
explication=<:iextras:precisions_pour_traitements:>, |
||||
datas=#ARRAY{ |
||||
'',<:iextras:radio_traitements_aucun:>, |
||||
'_TRAITEMENT_TYPO',<:iextras:radio_traitements_typo:>, |
||||
'_TRAITEMENT_RACCOURCIS',<:iextras:radio_traitements_raccourcis:>}})] |
||||
|
||||
</ul> |
||||
</fieldset> |
||||
|
||||
<fieldset> |
||||
<h3 class='legend'><:iextras:legend_options_saisies:></h3> |
||||
<ul> |
||||
[(#SAISIE{input,explication, |
||||
label=<:iextras:label_explication:>, |
||||
explication=<:iextras:precisions_pour_explication:>})] |
||||
|
||||
[(#VAL{_CHAMPS_EXTRAS_SAISIES_EXTERNES}|defined|et{#EVAL{_CHAMPS_EXTRAS_SAISIES_EXTERNES}}) |
||||
[(#SAISIE{input,attention, |
||||
label=<:iextras:label_attention:>, |
||||
explication=<:iextras:precisions_pour_attention:>})] |
||||
|
||||
[(#SAISIE{input,li_class, |
||||
label=<:iextras:label_li_class:>, |
||||
explication=<:iextras:precisions_pour_li_class:>})] |
||||
] |
||||
|
||||
[(#SAISIE{input,class, |
||||
label=<:iextras:label_class:>, |
||||
explication=<:iextras:precisions_pour_class:>})] |
||||
|
||||
</ul> |
||||
</fieldset> |
||||
[(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ] |
||||
<!--extra--> |
||||
<p class='boutons'><input type='submit' class='submit' value='[(#ENV{new}|?{<:bouton_ajouter:>,<:bouton_modifier:>})]' /></p> |
||||
</div></form> |
||||
</BOUCLE_si_editable> |
||||
</div> |
@ -0,0 +1,182 @@
|
||||
<?php |
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
|
||||
include_spip('inc/iextras'); |
||||
include_spip('inc/cextras_gerer'); |
||||
|
||||
function formulaires_editer_champ_extra_charger_dist($extra_id='new', $redirect=''){ |
||||
// nouveau ? |
||||
$new = ($extra_id == 'new') ? ' ': ''; |
||||
|
||||
// valeur par defaut (on utilise les valeurs d'un champ vide) |
||||
$c = new ChampExtra; |
||||
$valeurs = array_merge($c->toArray(), array( |
||||
'extra_id' => $extra_id, |
||||
'new' => $new, |
||||
'redirect' => $redirect, |
||||
)); |
||||
// valeur par defaut tout de meme sur sql et pour saisie |
||||
if (!$valeurs['sql']) $valeurs['sql'] = "text NOT NULL DEFAULT ''"; |
||||
|
||||
if (!$valeurs['type']) { |
||||
$valeurs['type'] = "ligne"; |
||||
} |
||||
|
||||
// si un extra est demande (pour edition) |
||||
// remplir les valeurs avec infos de celui-ci |
||||
if (!$new) { |
||||
$extra = iextra_get_extra($extra_id); |
||||
// si l'identifiant n'est pas trouve, c'est que le champ n'existe plus |
||||
// une ancienne url d'un marque page ? |
||||
if (!$extra) return false; |
||||
|
||||
$valeurs = array_merge($valeurs, $extra->toArray()); |
||||
// compatibilite le temps de migrer vers cextras 1.4.0 |
||||
if (isset($valeurs['precisions']) and $valeurs['precisions']) { |
||||
$valeurs['saisie_parametres']['explication'] = $valeurs['precisions']; |
||||
} |
||||
// separer saisies internes a celles du plug "saisies" |
||||
if ($valeurs['saisie_externe']) { |
||||
$valeurs['type'] = 'externe/' . $valeurs['type']; |
||||
} else { |
||||
$valeurs['type'] = 'interne/' . $valeurs['type']; |
||||
} |
||||
// chaque saisie_parametres devient un parametre a charger |
||||
$valeurs = array_merge($valeurs, $valeurs['saisie_parametres']); |
||||
} |
||||
return $valeurs; |
||||
} |
||||
|
||||
|
||||
function formulaires_editer_champ_extra_verifier_dist($extra_id='new', $redirect=''){ |
||||
$erreurs = array(); |
||||
|
||||
// nouveau ? |
||||
$new = ($extra_id == 'new') ? ' ': ''; |
||||
|
||||
// recuperer les valeurs postees |
||||
$extra = iextras_post_formulaire(); |
||||
|
||||
// pas de champ vide |
||||
foreach(array('champ', 'table', 'type', 'label', 'sql') as $c) { |
||||
if (!$extra[$c]) { |
||||
$erreurs[$c] = _T('iextras:veuillez_renseigner_ce_champ'); |
||||
} |
||||
} |
||||
|
||||
// 'champ' correctement ecrit (pas de majuscule ni de tiret) |
||||
if ($champ = trim($extra['champ'])) { |
||||
if (!preg_match('/^[a-z0-9_]+$/',$champ)) { |
||||
$erreurs['champ'] = _T('iextras:caracteres_interdits'); |
||||
} |
||||
} |
||||
|
||||
// si nouveau champ, ou modification du nom du champ |
||||
// verifier qu'un champ homonyme |
||||
// n'existe pas deja sur la meme table |
||||
$verifier = false; |
||||
if (!$new) { |
||||
$ancien = iextra_get_extra($extra_id); |
||||
if (($ancien->champ != $champ) or ($ancien->table != $extra['table'])) { |
||||
$verifier = true; |
||||
} |
||||
} |
||||
if ($new or $verifier) { |
||||
$table = table_objet_sql($extra['table']); |
||||
$desc = sql_showtable($table); |
||||
if (isset($desc['field'][$champ])) { |
||||
$erreurs['champ'] = _T('iextras:champ_deja_existant'); |
||||
} |
||||
} |
||||
|
||||
return $erreurs; |
||||
} |
||||
|
||||
|
||||
function formulaires_editer_champ_extra_traiter_dist($extra_id='new', $redirect=''){ |
||||
// nouveau ? |
||||
$new = ($extra_id == 'new') ? ' ': ''; |
||||
|
||||
// recuperer les valeurs postees |
||||
$extra = iextras_post_formulaire(); |
||||
|
||||
// cextra 1.4.0 : on separe les parametres des saisies |
||||
// dans un tableau specifique |
||||
$extra['saisie_parametres'] = array(); |
||||
foreach (array('explication', 'attention', 'class', 'li_class') as $p) { |
||||
$extra['saisie_parametres'][$p] = $extra[$p]; |
||||
unset($extra[$p]); |
||||
} |
||||
// type est soit interne, soit externe (plugin saisies) |
||||
$extra['saisie_externe'] = (substr($extra['type'],0,7) == 'externe' ); |
||||
$extra['type'] = substr($extra['type'], 8); // enlever 'externe/' et 'interne/' |
||||
|
||||
// recreer le tableau de stockage des extras |
||||
$extras = iextras_get_extras(); |
||||
|
||||
// ajout du champ ou modification du champ extra de meme id. |
||||
$extra = new ChampExtra($extra); |
||||
|
||||
// creer le champ s'il est nouveau : |
||||
if ($new) { |
||||
$extras_old = $extras; |
||||
$extras[] = $extra; // ajouter le champ cree |
||||
} else { |
||||
foreach($extras as $i=>$e) { |
||||
if ($e->get_id() == $extra_id) { |
||||
$extras[$i] = $extra; |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// l'enregistrer les modifs |
||||
iextras_set_extras($extras); |
||||
|
||||
$res = array( |
||||
'editable' => true, |
||||
); |
||||
|
||||
// creer le champ s'il est nouveau : |
||||
if ($new) { |
||||
extras_log("Creation d'un nouveau champ par auteur ".$GLOBALS['auteur_session']['id_auteur'], true); |
||||
if (creer_champs_extras($extra)) { |
||||
$res['message_ok'] = _T('iextras:champ_sauvegarde'); |
||||
} else { |
||||
extras_log("! Aie ! Erreur de creation du champ", true); |
||||
$res['message_erreur'] = _T('iextras:erreur_enregistrement_champ'); |
||||
// on remet l'ancienne declaration |
||||
iextras_set_extras($extras_old); |
||||
} |
||||
extras_log($extra, true); |
||||
} else { |
||||
// modification |
||||
$res['message_ok'] = _T('iextras:champ_sauvegarde'); |
||||
} |
||||
|
||||
|
||||
if ($redirect and !isset($res['message_erreur'])) { |
||||
$res['redirect'] = $redirect; |
||||
} |
||||
|
||||
return $res; |
||||
} |
||||
|
||||
// recuperer les valeurs postees par le formulaire |
||||
function iextras_post_formulaire() { |
||||
$extra = array(); |
||||
foreach(array( |
||||
'champ', 'table', 'type', |
||||
'label', 'sql', |
||||
'traitements', |
||||
// 'precisions', |
||||
'obligatoire', |
||||
'enum', 'rechercher', |
||||
'explication', 'attention', 'class', 'li_class' |
||||
) as $c) { |
||||
$extra[$c] = _request($c); |
||||
} |
||||
return $extra; |
||||
} |
||||
|
||||
?> |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.7 KiB |
@ -0,0 +1,69 @@
|
||||
<?php |
||||
|
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
|
||||
// etre certain d'avoir la classe ChampExtra de connue |
||||
include_spip('inc/cextras'); |
||||
|
||||
function iextras_get_extras(){ |
||||
$extras = @unserialize($GLOBALS['meta']['iextras']); |
||||
if (!is_array($extras)) $extras = array(); |
||||
// reinitialiser aucazou les valeurs de tables |
||||
foreach($extras as $e) { |
||||
if (!$e->_table_sql) { |
||||
$e->definir(); // va recreer les infos des tables/objet/type |
||||
} |
||||
} |
||||
return $extras; |
||||
} |
||||
|
||||
|
||||
/* retourne l'extra ayant l'id demande */ |
||||
function iextra_get_extra($extra_id){ |
||||
$extras = iextras_get_extras(); |
||||
foreach($extras as $extra) { |
||||
if ($extra->get_id() == $extra_id) { |
||||
return $extra; |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
function iextras_set_extras($extras){ |
||||
ecrire_meta('iextras',serialize($extras)); |
||||
return $extras; |
||||
} |
||||
|
||||
// tableau des extras, mais classes par table SQL |
||||
// et sous forme de tableau PHP pour pouvoir boucler dessus. |
||||
function iextras_get_extras_par_table(){ |
||||
$extras = iextras_get_extras(); |
||||
$tables = array(); |
||||
foreach($extras as $e) { |
||||
if (!isset($tables[$e->table])) { |
||||
$tables[$e->table] = array(); |
||||
} |
||||
$tables[$e->table][] = $e->toArray(); |
||||
} |
||||
return $tables; |
||||
} |
||||
|
||||
// tableau des extras, tries par table SQL |
||||
function iextras_get_extras_tries_par_table(){ |
||||
$extras = iextras_get_extras(); |
||||
$tables = $extras_tries = array(); |
||||
foreach($extras as $e) { |
||||
if (!isset($tables[$e->table])) { |
||||
$tables[$e->table] = array(); |
||||
} |
||||
$tables[$e->table][] = $e; |
||||
} |
||||
sort($tables); |
||||
foreach ($tables as $table) { |
||||
foreach ($table as $extra) { |
||||
$extras_tries[] = $extra; |
||||
} |
||||
} |
||||
return $extras_tries; |
||||
} |
||||
?> |
@ -0,0 +1,15 @@
|
||||
<?php |
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
|
||||
// fonction pour le pipeline, n'a rien a effectuer |
||||
function iextras_autoriser(){} |
||||
|
||||
// declarations d'autorisations |
||||
function autoriser_iextras_onglet_dist($faire, $type, $id, $qui, $opt) { |
||||
return autoriser('configurer', 'iextras', $id, $qui, $opt); |
||||
} |
||||
|
||||
function autoriser_iextras_configurer_dist($faire, $type, $id, $qui, $opt) { |
||||
return autoriser('webmestre', $type, $id, $qui, $opt); |
||||
} |
||||
?> |
@ -0,0 +1,92 @@
|
||||
<?php |
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
$GLOBALS[$GLOBALS['idx_lang']] = array( |
||||
//A |
||||
'action_associer' => 'manage this field', |
||||
'action_associer_title' => 'Manage the display of this extra field', |
||||
'action_desassocier' => 'disassociate', |
||||
'action_desassocier_title' => 'Don\'t manage the display of this extra field', |
||||
'action_descendre' => 'down', |
||||
'action_descendre_title' => 'Move the field down one position lower', |
||||
'action_modifier' => 'modify', |
||||
'action_modifier_title' => 'Modify the parameters of the extra field', |
||||
'action_monter' => 'up', |
||||
'action_monter_title' => 'Move the field up one position higher', |
||||
'action_supprimer' => 'delete', |
||||
'action_supprimer_title' => 'Totally delete the field from the database', |
||||
//C |
||||
'caracteres_interdits' => 'Some characters used are inappropriate for this field.', |
||||
'caracteres_autorises_champ' => 'Possible characters: letters without accents, numerals, - and _', |
||||
'champs_extras' => 'Extra Fields', |
||||
'champ_sauvegarde' => 'Extra field saved!', |
||||
'champ_deja_existant' => 'A field with the same name already exists for this table.', |
||||
//E |
||||
'erreur_action' => 'Action @action@ unknown.', |
||||
'erreur_enregistrement_champ' => 'Problem creating the extra field.', |
||||
//I |
||||
'icone_creer_champ_extra' => 'Create a new extra field', |
||||
'info_modifier_champ_extra' => 'Modify an extra field', |
||||
'info_nouveau_champ_extra' => 'New extra field', |
||||
'info_description_champ_extra' => "This page is used to manage the extra fields, |
||||
these being supplementary fields added to SPIP\'s default database tables, |
||||
taken into account in the object entry and modification forms.", |
||||
'info_description_champ_extra_creer' => "You can create new fields which will then be displayed on this page |
||||
under the heading of «List of extra fields», as well as in the forms.", |
||||
'info_description_champ_extra_presents' => "Finally, if there are already extra fields in your database, |
||||
but which have not been declared (by a plugin or set of templates), then you |
||||
can ask this plugin to manage them for you. These fields, if there are any, |
||||
will appear under the heading of \"List of existing fields not managed\".", |
||||
|
||||
//L |
||||
'label_champ' => 'Field name', |
||||
'label_class' => 'CSS classes', |
||||
'label_li_class' => 'CSS classes of the <li> parent', |
||||
'label_enum' => 'List of values', |
||||
'label_label' => 'Data entry label', |
||||
'label_obligatoire' => 'Compulsory field?', |
||||
'label_explication' => 'Data entry help', |
||||
'label_attention' => 'Very important help', |
||||
'label_rechercher' => 'Search', |
||||
'label_sql' => 'SQL definition', |
||||
'label_table' => 'Object', |
||||
'label_traitements' => 'Automatic processes', |
||||
'label_type' => 'Type of data', |
||||
'legend_declaration' => 'Declaration', |
||||
'legend_options_techniques' => 'Technical options', |
||||
'legend_options_saisies' => 'Data entry options', |
||||
'liste_des_extras' => 'List of extra fields', |
||||
'liste_des_extras_possibles' => 'List of existing fields not managed', |
||||
//P |
||||
'precisions_pour_class' => 'Add CSS classes for the element, |
||||
separated by a space. Example: "inserer_barre_edition" for a block |
||||
with the Porte Plume plugin', |
||||
'precisions_pour_li_class' => 'Add CSS classes for the <li> parent, |
||||
separated by a space. Example: "haut" to use the whole width |
||||
of the form', |
||||
'precisions_pour_enum' => 'Certain types of field require a list of accepted values: specify one value per line, followed by a comma and a description. An empty line is for the default value. The description may be a SPIP idiom.', |
||||
'precisions_pour_label' => 'May be a "plugin:stringname" idiom.', |
||||
'precisions_pour_explication' => 'You can provide more information about the data field. |
||||
May be a "plugin:stringname" idiom..', |
||||
'precisions_pour_attention' => 'To be used for VERY important details. |
||||
To be used with moderation! |
||||
May be a "plugin:stringname" idiom..', |
||||
'precisions_pour_rechercher' => 'Include this field in the search engine?', |
||||
'precisions_pour_type' => 'Display a field of type:', |
||||
'precisions_pour_traitements' => 'Automatically apply a process |
||||
for the resulting #FIELD_NAME field:', |
||||
//R |
||||
'radio_traitements_aucun' => 'None', |
||||
'radio_traitements_typo' => 'Only typographical processes (typo)', |
||||
'radio_traitements_raccourcis' => 'SPIP shortcut processes (clean)', |
||||
//S |
||||
'saisies_champs_extras' => 'From "Extra Fields"', |
||||
'saisies_saisies' => 'From "Saisies"', |
||||
'supprimer_reelement' => 'Delete this field?', |
||||
//T |
||||
'titre_page_iextras' => 'Extra Fields', |
||||
'titre_iextras' => 'Extras Fields', |
||||
|
||||
//V |
||||
'veuillez_renseigner_ce_champ' => 'Please enter this field!', |
||||
); |
||||
?> |
@ -0,0 +1,92 @@
|
||||
<?php |
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
$GLOBALS[$GLOBALS['idx_lang']] = array( |
||||
//A |
||||
'action_associer' => 'gérer ce champ', |
||||
'action_associer_title' => 'Gérer l\'affichage de ce champ extra', |
||||
'action_desassocier' => 'désassocier', |
||||
'action_desassocier_title' => 'Ne plus gérer l\'affichage de ce champ extra', |
||||
'action_descendre' => 'descendre', |
||||
'action_descendre_title' => 'Déplacer le champ d\'un rang vers le bas', |
||||
'action_modifier' => 'modifier', |
||||
'action_modifier_title' => 'Modifier les paramètres du champ extra', |
||||
'action_monter' => 'monter', |
||||
'action_monter_title' => 'Monter le champ d\'un rang vers le haut', |
||||
'action_supprimer' => 'supprimer', |
||||
'action_supprimer_title' => 'Supprimer totalement le champ de la base de données', |
||||
//C |
||||
'caracteres_interdits' => 'Certains caracères utilisés ne conviennent pas pour ce champ.', |
||||
'caracteres_autorises_champ' => 'Caractères possibles : lettres sans accent, chiffres, - et _', |
||||
'champs_extras' => 'Champs Extras', |
||||
'champ_sauvegarde' => 'Champ extra sauvegardé !', |
||||
'champ_deja_existant' => 'Un champ homonyme existe déjà pour cette table.', |
||||
//E |
||||
'erreur_action' => 'Action @action@ inconnue.', |
||||
'erreur_enregistrement_champ' => 'Problème de création du champ extra.', |
||||
//I |
||||
'icone_creer_champ_extra' => 'Créer un nouveau champ extra', |
||||
'info_modifier_champ_extra' => 'Modifier champ extra', |
||||
'info_nouveau_champ_extra' => 'Nouveau champ extra', |
||||
'info_description_champ_extra' => "Cette page permet de gérer des champs extras, |
||||
c'est à dire des champs supplémentaires dans les tables de SPIP, |
||||
pris en compte dans les formulaires d'édition.", |
||||
'info_description_champ_extra_creer' => "Vous pouvez créer de nouveaux champs qui s'afficheront alors |
||||
sur cette page, dans le cadre «Liste des champs extras», ainsi que dans les formulaires.", |
||||
'info_description_champ_extra_presents' => "Enfin, si des champs existent déjà dans votre base de donnée, |
||||
mais ne sont pas déclarés (par un plugin ou un jeu de squelettes), vous |
||||
pouvez demander à ce plugin de les gérer. Ces champs, s'il y en a, |
||||
apparaissent dans un cadre «Liste des champs présents non gérés».", |
||||
|
||||
//L |
||||
'label_champ' => 'Nom du champ', |
||||
'label_class' => 'Classes CSS', |
||||
'label_li_class' => 'Classes CSS du <li> parent', |
||||
'label_enum' => 'Liste de valeurs', |
||||
'label_label' => 'Label de la saisie', |
||||
'label_obligatoire' => 'Champ obligatoire ?', |
||||
'label_explication' => 'Explications de la saisie', |
||||
'label_attention' => 'Explications très importantes', |
||||
'label_rechercher' => 'Recherche', |
||||
'label_sql' => 'Définition SQL', |
||||
'label_table' => 'Objet', |
||||
'label_traitements' => 'Traitements automatiques', |
||||
'label_type' => 'Type de saisie', |
||||
'legend_declaration' => 'Déclaration', |
||||
'legend_options_techniques' => 'Options techniques', |
||||
'legend_options_saisies' => 'Options de la saisie', |
||||
'liste_des_extras' => 'Liste des champs extras', |
||||
'liste_des_extras_possibles' => 'Liste des champs présents non gérés', |
||||
//P |
||||
'precisions_pour_class' => 'Ajouter des classes CSS sur l\'élément, |
||||
séparées par un espace. Exemple : "inserer_barre_edition" pour un bloc |
||||
avec le plugin Porte Plume', |
||||
'precisions_pour_li_class' => 'Ajouter des classes CSS sur le <li> parent, |
||||
séparées par un espace. Exemple : "haut" pour avoir toute la |
||||
largeur sur le formulaire', |
||||
'precisions_pour_enum' => 'Certains types de champ demandent une liste des valeurs acceptées : indiquez-en une par ligne, suivie d\'une virgule et d\'une description. Une ligne vide pour la valeur par défaut. La description peut être une chaîne de langue.', |
||||
'precisions_pour_label' => 'Peut être une chaîne de langue «plugin:chaine».', |
||||
'precisions_pour_explication' => 'Vous pouvez donner plus d\'informations concernant la saisie. |
||||
Peut être une chaîne de langue «plugin:chaine».', |
||||
'precisions_pour_attention' => 'Pour quelque chose de très important à indiquer. |
||||
À utiliser avec beaucoup de modération ! |
||||
Peut être une chaîne de langue «plugin:chaine».', |
||||
'precisions_pour_rechercher' => 'Inclure ce champ dans le moteur de recherche ?', |
||||
'precisions_pour_type' => 'Afficher une saisie de type :', |
||||
'precisions_pour_traitements' => 'Appliquer automatiquement un traitement |
||||
pour la balise #NOM_DU_CHAMP résultante :', |
||||
//R |
||||
'radio_traitements_aucun' => 'Aucun', |
||||
'radio_traitements_typo' => 'Traitements de typographie uniquement (typo)', |
||||
'radio_traitements_raccourcis' => 'Traitements des raccourcis SPIP (propre)', |
||||
//S |
||||
'saisies_champs_extras' => 'De «Champs Extras»', |
||||
'saisies_saisies' => 'De «Saisies»', |
||||
'supprimer_reelement' => 'Supprimer ce champ ?', |
||||
//T |
||||
'titre_page_iextras' => 'Champs Extras', |
||||
'titre_iextras' => 'Champs Extras', |
||||
|
||||
//V |
||||
'veuillez_renseigner_ce_champ' => 'Veuillez renseigner ce champ !', |
||||
); |
||||
?> |
@ -0,0 +1,91 @@
|
||||
<?php |
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
$GLOBALS[$GLOBALS['idx_lang']] = array( |
||||
//A |
||||
'action_associer' => 'gestisci questo campo', |
||||
'action_associer_title' => 'Gestisci della visualizzazione di questo campo extra', |
||||
'action_desassocier' => 'disassocia', |
||||
'action_desassocier_title' => 'Non gestire la visualizzazione di questo campo extra', |
||||
'action_descendre' => 'sposta giù', |
||||
'action_descendre_title' => 'Sposta il campo verso il basso', |
||||
'action_modifier' => 'modifica', |
||||
'action_modifier_title' => 'Modifica i parametri del campo extra', |
||||
'action_monter' => 'sposta su', |
||||
'action_monter_title' => 'Sposta il campo verso l\'alto', |
||||
'action_supprimer' => 'elimina', |
||||
'action_supprimer_title' => 'Elimina totalmente il campo dal database', |
||||
//C |
||||
'caracteres_interdits' => 'Alcuni caratteri utilizzati non sono compatibili con questo campo.', |
||||
'caracteres_autorises_champ' => 'Caratteri possibili: lettere senza accento, cifre, - e _', |
||||
'champs_extras' => 'Campi Extra', |
||||
'champ_sauvegarde' => 'Campo extra salvato!', |
||||
'champ_deja_existant' => 'Un campo con lo stesso nome già esiste per questa tabella.', |
||||
//E |
||||
'erreur_action' => 'Azione @action@ sconosciuta.', |
||||
'erreur_enregistrement_champ' => 'Problema di creazione del campo extra.', |
||||
//I |
||||
'icone_creer_champ_extra' => 'Crea un nuovo campo extra', |
||||
'info_modifier_champ_extra' => 'Modifica il campo extra', |
||||
'info_nouveau_champ_extra' => 'Nuovo campo extra', |
||||
'info_description_champ_extra' => "Questa pagina consente di gestire i campi extra, |
||||
e cioè dei campi supplementari all'interno delle tabelle di SPIP, |
||||
gestiti dai form di modifica e creazione.", |
||||
'info_description_champ_extra_creer' => "Puoi creare dei nuovi campi che verranno quindi visualizzati |
||||
su questa pagina, nel riquadro \"Lista dei campi extra\", oltre che nei form.", |
||||
'info_description_champ_extra_presents' => "Infine, se dei campi già esistono nel database, |
||||
ma non sono dichiarati (da parte di un plugin o di modelli), puoi |
||||
scegliere di farli gestire a questo plugin. Questi campi, qualora rilevati, |
||||
verranno mostrati nel riquadro \"Lista dei campi presenti e non gestiti\".", |
||||
|
||||
//L |
||||
'label_champ' => 'Nome del campo', |
||||
'label_class' => 'Classi CSS', |
||||
'label_li_class' => 'Classi CSS dell\'<li> padre', |
||||
'label_enum' => 'Lista dei valori', |
||||
'label_label' => 'Etichetta di inserimento', |
||||
'label_obligatoire' => 'Campo obbligatorio?', |
||||
'label_explication' => 'Istruzioni di inserimento', |
||||
'label_attention' => 'Istruzioni importanti', |
||||
'label_rechercher' => 'Ricerca', |
||||
'label_sql' => 'Definizione SQL', |
||||
'label_table' => 'Oggetto', |
||||
'label_traitements' => 'Trattamenti automatici', |
||||
'label_type' => 'Tipo di campo', |
||||
'legend_declaration' => 'Dichiarazione', |
||||
'legend_options_techniques' => 'Opzioni tecniche', |
||||
'legend_options_saisies' => 'Opzioni di inserimento', |
||||
'liste_des_extras' => 'Lista dei campi extra', |
||||
'liste_des_extras_possibles' => 'Lista dei campi presenti e non gestiti', |
||||
//P |
||||
'precisions_pour_class' => 'Aggiungi delle classi CSS all\'elemento, |
||||
separate da uno spazio. Esempio: "inserer_barre_edition" per un riquadro |
||||
con il plugin Porte Plume', |
||||
'precisions_pour_li_class' => 'Aggiungi delle classi CSS all\'elemento <li> padre, |
||||
separate da uno spazio. Esempio: "haut" per avere tutta la larghezza del form', |
||||
'precisions_pour_enum' => 'Alcuni tipi di campi richiedono una lista di valori accettati: indicane una per riga, seguito da una virgola e da una descrizione. Una riga vuota per il valore predefinito. La descrizione può essere un stringa di traduzione.', |
||||
'precisions_pour_label' => 'Può essere una stringa di traduzione «plugin:stringa».', |
||||
'precisions_pour_explication' => 'Puoi fornire più informazioni riguardanti l\'inserimento. |
||||
Può essere una stringa di traduzione «plugin:stringa».', |
||||
'precisions_pour_attention' => 'Per indicare un\'informazione importante. |
||||
Utilizzare con moderazione!! |
||||
Può essere una stringa di traduzione «plugin:stringa».', |
||||
'precisions_pour_rechercher' => 'Includere questo campo nel motore di ricerca?', |
||||
'precisions_pour_type' => 'Mostra un campo di tipo:', |
||||
'precisions_pour_traitements' => 'Applica automaticamente un trattamento |
||||
per il segnaposto #NOME_DEL_CAMPO:', |
||||
//R |
||||
'radio_traitements_aucun' => 'Nessuno', |
||||
'radio_traitements_typo' => 'Solo trattamento tipografico (typo)', |
||||
'radio_traitements_raccourcis' => 'Trattamento delle scorciatoie di SPIP (propre)', |
||||
//S |
||||
'saisies_champs_extras' => 'Dei «Campi Extra»', |
||||
'saisies_saisies' => 'De «Saisies»', |
||||
'supprimer_reelement' => 'Elimina questo campo?', |
||||
//T |
||||
'titre_page_iextras' => 'Campi Extra', |
||||
'titre_iextras' => 'Campi Extra', |
||||
|
||||
//V |
||||
'veuillez_renseigner_ce_champ' => 'Si prega di compilare questo campo!', |
||||
); |
||||
?> |
@ -0,0 +1,55 @@
|
||||
<plugin> |
||||
<nom> |
||||
<multi> |
||||
[fr]Interface pour Champs Extras |
||||
[en]Interface for Extra fields |
||||
[it]Interfaccia per i Campi Extra |
||||
</multi> |
||||
</nom> |
||||
<slogan> |
||||
<multi> |
||||
[fr]Interface de gestion des champs extras dans l'espace privé |
||||
[en]Interface to manage the extra fields on SPIP objects |
||||
[it]Interfaccia per gestire i campi extra. |
||||
</multi> |
||||
</slogan> |
||||
<auteur>Matthieu Marcillaud, Fil</auteur> |
||||
<licence>GNU/GPL</licence> |
||||
<version>1.3.0</version> |
||||
<icon>images/iextras-64.png</icon> |
||||
<description> |
||||
<multi> |
||||
[fr]Pour le bon fonctionnement du plugin champs extras 2 et sa visualisation dans l’espace privé, il faut mettre en place ce plugin. |
||||
[en]For the proper functioning of the extra fields plugin 2 and its visualization in the private space, it is necessary to implement this plugin. |
||||
[it]Interfaccia per gestire i campi extra. |
||||
</multi> |
||||
</description> |
||||
<etat>dev</etat> |
||||
<prefix>iextras</prefix> |
||||
<lien>http://contrib.spip.net/Champs-Extras-2-Interface</lien> |
||||
|
||||
<necessite id="SPIP" version="[2.0.0;2.1.99]" /> |
||||
<necessite id="cextras" version="[1.10.0;]" /> |
||||
<necessite id="spip_bonux" version="[2.0.0;]" /> |
||||
<necessite id="saisies" version="[1.13.0;]" /> |
||||
|
||||
<pipeline> |
||||
<nom>declarer_champs_extras</nom> |
||||
<inclure>base/iextras.php</inclure> |
||||
</pipeline> |
||||
<pipeline> |
||||
<nom>autoriser</nom> |
||||
<inclure>inc/iextras_autoriser.php</inclure> |
||||
</pipeline> |
||||
|
||||
<onglet id='iextras' parent='configuration'> |
||||
<icone>images/iextras-24.png</icone> |
||||
<titre>iextras:champs_extras</titre> |
||||
</onglet> |
||||
|
||||
<bouton id='iextras' parent='bando_configuration'> |
||||
<icone>images/iextras-16.png</icone> |
||||
<titre>iextras:champs_extras</titre> |
||||
</bouton> |
||||
<categorie>outil</categorie> |
||||
</plugin> |
@ -0,0 +1,38 @@
|
||||
<BOUCLE_si_extras(CONDITION){si #ENV{extras}}> |
||||
[(#CHEMIN{images/iextras-24.png}|debut_cadre_trait_couleur{1, "", <:iextras:liste_des_extras:>})] |
||||
<BOUCLE_tables(POUR){tableau #ENV**{extras}}> |
||||
<h2>[(#ENV**{noms_tables}|table_valeur{#CLE}|table_valeur{nom})]</h2> |
||||
<B_extras> |
||||
<ul class="liste_extras"> |
||||
<BOUCLE_extras(POUR){tableau #VALEUR}> |
||||
<li> |
||||
[(#VALEUR|table_valeur{champ})] |
||||
[<small>— (#VALEUR|table_valeur{label}|_TT)</small>] |
||||
[(type: <tt>(#VALEUR|table_valeur{type})</tt>)] |
||||
<ul class="actions"> |
||||
[(#TOTAL_BOUCLE|>{1}|oui) |
||||
[(#COMPTEUR_BOUCLE|!={1}|oui) |
||||
<li><a href="[(#URL_ACTION_AUTEUR{iextras, [monter_extra/(#VALEUR|table_valeur{extra_id})], #SELF})]" title="<:iextras:action_monter_title|attribut_html:>"><:iextras:action_monter:></a></li> |
||||
] |
||||
[(#COMPTEUR_BOUCLE|!=={#TOTAL_BOUCLE}|oui) |
||||
<li><a href="[(#URL_ACTION_AUTEUR{iextras, [descendre_extra/(#VALEUR|table_valeur{extra_id})], #SELF})]" title="<:iextras:action_descendre_title|attribut_html:>"><:iextras:action_descendre:></a></li> |
||||
] |
||||
] |
||||
<li><a href="[(#ENV{url_edit_extra}|sinon{#URL_ECRIRE{iextras_edit}}|parametre_url{extra_id,#VALEUR|table_valeur{extra_id}})]" title="<:iextras:action_modifier_title|attribut_html:>"><:iextras:action_modifier:></a></li> |
||||
<li><a href="[(#URL_ACTION_AUTEUR{iextras, [desassocier_extra/(#VALEUR|table_valeur{extra_id})], #SELF})]" title="<:iextras:action_desassocier_title|attribut_html:>"><:iextras:action_desassocier:></a></li> |
||||
<li><a href="[(#URL_ACTION_AUTEUR{iextras, [supprimer_extra/(#VALEUR|table_valeur{extra_id})], #SELF})]" class="supprimer" title="<:iextras:action_supprimer_title|attribut_html:>"><:iextras:action_supprimer:></a></li> |
||||
</ul> |
||||
</li> |
||||
</BOUCLE_extras> |
||||
</ul> |
||||
</B_extras> |
||||
</BOUCLE_tables> |
||||
[(#VAL{1}|fin_cadre_trait_couleur)] |
||||
<script type="text/javascript"> |
||||
(function($) { |
||||
$('ul.liste_extras .supprimer').click(function(){ |
||||
return confirm("<:iextras:supprimer_reelement|attribut_html:>"); |
||||
}); |
||||
})(jQuery); |
||||
</script> |
||||
</BOUCLE_si_extras> |
@ -0,0 +1,27 @@
|
||||
<BOUCLE_si_extras(CONDITION){si #ENV{extras}}> |
||||
[(#CHEMIN{images/iextras-24.png}|debut_cadre_trait_couleur{1, "", <:iextras:liste_des_extras_possibles:>})] |
||||
<BOUCLE_tables(POUR){tableau #ENV**{extras}}> |
||||
<h2>[(#ENV**{noms_tables}|table_valeur{#CLE|replace{^spip_|s$,''}}|table_valeur{nom})]</h2> |
||||
<B_extras> |
||||
<ul class="liste_extras_possibles"> |
||||
<BOUCLE_extras(POUR){tableau #VALEUR}> |
||||
<li> |
||||
#CLE |
||||
<ul class="actions"> |
||||
<li><a href="[(#URL_ACTION_AUTEUR{iextras, [associer_champ/#_tables:CLE/(#CLE)], #SELF})]" title="<:iextras:action_associer_title|attribut_html:>"><:iextras:action_associer:></a></li> |
||||
<li><a href="[(#URL_ACTION_AUTEUR{iextras, [supprimer_champ/#_tables:CLE/(#CLE)], #SELF})]" class="supprimer" title="<:iextras:action_supprimer_title|attribut_html:>"><:iextras:action_supprimer:></a></li> |
||||
</ul> |
||||
</li> |
||||
</BOUCLE_extras> |
||||
</ul> |
||||
</B_extras> |
||||
</BOUCLE_tables> |
||||
<script type="text/javascript"> |
||||
(function($) { |
||||
$('ul.liste_extras_possibles .supprimer').click(function(){ |
||||
return confirm("<:iextras:supprimer_reelement|attribut_html:>"); |
||||
}); |
||||
})(jQuery); |
||||
</script> |
||||
[(#VAL{1}|fin_cadre_trait_couleur)] |
||||
</BOUCLE_si_extras> |
@ -0,0 +1,8 @@
|
||||
<div class='cadre-formulaire-editer'> |
||||
<div class="entete-formulaire"> |
||||
#ENV**{icone_retour} |
||||
[<h1>(#ENV{titre})</h1>] |
||||
</div> |
||||
#FORMULAIRE_EDITER_CHAMP_EXTRA{#ENV{extra_id,new},#ENV{redirect}} |
||||
</div> |
||||
|
@ -0,0 +1,3 @@
|
||||
<p><:iextras:info_description_champ_extra:></p> |
||||
<p><:iextras:info_description_champ_extra_creer:></p> |
||||
<p><:iextras:info_description_champ_extra_presents:></p> |
Loading…
Reference in new issue