ca5540e6944943721f414e939f84776f9ea829c5
[freeside.git] / torrus / templates / html-incblocks.txt
1 [%#
2   $Id: html-incblocks.txt,v 1.1 2010-12-27 00:04:03 ivan Exp $
3   All BLOCK statements are defined here
4 %]
5
6 [%#  ###########    Initialize globals   ################ %]
7 [% global.setDateDialog = 0; %]
8
9
10 [%#  ###########    Print the starting HTML blahblah   ################ %]
11
12 [% BLOCK htmlstart;
13    IF ! contentClass; contentClass="Content"; END %]
14 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
15         "http://www.w3.org/TR/html4/strict.dtd">
16 <HTML>
17 <!-- Torrus Copyright (c) 2003-2004 Stanislav Sinyagin -->
18 <HEAD>
19 <SCRIPT language="JavaScript"> 
20 <!--
21 function helpwindow() 
22
23 window.open('[%url(token) _ '&view=helptext-html'%]','helpwindow',
24 'width=600,height=400,resizable=yes,left=200,top=100'); 
25
26 //--> 
27 </SCRIPT>
28 <TITLE>[% title %]</TITLE>
29 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
30 [% IF expires %]<META HTTP-EQUIV="Refresh" CONTENT="[% expires %]"/>[% END %]
31 <STYLE type="text/css" media="all">
32   @import url( [% plainURL _ style('stylesheet') %] );
33   [% cssoverlay = style('cssoverlay'); IF cssoverlay; %]
34   @import url( [% cssoverlay %] );
35   [% END %]
36 </STYLE>
37 </HEAD>
38 <BODY>
39
40 <DIV CLASS="Header">
41
42 <SPAN CLASS="CompanyInfo">
43 <A TITLE="company info"
44 HREF="[%companyURL%]">[% IF companyLogo %]<IMG SRC="[%companyLogo%]"
45 ALT=[%companyName%] STYLE="border:0">[% ELSE; companyName; END %]</A>
46 </SPAN>
47
48 [% IF siteInfo %]
49 <SPAN CLASS="SiteInfo">
50 [% siteInfo %]
51 </SPAN>
52 [% END %]
53
54 [% IF treeName and treeInfo %]
55 <SPAN CLASS="TreeInfo">
56 [% treeInfo %]
57 </SPAN>
58 [% END %]
59
60 [% IF userAuth and uid;
61      commonname = userAttr('cn');
62      IF commonname == ''; commonname = uid; END; %]
63 <DIV CLASS="LoginInfo">
64 <SPAN CLASS="UserName">[% commonname %]</SPAN>
65 <SPAN CLASS="Logout"><A HREF="[% topURL _ '?LOGOUT=1' %]">Logout</A></SPAN>
66 </DIV>
67 [% END %]
68 </DIV>
69 <DIV CLASS="CurrentTime">[% timestamp %]</DIV>
70 [% IF printpath %]
71   <DIV CLASS="PathMenu">
72     [% INCLUDE treename %]
73     <DIV CLASS="CurrentPath">
74       <SPAN CLASS="PathMenuHeader">Current path:</SPAN>
75       <SPAN CLASS="PathURLs">[% splitUrls(token) %]</SPAN>
76     </DIV>
77   </DIV>
78 [% END %]
79 [% IF not noTopMenu %]
80 <DIV CLASS="TopMenu">
81 [% INCLUDE shortcut url=topURL text="Top"
82                     title="Choose from the list of trees"%]
83 [% theParent=parent(token);
84    IF theParent and theParent != token;
85      INCLUDE shortcut url=url(theParent) text="Up"
86                     title="Climb up the tree";
87    END %]
88 [% INCLUDE helpshortcut %]
89 [% IF mayDisplayAdmInfo(token);
90      INCLUDE shortcut url=url(token,'adminfo')
91                       text="AdmInfo"
92                       title="Administrative details"
93                       newwindow=1;
94    END
95 %]
96
97 </DIV>
98 [% END %]
99 <DIV CLASS="[%contentClass%]">
100 [% global.contentFinished = 0 %]
101 [% IF global.printError %]
102 <DIV CLASS="ErrorMessage">[% global.printError %]</DIV>
103 [% global.printError = '' %]
104 [% END %]
105 [% END %]
106
107 [%#  ###########    Print the legend   ################ %]
108
109 [% BLOCK legend %]
110 [%   legend = nodeParam(token, 'legend') %]
111 [%   IF legend.length > 0 %]
112 <DIV CLASS="Legend">
113 [%     FOREACH legpairstring = legend.split(';') %]
114 [%       SET legpair = legpairstring.split(':') %]
115          <DIV CLASS="LegendRow">
116            <SPAN CLASS="LegendName">[% xmlnorm(legpair.0) %]:</SPAN>
117            <SPAN CLASS="LegendValue">[% xmlnorm(legpair.1) %]</SPAN>
118          </DIV>
119 [%     END %]
120 </DIV>
121 [%   END %]
122 [% END %]
123
124 [%# ###########    Print the TZ and NOW variables   ################ %]
125
126 [% BLOCK variables %]
127 [%   IF variables.TZ or variables.NOW %]
128 <P CLASS="Variables">
129 [%     IF variables.TZ %]
130           <SPAN CLASS="VariableName">Timezone:</SPAN>
131           <SPAN CLASS="VariableValue">[% variables.TZ %].</SPAN>
132 [%     END %]
133 [%     IF variables.NOW %]
134           <SPAN CLASS="VariableName">Report date:</SPAN>
135           <SPAN CLASS="VariableValue">[% variables.NOW %].</SPAN>
136 [%     END %]
137 </P>
138 [%   END %]
139 [% END %]
140
141
142 [%# ###########    Print the current tree name   ################ %]
143
144 [% BLOCK treename %]
145     <DIV CLASS="CurrentTree">
146       <SPAN CLASS="PathMenuHeader">Tree:</SPAN>
147       <SPAN CLASS="TreeName">[% treeName %]</SPAN>
148     </DIV>
149 [% END %]
150
151 [%# ###########    Print the shortcut   ################ %]
152
153 [% BLOCK shortcut %]
154   <SPAN CLASS="Shortcut">
155   [&nbsp;<A TITLE="[%title%]" HREF="[%url%]"
156             [%IF newwindow; 'TARGET="_blank"'; END%]>[%text%]</A>&nbsp;]
157   </SPAN>
158 [% END %]
159
160 [%# ###########    Print the Help shortcut   ################ %]
161 [% BLOCK helpshortcut;
162      IF nodeParam(token, 'help-text', 1);
163        INCLUDE shortcut
164          url="javascript:helpwindow()"
165          text="Help"
166          title="Open a help window for this page";
167      END;
168    END %]
169
170 [%# ###########    Print the common bottomline   ################ %]
171
172 [% BLOCK bottomline %]
173 </DIV><!-- Content -->[% global.contentFinished = 1 %]
174 <DIV CLASS="BottomMenu">
175 [% INCLUDE shortcut url=persistentUrl(token,view,global.bookmarkVars)
176                     text="Bookmark"
177                     title="Permanent link to this page"%]
178 [% INCLUDE shortcut url=url('SS')           text="Tokensets"
179                     title="List of non-empty tokensets"%]
180 [% INCLUDE shortcut url=url(token,view,'MEDIA','printer','OVS',ovs)
181                     text="Printable view"
182                     title="Prepare this page for printing"
183                     newwindow=1%]
184 [% IF mayDisplayReports();
185      INCLUDE shortcut url=reportsUrl
186                       text="Reports"
187                       title="Show reports page"
188                       newwindow=1;
189    END %]
190 [% IF global.setDateDialog; INCLUDE enterdate; END %]
191 [% INCLUDE searchdialog %]
192 </DIV>
193 [% END %]
194
195 [%# ###########    Print the Tokensets bottomline   ################ %]
196
197 [% BLOCK tsetbottomline %]
198 </DIV><!-- Content -->[% global.contentFinished = 1 %]
199 <DIV CLASS="BottomMenu">
200 [% INCLUDE shortcut url=url(pathToken('/')) text="Datasources tree"
201                     title="Back to the datasources tree" %]
202 [% INCLUDE shortcut url=url(token,view,'MEDIA','printer')
203                     text="Printable view"
204                     title="Prepare this page for printing"
205                     newwindow=1%]
206 [% INCLUDE helpshortcut %]
207 [% INCLUDE searchdialog %]
208 </DIV>
209 [% END %]
210
211
212 [%# ###########    Print the ending HTML blahblah   ################ %]
213
214 [% BLOCK htmlend %]
215 [% IF ! global.contentFinished %]</DIV><!-- Content -->[% END %]
216 <DIV CLASS="Footer">
217   Powered by <A HREF="http://torrus.org">Torrus</A> [% version %]
218 </DIV>
219 </BODY>
220 </HTML>
221 [% END %]
222
223 [%# ########   Print the RRD graph image   ####### %]
224
225 [% BLOCK rrgraph %]
226 <DIV CLASS="GraphImage">
227 <IMG SRC="[%url(token, view, vars)%]"
228      ALT="[% param(view, 'description') %]">
229 </DIV>
230 [% END %]
231
232
233 [%# ########   Print the short-term RRD graph image   ####### %]
234
235 [% BLOCK shortgraph %]
236 [%
237   hidden = 0;
238   IF nodeParam(token,'hidden') == 'yes';
239     hidden = 1;
240   END;
241   IF not hidden or variables.SHOWHIDDEN
242 %]
243 <DIV CLASS="ShortGraph">
244       [% IF not urltoken; urltoken = token; END %]
245       [% hidden ? '<SPAN CLASS="ShowHidden">':'' %]
246       <DIV CLASS="NodeName">
247         <A HREF="[%url(urltoken,urlview)%]">[% nodename %]</A>
248       </DIV>
249       [%IF comment%]<DIV CLASS="NodeDescr">[%xmlnorm(comment)%]</DIV>[%END%]
250       [% hidden ? '</SPAN>':'' %]
251       
252       [%
253         shortView = nodeParam(token,'rrgraph-views').split(',').0;
254         shortvars = [];
255         IF nodeParam(token, 'rrd-hwpredict') == 'enabled' and
256            param(view, 'rrd-hwpredict') != 'disabled';
257           global.hwpredict = 1;
258           IF variables.NOHW;
259             shortvars = ['NOHW', 1];
260           ELSE;
261             shortvars = ['NOHW', ''];          
262           END;
263         END
264       %]
265       <DIV CLASS="GraphImage">
266       <A HREF="[%url(urltoken,urlview)%]">
267       <IMG SRC="[%url(token, shortView, shortvars)%]"
268            ALT="[% param(shortView, 'description') %]">
269       </A>
270       </DIV>
271 </DIV>
272   [% END %]
273 [% END %]
274
275
276 [%# ########   Print the overview shortcuts   ####### %]
277 [% BLOCK overviewShortcuts %]
278 [%
279   IF nodeParam(token, 'has-overview-shortcuts', 1) == 'yes';
280     FOREACH ovs = nodeParam(token,'overview-shortcuts').split('\s*,\s*');
281      p1 = 'overview-shortcut-text-' _ ovs;
282      p2 = 'overview-shortcut-title-' _ ovs;
283      INCLUDE shortcut
284         url=url(token, 'overview-subleaves-html', 'OVS', ovs)
285         text=nodeParam(token, p1, 1)
286         title=nodeParam(token, p2, 1);
287     END;
288   END %]
289 [% END %]
290
291
292 [%# ########   Set the date variable   ####### %]
293 [% BLOCK setdate %]
294 [% IF variables.SETDATE == 1;
295      thedate = verifyDate( variables.SETDATEV );
296      IF thedate.length == 0;
297          global.printError = 'Incorrect date format';
298          clearVar('SETDATE');
299      ELSE;
300          variables.NOW = thedate;
301      END;
302    ELSE;
303      clearVar('NOW');
304      clearVar('SETDATE');
305      clearVar('SETDATEV');
306    END;
307    global.setDateDialog = 1;
308 %]
309 [% END %]
310
311
312 [%# ########   Print the date selection elements   ####### %]
313 [% BLOCK enterdate %]
314 <SPAN CLASS="SetDateDialog">
315 <FORM METHOD=GET ACTION="[%topUrl()%]">
316 <INPUT TYPE="hidden" NAME="token" VALUE="[%token%]"/>
317 <INPUT TYPE="hidden" NAME="view" VALUE="[%view%]"/>
318 [% IF ovs %]<INPUT TYPE="hidden" NAME="OVS" VALUE="[%ovs%]"/>[% END %]
319 <LABEL>
320 <INPUT TYPE="checkbox" NAME="SETDATE" VALUE="1"
321 [%variables.SETDATE ? 'CHECKED':''%]/>
322 Set date</LABEL>
323 <INPUT TYPE="text" NAME="SETDATEV" SIZE="22" VALUE="[%variables.SETDATEV%]"/>
324 <INPUT TYPE="submit" VALUE="&gt;"/>
325 </FORM>
326 </SPAN>
327 [% END %]
328
329
330 [%# ########   Print the searchform HTML   ####### %]
331 [% BLOCK searchdialog %]
332 [% IF searchEnabled %]
333 <SPAN CLASS="SearchDialog">
334 <FORM METHOD=GET ACTION="[%topUrl()%]">
335 <INPUT TYPE="hidden" NAME="token" VALUE="[%pathToken('/')%]"/>
336 <INPUT TYPE="hidden" NAME="view" VALUE="search"/>
337 <LABEL>Search</LABEL>
338 <INPUT TYPE="text" NAME="SEARCH" SIZE="22" VALUE=""/>
339 <INPUT TYPE="submit" VALUE="&gt;"/>
340 </FORM>
341 </SPAN>
342 [% END %]
343 [% END %]
344
345 [%# ########   Print the Global searchform HTML   ####### %]
346 [% BLOCK globalsearchdialog %]
347 [% IF mayGlobalSearch() %]
348 <SPAN CLASS="SearchDialog">
349 <FORM METHOD=GET ACTION="[%topUrl()%]">
350 <LABEL>Search</LABEL>
351 <INPUT TYPE="text" NAME="SEARCH" SIZE="22" VALUE=""/>
352 <INPUT TYPE="submit" VALUE="&gt;"/>
353 </FORM>
354 </SPAN>
355 [% END %]
356 [% END %]