1
function MENU(config, updater, menu_id) {
2
this.aMenuBar = new dhtmlXMenuBarObject(document.getElementById(menu_id));
3
this.aMenuBar.setOnClickHandler(this.onClick(this));
4
this.aMenuBar.setGfxPath("images/");
5
this.aMenuBar.setZIndex(1000);
8
if (config) config.Register(this);
10
this.updater = updater;
16
MENU.prototype.Load = function() {
20
MENU.prototype.AttachWindow = function(wnd) {
24
MENU.prototype.AttachExporter = function(exp) {
29
MENU.prototype.ReLoad = function() {
30
this.aMenuBar.loadXML(adei.GetServiceURL("menu"));
31
this.aMenuBar.showBar();
34
MENU.prototype.SetQuery = function(srv, db, grp, mask, exp) {
35
// This will force reset of time range (independent of other settings)
36
if (typeof exp == "undefined") exp = "0-0";
38
this.config.ApplyDataSource(srv,db,grp,mask,exp);
41
MENU.prototype.SetSource = function(srv, db, grp, mask) {
42
this.config.ApplyDataSource(srv,db,grp,mask);
45
MENU.prototype.SetWindow = function(width) {
47
this.window.UpdateWidth(width);
51
MENU.prototype.SetFormat = function(format) {
53
this.exporter.SetFormat(format);
57
MENU.prototype.SetExportSampling = function(sampling) {
59
this.exporter.SetSampling(sampling);
63
MENU.prototype.LockWindow = function() {
64
if (this.window) this.window.Lock();
67
MENU.prototype.ReDraw = function() {
68
if (this.updater) this.updater.Update();
71
MENU.prototype.ExportWindow = function() {
73
this.exporter.Export(true, 0);
77
MENU.prototype.SetExportMask = function(mask) {
79
this.exporter.SetMask(mask);
83
MENU.prototype.onClick = function(self) {
84
return function(itemId,itemValue) {
85
var params = itemId.split("__");
86
if (params[0] == "folder") return;
89
if (params.length > 1) {
90
args = "\"" + params[1] + "\"";
91
for (var i = 2; i < params.length; i++)
92
args += ", \"" + params[i] + "\"";
95
var cmd = "if (typeof self." + params[0] + " == \"function\") {" +
96
"self." + params[0] + "(" + args + ");" +
98
"adeiReportError(\"Invalid menu action (" + params[0] + ")\", \"MENU\");" +
b'\\ No newline at end of file'