366 lines
15 KiB
JavaScript
366 lines
15 KiB
JavaScript
define([
|
|
'dojo/request/xhr',
|
|
'dojo/dom-class',
|
|
'dijit/MenuBar',
|
|
'dijit/MenuBarItem',
|
|
'dijit/ToolbarSeparator',
|
|
'gutachten/lib/xhr',
|
|
'dojo/domReady!'
|
|
], function (
|
|
xhr,
|
|
domClass,
|
|
MenuBar,
|
|
MenuBarItem,
|
|
ToolbarSeparator,
|
|
gutachten_xhr
|
|
) {
|
|
return {
|
|
create: function (bc_base) {
|
|
/*******************************************************
|
|
* top menu
|
|
*******************************************************/
|
|
function tmsetactive(tm) {
|
|
switch (tm) {
|
|
case 'tm1':
|
|
domClass.add('tm1', 'topmenu-selected')
|
|
domClass.remove('tm2', 'topmenu-selected')
|
|
domClass.remove('tm3', 'topmenu-selected')
|
|
break;
|
|
case 'tm2':
|
|
domClass.remove('tm1', 'topmenu-selected')
|
|
domClass.add('tm2', 'topmenu-selected')
|
|
domClass.remove('tm3', 'topmenu-selected')
|
|
break;
|
|
case 'tm3':
|
|
domClass.remove('tm1', 'topmenu-selected')
|
|
domClass.remove('tm2', 'topmenu-selected')
|
|
domClass.add('tm3', 'topmenu-selected')
|
|
break;
|
|
}
|
|
}
|
|
|
|
var topmenu = new MenuBar({
|
|
id: 'topmenu',
|
|
region: "top",
|
|
className: 'center',
|
|
splitter: false
|
|
})
|
|
topmenu.addChild(
|
|
new MenuBarItem({
|
|
id: "tm1",
|
|
class: 'topmenu-selected',
|
|
label: '<i class="far fa-building"></i> Projekte Alle',
|
|
onClick: function (evt) {
|
|
tmsetactive('tm1')
|
|
dijit
|
|
.byId('stack_container_main')
|
|
.selectChild(dijit.byId('bc_projekte_alle'))
|
|
}
|
|
})
|
|
)
|
|
topmenu.addChild(new ToolbarSeparator())
|
|
topmenu.addChild(
|
|
new MenuBarItem({
|
|
id: "tm2",
|
|
label: '<i class="fa fa-building"></i> Projekte Active',
|
|
onClick: function (evt) {
|
|
tmsetactive('tm2')
|
|
dijit
|
|
.byId('stack_container_main')
|
|
.selectChild(dijit.byId('bc_projekte_active'))
|
|
}
|
|
})
|
|
)
|
|
topmenu.addChild(new ToolbarSeparator())
|
|
topmenu.addChild(
|
|
new MenuBarItem({
|
|
id: "tm3",
|
|
label: '<i class="fa fa-clipboard-list"></i> Vorlagen',
|
|
onClick: function (evt) {
|
|
tmsetactive('tm3')
|
|
dijit
|
|
.byId('stack_container_main')
|
|
.selectChild(dijit.byId('tap_vorlagen_center'))
|
|
}
|
|
})
|
|
)
|
|
if (LOCALSCOPE.uid == 1) {
|
|
// Hermann
|
|
topmenu.addChild(new ToolbarSeparator())
|
|
topmenu.addChild(
|
|
new MenuBarItem({
|
|
showLabel: true,
|
|
label: '<i class="fa fa-font"></i> Font',
|
|
onClick: function () {
|
|
var callback = function (response) {
|
|
alert('Sonderzeichen Gerichted')
|
|
}
|
|
gutachten_xhr.call_function(
|
|
callback,
|
|
'settings_controller',
|
|
'sonderzeichen'
|
|
)
|
|
}
|
|
})
|
|
)
|
|
}
|
|
topmenu.addChild(new ToolbarSeparator())
|
|
topmenu.addChild(
|
|
new MenuBarItem({
|
|
showLabel: true,
|
|
style: 'margin-right:10px',
|
|
label: '<i class="fa fa-sign-out-alt"></i> Logout',
|
|
onClick: function () {
|
|
xhr('index.php?eID=tx_gutachten', {
|
|
data: {
|
|
logintype: 'logout',
|
|
pid: '53'
|
|
},
|
|
handleAs: 'json',
|
|
method: 'POST'
|
|
}).then(function (data) {
|
|
location.href = 'index.php'
|
|
})
|
|
}
|
|
})
|
|
)
|
|
bc_base.addChild(topmenu)
|
|
|
|
|
|
|
|
// var cp_titelbox = (window.cp_titelbox = new ContentPane({
|
|
// id: "cp_titelbox",
|
|
// region: "top",
|
|
// splitter: false
|
|
// }));
|
|
|
|
// var bc_base_topmenu = (window.bc_base_topmenu = new BorderContainer({
|
|
// design: 'sidebar',
|
|
// region: 'top',
|
|
// id: 'bc_base_topmenu',
|
|
// splitter: false
|
|
// }))
|
|
// var cp_base_topmenu_left = (window.cp_base_topmenu_left = new ContentPane(
|
|
// {
|
|
// id: 'cp_base_topmenu_left',
|
|
// region: 'left',
|
|
// splitter: false
|
|
// }
|
|
// ))
|
|
// bc_base_topmenu.addChild(cp_base_topmenu_left)
|
|
// var cp_base_topmenu_center = (window.cp_base_topmenu_center =
|
|
// new ContentPane({
|
|
// id: 'cp_base_topmenu_center',
|
|
// region: 'center',
|
|
// splitter: false
|
|
// }))
|
|
// bc_base_topmenu.addChild(cp_base_topmenu_center)
|
|
// var cp_base_topmenu_right = (window.cp_base_topmenu_right =
|
|
// new ContentPane({
|
|
// id: 'cp_base_topmenu_right',
|
|
// region: 'right',
|
|
// splitter: false
|
|
// }))
|
|
// bc_base_topmenu.addChild(cp_base_topmenu_right)
|
|
|
|
// /*******************************************************
|
|
// * top menu left
|
|
// *******************************************************/
|
|
// var topmenu_left = new MenuBar({
|
|
// id: 'topmenu_left',
|
|
// splitter: false
|
|
// })
|
|
// topmenu_left.addChild(
|
|
// new MenuBarItem({
|
|
// showLabel: true,
|
|
// label: '<i class="fa fa-building blau"></i> Nutzwertgutachten',
|
|
// onClick: function (evt) {
|
|
// window.location = 'index.php'
|
|
// }
|
|
// })
|
|
// )
|
|
// // topmenu_left.addChild(new MenuBarItem(
|
|
// // {
|
|
// // showLabel: true,
|
|
// // label: '<span class="logo">Nutzwertgutachten</span>',
|
|
// // onClick: function ()
|
|
// // {
|
|
// // window.location = 'index.php';
|
|
// // }
|
|
// // }));
|
|
// cp_base_topmenu_left.addChild(topmenu_left)
|
|
|
|
// /*******************************************************
|
|
// * top menu CENTER
|
|
// *******************************************************/
|
|
// var topmenu_center = new MenuBar({
|
|
// id: 'topmenu_center',
|
|
// style: 'text-align:center',
|
|
// splitter: false
|
|
// })
|
|
// topmenu_center.addChild(
|
|
// new MenuBarItem({
|
|
// showLabel: true,
|
|
// label: '<i class="far fa-building blau"></i> Projekte Alle',
|
|
// onClick: function (evt) {
|
|
// dijit
|
|
// .byId('stack_container_main')
|
|
// .selectChild(dijit.byId('bc_projekte_alle'))
|
|
// }
|
|
// })
|
|
// )
|
|
// topmenu_center.addChild(new ToolbarSeparator())
|
|
// topmenu_center.addChild(
|
|
// new MenuBarItem({
|
|
// showLabel: true,
|
|
// label: '<i class="fa fa-building blau"></i> Projekte Active',
|
|
// onClick: function (evt) {
|
|
// dijit
|
|
// .byId('stack_container_main')
|
|
// .selectChild(dijit.byId('bc_projekte_active'))
|
|
// }
|
|
// })
|
|
// )
|
|
// topmenu_center.addChild(new ToolbarSeparator())
|
|
// topmenu_center.addChild(
|
|
// new MenuBarItem({
|
|
// showLabel: true,
|
|
// label: '<i class="fa fa-clipboard-list blau"></i> Vorlagen',
|
|
// onClick: function (evt) {
|
|
// dijit
|
|
// .byId('stack_container_main')
|
|
// .selectChild(dijit.byId('tap_vorlagen_center'))
|
|
// }
|
|
// })
|
|
// )
|
|
// cp_base_topmenu_center.addChild(topmenu_center)
|
|
|
|
// /*******************************************************
|
|
// * top menu right
|
|
// *******************************************************/
|
|
// var topmenu_right = new MenuBar({
|
|
// id: 'topmenu_right',
|
|
// splitter: false,
|
|
// style: 'text-align:right'
|
|
// })
|
|
// //
|
|
// // var dd_topmenu2 = new DropDownMenu(
|
|
// // {
|
|
// // region: "top",
|
|
// // id: "dd_topmenu2"
|
|
// // });
|
|
|
|
// // dd_topmenu2.addChild(new MenuItem(
|
|
// // {
|
|
// // showLabel: true,
|
|
// // label: '<i class="far fa-image"></i> ' + (LOCALSCOPE.layout == "Dark" ? "Hell" : "Dunkel") + ' ',
|
|
// // id: "thema-button-" + (LOCALSCOPE.layout == "Dark" ? "Light" : "Dark"),
|
|
// // onClick: function ()
|
|
// // {
|
|
// // var callback = function (response)
|
|
// // {
|
|
// // location.reload();
|
|
// // };
|
|
// // gutachten_xhr.call_function(
|
|
// // callback,
|
|
// // "settings_controller",
|
|
// // "toggle_theme",
|
|
// // );
|
|
// // }
|
|
// // }));
|
|
// if (LOCALSCOPE.uid == 1) {
|
|
// // Hermann
|
|
// topmenu_right.addChild(
|
|
// new MenuBarItem({
|
|
// showLabel: true,
|
|
// label: '<i class="fa fa-font blau"></i> Font',
|
|
// onClick: function () {
|
|
// var callback = function (response) {
|
|
// alert('Sonderzeichen Gerichted')
|
|
// }
|
|
// gutachten_xhr.call_function(
|
|
// callback,
|
|
// 'settings_controller',
|
|
// 'sonderzeichen'
|
|
// )
|
|
// }
|
|
// })
|
|
// )
|
|
// }
|
|
// topmenu_right.addChild(
|
|
// new MenuBarItem({
|
|
// showLabel: true,
|
|
// label: '<i class="far fa-user blau"></i> ' + LOCALSCOPE.username
|
|
// })
|
|
// )
|
|
// topmenu_right.addChild(new ToolbarSeparator())
|
|
// topmenu_right.addChild(
|
|
// new MenuBarItem({
|
|
// showLabel: true,
|
|
// id: 'toggle_help_onoff',
|
|
// label:
|
|
// LOCALSCOPE.tx_help == 1
|
|
// ? '<i class="fa fa-toggle-on nuhhelp"></i> Hilfe An'
|
|
// : '<i class="fa fa-toggle-off blau"></i> Hilfe Aus',
|
|
// onClick: function () {
|
|
// var callback = function (response) {
|
|
// LOCALSCOPE.tx_help = response
|
|
// if (LOCALSCOPE.tx_help * 1 == 0) {
|
|
// dijit
|
|
// .byId('toggle_help_onoff')
|
|
// .set(
|
|
// 'label',
|
|
// '<i class="fa fa-toggle-off blau"></i> Hilfe Aus'
|
|
// )
|
|
// query('.help').forEach(function (node) {
|
|
// domClass.add(node, 'help_off')
|
|
// domClass.remove(node, 'help_on')
|
|
// })
|
|
// } else {
|
|
// dijit
|
|
// .byId('toggle_help_onoff')
|
|
// .set(
|
|
// 'label',
|
|
// '<i class="fa fa-toggle-on nuhhelp"></i> Hilfe An'
|
|
// )
|
|
// query('.help').forEach(function (node) {
|
|
// domClass.add(node, 'help_on')
|
|
// domClass.remove(node, 'help_off')
|
|
// })
|
|
// }
|
|
// }
|
|
// gutachten_xhr.call_function_text(
|
|
// callback,
|
|
// 'settings_controller',
|
|
// 'toggle_help_onoff'
|
|
// )
|
|
// }
|
|
// })
|
|
// )
|
|
// topmenu_right.addChild(new ToolbarSeparator())
|
|
// topmenu_right.addChild(
|
|
// new MenuBarItem({
|
|
// showLabel: true,
|
|
// style: 'margin-right:10px',
|
|
// label: '<i class="fa fa-sign-out-alt blau"></i> Logout',
|
|
// onClick: function () {
|
|
// xhr('index.php?eID=tx_gutachten', {
|
|
// data: {
|
|
// logintype: 'logout',
|
|
// pid: '53'
|
|
// },
|
|
// handleAs: 'json',
|
|
// method: 'POST'
|
|
// }).then(function (data) {
|
|
// location.href = 'index.php'
|
|
// })
|
|
// }
|
|
// })
|
|
// )
|
|
// cp_base_topmenu_right.addChild(topmenu_right)
|
|
|
|
// dijit.byId('bc_base').addChild(bc_base_topmenu)
|
|
}
|
|
}
|
|
})
|