From 39abe1928c4beab8336266d54520a5987c39b4aa Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 16 Dec 2015 13:55:43 +0100 Subject: [PATCH] Overhauled page / menu system, wip --- com.woltlab.wcf/acpMenu.xml | 7 + com.woltlab.wcf/menu.xml | 15 ++ com.woltlab.wcf/menuItem.xml | 44 ++++ com.woltlab.wcf/package.xml | 9 +- com.woltlab.wcf/packageInstallationPlugin.xml | 3 + com.woltlab.wcf/page.xml | 38 ++++ com.woltlab.wcf/templates/pageHeaderMenu.tpl | 9 +- wcfsetup/install/files/acp/js/WCF.ACP.js | 63 ------ .../files/acp/templates/applicationEdit.tpl | 20 +- .../acp/templates/applicationManagement.tpl | 11 +- .../install/files/acp/templates/pageAdd.tpl | 6 +- .../files/acp/templates/pageLanding.tpl | 59 +++++ .../install/files/acp/templates/pageList.tpl | 2 + .../files/lib/acp/form/LoginForm.class.php | 5 - .../files/lib/acp/form/PageAddForm.class.php | 17 +- .../lib/acp/form/PageLandingForm.class.php | 134 ++++++++++++ .../data/application/Application.class.php | 20 ++ .../application/ApplicationAction.class.php | 45 ++-- .../application/ApplicationEditor.class.php | 68 +----- .../install/files/lib/data/box/Box.class.php | 53 +++-- .../files/lib/data/menu/MenuCache.class.php | 51 +++++ .../lib/data/menu/ViewableMenu.class.php | 29 +++ .../data/menu/item/MenuItemNodeTree.class.php | 15 +- .../files/lib/data/page/Page.class.php | 9 + .../files/lib/page/AbstractPage.class.php | 1 + .../install/files/lib/system/WCF.class.php | 32 ++- .../application/ApplicationHandler.class.php | 30 +-- .../files/lib/system/box/BoxHandler.class.php | 5 +- .../system/breadcrumb/Breadcrumbs.class.php | 31 ++- .../builder/ApplicationCacheBuilder.class.php | 30 +-- .../cache/builder/MenuCacheBuilder.class.php | 35 +++ .../builder/RoutingCacheBuilder.class.php | 46 +++- .../lib/system/menu/page/PageMenu.class.php | 43 +--- .../PackageInstallationDispatcher.class.php | 102 ++++----- .../BoxPackageInstallationPlugin.class.php | 207 ++++++++++++++++++ .../MenuPackageInstallationPlugin.class.php | 95 +++++++- .../PagePackageInstallationPlugin.class.php | 6 +- .../system/request/ControllerMap.class.php | 90 +++++++- .../system/request/FlexibleRoute.class.php | 16 +- .../lib/system/request/LinkHandler.class.php | 45 ++-- .../system/request/RequestHandler.class.php | 45 ++-- .../files/lib/system/request/Route.class.php | 3 + .../route/DynamicRequestRoute.class.php | 51 +---- .../util/exception/CryptoException.class.php | 4 +- wcfsetup/install/lang/de.xml | 3 - wcfsetup/install/lang/en.xml | 3 - wcfsetup/setup/db/install.sql | 7 +- 47 files changed, 1123 insertions(+), 539 deletions(-) create mode 100644 com.woltlab.wcf/menu.xml create mode 100644 com.woltlab.wcf/menuItem.xml create mode 100644 wcfsetup/install/files/acp/templates/pageLanding.tpl create mode 100644 wcfsetup/install/files/lib/acp/form/PageLandingForm.class.php create mode 100644 wcfsetup/install/files/lib/data/menu/MenuCache.class.php create mode 100644 wcfsetup/install/files/lib/data/menu/ViewableMenu.class.php create mode 100644 wcfsetup/install/files/lib/system/cache/builder/MenuCacheBuilder.class.php create mode 100644 wcfsetup/install/files/lib/system/package/plugin/BoxPackageInstallationPlugin.class.php diff --git a/com.woltlab.wcf/acpMenu.xml b/com.woltlab.wcf/acpMenu.xml index 65f790266e..1364dd8150 100644 --- a/com.woltlab.wcf/acpMenu.xml +++ b/com.woltlab.wcf/acpMenu.xml @@ -618,6 +618,13 @@ admin.content.cms.canManagePage + + + wcf.acp.menu.link.cms.page.list + admin.content.cms.canManagePage + fa-home + + wcf.acp.menu.link.cms.page.list diff --git a/com.woltlab.wcf/menu.xml b/com.woltlab.wcf/menu.xml new file mode 100644 index 0000000000..80da9c4f5e --- /dev/null +++ b/com.woltlab.wcf/menu.xml @@ -0,0 +1,15 @@ + + + + + Hauptmenü + Main Menu + + + mainMenu + 0 + 1 + + + + diff --git a/com.woltlab.wcf/menuItem.xml b/com.woltlab.wcf/menuItem.xml new file mode 100644 index 0000000000..cb2f054c1f --- /dev/null +++ b/com.woltlab.wcf/menuItem.xml @@ -0,0 +1,44 @@ + + + + + com.woltlab.wcf.MainMenu + <![CDATA[Dashboard]]> + <![CDATA[Dashboard]]> + com.woltlab.wcf.Dashboard + + + + com.woltlab.wcf.MainMenu + <![CDATA[Mitglieder]]> + <![CDATA[Members]]> + com.woltlab.wcf.MembersList + + + com.woltlab.wcf.MembersList + <![CDATA[Letzte Aktivitäten]]> + <![CDATA[Recent Activities]]> + com.woltlab.wcf.RecentActivityList + + + com.woltlab.wcf.MembersList + <![CDATA[Benutzer Online]]> + <![CDATA[Users Online]]> + com.woltlab.wcf.UsersOnlineList + + + com.woltlab.wcf.MembersList + <![CDATA[Team]]> + <![CDATA[Team]]> + com.woltlab.wcf.Team + + + com.woltlab.wcf.MembersList + <![CDATA[Benutzer suchen]]> + <![CDATA[Search Users]]> + com.woltlab.wcf.UserSearch + + + + + diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index 37dd5fbfbd..84ce6d35fc 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -5,7 +5,7 @@ 1 - 2.2.0 Alpha 1 + 2.2.0 Alpha 2 2015-10-22 @@ -40,6 +40,13 @@ + + acp/post_install.php + + + + + diff --git a/com.woltlab.wcf/packageInstallationPlugin.xml b/com.woltlab.wcf/packageInstallationPlugin.xml index 2ced21adcf..33d2ecb8c1 100644 --- a/com.woltlab.wcf/packageInstallationPlugin.xml +++ b/com.woltlab.wcf/packageInstallationPlugin.xml @@ -30,5 +30,8 @@ wcf\system\package\plugin\UserMenuPackageInstallationPlugin wcf\system\package\plugin\UserNotificationEventPackageInstallationPlugin wcf\system\package\plugin\DashboardBoxPackageInstallationPlugin + wcf\system\package\plugin\BoxPackageInstallationPlugin + wcf\system\package\plugin\MenuPackageInstallationPlugin + wcf\system\package\plugin\MenuItemPackageInstallationPlugin diff --git a/com.woltlab.wcf/page.xml b/com.woltlab.wcf/page.xml index cf05e50ffb..f9e2865624 100644 --- a/com.woltlab.wcf/page.xml +++ b/com.woltlab.wcf/page.xml @@ -1,6 +1,44 @@ + + + wcf\page\DashboardPage + + + + + + wcf\page\MembersListPage + + + + + wcf\page\RecentActivityListPage + + + com.woltlab.wcf.MembersList + + + wcf\page\UsersOnlineListPage + + + com.woltlab.wcf.MembersList + + + wcf\page\TeamPage + + + com.woltlab.wcf.MembersList + + + wcf\page\UserSearchForm + + + com.woltlab.wcf.MembersList + + + Cookie Policy Cookie-Richtlinie diff --git a/com.woltlab.wcf/templates/pageHeaderMenu.tpl b/com.woltlab.wcf/templates/pageHeaderMenu.tpl index 15b97c03c9..fab563ca1b 100644 --- a/com.woltlab.wcf/templates/pageHeaderMenu.tpl +++ b/com.woltlab.wcf/templates/pageHeaderMenu.tpl @@ -1,6 +1,11 @@ -{if $__wcf->getPageMenu()->getMenuItems('header')|count > 0} +{@$__wcf->getBoxHandler()->getBoxes('mainMenu')[0]} +{*if $__wcf->getPageMenu()->getMenuItems('header')|count > 0} -{/if} +{/if*} diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.js b/wcfsetup/install/files/acp/js/WCF.ACP.js index a30a1b1ff3..467e0b7c04 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.js @@ -16,69 +16,6 @@ WCF.ACP = { }; */ WCF.ACP.Application = { }; -/** - * Provides the ability to set an application as primary. - * - * @param integer packageID - */ -WCF.ACP.Application.SetAsPrimary = Class.extend({ - /** - * application package id - * @var integer - */ - _packageID: 0, - - /** - * Initializes the WCF.ACP.Application.SetAsPrimary class. - * - * @param integer packageID - */ - init: function(packageID) { - this._packageID = packageID; - - $('#setAsPrimary').click($.proxy(this._click, this)); - }, - - /** - * Shows a confirmation dialog to set current application as primary. - */ - _click: function() { - WCF.System.Confirmation.show(WCF.Language.get('wcf.acp.application.setAsPrimary.confirmMessage'), $.proxy(function(action) { - if (action === 'confirm') { - this._setAsPrimary(); - } - }, this)); - }, - - /** - * Sets an application as primary. - */ - _setAsPrimary: function() { - new WCF.Action.Proxy({ - autoSend: true, - data: { - actionName: 'setAsPrimary', - className: 'wcf\\data\\application\\ApplicationAction', - objectIDs: [ this._packageID ] - }, - success: $.proxy(function(data, textStatus, jqXHR) { - var $notification = new WCF.System.Notification(WCF.Language.get('wcf.global.success')); - $notification.show(); - - // remove button - $('#setAsPrimary').parent().remove(); - - // insert icon - $headline = $('.boxHeadline > h1'); - $headline.html($headline.html() + ' '); - $('').appendTo($headline); - - WCF.DOMNodeInsertedHandler.execute(); - }, this) - }); - } -}); - /** * Namespace for ACP cronjob management. */ diff --git a/wcfsetup/install/files/acp/templates/applicationEdit.tpl b/wcfsetup/install/files/acp/templates/applicationEdit.tpl index d8b9baa203..bceaf485bf 100644 --- a/wcfsetup/install/files/acp/templates/applicationEdit.tpl +++ b/wcfsetup/install/files/acp/templates/applicationEdit.tpl @@ -1,22 +1,7 @@ {include file='header' pageTitle='wcf.acp.application.edit'} -{if $application->packageID != 1 && !$application->isPrimary} - -{/if} -
-

{lang}wcf.acp.application.edit.title{/lang}{if $application->isPrimary} {/if}

+

{lang}wcf.acp.application.edit.title{/lang}

{include file='formError'} @@ -28,9 +13,6 @@