Projet

Général

Profil

category.tpl.php

Alexandre Boucher, 11/09/2013 13:51

 
1
<?php
2
// +-------------------------------------------------+
3
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
4
// +-------------------------------------------------+
5
// $Id: category.tpl.php,v 1.39 2013-02-20 14:35:01 ngantier Exp $
6

    
7
if (stristr($_SERVER['REQUEST_URI'], ".tpl.php")) die("no access");
8

    
9
// templates pour la gestion des catégories
10
require_once("$base_path/javascript/misc.inc.php");
11
require_once("$include_path/misc.inc.php"); 
12

    
13
// $categ_browser : template du browser de catégories
14
$categ_browser = "
15

16
<br />
17
<div class='row'>
18
        !!browser_top!!
19
        !!browser_header!!<hr />
20
</div>
21
<div class='row'>
22
        <table border='0'>
23
                !!browser_content!!
24
        </table>
25
</div>";
26

    
27
// $category_form : template du form de catégories
28
$selector_prop = "dependent=yes, width=$selector_x_size, height=$selector_y_size, resizable=1, scrollbars=yes, resizable=yes";
29
$select_categ_prop = "scrollbars=yes, location=no, toolbar=no, dependent=yes, resizable=yes";
30
$category_form = jscript_unload_question()."
31
<script type='text/javascript'>
32
<!--
33
        function test_form(form)
34
        {
35
                if(document.getElementById('category_libelle_defaut').value.replace(/^\s+|\s+$/g, '').length == 0)
36
                        {
37
                                var msg = \"$msg[thes_libelle_categ_ref_manquant]\"+\"\\n!!lang_def_js!!\";
38
                                alert(msg);
39
                                return false;
40
                        }
41
                unload_off();
42
                return true;
43
        }
44
        
