2 $Id: html-incblocks.txt,v 1.4 2010-12-29 03:12:19 ivan Exp $
3 All BLOCK statements are defined here
6 [%# ########### Initialize globals ################ %]
7 [% global.setDateDialog = 0; %]
10 [%# ########### Print the starting HTML blahblah ################ %]
13 IF ! contentClass; contentClass="Content"; END %]
15 [% freesideHeader(title, style('stylesheet')) %]
17 <SCRIPT language="JavaScript">
21 window.open('[%url(token) _ '&view=helptext-html'%]','helpwindow',
22 'width=600,height=400,resizable=yes,left=200,top=100');
27 <DIV CLASS="CurrentTime">[% timestamp %]</DIV>
29 <DIV CLASS="PathMenu">
30 [% INCLUDE treename %]
31 <DIV CLASS="CurrentPath">
32 <SPAN CLASS="PathMenuHeader">Current path:</SPAN>
33 <SPAN CLASS="PathURLs">[% splitUrls(token) %]</SPAN>
37 [% IF not noTopMenu %]
39 [% INCLUDE shortcut url=topURL text="Top"
40 title="Choose from the list of trees"%]
41 [% theParent=parent(token);
42 IF theParent and theParent != token;
43 INCLUDE shortcut url=url(theParent) text="Up"
44 title="Climb up the tree";
46 [% INCLUDE helpshortcut %]
47 [% IF mayDisplayAdmInfo(token);
48 INCLUDE shortcut url=url(token,'adminfo')
50 title="Administrative details"
57 <DIV CLASS="[%contentClass%]">
58 [% global.contentFinished = 0 %]
59 [% IF global.printError %]
60 <DIV CLASS="ErrorMessage">[% global.printError %]</DIV>
61 [% global.printError = '' %]
65 [%# ########### Print the legend ################ %]
68 [% legend = nodeParam(token, 'legend') %]
69 [% IF legend.length > 0 %]
71 [% FOREACH legpairstring = legend.split(';') %]
72 [% SET legpair = legpairstring.split(':') %]
73 <DIV CLASS="LegendRow">
74 <SPAN CLASS="LegendName">[% xmlnorm(legpair.0) %]:</SPAN>
75 <SPAN CLASS="LegendValue">[% xmlnorm(legpair.1) %]</SPAN>
82 [%# ########### Print the TZ and NOW variables ################ %]
85 [% IF variables.TZ or variables.NOW %]
88 <SPAN CLASS="VariableName">Timezone:</SPAN>
89 <SPAN CLASS="VariableValue">[% variables.TZ %].</SPAN>
91 [% IF variables.NOW %]
92 <SPAN CLASS="VariableName">Report date:</SPAN>
93 <SPAN CLASS="VariableValue">[% variables.NOW %].</SPAN>
100 [%# ########### Print the current tree name ################ %]
103 <DIV CLASS="CurrentTree">
104 <SPAN CLASS="PathMenuHeader">Tree:</SPAN>
105 <SPAN CLASS="TreeName">[% treeName %]</SPAN>
109 [%# ########### Print the shortcut ################ %]
112 <SPAN CLASS="Shortcut">
113 [ <A TITLE="[%title%]" HREF="[%url%]"
114 [%IF newwindow; 'TARGET="_blank"'; END%]>[%text%]</A> ]
118 [%# ########### Print the Help shortcut ################ %]
119 [% BLOCK helpshortcut;
120 IF nodeParam(token, 'help-text', 1);
122 url="javascript:helpwindow()"
124 title="Open a help window for this page";
128 [%# ########### Print the common bottomline ################ %]
130 [% BLOCK bottomline %]
131 </DIV><!-- Content -->[% global.contentFinished = 1 %]
132 <DIV CLASS="BottomMenu">
133 [% INCLUDE shortcut url=persistentUrl(token,view,global.bookmarkVars)
135 title="Permanent link to this page"%]
136 [% INCLUDE shortcut url=url('SS') text="Tokensets"
137 title="List of non-empty tokensets"%]
138 [%# INCLUDE shortcut url=url(token,view,'MEDIA','printer','OVS',ovs)
139 # text="Printable view"
140 # title="Prepare this page for printing"
142 [% IF mayDisplayReports();
143 INCLUDE shortcut url=reportsUrl
145 title="Show reports page"
148 [% IF global.setDateDialog; INCLUDE enterdate; END %]
149 [% INCLUDE searchdialog %]
153 [%# ########### Print the Tokensets bottomline ################ %]
155 [% BLOCK tsetbottomline %]
156 </DIV><!-- Content -->[% global.contentFinished = 1 %]
157 <DIV CLASS="BottomMenu">
158 [% INCLUDE shortcut url=url(pathToken('/')) text="Datasources tree"
159 title="Back to the datasources tree" %]
160 [% INCLUDE shortcut url=url(token,view,'MEDIA','printer')
161 text="Printable view"
162 title="Prepare this page for printing"
164 [% INCLUDE helpshortcut %]
165 [% INCLUDE searchdialog %]
170 [%# ########### Print the ending HTML blahblah ################ %]
173 [% IF ! global.contentFinished %]</DIV><!-- Content -->[% END %]
177 [%# ######## Print the RRD graph image ####### %]
180 <DIV CLASS="GraphImage">
181 <IMG SRC="[%url(token, view, vars)%]"
182 ALT="[% param(view, 'description') %]">
187 [%# ######## Print the short-term RRD graph image ####### %]
189 [% BLOCK shortgraph %]
192 IF nodeParam(token,'hidden') == 'yes';
195 IF not hidden or variables.SHOWHIDDEN
197 <DIV CLASS="ShortGraph">
198 [% IF not urltoken; urltoken = token; END %]
199 [% hidden ? '<SPAN CLASS="ShowHidden">':'' %]
200 <DIV CLASS="NodeName">
201 <A HREF="[%url(urltoken,urlview)%]">[% nodename %]</A>
203 [%IF comment%]<DIV CLASS="NodeDescr">[%xmlnorm(comment)%]</DIV>[%END%]
204 [% hidden ? '</SPAN>':'' %]
207 shortView = nodeParam(token,'rrgraph-views').split(',').0;
209 IF nodeParam(token, 'rrd-hwpredict') == 'enabled' and
210 param(view, 'rrd-hwpredict') != 'disabled';
211 global.hwpredict = 1;
213 shortvars = ['NOHW', 1];
215 shortvars = ['NOHW', ''];
219 <DIV CLASS="GraphImage">
220 <A HREF="[%url(urltoken,urlview)%]">
221 <IMG SRC="[%url(token, shortView, shortvars)%]"
222 ALT="[% param(shortView, 'description') %]">
230 [%# ######## Print the overview shortcuts ####### %]
231 [% BLOCK overviewShortcuts %]
233 IF nodeParam(token, 'has-overview-shortcuts', 1) == 'yes';
234 FOREACH ovs = nodeParam(token,'overview-shortcuts').split('\s*,\s*');
235 p1 = 'overview-shortcut-text-' _ ovs;
236 p2 = 'overview-shortcut-title-' _ ovs;
238 url=url(token, 'overview-subleaves-html', 'OVS', ovs)
239 text=nodeParam(token, p1, 1)
240 title=nodeParam(token, p2, 1);
246 [%# ######## Set the date variable ####### %]
248 [% IF variables.SETDATE == 1;
249 thedate = verifyDate( variables.SETDATEV );
250 IF thedate.length == 0;
251 global.printError = 'Incorrect date format';
254 variables.NOW = thedate;
259 clearVar('SETDATEV');
261 global.setDateDialog = 1;
266 [%# ######## Print the date selection elements ####### %]
267 [% BLOCK enterdate %]
268 <SPAN CLASS="SetDateDialog">
269 <FORM METHOD=GET ACTION="[%topUrl()%]">
270 <INPUT TYPE="hidden" NAME="token" VALUE="[%token%]"/>
271 <INPUT TYPE="hidden" NAME="view" VALUE="[%view%]"/>
272 [% IF ovs %]<INPUT TYPE="hidden" NAME="OVS" VALUE="[%ovs%]"/>[% END %]
274 <INPUT TYPE="checkbox" NAME="SETDATE" VALUE="1"
275 [%variables.SETDATE ? 'CHECKED':''%]/>
277 <INPUT TYPE="text" NAME="SETDATEV" SIZE="22" VALUE="[%variables.SETDATEV%]"/>
278 <INPUT TYPE="submit" VALUE=">"/>
284 [%# ######## Print the searchform HTML ####### %]
285 [% BLOCK searchdialog %]
286 [% IF searchEnabled %]
287 <SPAN CLASS="SearchDialog">
288 <FORM METHOD=GET ACTION="[%topUrl()%]">
289 <INPUT TYPE="hidden" NAME="token" VALUE="[%pathToken('/')%]"/>
290 <INPUT TYPE="hidden" NAME="view" VALUE="search"/>
291 <LABEL>Search</LABEL>
292 <INPUT TYPE="text" NAME="SEARCH" SIZE="22" VALUE=""/>
293 <INPUT TYPE="submit" VALUE=">"/>
299 [%# ######## Print the Global searchform HTML ####### %]
300 [% BLOCK globalsearchdialog %]
301 [% IF mayGlobalSearch() %]
302 <SPAN CLASS="SearchDialog">
303 <FORM METHOD=GET ACTION="[%topUrl()%]">
304 <LABEL>Search</LABEL>
305 <INPUT TYPE="text" NAME="SEARCH" SIZE="22" VALUE=""/>
306 <INPUT TYPE="submit" VALUE=">"/>