2 if (!defined("_ECRIRE_INC_VERSION")) return;
5 * Pipeline ieconfig pour l'import/export de configuration
10 function noizetier_ieconfig($flux){
11 $action = $flux['args']['action'];
13 // Formulaire d'export
14 if ($action=='form_export') {
17 'saisie' => 'fieldset',
19 'nom' => 'noizetier_export',
20 'label' => '<:noizetier:editer_noizetier_titre:>',
21 'icone' => 'img/noizetier-24.png'
25 'saisie' => 'explication',
27 'nom' => 'noizetier_export_explication',
28 'texte' => '<:noizetier:ieconfig_noizetier_export_explication:>'
32 'saisie' => 'oui_non',
34 'nom' => 'noizetier_export_option',
35 'label' => '<:noizetier:ieconfig_noizetier_export_option:>',
42 $flux['data'] = array_merge($flux['data'],$saisies);
46 if ($action=='export' && _request('noizetier_export_option')=='on') {
47 include_spip('inc/noizetier');
48 $flux['data']['noizetier'] = noizetier_tableau_export();
51 // Formulaire d'import
52 if ($action=='form_import' && isset($flux['args']['config']['noizetier'])) {
53 $texte_explication = '';
54 if (isset($flux['args']['config']['noizetier']['noisettes'])) {
55 $texte_explication .= _T('noizetier:formulaire_liste_pages_config');
57 foreach($flux['args']['config']['noizetier']['noisettes'] as $noisette)
58 $pages[] = $noisette['type'].'-'.$noisette['composition'];
59 $pages = array_unique($pages);
60 foreach ($pages as $page)
61 $texte_explication .= '<br />» '.rtrim($page,'-');
63 if (isset($flux['args']['config']['noizetier']['noizetier_compositions'])) {
64 $texte_explication .= '<br />'._T('noizetier:formulaire_liste_compos_config');
65 foreach($flux['args']['config']['noizetier']['noizetier_compositions'] as $type => $compositions)
66 foreach ($compositions as $composition => $compo)
67 $texte_explication .= '<br />» '.$type.'-'.$composition;
69 if (isset($flux['args']['config']['noizetier']['noizetier_compositions'])) {
72 'saisie' => 'fieldset',
74 'nom' => 'noizetier_export',
75 'label' => '<:noizetier:editer_noizetier_titre:>',
76 'icone' => 'img/noizetier-24.png'
80 'saisie' => 'explication',
82 'nom' => 'noizetier_export_explication',
83 'texte' => $texte_explication
87 'saisie' => 'selection',
89 'nom' => 'noizetier_type_import',
90 'label' => '<:noizetier:formulaire_type_import:>',
91 'explication' => '<:noizetier:formulaire_type_import_explication:>',
93 'option_intro' => '<:noizetier:ieconfig_ne_pas_importer:>',
95 'fusion' => '<:noizetier:formulaire_import_fusion:>',
96 'remplacer' => '<:noizetier:formulaire_import_remplacer:>'
101 'saisie' => 'selection',
103 'nom' => 'noizetier_import_compos',
104 'label' => '<:noizetier:formulaire_import_compos:>',
106 'cacher_option_intro' => 'oui',
108 'oui' => '<:noizetier:oui:>',
109 'non' => '<:noizetier:non:>'
119 'saisie' => 'fieldset',
121 'nom' => 'noizetier_export',
122 'label' => '<:noizetier:editer_noizetier_titre:>',
123 'icone' => 'img/noizetier-24.png'
127 'saisie' => 'explication',
129 'nom' => 'noizetier_export_explication',
130 'texte' => $texte_explication
134 'saisie' => 'selection',
136 'nom' => 'noizetier_type_import',
137 'label' => '<:noizetier:formulaire_type_import:>',
138 'explication' => '<:noizetier:formulaire_type_import_explication:>',
140 'option_intro' => '<:noizetier:ieconfig_ne_pas_importer:>',
142 'fusion' => '<:noizetier:formulaire_import_fusion:>',
143 'remplacer' => '<:noizetier:formulaire_import_remplacer:>'
148 'saisie' => 'hidden',
150 'nom' => 'noizetier_import_compos',
158 $flux['data'] = array_merge($flux['data'],$saisies);
161 // Import de la configuration
162 if ($action=='import' && isset($flux['args']['config']['noizetier']) && _request('noizetier_type_import')!='') {
163 include_spip('inc/noizetier');
164 if (!noizetier_importer_configuration(_request('noizetier_type_import'),_request('noizetier_import_compos'),$flux['args']['config']['noizetier']))
165 $flux['data'] .= _T('noizetier:ieconfig_probleme_import_config').'<br />';