2 $Id: html-incblocks.txt,v 1.1 2010-12-27 00:04:03 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 %]
14 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
15 "http://www.w3.org/TR/html4/strict.dtd">
17 <!-- Torrus Copyright (c) 2003-2004 Stanislav Sinyagin -->
19 <SCRIPT language="JavaScript">
23 window.open('[%url(token) _ '&view=helptext-html'%]','helpwindow',
24 'width=600,height=400,resizable=yes,left=200,top=100');
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 %] );
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>
49 <SPAN CLASS="SiteInfo">
54 [% IF treeName and treeInfo %]
55 <SPAN CLASS="TreeInfo">
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>
69 <DIV CLASS="CurrentTime">[% timestamp %]</DIV>
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>
79 [% IF not noTopMenu %]
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";
88 [% INCLUDE helpshortcut %]
89 [% IF mayDisplayAdmInfo(token);
90 INCLUDE shortcut url=url(token,'adminfo')
92 title="Administrative details"
99 <DIV CLASS="[%contentClass%]">
100 [% global.contentFinished = 0 %]
101 [% IF global.printError %]
102 <DIV CLASS="ErrorMessage">[% global.printError %]</DIV>
103 [% global.printError = '' %]
107 [%# ########### Print the legend ################ %]
110 [% legend = nodeParam(token, 'legend') %]
111 [% IF legend.length > 0 %]
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>
124 [%# ########### Print the TZ and NOW variables ################ %]
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>
133 [% IF variables.NOW %]
134 <SPAN CLASS="VariableName">Report date:</SPAN>
135 <SPAN CLASS="VariableValue">[% variables.NOW %].</SPAN>
142 [%# ########### Print the current tree name ################ %]
145 <DIV CLASS="CurrentTree">
146 <SPAN CLASS="PathMenuHeader">Tree:</SPAN>
147 <SPAN CLASS="TreeName">[% treeName %]</SPAN>
151 [%# ########### Print the shortcut ################ %]
154 <SPAN CLASS="Shortcut">
155 [ <A TITLE="[%title%]" HREF="[%url%]"
156 [%IF newwindow; 'TARGET="_blank"'; END%]>[%text%]</A> ]
160 [%# ########### Print the Help shortcut ################ %]
161 [% BLOCK helpshortcut;
162 IF nodeParam(token, 'help-text', 1);
164 url="javascript:helpwindow()"
166 title="Open a help window for this page";
170 [%# ########### Print the common bottomline ################ %]
172 [% BLOCK bottomline %]
173 </DIV><!-- Content -->[% global.contentFinished = 1 %]
174 <DIV CLASS="BottomMenu">
175 [% INCLUDE shortcut url=persistentUrl(token,view,global.bookmarkVars)
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"
184 [% IF mayDisplayReports();
185 INCLUDE shortcut url=reportsUrl
187 title="Show reports page"
190 [% IF global.setDateDialog; INCLUDE enterdate; END %]
191 [% INCLUDE searchdialog %]
195 [%# ########### Print the Tokensets bottomline ################ %]
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"
206 [% INCLUDE helpshortcut %]
207 [% INCLUDE searchdialog %]
212 [%# ########### Print the ending HTML blahblah ################ %]
215 [% IF ! global.contentFinished %]</DIV><!-- Content -->[% END %]
217 Powered by <A HREF="http://torrus.org">Torrus</A> [% version %]
223 [%# ######## Print the RRD graph image ####### %]
226 <DIV CLASS="GraphImage">
227 <IMG SRC="[%url(token, view, vars)%]"
228 ALT="[% param(view, 'description') %]">
233 [%# ######## Print the short-term RRD graph image ####### %]
235 [% BLOCK shortgraph %]
238 IF nodeParam(token,'hidden') == 'yes';
241 IF not hidden or variables.SHOWHIDDEN
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>
249 [%IF comment%]<DIV CLASS="NodeDescr">[%xmlnorm(comment)%]</DIV>[%END%]
250 [% hidden ? '</SPAN>':'' %]
253 shortView = nodeParam(token,'rrgraph-views').split(',').0;
255 IF nodeParam(token, 'rrd-hwpredict') == 'enabled' and
256 param(view, 'rrd-hwpredict') != 'disabled';
257 global.hwpredict = 1;
259 shortvars = ['NOHW', 1];
261 shortvars = ['NOHW', ''];
265 <DIV CLASS="GraphImage">
266 <A HREF="[%url(urltoken,urlview)%]">
267 <IMG SRC="[%url(token, shortView, shortvars)%]"
268 ALT="[% param(shortView, 'description') %]">
276 [%# ######## Print the overview shortcuts ####### %]
277 [% BLOCK overviewShortcuts %]
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;
284 url=url(token, 'overview-subleaves-html', 'OVS', ovs)
285 text=nodeParam(token, p1, 1)
286 title=nodeParam(token, p2, 1);
292 [%# ######## Set the date variable ####### %]
294 [% IF variables.SETDATE == 1;
295 thedate = verifyDate( variables.SETDATEV );
296 IF thedate.length == 0;
297 global.printError = 'Incorrect date format';
300 variables.NOW = thedate;
305 clearVar('SETDATEV');
307 global.setDateDialog = 1;
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 %]
320 <INPUT TYPE="checkbox" NAME="SETDATE" VALUE="1"
321 [%variables.SETDATE ? 'CHECKED':''%]/>
323 <INPUT TYPE="text" NAME="SETDATEV" SIZE="22" VALUE="[%variables.SETDATEV%]"/>
324 <INPUT TYPE="submit" VALUE=">"/>
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=">"/>
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=">"/>