2 $Id: html-incblocks.txt,v 1.3 2010-12-27 18:11:56 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');
30 <SPAN CLASS="SiteInfo">
35 [% IF treeName and treeInfo %]
36 <SPAN CLASS="TreeInfo">
41 [% IF userAuth and uid;
42 commonname = userAttr('cn');
43 IF commonname == ''; commonname = uid; END; %]
44 <DIV CLASS="LoginInfo">
45 <SPAN CLASS="UserName">[% commonname %]</SPAN>
46 <SPAN CLASS="Logout"><A HREF="[% topURL _ '?LOGOUT=1' %]">Logout</A></SPAN>
50 <DIV CLASS="CurrentTime">[% timestamp %]</DIV>
52 <DIV CLASS="PathMenu">
53 [% INCLUDE treename %]
54 <DIV CLASS="CurrentPath">
55 <SPAN CLASS="PathMenuHeader">Current path:</SPAN>
56 <SPAN CLASS="PathURLs">[% splitUrls(token) %]</SPAN>
60 [% IF not noTopMenu %]
62 [% INCLUDE shortcut url=topURL text="Top"
63 title="Choose from the list of trees"%]
64 [% theParent=parent(token);
65 IF theParent and theParent != token;
66 INCLUDE shortcut url=url(theParent) text="Up"
67 title="Climb up the tree";
69 [% INCLUDE helpshortcut %]
70 [% IF mayDisplayAdmInfo(token);
71 INCLUDE shortcut url=url(token,'adminfo')
73 title="Administrative details"
80 <DIV CLASS="[%contentClass%]">
81 [% global.contentFinished = 0 %]
82 [% IF global.printError %]
83 <DIV CLASS="ErrorMessage">[% global.printError %]</DIV>
84 [% global.printError = '' %]
88 [%# ########### Print the legend ################ %]
91 [% legend = nodeParam(token, 'legend') %]
92 [% IF legend.length > 0 %]
94 [% FOREACH legpairstring = legend.split(';') %]
95 [% SET legpair = legpairstring.split(':') %]
96 <DIV CLASS="LegendRow">
97 <SPAN CLASS="LegendName">[% xmlnorm(legpair.0) %]:</SPAN>
98 <SPAN CLASS="LegendValue">[% xmlnorm(legpair.1) %]</SPAN>
105 [%# ########### Print the TZ and NOW variables ################ %]
107 [% BLOCK variables %]
108 [% IF variables.TZ or variables.NOW %]
109 <P CLASS="Variables">
110 [% IF variables.TZ %]
111 <SPAN CLASS="VariableName">Timezone:</SPAN>
112 <SPAN CLASS="VariableValue">[% variables.TZ %].</SPAN>
114 [% IF variables.NOW %]
115 <SPAN CLASS="VariableName">Report date:</SPAN>
116 <SPAN CLASS="VariableValue">[% variables.NOW %].</SPAN>
123 [%# ########### Print the current tree name ################ %]
126 <DIV CLASS="CurrentTree">
127 <SPAN CLASS="PathMenuHeader">Tree:</SPAN>
128 <SPAN CLASS="TreeName">[% treeName %]</SPAN>
132 [%# ########### Print the shortcut ################ %]
135 <SPAN CLASS="Shortcut">
136 [ <A TITLE="[%title%]" HREF="[%url%]"
137 [%IF newwindow; 'TARGET="_blank"'; END%]>[%text%]</A> ]
141 [%# ########### Print the Help shortcut ################ %]
142 [% BLOCK helpshortcut;
143 IF nodeParam(token, 'help-text', 1);
145 url="javascript:helpwindow()"
147 title="Open a help window for this page";
151 [%# ########### Print the common bottomline ################ %]
153 [% BLOCK bottomline %]
154 </DIV><!-- Content -->[% global.contentFinished = 1 %]
155 <DIV CLASS="BottomMenu">
156 [% INCLUDE shortcut url=persistentUrl(token,view,global.bookmarkVars)
158 title="Permanent link to this page"%]
159 [% INCLUDE shortcut url=url('SS') text="Tokensets"
160 title="List of non-empty tokensets"%]
161 [% INCLUDE shortcut url=url(token,view,'MEDIA','printer','OVS',ovs)
162 text="Printable view"
163 title="Prepare this page for printing"
165 [% IF mayDisplayReports();
166 INCLUDE shortcut url=reportsUrl
168 title="Show reports page"
171 [% IF global.setDateDialog; INCLUDE enterdate; END %]
172 [% INCLUDE searchdialog %]
176 [%# ########### Print the Tokensets bottomline ################ %]
178 [% BLOCK tsetbottomline %]
179 </DIV><!-- Content -->[% global.contentFinished = 1 %]
180 <DIV CLASS="BottomMenu">
181 [% INCLUDE shortcut url=url(pathToken('/')) text="Datasources tree"
182 title="Back to the datasources tree" %]
183 [% INCLUDE shortcut url=url(token,view,'MEDIA','printer')
184 text="Printable view"
185 title="Prepare this page for printing"
187 [% INCLUDE helpshortcut %]
188 [% INCLUDE searchdialog %]
193 [%# ########### Print the ending HTML blahblah ################ %]
196 [% IF ! global.contentFinished %]</DIV><!-- Content -->[% END %]
200 [%# ######## Print the RRD graph image ####### %]
203 <DIV CLASS="GraphImage">
204 <IMG SRC="[%url(token, view, vars)%]"
205 ALT="[% param(view, 'description') %]">
210 [%# ######## Print the short-term RRD graph image ####### %]
212 [% BLOCK shortgraph %]
215 IF nodeParam(token,'hidden') == 'yes';
218 IF not hidden or variables.SHOWHIDDEN
220 <DIV CLASS="ShortGraph">
221 [% IF not urltoken; urltoken = token; END %]
222 [% hidden ? '<SPAN CLASS="ShowHidden">':'' %]
223 <DIV CLASS="NodeName">
224 <A HREF="[%url(urltoken,urlview)%]">[% nodename %]</A>
226 [%IF comment%]<DIV CLASS="NodeDescr">[%xmlnorm(comment)%]</DIV>[%END%]
227 [% hidden ? '</SPAN>':'' %]
230 shortView = nodeParam(token,'rrgraph-views').split(',').0;
232 IF nodeParam(token, 'rrd-hwpredict') == 'enabled' and
233 param(view, 'rrd-hwpredict') != 'disabled';
234 global.hwpredict = 1;
236 shortvars = ['NOHW', 1];
238 shortvars = ['NOHW', ''];
242 <DIV CLASS="GraphImage">
243 <A HREF="[%url(urltoken,urlview)%]">
244 <IMG SRC="[%url(token, shortView, shortvars)%]"
245 ALT="[% param(shortView, 'description') %]">
253 [%# ######## Print the overview shortcuts ####### %]
254 [% BLOCK overviewShortcuts %]
256 IF nodeParam(token, 'has-overview-shortcuts', 1) == 'yes';
257 FOREACH ovs = nodeParam(token,'overview-shortcuts').split('\s*,\s*');
258 p1 = 'overview-shortcut-text-' _ ovs;
259 p2 = 'overview-shortcut-title-' _ ovs;
261 url=url(token, 'overview-subleaves-html', 'OVS', ovs)
262 text=nodeParam(token, p1, 1)
263 title=nodeParam(token, p2, 1);
269 [%# ######## Set the date variable ####### %]
271 [% IF variables.SETDATE == 1;
272 thedate = verifyDate( variables.SETDATEV );
273 IF thedate.length == 0;
274 global.printError = 'Incorrect date format';
277 variables.NOW = thedate;
282 clearVar('SETDATEV');
284 global.setDateDialog = 1;
289 [%# ######## Print the date selection elements ####### %]
290 [% BLOCK enterdate %]
291 <SPAN CLASS="SetDateDialog">
292 <FORM METHOD=GET ACTION="[%topUrl()%]">
293 <INPUT TYPE="hidden" NAME="token" VALUE="[%token%]"/>
294 <INPUT TYPE="hidden" NAME="view" VALUE="[%view%]"/>
295 [% IF ovs %]<INPUT TYPE="hidden" NAME="OVS" VALUE="[%ovs%]"/>[% END %]
297 <INPUT TYPE="checkbox" NAME="SETDATE" VALUE="1"
298 [%variables.SETDATE ? 'CHECKED':''%]/>
300 <INPUT TYPE="text" NAME="SETDATEV" SIZE="22" VALUE="[%variables.SETDATEV%]"/>
301 <INPUT TYPE="submit" VALUE=">"/>
307 [%# ######## Print the searchform HTML ####### %]
308 [% BLOCK searchdialog %]
309 [% IF searchEnabled %]
310 <SPAN CLASS="SearchDialog">
311 <FORM METHOD=GET ACTION="[%topUrl()%]">
312 <INPUT TYPE="hidden" NAME="token" VALUE="[%pathToken('/')%]"/>
313 <INPUT TYPE="hidden" NAME="view" VALUE="search"/>
314 <LABEL>Search</LABEL>
315 <INPUT TYPE="text" NAME="SEARCH" SIZE="22" VALUE=""/>
316 <INPUT TYPE="submit" VALUE=">"/>
322 [%# ######## Print the Global searchform HTML ####### %]
323 [% BLOCK globalsearchdialog %]
324 [% IF mayGlobalSearch() %]
325 <SPAN CLASS="SearchDialog">
326 <FORM METHOD=GET ACTION="[%topUrl()%]">
327 <LABEL>Search</LABEL>
328 <INPUT TYPE="text" NAME="SEARCH" SIZE="22" VALUE=""/>
329 <INPUT TYPE="submit" VALUE=">"/>