45
function confirm_delete() {
46
        result = confirm(\"${msg[confirm_suppr]}\");
47
        if(result) {
48
                unload_off();
49
            document.location='./autorites.php?categ=categories&sub=delete&parent=!!parent!!&id=!!id!!';
50
                } else
51
            document.forms['categ_form'].elements['category_libelle!!lang_def_cle!!'].focus();
52
    }
53
-->
54
</script>
55
<form class='form-$current_module' id='categ_form' name='categ_form' method='post' action='!!action!!'>
56
<h3>!!form_title!!</h3>
57
<div class='form-contenu'>
58

59
        <!-- libelle defaut -->
60
        <div class='row'>
61
                <label class='etiquette' >".htmlentities($msg[103], ENT_QUOTES, $charset)."</label><label class='etiquette'>!!lang_def!!</label>
62
                <!-- bt_lib_trad -->
63
        </div>
64
        <div class='row'>
65
                <div class='colonne2'>
66
                        <input type='text' class='saisie-80em' id='category_libelle_defaut' name='category_libelle!!lang_def_cle!!' value=\"!!lang_def_libelle!!\" />
67
                </div>
68
                <div class='colonne2'>
69
                        <label class='etiquette'>".htmlentities($msg[not_use_in_indexation], ENT_QUOTES, $charset)."</label><input type=\"checkbox\" id=\"not_use_in_indexation\"  name=\"not_use_in_indexation\" value='1' !!not_use_in_indexation!! />
70
                </div>
71
        </div>
72
        <!--        libelle traductions-->
73
        <div id='lib_trad' class='form-$current_module' style='display:none' >
74
                !!c_libelle_trad!!
75
        </div>
76
        
77
        <div class='row'>
78
                <!--        note application defaut -->
79
                <div class='colonne2'>
80
                        <label class='etiquette'>".htmlentities($msg[categ_na], ENT_QUOTES, $charset)."</label><label class='etiquette'>!!lang_def!!</label>
81
                </div>
82
        
83
                <!--        commentaire defaut -->
84
                <div class='colonne_suite'>
85
                        <label class='etiquette'>".htmlentities($msg[categ_commentaire], ENT_QUOTES, $charset)."</label><label class='etiquette'>!!lang_def!!</label>
86
                        <!-- bt_cm_na_trad -->
87
                </div>
88
        
89
        </div>
90
        
91
        <div class='row'>
92
                <!-- note application defaut -->
93
                <div class='colonne2'>
94
                        <textarea class='saisie-50em' id='category_na' name='category_na!!lang_def_cle!!' cols='40' rows='2' wrap='virtual'>!!lang_def_na!!</textarea>
95
                </div>
96
                <!-- commentaire defaut -->
97
                <div class='colonne_suite'>
98
                        <textarea class='saisie-50em' id='category_comment' name='category_cm!!lang_def_cle!!' cols='40' rows='2' wrap='virtual'>!!lang_def_cm!!</textarea>
99
                </div>
100
        </div>
101
        
102
        <div id='cm_na_trad' class='row' style='display:none' >
103
                <!--note application et commentaire traductions -->
104
                !!cm_na_trad!!
105
        </div>
106
        
107
        <!--categ_parent -->
108
        <!-- renvoivoir -->
109
        <!-- renvoivoiraussi -->
110
        <!-- liaison -->
111
        !!aut_pperso!!
112
        <div class='row'>
113
                <div class='left'>
114
                        <div class='row'>
115
                                <label class='etiquette' >".htmlentities($msg[categ_num_aut], ENT_QUOTES, $charset)."</label>
116
                        </div>
117
                        <div class='row'>
118
                                <!-- numero_autorite -->
119
                        </div>
120
                        <div class='row'>
121
                                <label class='etiquette' for='authority_import_denied'>".$msg['authority_import_denied']."</label> &nbsp;
122
                                <input type='checkbox' id='authority_import_denied' name='authority_import_denied' value='1' !!authority_import_denied!!/>
123
                        </div>
124
                </div>
125
                <div class='right'>
126
                        <!-- imprimer_thesaurus -->
127
                </div>
128
        </div>
129
        <!-- aut_link -->
130
        <div class='row'>
131
        </div>
132
</div>
133

134
<!--boutons        -->
135
<div class='row'>
136
        <div class='left'>
137
                <input type='button' class='bouton' value='$msg[76]' onClick=\"unload_off();document.location='./autorites.php?categ=categories&sub=&parent=!!id_parent!!'\" />
138
                <input type='submit' class='bouton' value='$msg[77]' onClick=\"return test_form(this.form)\" />
139
                <!-- remplace_categ -->
140
                !!voir_notices!!
141
        </div>
142
        <div class='right'>
143
                <!-- delete_button -->
144
        </div>
145
</div>
146
<div class='row'></div>
147
</form>
148
<script type='text/javascript'>
149
        document.forms['categ_form'].elements['category_libelle!!lang_def_cle!!'].focus();
150

151
        function bascule_trad(item) {
152
                var elt = document.getElementById(item);
153
                if (elt.style.display == 'none') elt.style.display = ''; else elt.style.display = 'none'; 
154
        }
155
</script>";
156

    
157
$select_categ_prop = "scrollbars=yes, toolbar=no, dependent=yes, resizable=yes";
158

    
159
$add_see_also="
160
<script>
161
        function fonction_selecteur_categ() {
162
                name=this.getAttribute('id').substring(4);
163
                name_id = name.substr(0,7)+'_id'+name.substr(7);
164
                openPopUp('./select.php?what=categorie&caller=categ_form&p1='+name_id+'&p2='+name+'&dyn=1', 'select_categ', 700, 500, -2, -2, '$select_categ_prop');
165
        }
166
        function fonction_raz_categ() {
167
                name=this.getAttribute('id').substring(4);
168
                name_id = name.substr(0,7)+'_id'+name.substr(7);
169
                name_rec = name.substr(0,7)+'_rec'+name.substr(7);
170
                document.getElementById(name_id).value=0;
171
                document.getElementById(name).value='';
172
                document.getElementById(name_rec).checked=false;
173
        }
174
        function add_categ() {
175
                template = document.getElementById('addcateg');
176
                categ=document.createElement('div');
177
                categ.className='row';
178

179
                suffixe = eval('document.categ_form.max_categ.value')
180
                nom_id = 'f_categ'+suffixe
181
                f_categ = document.createElement('input');
182
                f_categ.setAttribute('name',nom_id);
183
                f_categ.setAttribute('id',nom_id);
184
                f_categ.setAttribute('type','text');
185
                f_categ.className='saisie-80emr';
186
                f_categ.setAttribute('readonly','');
187
                f_categ.setAttribute('value','');
188
                
189
                f_categ_rec = document.createElement('input');
190
                f_categ_rec.name = 'f_categ_rec'+suffixe;
191
                f_categ_rec.setAttribute('id','f_categ_rec'+suffixe);
192
                f_categ_rec.setAttribute('type','checkbox');
193
                f_categ_rec.setAttribute('value','1');                
194

195
                del_f_categ = document.createElement('input');
196
                del_f_categ.setAttribute('id','del_f_categ'+suffixe);
197
                del_f_categ.onclick=fonction_raz_categ;
198
                del_f_categ.setAttribute('type','button');
199
                del_f_categ.className='bouton_small';
200
                del_f_categ.setAttribute('readonly','');
201
                del_f_categ.setAttribute('value','$msg[raz]');
202
                
203
                f_categ_id = document.createElement('input');
204
                f_categ_id.name='f_categ_id'+suffixe;
205
                f_categ_id.setAttribute('type','hidden');
206
                f_categ_id.setAttribute('id','f_categ_id'+suffixe);
207
                f_categ_id.setAttribute('value','');
208
                
209
                categ.appendChild(f_categ);
210
                space=document.createTextNode(' ');
211
                categ.appendChild(space);
212
                categ.appendChild(f_categ_rec);
213
                categ.appendChild(space);
214
                categ.appendChild(del_f_categ);
215
                categ.appendChild(f_categ_id);
216

217
                template.appendChild(categ);
218
                
219
                if(document.getElementById('tab_categ_order')) {
220
                        tab_categ_order = document.getElementById('tab_categ_order');
221
                        if (tab_categ_order.value != '') tab_categ_order.value += ','+suffixe;
222
                }
223

224
                document.categ_form.max_categ.value=suffixe*1+1*1 ;
225
        }
226
</script>";
227
        
228
$categ0 = "
229
        <div class='row'>
230
                <input type='text' class='saisie-80emr' id='f_categ!!icateg!!' name='f_categ!!icateg!!' readonly value=\"!!categ_libelle!!\" /><input type='checkbox' id='f_categ_rec!!icateg!!' name='f_categ_rec!!icateg!!' !!chk!! />
231
                <input type='button' class='bouton_small' value='$msg[parcourir]' onclick=\"openPopUp('./select.php?what=categorie&caller=categ_form&p1=f_categ_id!!icateg!!&p2=f_categ!!icateg!!&dyn=1&parent=!!parent!!&id2=!!id!!', 'select_categ', 700, 500, -2, -2, '$select_categ_prop')\" />
232
                <input type='button' class='bouton_small' value='$msg[raz]' onclick=\"this.form.f_categ!!icateg!!.value=''; this.form.f_categ_id!!icateg!!.value='0'; this.form.f_categ_rec!!icateg!!.checked=false; \" />
233
                <input type='hidden' name='f_categ_id!!icateg!!' id='f_categ_id!!icateg!!' value='!!categ_id!!' /><input type='button' class='bouton_small' value='+' onClick=\"add_categ();\"/>
234
        </div>";
235
        
236
$categ1 = "
237
        <div class='row'>
238
                <input type='text' class='saisie-80emr' id='f_categ!!icateg!!' name='f_categ!!icateg!!' readonly value=\"!!categ_libelle!!\" /><input type='checkbox' id='f_categ_rec!!icateg!!' name='f_categ_rec!!icateg!!' !!chk!! />&nbsp;<input type='button' class='bouton_small' value='$msg[raz]' onclick=\"this.form.f_categ!!icateg!!.value=''; this.form.f_categ_id!!icateg!!.value='0'; \" /><input type='hidden' name='f_categ_id!!icateg!!' id='f_categ_id!!icateg!!' value='!!categ_id!!' />
239
        </div>";
240

    
241
$form_categ_parent = "
242
        <div class='row'>
243
                <label class='etiquette' for='form_categparent'>".htmlentities($msg[categ_parent], ENT_QUOTES, $charset)."</label>
244
        </div>
245
        <div class='row'>
246
                <input type='text' class='saisie-80emr' name='category_parent' readonly value=\"!!parent_libelle!!\" />
247
                <input type='button' class='bouton_small' onclick=\"openPopUp('./select.php?what=categorie&caller=categ_form&p1=category_parent_id&p2=category_parent&keep_tilde=1&parent=!!parent!!&id2='+document.categ_form.category_parent_id.value, 'select_categ', 700, 500, -2, -2, '$select_categ_prop')\" title='$msg[157]' value='$msg[parcourir]' />
248
                <input type='button' class='bouton_small' value='$msg[raz]' onclick=\"this.form.category_parent.value=''; this.form.category_parent_id.value='0'; \" />                
249
                <input type='hidden' name='category_parent_id' value='!!parent_value!!' />
250
        </div>";
251

    
252
$form_renvoivoir = "
253
        <div class='row'>
254
                <label class='etiquette' for='form_renvoivoir'>".htmlentities($msg[categ_renvoi], ENT_QUOTES, $charset)."</label>
255
        </div>
256
        <div class='row'>
257
                <input type='text' class='saisie-80emr' name='category_voir' size='48' readonly value=\"!!voir_libelle!!\" />
258
                <input type='button' class='bouton_small' onclick=\"openPopUp('./select.php?what=categorie&caller=categ_form&p1=category_voir_id&p2=category_voir&parent=!!parent!!&id2='+document.categ_form.category_voir_id.value, 'select_categ', 700, 500, -2, -2, '$select_categ_prop')\" title='$msg[157]' value='$msg[parcourir]' />
259
                <input type='button' class='bouton_small' value='$msg[raz]' onclick=\"this.form.category_voir.value=''; this.form.category_voir_id.value='0'; \" />                
260
                <input type='hidden' name='category_voir_id' value='!!voir_value!!' />
261
        </div>";
262

    
263
$form_renvoivoiraussi = "
264
        <div class='row'>
265
                <label class='etiquette' for='form_renvoivoir'>".$msg['renvoi_voir_aussi'].$msg['renvoi_reciproque']."</label>
266
        </div>
267
        !!renvoi_voir_aussi!!";
268

    
269
$form_num_aut = "
270
        <input type='text' class='saisie-20em' id='num_aut' name='num_aut' value=\"!!num_aut!!\" />";
271
        
272
// $categ_replace : form remplacement categorie
273
$form_categ_replace = "
274
<script src='javascript/ajax.js'></script>
275
<form class='form-$current_module' name='categ_replace' method='post' action='./autorites.php?categ=categories&sub=categ_replace&id=!!id!!&parent=!!parent!!' onSubmit=\"return false\" >
276
<h3>$msg[159] !!old_categ_libelle!! </h3>
277
<div class='form-contenu'>
278
        <div class='row'>
279
                <label class='etiquette' for='par'>".htmlentities($msg[160], ENT_QUOTES, $charset)."</label>
280
        </div>
281
        <div class='row'>
282
                <input type='text' class='saisie-80emr' name='by_libelle' id='by_libelle' value=\"\" completion=\"categories_mul\" autfield=\"by\" />
283
                <input type='button' class='bouton_small' value='$msg[raz]' onclick=\"this.form.by_libelle.value=''; this.form.by.value='0'; \" />
284
                <input type='button' class='bouton_small' onclick=\"openPopUp('./select.php?what=categorie&caller=categ_replace&p1=by&p2=by_libelle&keep_tilde=1&parent=0&deb_rech='+".pmb_escape()."(this.form.by_libelle.value), 'select_categ', 700, 500, -2, -2, '$select_categ_prop')\" value='$msg[parcourir]' />
285
                <input type='hidden' name='by' id='by' value='0'>
286
        </div>
287
        <div class='row'>                
288
                <input id='aut_link_save' name='aut_link_save' type='checkbox'  value='1'>".$msg["aut_replace_link_save"]."
289
        </div>        
290
</div>
291
<div class='row'>
292
        <input type='button' class='bouton' value='$msg[76]' onClick=\"document.location='./autorites.php?categ=categories&sub=categ_form&id=!!id!!&parent=!!parent!!';\">
293
        <input type='button' class='bouton' value='$msg[159]' id='btsubmit' onClick=\"this.form.submit();\" >
294
        </div>
295
</form>
296
<script type='text/javascript'>
297
        ajax_parse_dom();
298
        document.forms['categ_replace'].elements['by_libelle'].focus();
299
</script>
300
";
301

    
302
$liaison_tpl = "
303
<div id='el0Parent' class='parent' >
304
        <h3>
305
            <img src='./images/plus.gif' class='img_plus' align='bottom' name='imEx' id='el0Img' title='$msg[categ_links]' border='0' onClick=\"expandBase('el0', true); return false;\" />
306
            $msg[categ_links]
307
    </h3>
308
</div>
309
<div id='el0Child' class='child'>
310
    <!-- categ_child -->
311
    <!-- categ_renvoivoir -->
312
    <!-- categ_renvoivoiraussi -->
313
</div>
314
<div class='row'></div>";
315
   
316
?>