|
@@ -314,7 +314,7 @@ jQuery(document).ready(function() {
|
|
|
$outUrls = array();
|
|
$outUrls = array();
|
|
|
$outMenus = array();// typeName => label (order by label)
|
|
$outMenus = array();// typeName => label (order by label)
|
|
|
$typeNameToIdZasob = array();// $typeName => $idZasob
|
|
$typeNameToIdZasob = array();// $typeName => $idZasob
|
|
|
- if ($userAcl->getPermsFiltrProcesId()) {
|
|
|
|
|
|
|
+ if ($userAcl->getPermsFiltrProcesId()) { // TODO: fetch menu from ajax - fix menuStore
|
|
|
$tbls = $userAcl->getTablesAcl();
|
|
$tbls = $userAcl->getTablesAcl();
|
|
|
$urls = $userAcl->getUrls();
|
|
$urls = $userAcl->getUrls();
|
|
|
|
|
|
|
@@ -334,7 +334,7 @@ jQuery(document).ready(function() {
|
|
|
if (null == $vTblAcl) continue;
|
|
if (null == $vTblAcl) continue;
|
|
|
$tblName = $vTblAcl->getName();
|
|
$tblName = $vTblAcl->getName();
|
|
|
$typeName = "p5_default_db:{$tblName}";
|
|
$typeName = "p5_default_db:{$tblName}";
|
|
|
- $labelsOutMenus[$typeName] = $vTblAcl->getLongLabel();
|
|
|
|
|
|
|
+ $labelsOutMenus[$typeName] = $vTblAcl->getLongLabel(); // TODO: legacy
|
|
|
$rawOutMenus[$typeName] = strtolower($vTblAcl->getLongRawLabel());
|
|
$rawOutMenus[$typeName] = strtolower($vTblAcl->getLongRawLabel());
|
|
|
$typeNameToIdZasob[$typeName] = $kZasobID;
|
|
$typeNameToIdZasob[$typeName] = $kZasobID;
|
|
|
// if ($userAcl->getPermsFiltrProcesId()) {
|
|
// if ($userAcl->getPermsFiltrProcesId()) {
|
|
@@ -927,8 +927,6 @@ jQuery(document).ready(function() {
|
|
|
</nav>
|
|
</nav>
|
|
|
<?php
|
|
<?php
|
|
|
|
|
|
|
|
- UI::inlineJS(APP_PATH_WWW . '/static/p5UI/menuStore.js');
|
|
|
|
|
-
|
|
|
|
|
$idFiltrProcesID = $userAcl->getPermsFiltrProcesId();
|
|
$idFiltrProcesID = $userAcl->getPermsFiltrProcesId();
|
|
|
if ($idFiltrProcesID > 0) {
|
|
if ($idFiltrProcesID > 0) {
|
|
|
echo UI::h('div', [ 'id' => "SE-menu-sub", 'style' => "clear:both;" ], array_merge(
|
|
echo UI::h('div', [ 'id' => "SE-menu-sub", 'style' => "clear:both;" ], array_merge(
|
|
@@ -988,49 +986,8 @@ jQuery(document).ready(function() {
|
|
|
})(window)
|
|
})(window)
|
|
|
");
|
|
");
|
|
|
|
|
|
|
|
- echo UI::h('script', [], "
|
|
|
|
|
- (function (global) {
|
|
|
|
|
- if (!global.p5UI__MenuStore) throw 'Missing global.p5UI__MenuStore'
|
|
|
|
|
-
|
|
|
|
|
- function initP5MainMenuDropdown( btnNode, idSubMenu ) {
|
|
|
|
|
- if (!btnNode._initialized) {
|
|
|
|
|
- var jqDropdownTrigger = jQuery(btnNode)
|
|
|
|
|
- var jqDropdownMenu = jQuery('#' + idSubMenu)
|
|
|
|
|
- var jqDropdownParent = jqDropdownMenu.parent()
|
|
|
|
|
-
|
|
|
|
|
- global.p5UI__MenuStore.subscribe(
|
|
|
|
|
- (function (global, idSubMenu) {
|
|
|
|
|
- return function renderP5MainMenuDropdown(data) {
|
|
|
|
|
- var jqDropdownMenu = jQuery('#' + idSubMenu)
|
|
|
|
|
- jqDropdownMenu.empty()
|
|
|
|
|
- jqDropdownMenu.append(data.objects.map(function (item) {
|
|
|
|
|
- var star = (-1 !== data.idsBookmarks.indexOf(item.id))
|
|
|
|
|
- ? '<i class=\"bookmark-item-rem glyphicon glyphicon-star\" title=\"Usuń z ulubionych\" onClick=\"return p5BookmarksRemove(event, ' + item.id + ')\"></i>'
|
|
|
|
|
- : '<i class=\"bookmark-item-add glyphicon glyphicon-star-empty\" title=\"Dodaj do ulubionych\" onClick=\"return p5BookmarksAdd(event, ' + item.id + ')\"></i>'
|
|
|
|
|
- return jQuery('<li>' +
|
|
|
|
|
- '<a href=\"index.php?_route=ViewTableAjax&namespace=' + item.namespace + '\">' +
|
|
|
|
|
- star +
|
|
|
|
|
- ' ' + item.label +
|
|
|
|
|
- '</a>' +
|
|
|
|
|
- '</li>');
|
|
|
|
|
- }))
|
|
|
|
|
- }
|
|
|
|
|
- })(global, idSubMenu)
|
|
|
|
|
- )
|
|
|
|
|
-
|
|
|
|
|
- jqDropdownTrigger.attr('data-toggle', 'dropdown') // is required by bootstrap dorpdown.js evenf if is called via js
|
|
|
|
|
-
|
|
|
|
|
- global.p5UI__MenuStore.forceUpdate()
|
|
|
|
|
-
|
|
|
|
|
- jQuery(btnNode).dropdown()
|
|
|
|
|
- }
|
|
|
|
|
- btnNode._initialized = true
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- global.initP5MainMenuDropdown = initP5MainMenuDropdown
|
|
|
|
|
- })(window)
|
|
|
|
|
- ");
|
|
|
|
|
|
|
+ UI::inlineCSS(APP_PATH_WWW . '/static/p5UI/initP5MainMenuDropdown.css');
|
|
|
|
|
+ UI::inlineJS(APP_PATH_WWW . '/static/p5UI/initP5MainMenuDropdown.js');
|
|
|
|
|
|
|
|
echo UI::h('script', [], "
|
|
echo UI::h('script', [], "
|
|
|
(function (global) {
|
|
(function (global) {
|
|
@@ -1076,20 +1033,14 @@ jQuery(document).ready(function() {
|
|
|
})(window)
|
|
})(window)
|
|
|
");
|
|
");
|
|
|
|
|
|
|
|
- $args = [
|
|
|
|
|
- 'P5MENU_URL' => Router::getRoute('P5Menu')->getLink(),
|
|
|
|
|
- ];
|
|
|
|
|
echo UI::h('script', [], "
|
|
echo UI::h('script', [], "
|
|
|
(function (global) {
|
|
(function (global) {
|
|
|
if (!global.p5UI__MenuStore) throw 'Missing global.p5UI__MenuStore'
|
|
if (!global.p5UI__MenuStore) throw 'Missing global.p5UI__MenuStore'
|
|
|
- var P5MENU_URL = '{$args['P5MENU_URL']}'
|
|
|
|
|
-
|
|
|
|
|
- global.p5UI__MenuStore.setRemoteUrl(P5MENU_URL)
|
|
|
|
|
|
|
|
|
|
if (global.p5UI__MenuStore.hasData()) {
|
|
if (global.p5UI__MenuStore.hasData()) {
|
|
|
global.p5UI__MenuStore.forceUpdate() // force update all subscribers
|
|
global.p5UI__MenuStore.forceUpdate() // force update all subscribers
|
|
|
} else {
|
|
} else {
|
|
|
- global.p5UI__MenuStore.remoteUpdate() // update from remote url @see setRemoteUrl
|
|
|
|
|
|
|
+ global.p5UI__MenuStore.remoteUpdate() // update from remote url
|
|
|
}
|
|
}
|
|
|
})(window)
|
|
})(window)
|
|
|
");
|
|
");
|