1 | <?php |
---|
2 | |
---|
3 | // Sécurité |
---|
4 | if (!defined("_ECRIRE_INC_VERSION")) return; |
---|
5 | |
---|
6 | // On déclare le formulaire pour éditer un formulaire |
---|
7 | $GLOBALS['formulaires']['editer_formulaire'] = array( |
---|
8 | array( |
---|
9 | 'saisie' => 'input', |
---|
10 | 'options' => array( |
---|
11 | 'nom' => 'titre', |
---|
12 | 'label' => '<:formidable:editer_titre:>', |
---|
13 | 'obligatoire' => 'oui', |
---|
14 | 'class' => 'multilang' |
---|
15 | ) |
---|
16 | ), |
---|
17 | array( |
---|
18 | 'saisie' => 'input', |
---|
19 | 'options' => array( |
---|
20 | 'nom' => 'identifiant', |
---|
21 | 'label' => '<:formidable:editer_identifiant:>', |
---|
22 | 'explication' => '<:formidable:editer_identifiant_explication:>', |
---|
23 | 'obligatoire' => 'oui' |
---|
24 | ), |
---|
25 | 'verifier' => array( |
---|
26 | 'type' => 'regex', |
---|
27 | 'options' => array( |
---|
28 | 'modele' => '/^[\w]+$/' |
---|
29 | ) |
---|
30 | ) |
---|
31 | ), |
---|
32 | array( |
---|
33 | 'saisie' => 'textarea', |
---|
34 | 'options' => array( |
---|
35 | 'nom' => 'message_retour', |
---|
36 | 'label' => '<:formidable:editer_message_ok:>', |
---|
37 | 'explication' => '<:formidable:editer_message_ok_explication:>', |
---|
38 | 'rows' => 5, |
---|
39 | 'li_class' => 'editer_texte', |
---|
40 | 'class' => 'multilang' |
---|
41 | ) |
---|
42 | ), |
---|
43 | array( |
---|
44 | 'saisie' => 'textarea', |
---|
45 | 'options' => array( |
---|
46 | 'nom' => 'descriptif', |
---|
47 | 'label' => '<:formidable:editer_descriptif:>', |
---|
48 | 'explication' => '<:formidable:editer_descriptif_explication:>', |
---|
49 | 'rows' => 5, |
---|
50 | 'class' => 'multilang' |
---|
51 | ) |
---|
52 | ), |
---|
53 | array( |
---|
54 | 'saisie' => 'selection', |
---|
55 | 'options' => array( |
---|
56 | 'nom' => 'apres', |
---|
57 | 'label' => '<:formidable:editer_apres_label:>', |
---|
58 | 'explication' => '<:formidable:editer_apres_explication:>', |
---|
59 | 'datas' => array( |
---|
60 | 'formulaire' => _T('formidable:editer_apres_choix_formulaire'), |
---|
61 | 'valeurs' => _T('formidable:editer_apres_choix_valeurs'), |
---|
62 | 'rien' => _T('formidable:editer_apres_choix_rien'), |
---|
63 | 'redirige' => _T('formidable:editer_apres_choix_redirige'), |
---|
64 | ), |
---|
65 | 'defaut' => 'formulaire', |
---|
66 | 'cacher_option_intro' => 'on' |
---|
67 | ) |
---|
68 | ), |
---|
69 | array( |
---|
70 | 'saisie' => 'input', |
---|
71 | 'options' => array( |
---|
72 | 'nom' => 'url_redirect', |
---|
73 | 'label' => '<:formidable:editer_redirige_url:>', |
---|
74 | 'explication' => '<:formidable:editer_redirige_url_explication:>', |
---|
75 | 'obligatoire' => 'non' |
---|
76 | ) |
---|
77 | ) |
---|
78 | ); |
---|
79 | |
---|
80 | function puce_statut_formulaires_reponse_dist($id, $statut, $id_rubrique, $type='formulaires_reponse', $ajax=false){ |
---|
81 | global $lang_objet; |
---|
82 | |
---|
83 | static $coord = array( |
---|
84 | 'publie' => 1, |
---|
85 | 'prop' => 0, |
---|
86 | 'poubelle' => 2 |
---|
87 | ); |
---|
88 | |
---|
89 | $lang_dir = lang_dir($lang_objet); |
---|
90 | $ajax_node = " id='imgstatut$type$id'"; |
---|
91 | $inser_puce = puce_statut($statut, " width='9' height='9' style='margin: 1px;'$ajax_node"); |
---|
92 | |
---|
93 | if (!autoriser('instituer', 'formulaires_reponse', $id) |
---|
94 | or !_ACTIVER_PUCE_RAPIDE |
---|
95 | ) |
---|
96 | return $inser_puce; |
---|
97 | |
---|
98 | $titles = array( |
---|
99 | "orange" => _T('texte_statut_propose_evaluation'), |
---|
100 | "verte" => _T('texte_statut_publie'), |
---|
101 | "poubelle" => _T('texte_statut_poubelle') |
---|
102 | ); |
---|
103 | |
---|
104 | $clip = 1 + (11 * $coord[$statut]); |
---|
105 | |
---|
106 | if ($ajax){ |
---|
107 | return "<span class='puce_article_fixe'>" |
---|
108 | . $inser_puce |
---|
109 | . "</span>" |
---|
110 | . "<span class='puce_article_popup' id='statutdecal$type$id' style='width:33px; margin-left: -$clip"."px;'>" |
---|
111 | . afficher_script_statut($id, $type, -1, 'puce-orange.gif', 'prop', $titles['orange']) |
---|
112 | . afficher_script_statut($id, $type, -12, 'puce-verte.gif', 'publie', $titles['verte']) |
---|
113 | . afficher_script_statut($id, $type, -23, 'puce-poubelle.gif', 'poubelle', $titles['poubelle']) |
---|
114 | . "</span>"; |
---|
115 | } |
---|
116 | |
---|
117 | $nom = "puce_statut_"; |
---|
118 | |
---|
119 | if ((! _SPIP_AJAX) AND $type != 'formulaires_reponse') |
---|
120 | $over =''; |
---|
121 | else { |
---|
122 | $action = generer_url_ecrire('puce_statut_formulaires',"",true); |
---|
123 | $action = "if (!this.puce_loaded) { this.puce_loaded = true; prepare_selec_statut('$nom', '$type', '$id', '$action'); }"; |
---|
124 | $over = "\nonmouseover=\"$action\""; |
---|
125 | } |
---|
126 | |
---|
127 | return "<span class='puce_article' id='$nom$type$id' dir='$lang_dir'$over>" |
---|
128 | . $inser_puce |
---|
129 | . '</span>'; |
---|
130 | } |
---|
131 | |
---|
132 | if (!function_exists('array_fill_keys')){ |
---|
133 | function array_fill_keys($keys, $value){ |
---|
134 | array_combine($keys,array_fill(0,count($keys),$value)); |
---|
135 | } |
---|
136 | } |
---|
137 | |
---|
138 | ?> |
---|