cms_editorial.tpl.php
1 |
<?php
|
---|---|
2 |
// +-------------------------------------------------+
|
3 |
// | 2002-2011 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
|
4 |
// +-------------------------------------------------+
|
5 |
// $Id: cms_editorial.tpl.php,v 1.11 2012-12-26 09:15:47 arenou Exp $
|
6 |
|
7 |
if (stristr($_SERVER['REQUEST_URI'], ".tpl.php")) die("no access"); |
8 |
|
9 |
$cms_editorial_form_tpl = " |
10 |
<form name='!!cms_editorial_form_name!!' class='cms_editorial_form' action='./cms.php?categ=!!type!!&sub=save' id='!!cms_editorial_form_id!!' method='post' !!cms_editorial_form_attr!!>
|
11 |
<h3>!!form_title!!</h3>
|
12 |
<div class='form-contenu'>
|
13 |
<input type='hidden' name='cms_editorial_form_obj_id' id='cms_editorial_form_obj_id' value='!!cms_editorial_form_obj_id!!' />
|
14 |
!!fields!!
|
15 |
<div class='row'> </div>
|
16 |
<hr>
|
17 |
<div id='editorial_type_content_form' dojoType='dojox.layout.ContentPane' href='!!type_href!!'></div>
|
18 |
</div>
|
19 |
<div class='row'>
|
20 |
<div class='left'>
|
21 |
<input type='hidden' name='cms_editorial_form_delete' value='0' />
|
22 |
<input type='submit' class='bouton' value='".$msg['cms_editorial_form_save']."' onclick='load_textareas();document.forms[\"!!cms_editorial_form_name!!\"].cms_editorial_form_delete.value=0;'/> |
23 |
!!cms_editorial_suite!!
|
24 |
</div>
|
25 |
<div class='right'>
|
26 |
!!cms_editorial_form_suppr!!
|
27 |
</div>
|
28 |
</div>
|
29 |
<div class='row'> </div>
|
30 |
</form>
|
31 |
<script type='text/javascript'>
|
32 |
function load_textareas(){
|
33 |
if(document.forms['!!cms_editorial_form_name!!'].cms_editorial_form_resume) document.forms['!!cms_editorial_form_name!!'].cms_editorial_form_resume.value = dijit.byId('cms_editorial_form_resume_form').get('value');
|
34 |
if(document.forms['!!cms_editorial_form_name!!'].cms_editorial_form_contenu) document.forms['!!cms_editorial_form_name!!'].cms_editorial_form_contenu.value = dijit.byId('cms_editorial_form_contenu_form').get('value');
|
35 |
}
|
36 |
</script>";
|
37 |
|
38 |
$cms_editorial_form_del_button_tpl =" |
39 |
<input type='submit' class='bouton' onclick='document.forms[\"!!cms_editorial_form_name!!\"].cms_editorial_form_delete.value=1;document.forms[\"!!cms_editorial_form_name!!\"].action=\"$base_path/cms.php?categ=sections&sub=del\"' value='".$msg['cms_editorial_form_delete']."'/> |
40 |
";
|
41 |
|
42 |
$cms_editorial_parent_field = " |
43 |
<div class='row'>
|
44 |
<div class='colonne'>
|
45 |
<div class='row'>
|
46 |
<label for='cms_editorial_form_parent'>".$msg['cms_editorial_form_parent']."</label> |
47 |
</div>
|
48 |
<div class='row'>
|
49 |
<select name='cms_editorial_form_parent' id='cms_editorial_form_parent'>
|
50 |
!!cms_editorial_form_parent_options!!
|
51 |
</select>
|
52 |
</div>
|
53 |
</div>
|
54 |
</div>";
|
55 |
|
56 |
|
57 |
$cms_editorial_title_field = " |
58 |
<div class='row'>
|
59 |
<div class='colonne'>
|
60 |
<div class='row'>
|
61 |
<label for='cms_editorial_form_title'>".$msg['cms_editorial_form_title']."</label> |
62 |
</div>
|
63 |
<div class='row'>
|
64 |
<input type='text' name='cms_editorial_form_title' id='cms_editorial_form_title' value=\"!!cms_editorial_form_title!!\" class='saisie-80em'/>
|
65 |
</div>
|
66 |
</div>
|
67 |
</div>";
|
68 |
|
69 |
$cms_dojo_plugins_editor=
|
70 |
" data-dojo-props=\"extraPlugins:[
|
71 |
{name: 'fontName', plainText: true},
|
72 |
{name: 'fontSize', plainText: true},
|
73 |
{name: 'formatBlock', plainText: true},
|
74 |
'foreColor','hiliteColor',
|
75 |
'createLink', 'unlink', 'insertImage',
|
76 |
'fullscreen',
|
77 |
'viewsource'
|
78 |
]\" ";
|
79 |
|
80 |
$cms_editorial_resume_field = " |
81 |
<div class='row'>
|
82 |
<div class='colonne'>
|
83 |
<div class='row'>
|
84 |
<label for='cms_editorial_form_resume'>".$msg['cms_editorial_form_resume']."</label> |
85 |
</div>
|
86 |
<div class='row'>
|
87 |
<input type='hidden' name='cms_editorial_form_resume' value=''/>
|
88 |
<div data-dojo-type='dijit/Editor' $cms_dojo_plugins_editor id='cms_editorial_form_resume_form' rows='5' class='saisie-80em' wrap='virtual'>!!cms_editorial_form_resume!!</div>
|
89 |
</div>
|
90 |
</div>
|
91 |
</div>";
|
92 |
|
93 |
$cms_editorial_contenu_field = " |
94 |
<div class='row'>
|
95 |
<div class='colonne'>
|
96 |
<div class='row'>
|
97 |
<label for='cms_editorial_form_contenu'>".$msg['cms_editorial_form_contenu']."</label> |
98 |
</div>
|
99 |
<div class='row'>
|
100 |
<input type='hidden' name='cms_editorial_form_contenu' value=''/>
|
101 |
<div data-dojo-type='dijit/Editor' $cms_dojo_plugins_editor id='cms_editorial_form_contenu_form' rows='5' class='saisie-80em' wrap='virtual'>!!cms_editorial_form_contenu!!</div>
|
102 |
</div>
|
103 |
</div>
|
104 |
</div>";
|
105 |
|
106 |
$cms_editorial_desc_field = " |
107 |
<div class='row'>
|
108 |
<div class='colonne'>
|
109 |
<div class='row'>
|
110 |
<label for='cms_editorial_form_desc'>".$msg['cms_editorial_form_desc']."</label> |
111 |
</div>
|
112 |
<div class='row'>
|
113 |
!!cms_categs!!
|
114 |
<div id='addcateg'/></div>
|
115 |
</div>
|
116 |
</div>
|
117 |
</div>
|
118 |
<script type='text/javascript'>
|
119 |
dojo.require('dijit.Editor');
|
120 |
dojo.require('dijit._editor.plugins.LinkDialog');
|
121 |
dojo.require('dijit._editor.plugins.FontChoice');
|
122 |
dojo.require('dijit._editor.plugins.TextColor');
|
123 |
|
124 |
dojo.require('dijit._editor.plugins.FullScreen');
|
125 |
dojo.require('dijit._editor.plugins.ViewSource');
|
126 |
|
127 |
ajax_parse_dom();
|
128 |
function add_categ() {
|
129 |
template = document.getElementById('addcateg');
|
130 |
categ=document.createElement('div');
|
131 |
categ.className='row';
|
132 |
|
133 |
suffixe = eval('document.!!cms_editorial_form_name!!.max_categ.value')
|
134 |
nom_id = 'f_categ'+suffixe
|
135 |
f_categ = document.createElement('input');
|
136 |
f_categ.setAttribute('name',nom_id);
|
137 |
f_categ.setAttribute('id',nom_id);
|
138 |
f_categ.setAttribute('type','text');
|
139 |
f_categ.className='saisie-80emr';
|
140 |
f_categ.setAttribute('value','');
|
141 |
f_categ.setAttribute('completion','categories_mul');
|
142 |
f_categ.setAttribute('autfield','f_categ_id'+suffixe);
|
143 |
|
144 |
del_f_categ = document.createElement('input');
|
145 |
del_f_categ.setAttribute('id','del_f_categ'+suffixe);
|
146 |
del_f_categ.onclick=fonction_raz_categ;
|
147 |
del_f_categ.setAttribute('type','button');
|
148 |
del_f_categ.className='bouton';
|
149 |
del_f_categ.setAttribute('readonly','');
|
150 |
del_f_categ.setAttribute('value','$msg[raz]');
|
151 |
|
152 |
f_categ_id = document.createElement('input');
|
153 |
f_categ_id.name='f_categ_id'+suffixe;
|
154 |
f_categ_id.setAttribute('type','hidden');
|
155 |
f_categ_id.setAttribute('id','f_categ_id'+suffixe);
|
156 |
f_categ_id.setAttribute('value','');
|
157 |
|
158 |
categ.appendChild(f_categ);
|
159 |
space=document.createTextNode(' ');
|
160 |
categ.appendChild(space);
|
161 |
categ.appendChild(del_f_categ);
|
162 |
categ.appendChild(f_categ_id);
|
163 |
|
164 |
template.appendChild(categ);
|
165 |
|
166 |
// tab_categ_order = document.getElementById('tab_categ_order');
|
167 |
// if (tab_categ_order.value != '') tab_categ_order.value += ','+suffixe;
|
168 |
|
169 |
document.!!cms_editorial_form_name!!.max_categ.value=suffixe*1+1*1 ;
|
170 |
ajax_pack_element(f_categ);
|
171 |
}
|
172 |
function fonction_selecteur_categ() {
|
173 |
name=this.getAttribute('id').substring(4);
|
174 |
name_id = name.substr(0,7)+'_id'+name.substr(7);
|
175 |
openPopUp('./select.php?what=categorie&caller=!!cms_editorial_form_name!!&p1='+name_id+'&p2='+name+'&dyn=1', 'select_categ', 700, 500, -2, -2, 'scrollbars=yes, toolbar=no, dependent=yes, resizable=yes');
|
176 |
}
|
177 |
function fonction_raz_categ() {
|
178 |
name=this.getAttribute('id').substring(4);
|
179 |
name_id = name.substr(0,7)+'_id'+name.substr(7);
|
180 |
document.getElementById(name_id).value=0;
|
181 |
document.getElementById(name).value='';
|
182 |
}
|
183 |
</script>";
|
184 |
|
185 |
$cms_editorial_first_desc = " |
186 |
<div class='row'>
|
187 |
<input type='hidden' name='max_categ' value=\"!!max_categ!!\" />
|
188 |
<input type='text' class='saisie-80emr' id='f_categ!!icateg!!' name='f_categ!!icateg!!' value=\"!!categ_libelle!!\" completion=\"categories_mul\" autfield=\"f_categ_id!!icateg!!\" />
|
189 |
|
190 |
<input type='button' class='bouton' value='$msg[parcourir]' onclick=\"openPopUp('./select.php?what=categorie&caller='+this.form.name+'&p1=f_categ_id!!icateg!!&p2=f_categ!!icateg!!&dyn=1&parent=0&deb_rech=', 'select_categ', 700, 500, -2, -2, '$select_categ_prop')\" />
|
191 |
<input type='button' class='bouton' value='$msg[raz]' onclick=\"this.form.f_categ!!icateg!!.value=''; this.form.f_categ_id!!icateg!!.value='0'; \" />
|
192 |
<input type='hidden' name='f_categ_id!!icateg!!' id='f_categ_id!!icateg!!' value='!!categ_id!!' />
|
193 |
<input type='button' class='bouton' value='+' onClick=\"add_categ();\"/>
|
194 |
</div>";
|
195 |
$cms_editorial_other_desc = " |
196 |
<div class='row'>
|
197 |
<input type='text' class='saisie-80emr' id='f_categ!!icateg!!' name='f_categ!!icateg!!' value=\"!!categ_libelle!!\" completion=\"categories_mul\" autfield=\"f_categ_id!!icateg!!\" />
|
198 |
|
199 |
<input type='button' class='bouton' value='$msg[raz]' onclick=\"this.form.f_categ!!icateg!!.value=''; this.form.f_categ_id!!icateg!!.value='0'; \" />
|
200 |
<input type='hidden' name='f_categ_id!!icateg!!' id='f_categ_id!!icateg!!' value='!!categ_id!!' />
|
201 |
</div>";
|
202 |
|
203 |
$cms_editorial_publication_state_field = " |
204 |
<div class='row'>
|
205 |
<div class='colonne'>
|
206 |
<div class='row'>
|
207 |
<label for='cms_editorial_form_publication_state'>".$msg['cms_editorial_form_publication_state']."</label> |
208 |
</div>
|
209 |
<div class='row'>
|
210 |
<select name='cms_editorial_form_publication_state' id='cms_editorial_form_publication_state'>
|
211 |
!!cms_editorial_form_publications_states_options!!
|
212 |
</select>
|
213 |
</div>
|
214 |
</div>
|
215 |
</div>
|
216 |
";
|
217 |
|
218 |
$cms_editorial_dates_field = " |
219 |
<div class='row'>
|
220 |
<div class='colonne'>
|
221 |
<div class='row'>
|
222 |
<label for='cms_editorial_form_start_date'>".$msg['cms_editorial_form_start_date']."</label> |
223 |
</div>
|
224 |
<div class='row'>
|
225 |
<input type='hidden' name='cms_editorial_form_start_date_value' id='cms_editorial_form_start_date_value' value='!!cms_editorial_form_start_date_value!!' />
|
226 |
<input type='button' class='button' id='cms_editorial_form_start_date' name='cms_editorial_form_start_date' onclick='openPopUp(\"$base_path/select.php?what=calendrier&caller=\"+this.form.name+\"& date_caller=!!day!!¶m1=cms_editorial_form_start_date_value¶m2=cms_editorial_form_start_date&auto_submit=no\");' value='!!cms_editorial_form_start_date!!'/>
|
227 |
<input type='button' onclick=\"this.form.elements['cms_editorial_form_start_date'].value='".$msg['no_date']."'; this.form.elements['cms_editorial_form_start_date_value'].value='';\" value='X' class='bouton'> |
228 |
</div>
|
229 |
</div>
|
230 |
</div>
|
231 |
<div class='row'>
|
232 |
<div class='colonne2'>
|
233 |
<div class='row'>
|
234 |
<label for='cms_editorial_form_end_date'>".$msg['cms_editorial_form_end_date']."</label> |
235 |
</div>
|
236 |
<div class='row'>
|
237 |
<input type='hidden' name='cms_editorial_form_end_date_value' id='cms_editorial_form_end_date_value' value='!!cms_editorial_form_end_date_value!!' />
|
238 |
<input type='button' class='button' id='cms_editorial_form_end_date' name='cms_editorial_form_end_date' onclick='openPopUp(\"$base_path/select.php?what=calendrier&caller=\"+this.form.name+\"&date_caller=!!day!!¶m1=cms_editorial_form_end_date_value¶m2=cms_editorial_form_end_date&auto_submit=no\");' value='!!cms_editorial_form_end_date!!'/>
|
239 |
<input type='button' onclick=\"this.form.elements['cms_editorial_form_end_date'].value='".$msg['no_date']."'; this.form.elements['cms_editorial_form_end_date_value'].value='';\" value='X' class='bouton'> |
240 |
</div>
|
241 |
</div>
|
242 |
</div>
|
243 |
";
|
244 |
|
245 |
$cms_editorial_type_field = " |
246 |
<div class='row'>
|
247 |
<div class='colonne'>
|
248 |
<div class='row'>
|
249 |
<label for='cms_editorial_form_type'>".$msg['cms_editorial_form_type']."</label> |
250 |
</div>
|
251 |
<div class='row'>
|
252 |
<select name='cms_editorial_form_type' id='cms_editorial_form_type' onchange='cms_editorial_load_type_form(this.value)'>
|
253 |
!!cms_editorial_form_type_options!!
|
254 |
</select>
|
255 |
</div>
|
256 |
</div>
|
257 |
</div>
|
258 |
<div class='row'> </div>
|
259 |
<script type='text/javascript'>
|
260 |
dojo.require('dojox.layout.ContentPane');
|
261 |
function cms_editorial_load_type_form(id){
|
262 |
var content = dijit.byId('editorial_type_content_form');
|
263 |
content.href='./ajax.php?module=cms&categ=get_type_form&elem=".$categ."&type_id='+id+'&id='+dojo.byId('cms_editorial_form_obj_id').value; |
264 |
content.refresh();
|
265 |
}
|
266 |
</script>
|
267 |
";
|