source: ZMS/trunk/manage_addzmsform.dtml @ 1835

Revision 1835, 12.4 KB checked in by zmsdev, 2 months ago (diff)

added support for mobile-theme

Line 
1<dtml-call "REQUEST.set('MISC_ZMS','misc_/zms/')">
2<dtml-call "misc_.zms['initutil'].setConfProperty('HTTP.proxy',REQUEST.get('http_proxy',''))">
3<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
4<html lang="en">
5<head>
6<title>Add ZMS-Object</title>
7<link rel="stylesheet" type="text/css" href="/++resource++zms_/manage_page_style-min.css">
8<script type="text/javascript" charset="UTF-8" src="/++resource++zms_/jquery/jquery-all.min.js"></script>
9<script language="JavaScript">
10<!--//
11
12  function themeChange(el) {
13    var i = el.selectedIndex;
14    var v = el.options[i].value;
15    if (v.length == 0)
16      img_src = "<dtml-var MISC_ZMS>spacer.gif";
17    else if (v.indexOf('http://')==0)
18      img_src = v.replace('.zexp','.jpg');
19    else
20      img_src = "<dtml-var MISC_ZMS>"+v.replace('.zexp','.jpg');
21    document.img_theme.src = img_src;
22    document.img_theme.alt = v;
23  }
24
25  function isBlank(val) {
26    if (val == null) { return true; }
27      for (var i=0; i < val.length; i++) {
28        if ((val.charAt(i) != ' ') && (val.charAt(i) != "\t") && (val.charAt(i) != "\n")) { return false; }
29      }
30    return true;
31  }
32
33  function disallowBlank(obj) {
34    var msg;
35    var dofocus;
36    if (arguments.length>1) { msg = arguments[1]; }
37    if (arguments.length>2) { dofocus = arguments[2]; } else { dofocus=false; }
38      if (isBlank(obj.value)) {
39        if (!isBlank(msg)) {
40          alert(msg);
41        }
42        if (dofocus) {
43          obj.select();
44          obj.focus();
45        }
46      return true;
47    }
48    return false;
49  }
50
51  function formOnSubmit(fm) {
52    var b = true;
53    b = b && !disallowBlank(fm.elements['theme:required'],"Value for >Theme< is required!",false);
54    return b;
55  }
56
57//-->
58</script>
59</head>
60
61<body class="zmi">
62<div class="zmi zmiNeutralColorLight0">
63
64        <div id="zmi_header">
65                <div class="zmi-document-margin">
66                        <div class="zmi_col_left">
67                                <img id="zmi_banner" src="/misc_/zms/spacer.gif" title="ZMS - ZOPE based contentmanagement system for science, technology and medicine" border="0" onclick="window.open('http://www.zms-publishing.com');"/>
68                        </div><!-- .zmi_col_left -->
69                </div><!-- .zmi-document-margin -->
70        </div><!-- #zmi_header -->
71
72<form action="manage_addZMS" method="post" onsubmit="return formOnSubmit(this)">
73<input type="hidden" name="preview" value="preview">
74
75<table cellspacing="2" width="100%">
76<tr valign="top">
77 <td align="left" class="form-label" colspan="2"><h3 class="ui-accordion-header ui-helper-reset ui-state-active ui-corner-all">Add ZMS-Instance</h3></td>
78</tr>
79
80<!-- ####################################################################### -->
81<!-- ###   B A S I C   P R O P E R T I E S                                   -->
82<!-- ####################################################################### -->
83<tr valign="top">
84 <td><div class="form-label">Folder-Id</div></td>
85 <td><input class="form-element" type="text" name="folder_id" size="40" value="myzmsx"></td>
86</tr>
87
88<!-- ####################################################################### -->
89<!-- ###   P R I M A R Y   L A N G U A G E                                   -->
90<!-- ####################################################################### -->
91<tr valign="top">
92 <td><div class="form-label">Language</div></td>
93 <td>
94  <table cellspacing="0" cellpadding="0" border="0">
95  <tr>
96   <td><input class="form-element" type="text" name="lang:required" size="3" value="ger"></td>
97   <td><input class="form-element" type="text" name="lang_label:required" size="20" value="Deutsch"></td>
98   <td>
99    <select class="form-element" name="manage_lang:required">
100     <option value="ger">Deutsch</option>
101     <option value="eng">English</option>
102     <option value="fra">Francais</option>
103     <option value="esp">Espanol</option>
104     <option value="ita">Italiano</option>
105     <option value="chi">Chinese</option>
106    </select>
107   </td>
108  </tr>
109  <tr>
110   <td align="right"><font style="font-size:9px">Id</font></td>
111   <td align="right"><font style="font-size:9px">Label</font></td>
112   <td align="right"><font style="font-size:9px">Management</font></td>
113  </tr>
114  </table>
115 </td>
116</tr>
117<tr valign="top">
118 <td></td>
119 <td>
120  <div class="form-small">
121   <i><b>WARNING</b>: The primary language can not be changed after instantiation!</i>
122  </div>
123 </td>
124</tr>
125
126<!-- ########################################################################## -->
127<!-- ###   T E M P L A T E S E T                                                -->
128<!-- ########################################################################## -->
129<tr class="row-hilite">
130 <td align="left" class="form-label" colspan="2"><h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all">Templateset</h3></td>
131</tr>
132<tr valign="top">
133 <td><div class="form-text">Theme</div></td>
134 <td>
135
136  <dtml-call "REQUEST.set('themes',None)">
137  <dtml-if "REQUEST.get('themes') is None"><dtml-call "REQUEST.set('themes',misc_.zms['initutil'].import_instance_home(this(),'www/themes.zcml'))"></dtml-if>
138  <dtml-if "REQUEST.get('themes') is None"><dtml-call "REQUEST.set('themes',misc_.zms['initutil'].http_import('%s/misc_/zms/themes.zcml'%BASE0.replace('https','http')))"></dtml-if>
139  <dtml-if "REQUEST.get('themes') is not None"><dtml-call "REQUEST.set('themes',misc_.zms['initutil'].re_sub('<!--(.|\s)*?-->','',themes))"></dtml-if>
140  <dtml-call "REQUEST.set('themes',misc_.zms['initutil'].re_search('source location=\042(.*?)\042/>',themes))">
141  <select class="form-element" name="theme:required" onchange="themeChange(this);" onkeyup="themeChange(this);">
142
143    <dtml-in "range(99)" reverse>
144     <dtml-let idx=sequence-item>
145      <dtml-try>
146       <dtml-call "REQUEST.set('o',misc_.zms['myZMStheme%i.jpg'%idx])">
147       <option value="myZMStheme<dtml-var idx>.zexp">myZMStheme<dtml-var idx></option>
148       <dtml-unless default_img_theme>
149        <dtml-call "REQUEST.set('default_img_theme','myZMStheme%i.jpg'%idx)">
150       </dtml-unless>
151      <dtml-except>
152      </dtml-try>
153     </dtml-let>
154    </dtml-in>
155    <dtml-unless default_img_theme>
156     <dtml-call "REQUEST.set('default_img_theme','spacer.gif')">
157    </dtml-unless>
158    <dtml-in themes>
159     <dtml-let theme=sequence-item>
160      <dtml-try>
161      <dtml-call "REQUEST.set('locations',misc_.zms['initutil'].http_import('%s/configure.zcml?ts=%s'%(theme,str(ZopeTime().timeTime()))))">
162      <dtml-call "REQUEST.set('locations',misc_.zms['initutil'].re_search('<file (.*?)/>',locations))">
163      <dtml-in locations>
164       <dtml-let location=sequence-item>
165        <dtml-call "REQUEST.set('location_id',location[location.find('id=\042')+len('id=\042'):])">
166        <dtml-call "REQUEST.set('location_id',location_id[:location_id.find('\042')])">
167        <dtml-call "REQUEST.set('location_title',location[location.find('title=\042')+len('title=\042'):])">
168        <dtml-call "REQUEST.set('location_title',location_title[:location_title.find('\042')])">
169        <option value="<dtml-var theme>/<dtml-var location_id>"><dtml-var location_id> (<dtml-var location_title>)</option>
170       </dtml-let>
171      </dtml-in>
172      <dtml-except><!-- [<dtml-var theme>] <dtml-var error_type>: <dtml-var error_value> <dtml-var error_tb> --></dtml-try>
173     </dtml-let>
174    </dtml-in>
175
176  </select>
177 </td>
178</tr>
179<tr valign="top">
180 <td><div class="form-label">Add Default Mobile Theme&nbsp;<sup style="background-color:#DCE204;color:#FFF;"><small>&nbsp;NEW&nbsp;</small></sup></em></div></td>
181 <td><input type="checkbox" name="mobile:int" value="1" onchange="if($(this).prop('checked')){$('#mobile_preview').show('normal')}else{$('#mobile_preview').hide('normal')}"/></td>
182</tr>
183<tr valign="top">
184 <td><div class="form-text"><em>Preview</em></div></td>
185 <td>
186  <table cellspacing="0" cellpadding="1" border="0" bgcolor="#000000">
187  <tr>
188   <td id="preview">
189    <table cellspacing="0" cellpadding="1" border="0" bgcolor="#ffffff">
190    <tr>
191     <td><img name="img_theme" src="<dtml-var MISC_ZMS><dtml-var default_img_theme>" border="0" width="250" height="160"></td>
192    </tr>
193    </table>
194   </td>
195   <td id="mobile_preview" class="ui-helper-hidden">
196    <table cellspacing="0" cellpadding="1" border="0" bgcolor="#ffffff">
197    <tr>
198     <td><img name="img_theme" src="<dtml-var MISC_ZMS>myZMSmobile.jpg" border="0" width="250" height="160"></td>
199    </tr>
200    </table>
201   </td>
202  </tr>
203  </table>
204 </td>
205</tr>
206<tr valign="top">
207 <td><div class="form-small"><em>Proxy</em></div></td>
208 <td>
209  <table cellspacing="0" cellpadding="1" border="0">
210  <tr valign="top">
211   <td>
212    <input class="form-small" type="text" id="http_proxy" name="http_proxy" value="<dtml-var "misc_.zms['initutil'].getConfProperty('HTTP.proxy','')">">
213    <div align="right" class="form-small">Host:Port</div>
214   </td>
215   <td>
216    [<a href="#" onclick="javascript:self.location='<dtml-var URL>?http_proxy='+document.getElementById('http_proxy').value;" class="form-small">Apply</a>]
217   </td>
218  </tr>
219  </table>
220 </td>
221</tr>
222
223<!-- ########################################################################## -->
224<!-- ###   I N I T I A L I Z A T I O N                                          -->
225<!-- ########################################################################## -->
226<tr class="row-hilite">
227 <td align="left" class="form-label" colspan="2"><h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all">Initialization</h3></td>
228</tr>
229<tr valign="middle">
230 <td><div class="form-label"><em>with default content</em></div></td>
231 <td><input type="radio" name="initialization:int" value="1" checked="checked"></td>
232</tr>
233<tr valign="middle">
234 <td><div class="form-label"><em>with ZMS2Go content&nbsp;<sup style="background-color:#DCE204;color:#FFF;"><small>&nbsp;NEW&nbsp;</small></sup></em></div></td>
235 <td><input type="radio" name="initialization:int" value="3"></td>
236</tr>
237<tr valign="middle">
238 <td><div class="form-label"><em>with eLearning components</em></div></td>
239 <td><input type="radio" name="initialization:int" value="2"></td>
240</tr>
241<tr valign="middle">
242 <td><div class="form-label"><em>None</em></div></td>
243 <td><input type="radio" name="initialization:int" value="0"></td>
244</tr>
245
246<!-- ########################################################################## -->
247<!-- ###   C O N F I G U R A T I O N                                            -->
248<!-- ########################################################################## -->
249<tr class="row-hilite">
250 <td align="left" class="form-label" colspan="2"><h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all">Configuration</h3></td>
251</tr>
252<tr valign="middle">
253 <td><div class="form-label"><em>Add ZMS Log</em></div></td>
254 <td><input type="checkbox" name="zmslog:int" value="1" checked="checked"/></td>
255</tr>
256<tr valign="middle">
257 <td><div class="form-label"><em>Add Galleria</em></div></td>
258 <td><input type="checkbox" name="specobj_galleria:int" value="1" checked="checked"/></td>
259</tr>
260<tr valign="middle">
261 <td><div class="form-label"><em>Add Example Database</em></div></td>
262 <td><input type="checkbox" name="specobj_exampledb:int" value="1"/></td>
263</tr>
264<tr valign="middle">
265 <td><div class="form-label"><em>Add Bulletin Board</em></div></td>
266 <td><input type="checkbox" name="specobj_discussions:int" value="1"/></td>
267</tr>
268<tr valign="middle">
269 <td><div class="form-label"><em>Add Newsletter</em></div></td>
270 <td><input type="checkbox" name="specobj_newsletter:int" value="1"/></td>
271</tr>
272<tr valign="middle">
273 <td><div class="form-label"><em>Add Calendar</em></div></td>
274 <td><input type="checkbox" name="specobj_calendar:int" value="1"></td>
275</tr>
276
277<!-- ########################################################################## -->
278<tr>
279  <td colspan="2"><hr size="1"></td>
280</tr>
281<tr>
282  <td>&nbsp;</td>
283  <td class="form-element">
284    <input class="ui-button ui-state-active ui-corner-all" name="btn" type="submit" value="Add">
285    <input class="ui-button ui-state-default ui-corner-all" name="btn" type="submit" value="Cancel">
286  </td>
287</tr>
288</table>
289</form>
290
291        <div id="zmi_footer">
292                <div class="zmi-document-margin">
293                        <div class="zmi_col_left">
294                                 &copy;&nbsp;<dtml-var "ZopeTime().year()">&nbsp;<a href="http://www.hoffmannliebenberg.de" target="_blank">HOFFMANN+LIEBENBERG</a>
295                        </div><!-- .zmi_col_left -->
296                </div><!-- .zmi-document-margin -->
297        </div><!-- #zmi_footer -->
298
299</div><!-- .zmi -->
300</body><!-- .zmi -->
301</html>
Note: See TracBrowser for help on using the repository browser.