From: Marcel Werk Date: Mon, 4 Apr 2016 14:16:46 +0000 (+0200) Subject: Removed old page menu X-Git-Tag: 3.0.0_Beta_1~1984 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=90430fa54f9a3ed6336c5847a06793d6082219ff;p=GitHub%2FWoltLab%2FWCF.git Removed old page menu --- diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index 5139271b9a..f9a9706610 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -32,7 +32,6 @@ - diff --git a/com.woltlab.wcf/pageMenu.xml b/com.woltlab.wcf/pageMenu.xml deleted file mode 100644 index 0c3bffd784..0000000000 --- a/com.woltlab.wcf/pageMenu.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - header - module_dashboard_page - - - - - header - user.profile.canViewMembersList - module_members_list - - - - - header - wcf.user.members - - - - - header - wcf.user.members - user.profile.canViewUsersOnlineList - module_users_online - - - - - header - wcf.user.members - user.profile.canViewMembersList - module_team_page - - - - - header - wcf.user.members - user.profile.canViewMembersList - module_members_list - - - - - footer - module_privacy_policy_page - - - \ No newline at end of file diff --git a/wcfsetup/install/files/acp/templates/pageMenuItemAdd.tpl b/wcfsetup/install/files/acp/templates/pageMenuItemAdd.tpl deleted file mode 100644 index 0b0244606e..0000000000 --- a/wcfsetup/install/files/acp/templates/pageMenuItemAdd.tpl +++ /dev/null @@ -1,261 +0,0 @@ -{include file='header' pageTitle='wcf.acp.pageMenu.'|concat:$action} - - - -
-

{lang}wcf.acp.pageMenu.{$action}{/lang}

-
- -{include file='formError'} - -{if $success|isset} -

{lang}wcf.global.success.{$action}{/lang}

-{/if} - -
- -
- -
-
- -
-
- - {if $errorField == 'menuPosition'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {else} - {lang}wcf.acp.pageMenu.menuPosition.error.{$errorType}{/lang} - {/if} - - {/if} -
- - -
-
-
- - {if $errorField == 'parentMenuItem'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {else} - {lang}wcf.acp.pageMenu.parentMenuItem.error.{$errorType}{/lang} - {/if} - - {/if} -
-
- - -
-
- - {if $errorField == 'pageMenuItem'} - - {if $errorType == 'multilingual'} - {lang}wcf.global.form.error.multilingual{/lang} - {else} - {lang}wcf.acp.pageMenu.pageMenuItem.error.{$errorType}{/lang} - {/if} - - {/if} - - {include file='multipleLanguageInputJavascript' elementIdentifier='pageMenuItem' forceSelection=true} -
- - - {event name='dataFields'} -
- -
-

{lang}wcf.acp.pageMenu.link{/lang}

- -
-
-
- - -
-
- - - - - - - - - - {event name='linkFields'} -
- -
-

{lang}wcf.acp.pageMenu.advanced{/lang}

- -
-
-
- -
-
- - {if $action == 'add' || !$menuItem->isLandingPage} -
-
-
- -
-
- {/if} - - {event name='advancedFields'} -
- - {event name='sections'} - -
- - {@SECURITY_TOKEN_INPUT_TAG} -
-
- -{include file='footer'} diff --git a/wcfsetup/install/files/acp/templates/pageMenuItemList.tpl b/wcfsetup/install/files/acp/templates/pageMenuItemList.tpl deleted file mode 100644 index 35016d5f57..0000000000 --- a/wcfsetup/install/files/acp/templates/pageMenuItemList.tpl +++ /dev/null @@ -1,141 +0,0 @@ -{include file='header' pageTitle='wcf.acp.pageMenu.list'} - - - -
-

{lang}wcf.acp.pageMenu.list{/lang}

-
- -

{lang}wcf.acp.pageMenu.landingPage.description{/lang}

- -
- -
- -{hascontent} -
-

{lang}wcf.acp.pageMenu.header{/lang}

- - -
-{/hascontent} - -{hascontent} -
-

{lang}wcf.acp.pageMenu.footer{/lang}

- - -
-{/hascontent} - -
- -
- -{include file='footer'} diff --git a/wcfsetup/install/files/lib/acp/form/PageMenuItemAddForm.class.php b/wcfsetup/install/files/lib/acp/form/PageMenuItemAddForm.class.php deleted file mode 100644 index a681e819a2..0000000000 --- a/wcfsetup/install/files/lib/acp/form/PageMenuItemAddForm.class.php +++ /dev/null @@ -1,314 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage acp.form - * @category Community Framework - */ -class PageMenuItemAddForm extends AbstractForm { - /** - * @see \wcf\page\AbstractPage::$activeMenuItem - */ - public $activeMenuItem = 'wcf.acp.menu.link.pageMenu.add'; - - /** - * list of available parent menu items - * @var \wcf\data\page\menu\item\PageMenuItemList - */ - public $availableParentMenuItems = null; - - /** - * activation state - * @var boolean - */ - public $isDisabled = false; - - /** - * internal link - * @var boolean - */ - public $isInternalLink = false; - - /** - * menu item controller - * @var string - */ - public $menuItemController = ''; - - /** - * menu item parameters - * @var string - */ - public $menuItemParameters = ''; - - /** - * menu item link - * @var string - */ - public $menuItemLink = ''; - - /** - * menu item position - * @var string - */ - public $menuPosition = 'header'; - - /** - * @see \wcf\page\AbstractPage::$neededPermissions - */ - public $neededPermissions = array('admin.content.cms.canManageMenu'); - - /** - * page menu item name - * @var string - */ - public $pageMenuItem = ''; - - /** - * parent menu item - * @var string - */ - public $parentMenuItem = ''; - - /** - * show order - * @var integer - */ - public $showOrder = 0; - - /** - * available page object types - * @var array<\wcf\data\object\type\ObjectType> - */ - public $pageObjectTypes = array(); - - /** - * id of the page object type that belongs to the menu item's controller - * @var integer - */ - public $menuItemPage = 0; - - /** - * @see \wcf\page\IPage::readParameters() - */ - public function readParameters() { - parent::readParameters(); - - I18nHandler::getInstance()->register('menuItemLink'); - I18nHandler::getInstance()->register('pageMenuItem'); - - $this->readAvailableParentMenuItems(); - - $this->pageObjectTypes = PageManager::getInstance()->getObjectTypes(); - } - - /** - * Prepares list object to read available parent menu items. - */ - protected function initAvailableParentMenuItems() { - $this->availableParentMenuItems = new PageMenuItemList(); - $this->availableParentMenuItems->getConditionBuilder()->add("page_menu_item.parentMenuItem = ''"); - $this->availableParentMenuItems->getConditionBuilder()->add('page_menu_item.menuPosition = ?', array('header')); - $this->availableParentMenuItems->sqlOrderBy = "page_menu_item.showOrder ASC"; - } - - /** - * Reads a list of available parent menu items. - */ - protected function readAvailableParentMenuItems() { - $this->initAvailableParentMenuItems(); - - $this->availableParentMenuItems->readObjects(); - } - - /** - * @see \wcf\form\IForm::readFormParameters() - */ - public function readFormParameters() { - parent::readFormParameters(); - - I18nHandler::getInstance()->readValues(); - if (I18nHandler::getInstance()->isPlainValue('menuItemLink')) $this->menuItemLink = I18nHandler::getInstance()->getValue('menuItemLink'); - if (I18nHandler::getInstance()->isPlainValue('pageMenuItem')) $this->pageMenuItem = I18nHandler::getInstance()->getValue('pageMenuItem'); - - if (isset($_POST['isDisabled'])) $this->isDisabled = true; - if (isset($_POST['isInternalLink'])) $this->isInternalLink = (bool) $_POST['isInternalLink']; - if (isset($_POST['menuItemController'])) $this->menuItemController = StringUtil::trim($_POST['menuItemController']); - if (isset($_POST['menuItemPage'])) $this->menuItemPage = intval($_POST['menuItemPage']); - if (isset($_POST['menuItemParameters'])) $this->menuItemParameters = StringUtil::trim($_POST['menuItemParameters']); - if (isset($_POST['menuPosition'])) $this->menuPosition = StringUtil::trim($_POST['menuPosition']); - if (isset($_POST['parentMenuItem'])) $this->parentMenuItem = StringUtil::trim($_POST['parentMenuItem']); - if (isset($_POST['showOrder'])) $this->showOrder = intval($_POST['showOrder']); - } - - /** - * @see \wcf\form\IForm::validate() - */ - public function validate() { - parent::validate(); - - // validate menu position - if (empty($this->menuPosition)) { - throw new UserInputException('menuPosition'); - } - else if ($this->menuPosition != 'header' && $this->menuPosition != 'footer') { - throw new UserInputException('menuPosition', 'notValid'); - } - - // validate menu item controller - if ($this->isInternalLink) { - if ($this->menuItemPage) { - $valid = false; - foreach ($this->pageObjectTypes as $page) { - if ($page->objectTypeID == $this->menuItemPage) { - $this->menuItemController = $page->className; - $valid = true; - break; - } - } - - if (!$valid) { - throw new UserInputException('menuItemPage', 'noValidSelection'); - } - } - else if (empty($this->menuItemController)) { - throw new UserInputException('menuItemPage'); - } - - if (!class_exists($this->menuItemController)) { - throw new UserInputException('menuItemController', 'notValid'); - } - - // validate menu item link - if (!I18nHandler::getInstance()->validateValue('menuItemLink', false, true)) { - throw new UserInputException('menuItemLink'); - } - } - else { - $this->menuItemController = ''; - - // validate menu item link - if (!I18nHandler::getInstance()->validateValue('menuItemLink')) { - throw new UserInputException('menuItemLink'); - } - } - - // validate page menu item name - if (!I18nHandler::getInstance()->validateValue('pageMenuItem', true)) { - throw new UserInputException('pageMenuItem', 'multilingual'); - } - - // validate parent menu item - if ($this->menuPosition == 'footer') { - $this->parentMenuItem = ''; - } - else if (!empty($this->parentMenuItem)) { - $valid = false; - foreach ($this->availableParentMenuItems as $menuItem) { - if ($menuItem->menuItem == $this->parentMenuItem) { - $valid = true; - break; - } - } - - if (!$valid) { - throw new UserInputException('parentMenuItem', 'notValid'); - } - } - } - - /** - * @see \wcf\form\IForm::save() - */ - public function save() { - parent::save(); - - $this->objectAction = new PageMenuItemAction(array(), 'create', array('data' => array_merge($this->additionalFields, array( - 'isDisabled' => ($this->isDisabled) ? 1 : 0, - 'menuItem' => $this->pageMenuItem, - 'menuItemController' => $this->menuItemController, - 'menuItemLink' => ($this->menuItemController ? $this->menuItemParameters : $this->menuItemLink), - 'menuPosition' => $this->menuPosition, - 'parentMenuItem' => $this->parentMenuItem, - 'showOrder' => $this->showOrder, - 'menuItem' => StringUtil::getRandomID() - )))); - $this->objectAction->executeAction(); - - $returnValues = $this->objectAction->getReturnValues(); - $menuItem = $returnValues['returnValues']; - $data = array(); - if (!I18nHandler::getInstance()->isPlainValue('menuItemLink')) { - I18nHandler::getInstance()->save('menuItemLink', 'wcf.page.menuItemLink'.$menuItem->menuItemID, 'wcf.page'); - $data['menuItemLink'] = 'wcf.page.menuItemLink'.$menuItem->menuItemID; - } - - // save menu item - I18nHandler::getInstance()->save('pageMenuItem', 'wcf.page.menuItem'.$menuItem->menuItemID, 'wcf.page'); - $data['menuItem'] = 'wcf.page.menuItem'.$menuItem->menuItemID; - - // update i18n values - $menuItemEditor = new PageMenuItemEditor($menuItem); - $menuItemEditor->update($data); - PageMenuItemEditor::resetCache(); - - // call saved event - $this->saved(); - - // show success - WCF::getTPL()->assign('success', true); - - // reset variables - $this->isDisabled = $this->isInternalLink = false; - $this->menuPosition = 'header'; - $this->menuItemController = $this->menuItemLink = $this->pageMenuItem = $this->parentMenuItem = $this->menuItemParameters = ''; - $this->showOrder = 0; - - I18nHandler::getInstance()->reset(); - - // reload parent menu items - if ($menuItem->menuPosition == 'header' && $menuItem->parentMenuItem == '') { - $this->readAvailableParentMenuItems(); - } - } - - /** - * @see \wcf\page\IPage::assignVariables() - */ - public function assignVariables() { - parent::assignVariables(); - - I18nHandler::getInstance()->assignVariables(); - - WCF::getTPL()->assign(array( - 'action' => 'add', - 'availableParentMenuItems' => $this->availableParentMenuItems, - 'isDisabled' => $this->isDisabled, - 'isInternalLink' => $this->isInternalLink, - 'menuItemController' => $this->menuItemPage ? '' : $this->menuItemController, - 'menuItemParameters' => $this->menuItemParameters, - 'menuItemLink' => $this->menuItemLink, - 'menuItemPage' => $this->menuItemPage, - 'menuPosition' => $this->menuPosition, - 'pages' => PageManager::getInstance()->getSelection(), - 'pageMenuItem' => $this->pageMenuItem, - 'parentMenuItem' => $this->parentMenuItem, - 'showOrder' => $this->showOrder - )); - } -} diff --git a/wcfsetup/install/files/lib/acp/form/PageMenuItemEditForm.class.php b/wcfsetup/install/files/lib/acp/form/PageMenuItemEditForm.class.php deleted file mode 100644 index 9546d17b09..0000000000 --- a/wcfsetup/install/files/lib/acp/form/PageMenuItemEditForm.class.php +++ /dev/null @@ -1,150 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage acp.form - * @category Community Framework - */ -class PageMenuItemEditForm extends PageMenuItemAddForm { - /** - * @see \wcf\page\AbstractPage::$activeMenuItem - */ - public $activeMenuItem = 'wcf.acp.menu.link.pageMenu'; - - /** - * page menu item object - * @var \wcf\data\page\menu\item\PageMenuItem - */ - public $menuItem = null; - - /** - * menu item id - * @var integer - */ - public $menuItemID = 0; - - /** - * @see \wcf\page\IPage::readParameters() - */ - public function readParameters() { - if (isset($_REQUEST['id'])) $this->menuItemID = intval($_REQUEST['id']); - $this->menuItem = new PageMenuItem($this->menuItemID); - if (!$this->menuItem->menuItemID) { - throw new IllegalLinkException(); - } - - parent::readParameters(); - } - - /** - * @see \wcf\acp\form\PageMenuItemAddForm::initAvailableParentMenuItems() - */ - protected function initAvailableParentMenuItems() { - parent::initAvailableParentMenuItems(); - - // remove current item as valid parent menu item - $this->availableParentMenuItems->getConditionBuilder()->add("page_menu_item.menuItem <> ?", array($this->menuItem->menuItem)); - } - - /** - * @see \wcf\page\IPage::readData() - */ - public function readData() { - parent::readData(); - - I18nHandler::getInstance()->setOptions('menuItemLink', PACKAGE_ID, $this->menuItem->menuItemLink, 'wcf.page.menuItemLink\d+'); - I18nHandler::getInstance()->setOptions('pageMenuItem', PACKAGE_ID, $this->menuItem->menuItem, 'wcf.page.menuItem\d+'); - - if (empty($_POST)) { - $this->isDisabled = ($this->menuItem->isDisabled) ? true : false; - $this->isInternalLink = ($this->menuItem->menuItemController) ? true : false; - $this->menuItemController = $this->menuItem->menuItemController; - if ($this->isInternalLink) { - $this->menuItemParameters = $this->menuItem->menuItemLink; - } - else { - $this->menuItemLink = $this->menuItem->menuItemLink; - } - $this->menuPosition = $this->menuItem->menuPosition; - $this->pageMenuItem = $this->menuItem->menuItem; - $this->parentMenuItem = $this->menuItem->parentMenuItem; - $this->showOrder = $this->menuItem->showOrder; - - foreach ($this->pageObjectTypes as $page) { - if ($page->className == $this->menuItemController) { - $this->menuItemPage = $page->objectTypeID; - } - } - } - } - - /** - * @see \wcf\form\IForm::save() - */ - public function save() { - AbstractForm::save(); - - // save menu item - I18nHandler::getInstance()->save('pageMenuItem', $this->menuItem->menuItem, 'wcf.page'); - - // save menu item link - $this->menuItemLink = 'wcf.page.menuItemLink'.$this->menuItem->menuItemID; - if (I18nHandler::getInstance()->isPlainValue('menuItemLink')) { - I18nHandler::getInstance()->remove($this->menuItemLink); - $this->menuItemLink= I18nHandler::getInstance()->getValue('menuItemLink'); - } - else { - I18nHandler::getInstance()->save('menuItemLink', $this->menuItemLink, 'wcf.page'); - } - - // save menu item - $this->objectAction = new PageMenuItemAction(array($this->menuItem), 'update', array('data' => array_merge($this->additionalFields, array( - 'isDisabled' => ($this->isDisabled) ? 1 : 0, - 'menuItemController' => $this->menuItemController, - 'menuItemLink' => ($this->menuItemController ? $this->menuItemParameters : $this->menuItemLink), - 'parentMenuItem' => ($this->menuPosition == 'header' ? $this->parentMenuItem : ''), - 'menuPosition' => $this->menuPosition, - 'showOrder' => $this->showOrder - )))); - $this->objectAction->executeAction(); - - // update children - if ($this->menuItem->menuPosition == 'header' && $this->menuPosition != 'header') { - $sql = "UPDATE wcf".WCF_N."_page_menu_item - SET parentMenuItem = '' - WHERE parentMenuItem = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array($this->menuItem->menuItem)); - } - $this->saved(); - - WCF::getTPL()->assign('success', true); - } - - /** - * @see \wcf\page\IPage::assignVariables() - */ - public function assignVariables() { - parent::assignVariables(); - - I18nHandler::getInstance()->assignVariables(!empty($_POST)); - - WCF::getTPL()->assign(array( - 'action' => 'edit', - 'menuItem' => $this->menuItem, - 'menuItemID' => $this->menuItemID - )); - } -} diff --git a/wcfsetup/install/files/lib/acp/page/PageMenuItemListPage.class.php b/wcfsetup/install/files/lib/acp/page/PageMenuItemListPage.class.php deleted file mode 100644 index 2611d373bc..0000000000 --- a/wcfsetup/install/files/lib/acp/page/PageMenuItemListPage.class.php +++ /dev/null @@ -1,84 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage acp.page - * @category Community Framework - */ -class PageMenuItemListPage extends AbstractPage { - /** - * @see \wcf\page\AbstractPage::$activeMenuItem - */ - public $activeMenuItem = 'wcf.acp.menu.link.pageMenu.list'; - - /** - * list of footer page menu items - * @var array<\wcf\data\page\menu\item\PageMenuItem> - */ - public $footerItems = array(); - - /** - * list of header page menu items - * @var array<\wcf\data\page\menu\item\PageMenuItem> - */ - public $headerItems = array(); - - /** - * @see \wcf\page\AbstractPage::$neededPermissions - */ - public $neededPermissions = array('admin.content.cms.canManageMenu'); - - /** - * @see \wcf\page\IPage::readData() - */ - public function readData() { - parent::readData(); - - $menuItemList = new PageMenuItemList(); - $menuItemList->sqlOrderBy = "page_menu_item.parentMenuItem ASC, page_menu_item.showOrder ASC"; - $menuItemList->readObjects(); - - foreach ($menuItemList as $menuItem) { - if ($menuItem->menuPosition == 'footer') { - if ($menuItem->parentMenuItem) { - $this->footerItems[$menuItem->parentMenuItem]->addChild($menuItem); - } - else { - $this->footerItems[$menuItem->menuItem] = $menuItem; - } - } - else { - if ($menuItem->parentMenuItem) { - if (isset($this->headerItems[$menuItem->parentMenuItem])) { - $this->headerItems[$menuItem->parentMenuItem]->addChild($menuItem); - } - } - else { - $this->headerItems[$menuItem->menuItem] = new ViewablePageMenuItem($menuItem); - } - } - } - } - - /** - * @see \wcf\page\IPage::assignVariables() - */ - public function assignVariables() { - parent::assignVariables(); - - WCF::getTPL()->assign(array( - 'footerItems' => $this->footerItems, - 'headerItems' => $this->headerItems - )); - } -} diff --git a/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItem.class.php b/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItem.class.php deleted file mode 100644 index 2c329d3f12..0000000000 --- a/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItem.class.php +++ /dev/null @@ -1,187 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage data.page.menu.item - * @category Community Framework - * - * @property-read integer $menuItemID - * @property-read integer $packageID - * @property-read string $menuItem - * @property-read string $parentMenuItem - * @property-read string $menuItemController - * @property-read string $menuItemLink - * @property-read string $menuPosition - * @property-read integer $showOrder - * @property-read string $permissions - * @property-read string $options - * @property-read integer $isDisabled - * @property-read string $className - * @property-read integer $isLandingPage - * @property-read integer $originIsSystem - */ -class PageMenuItem extends ProcessibleDatabaseObject implements ITreeMenuItem { - /** - * @see \wcf\data\DatabaseObject::$databaseTableName - */ - protected static $databaseTableName = 'page_menu_item'; - - /** - * @see \wcf\data\DatabaseObject::$databaseTableIndexName - */ - protected static $databaseTableIndexName = 'menuItemID'; - - /** - * @see \wcf\data\ProcessibleDatabaseObject::$processorInterface - */ - protected static $processorInterface = 'wcf\system\menu\page\IPageMenuItemProvider'; - - /** - * application abbreviation - * @var string - */ - protected $application = ''; - - /** - * menu item controller - * @var string - */ - protected $controller = null; - - /** - * @see \wcf\data\ProcessibleDatabaseObject::getProcessor() - */ - public function getProcessor() { - if (parent::getProcessor() === null) { - $this->processor = new DefaultPageMenuItemProvider($this); - } - - return $this->processor; - } - - /** - * @see \wcf\system\menu\ITreeMenuItem::getLink() - */ - public function getLink() { - // external link - if (!$this->menuItemController) { - return WCF::getLanguage()->get($this->menuItemLink); - } - - $this->parseController(); - return LinkHandler::getInstance()->getLink($this->controller, array('application' => $this->application, 'forceFrontend' => true), WCF::getLanguage()->get($this->menuItemLink)); - } - - /** - * Returns true if current menu item may be set as landing page. - * - * @return boolean - */ - public function isValidLandingPage() { - // item must be a top header menu item without parents - if ($this->menuPosition != 'header' || $this->parentMenuItem) { - return false; - } - - // external links are not valid - if (!$this->menuItemController) { - return false; - } - - // already is landing page - if ($this->isLandingPage) { - return false; - } - - // disabled items cannot be a landing page - if ($this->isDisabled) { - return false; - } - - return true; - } - - /** - * Returns true if this item can be deleted. - * - * @return boolean - */ - public function canDelete() { - if ($this->originIsSystem || $this->isLandingPage) { - return false; - } - - return true; - } - - /** - * Returns true if this item can be disabled. - * - * @return boolean - */ - public function canDisable() { - return ($this->isLandingPage ? false : true); - } - - /** - * Returns application abbreviation. - * - * @return string - */ - public function getApplication() { - $this->parseController(); - - return $this->application; - } - - /** - * Returns controller name. - * - * @return string - */ - public function getController() { - $this->parseController(); - - return $this->controller; - } - - /** - * Parses controller name. - */ - protected function parseController() { - if ($this->controller === null) { - $this->controller = ''; - - // resolve application and controller - if ($this->menuItemController) { - $parts = explode('\\', $this->menuItemController); - $this->application = array_shift($parts); - $menuItemController = array_pop($parts); - - // drop controller suffix - $this->controller = Regex::compile('(Action|Form|Page)$')->replace($menuItemController, ''); - } - } - } - - /** - * Returns the menu item name. - * - * @return string - */ - public function __toString() { - return WCF::getLanguage()->getDynamicVariable($this->menuItem); - } -} diff --git a/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemAction.class.php b/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemAction.class.php deleted file mode 100644 index 75641de8bf..0000000000 --- a/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemAction.class.php +++ /dev/null @@ -1,196 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage data.page.menu.item - * @category Community Framework - */ -class PageMenuItemAction extends AbstractDatabaseObjectAction implements ISortableAction, IToggleAction { - /** - * @see \wcf\data\AbstractDatabaseObjectAction::$className - */ - protected $className = 'wcf\data\page\menu\item\PageMenuItemEditor'; - - /** - * page menu item editor - * @var \wcf\data\page\menu\item\PageMenuItemEditor - */ - public $menuItemEditor = null; - - /** - * list of menu items - * @var array<\wcf\data\page\menu\item\PageMenuItem> - */ - public $menuItems = array(); - - /** - * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete - */ - protected $permissionsDelete = array('admin.content.cms.canManageMenu'); - - /** - * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate - */ - protected $permissionsUpdate = array('admin.content.cms.canManageMenu'); - - /** - * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP - */ - protected $requireACP = array('delete', 'toggle', 'update', 'updatePosition'); - - /** - * @see \wcf\data\IDatabaseObjectAction::create() - */ - public function create() { - if (!isset($this->parameters['data']['packageID'])) { - $this->parameters['data']['packageID'] = PACKAGE_ID; - } - - // calculate show order - $this->parameters['data']['showOrder'] = PageMenuItemEditor::getShowOrder($this->parameters['data']['showOrder'], $this->parameters['data']['menuPosition'], $this->parameters['data']['parentMenuItem']); - - $menuItem = parent::create(); - - if ($menuItem->menuPosition == 'header') { - PageMenuItemEditor::updateLandingPage(); - } - - return $menuItem; - } - - /** - * @see \wcf\data\AbstractDatabaseObjectAction::delete() - */ - public function delete() { - $returnValues = parent::delete(); - - PageMenuItemEditor::updateLandingPage(); - - return $returnValues; - } - - /** - * @see \wcf\data\AbstractDatabaseObjectAction::update() - */ - public function update() { - parent::update(); - - PageMenuItemEditor::updateLandingPage(); - } - - /** - * @see \wcf\data\ISortableAction::validateUpdatePosition() - */ - public function validateUpdatePosition() { - WCF::getSession()->checkPermissions(array('admin.content.cms.canManageMenu')); - - if (!isset($this->parameters['data']) || !isset($this->parameters['data']['structure']) || !is_array($this->parameters['data']['structure'])) { - throw new UserInputException('structure'); - } - - if (!isset($this->parameters['menuPosition']) || !in_array($this->parameters['menuPosition'], array('footer', 'header'))) { - throw new UserInputException('structure'); - } - - if ($this->parameters['menuPosition'] == 'footer') { - if (count($this->parameters['data']['structure']) > 1 || !isset($this->parameters['data']['structure'][0])) { - throw new UserInputException('structure'); - } - } - - $menuItemIDs = array(); - foreach ($this->parameters['data']['structure'] as $menuItems) { - $menuItemIDs = array_merge($menuItemIDs, $menuItems); - } - - $menuItemList = new PageMenuItemList(); - $menuItemList->getConditionBuilder()->add("page_menu_item.menuItemID IN (?)", array($menuItemIDs)); - $menuItemList->getConditionBuilder()->add("page_menu_item.menuPosition = ?", array($this->parameters['menuPosition'])); - $menuItemList->readObjects(); - $this->menuItems = $menuItemList->getObjects(); - - if (count($this->menuItems) != count($menuItemIDs)) { - throw new UserInputException('structure'); - } - - foreach ($this->parameters['data']['structure'] as $parentMenuItemID => $menuItems) { - if ($parentMenuItemID && !isset($this->menuItems[$parentMenuItemID])) { - throw new UserInputException('structure'); - } - } - } - - /** - * @see \wcf\data\ISortableAction::updatePosition() - */ - public function updatePosition() { - $sql = "UPDATE wcf".WCF_N."_page_menu_item - SET parentMenuItem = ?, - showOrder = ? - WHERE menuItemID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - - WCF::getDB()->beginTransaction(); - foreach ($this->parameters['data']['structure'] as $parentMenuItemID => $menuItems) { - foreach ($menuItems as $showOrder => $menuItemID) { - $statement->execute(array( - ($parentMenuItemID ? $this->menuItems[$parentMenuItemID]->menuItem : ''), - $showOrder + 1, - $menuItemID - )); - } - } - WCF::getDB()->commitTransaction(); - - // update landing page - if ($this->parameters['menuPosition'] == 'header') { - PageMenuItemEditor::updateLandingPage(); - } - } - - /** - * @see \wcf\data\AbstractDatabaseObjectAction::validateDelete() - */ - public function validateDelete() { - parent::validateDelete(); - - foreach ($this->objects as $pageMenuItem) { - if (!$pageMenuItem->canDelete()) { - throw new PermissionDeniedException(); - } - } - } - - /** - * @see \wcf\data\IToggleAction::validateToggle() - */ - public function validateToggle() { - $this->menuItemEditor = $this->getSingleObject(); - if ($this->menuItemEditor->isLandingPage) { - throw new PermissionDeniedException(); - } - - WCF::getSession()->checkPermissions($this->permissionsUpdate); - } - - /** - * @see \wcf\data\IToggleAction::toggle() - */ - public function toggle() { - $this->menuItemEditor->update(array( - 'isDisabled' => ($this->menuItemEditor->isDisabled ? 0 : 1) - )); - } -} diff --git a/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemEditor.class.php b/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemEditor.class.php deleted file mode 100644 index a9b98848da..0000000000 --- a/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemEditor.class.php +++ /dev/null @@ -1,137 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage data.page.menu.item - * @category Community Framework - */ -class PageMenuItemEditor extends DatabaseObjectEditor implements IEditableCachedObject { - /** - * @see \wcf\data\DatabaseObjectDecorator::$baseClass - */ - protected static $baseClass = 'wcf\data\page\menu\item\PageMenuItem'; - - /** - * @see \wcf\data\IEditableObject::delete() - */ - public function delete() { - // update show order - $sql = "UPDATE wcf".WCF_N."_page_menu_item - SET showOrder = showOrder - 1 - WHERE showOrder >= ? - AND menuPosition = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array( - $this->showOrder, - $this->menuPosition - )); - - parent::delete(); - } - - /** - * Sets first top header menu item as landing page. - */ - public static function updateLandingPage() { - $sql = "UPDATE wcf".WCF_N."_page_menu_item - SET isLandingPage = 0"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(); - - $sql = "UPDATE wcf".WCF_N."_page_menu_item - SET isLandingPage = ?, - isDisabled = ? - WHERE menuPosition = ? - AND parentMenuItem = ? - AND menuItemController <> ? - ORDER BY showOrder ASC"; - $statement = WCF::getDB()->prepareStatement($sql, 1); - $statement->execute(array( - 1, - 0, - 'header', - '', - '' - )); - - self::resetCache(); - } - - /** - * Updates the positions of a page menu item directly. - * - * @param integer $menuItemID - * @param string $menuPosition - * @param integer $showOrder - */ - public static function setShowOrder($menuItemID, $menuPosition = 'header', $showOrder = 1) { - // Update - $sql = "UPDATE wcf".WCF_N."_page_menu_item - SET showOrder = ?, - menuPosition = ? - WHERE menuItemID = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array( - $showOrder, - $menuPosition, - $menuItemID - )); - } - - /** - * Returns show order for a new menu item. - * - * @param integer $showOrder - * @param string $menuPosition - * @return integer - */ - public static function getShowOrder($showOrder, $menuPosition, $parentMenuItem = '') { - if ($showOrder == 0) { - // get next number in row - $sql = "SELECT MAX(showOrder) AS showOrder - FROM wcf".WCF_N."_page_menu_item - WHERE parentMenuItem = ? - AND menuPosition = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array( - $parentMenuItem, - $menuPosition - )); - $row = $statement->fetchArray(); - if (!empty($row)) $showOrder = intval($row['showOrder']) + 1; - else $showOrder = 1; - } - else { - $sql = "UPDATE wcf".WCF_N."_page_menu_item - SET showOrder = showOrder + 1 - WHERE parentMenuItem = ? - AND menuPosition = ? - AND showOrder >= ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array( - $parentMenuItem, - $menuPosition, - $showOrder - )); - } - - return $showOrder; - } - - /** - * @see \wcf\data\IEditableCachedObject::resetCache() - */ - public static function resetCache() { - PageMenuCacheBuilder::getInstance()->reset(); - } -} diff --git a/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemList.class.php b/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemList.class.php deleted file mode 100644 index 45797a5b0b..0000000000 --- a/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemList.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage data.page.menu.item - * @category Community Framework - */ -class PageMenuItemList extends DatabaseObjectList { - /** - * @see \wcf\data\DatabaseObjectList::$className - */ - public $className = 'wcf\data\page\menu\item\PageMenuItem'; -} diff --git a/wcfsetup/install/files/lib/data/page/menu/item/ViewablePageMenuItem.class.php b/wcfsetup/install/files/lib/data/page/menu/item/ViewablePageMenuItem.class.php deleted file mode 100644 index 705103d606..0000000000 --- a/wcfsetup/install/files/lib/data/page/menu/item/ViewablePageMenuItem.class.php +++ /dev/null @@ -1,85 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage data.page.menu.item - * @category Community Framework - */ -class ViewablePageMenuItem extends DatabaseObjectDecorator implements \Countable, \Iterator { - /** - * @see \wcf\data\DatabaseObjectDecorator::$baseClass - */ - protected static $baseClass = 'wcf\data\page\menu\item\PageMenuItem'; - - /** - * current iterator index - * @var integer - */ - protected $index = 0; - - /** - * list of page menu items - * @var array<\wcf\data\page\menu\item\PageMenuItem> - */ - protected $objects = array(); - - /** - * Adds a page menu item to collection. - * - * @param \wcf\data\page\menu\item\PageMenuItem $menuItem - */ - public function addChild(PageMenuItem $menuItem) { - if ($menuItem->parentMenuItem == $this->menuItem) { - $this->objects[] = $menuItem; - } - } - - /** - * @see \Countable::count() - */ - public function count() { - return count($this->objects); - } - - /** - * @see \Iterator::current() - */ - public function current() { - return $this->objects[$this->index]; - } - - /** - * @see \Iterator::key() - */ - public function key() { - return $this->index; - } - - /** - * @see \Iterator::next() - */ - public function next() { - ++$this->index; - } - - /** - * @see \Iterator::rewind() - */ - public function rewind() { - $this->index = 0; - } - - /** - * @see \Iterator::valid() - */ - public function valid() { - return isset($this->objects[$this->index]); - } -} diff --git a/wcfsetup/install/files/lib/form/UserSearchForm.class.php b/wcfsetup/install/files/lib/form/UserSearchForm.class.php index 9d758e0b3f..070dc757c3 100644 --- a/wcfsetup/install/files/lib/form/UserSearchForm.class.php +++ b/wcfsetup/install/files/lib/form/UserSearchForm.class.php @@ -23,11 +23,6 @@ use wcf\util\StringUtil; * @category Community Framework */ class UserSearchForm extends UserOptionListForm { - /** - * @inheritDoc - */ - public $activeMenuItem = 'wcf.user.search'; - /** * @inheritDoc */ diff --git a/wcfsetup/install/files/lib/page/AbstractPage.class.php b/wcfsetup/install/files/lib/page/AbstractPage.class.php index d6bf0f6ec7..a682dddd7f 100644 --- a/wcfsetup/install/files/lib/page/AbstractPage.class.php +++ b/wcfsetup/install/files/lib/page/AbstractPage.class.php @@ -4,7 +4,6 @@ use wcf\system\event\EventHandler; use wcf\system\exception\IllegalLinkException; use wcf\system\exception\PermissionDeniedException; use wcf\system\menu\acp\ACPMenu; -use wcf\system\menu\page\PageMenu; use wcf\system\request\RequestHandler; use wcf\system\WCF; use wcf\util\HeaderUtil; @@ -323,9 +322,6 @@ abstract class AbstractPage implements IPage, ITrackablePage { if (RequestHandler::getInstance()->isACPRequest()) { ACPMenu::getInstance()->setActiveMenuItem($this->activeMenuItem); } - else { - PageMenu::getInstance()->setActiveMenuItem($this->activeMenuItem); - } } } diff --git a/wcfsetup/install/files/lib/page/DashboardPage.class.php b/wcfsetup/install/files/lib/page/DashboardPage.class.php index 1308a4da9e..ec4172f8b3 100644 --- a/wcfsetup/install/files/lib/page/DashboardPage.class.php +++ b/wcfsetup/install/files/lib/page/DashboardPage.class.php @@ -1,7 +1,6 @@ getLandingPage()->menuItem == 'wcf.user.dashboard') { - WCF::getBreadcrumbs()->remove(0); - } - } - /** * @see \wcf\page\AbstractPage::assignVariables() */ diff --git a/wcfsetup/install/files/lib/page/EditHistoryPage.class.php b/wcfsetup/install/files/lib/page/EditHistoryPage.class.php index 1630323d1c..db9e807e6e 100644 --- a/wcfsetup/install/files/lib/page/EditHistoryPage.class.php +++ b/wcfsetup/install/files/lib/page/EditHistoryPage.class.php @@ -121,7 +121,7 @@ class EditHistoryPage extends AbstractPage { $this->object = $processor->getObjectByID($this->objectID); if (!$this->object->getObjectID()) throw new IllegalLinkException(); $processor->checkPermissions($this->object); - $this->activeMenuItem = $processor->getActivePageMenuItem(); + //$this->activeMenuItem = $processor->getActivePageMenuItem(); @todo $this->object->addBreadcrumbs(); if (isset($_REQUEST['newID']) && !$this->new) { diff --git a/wcfsetup/install/files/lib/page/MembersListPage.class.php b/wcfsetup/install/files/lib/page/MembersListPage.class.php index 6873bc1a10..d20585fedc 100644 --- a/wcfsetup/install/files/lib/page/MembersListPage.class.php +++ b/wcfsetup/install/files/lib/page/MembersListPage.class.php @@ -20,11 +20,6 @@ use wcf\util\HeaderUtil; * @category Community Framework */ class MembersListPage extends SortablePage { - /** - * @see \wcf\page\AbstractPage::$activeMenuItem - */ - public $activeMenuItem = 'wcf.user.members'; - /** * available letters * @var string diff --git a/wcfsetup/install/files/lib/page/RecentActivityListPage.class.php b/wcfsetup/install/files/lib/page/RecentActivityListPage.class.php index 1b9d0f73e5..660b6b4710 100644 --- a/wcfsetup/install/files/lib/page/RecentActivityListPage.class.php +++ b/wcfsetup/install/files/lib/page/RecentActivityListPage.class.php @@ -19,11 +19,6 @@ use wcf\system\WCF; * @category Community Framework */ class RecentActivityListPage extends AbstractPage { - /** - * @see \wcf\page\AbstractPage::$activeMenuItem - */ - public $activeMenuItem = 'wcf.user.recentActivity'; - /** * viewable user activity event list * @var \wcf\data\user\activity\event\ViewableUserActivityEventList diff --git a/wcfsetup/install/files/lib/page/SearchResultPage.class.php b/wcfsetup/install/files/lib/page/SearchResultPage.class.php index ec26d23534..8ef62db7b4 100644 --- a/wcfsetup/install/files/lib/page/SearchResultPage.class.php +++ b/wcfsetup/install/files/lib/page/SearchResultPage.class.php @@ -7,7 +7,6 @@ use wcf\system\breadcrumb\Breadcrumb; use wcf\system\event\EventHandler; use wcf\system\exception\IllegalLinkException; use wcf\system\exception\SystemException; -use wcf\system\menu\page\PageMenu; use wcf\system\request\LinkHandler; use wcf\system\search\SearchEngine; use wcf\system\WCF; @@ -105,9 +104,9 @@ class SearchResultPage extends MultipleLinkPage { // set active menu item if (isset($this->searchData['selectedObjectTypes']) && count($this->searchData['selectedObjectTypes']) == 1) { $objectType = SearchEngine::getInstance()->getObjectType(reset($this->searchData['selectedObjectTypes'])); - if (($activeMenuItem = $objectType->getActiveMenuItem())) { + /*if (($activeMenuItem = $objectType->getActiveMenuItem())) { @todo PageMenu::getInstance()->setActiveMenuItem($activeMenuItem); - } + }*/ } // add breadcrumbs diff --git a/wcfsetup/install/files/lib/page/TeamPage.class.php b/wcfsetup/install/files/lib/page/TeamPage.class.php index 6f398580ea..6c9d295927 100644 --- a/wcfsetup/install/files/lib/page/TeamPage.class.php +++ b/wcfsetup/install/files/lib/page/TeamPage.class.php @@ -17,11 +17,6 @@ use wcf\system\WCF; * @category Community Framework */ class TeamPage extends MultipleLinkPage { - /** - * @see \wcf\page\AbstractPage::$activeMenuItem - */ - public $activeMenuItem = 'wcf.user.team'; - /** * @see \wcf\page\AbstractPage::$neededPermissions */ diff --git a/wcfsetup/install/files/lib/page/UserPage.class.php b/wcfsetup/install/files/lib/page/UserPage.class.php index 5778cd2f06..49c7ab034c 100644 --- a/wcfsetup/install/files/lib/page/UserPage.class.php +++ b/wcfsetup/install/files/lib/page/UserPage.class.php @@ -28,11 +28,6 @@ use wcf\system\WCF; * @category Community Framework */ class UserPage extends AbstractPage { - /** - * @see \wcf\page\AbstractPage::$activeMenuItem - */ - public $activeMenuItem = 'wcf.user.members'; - /** * @see \wcf\page\AbstractPage::$enableTracking */ diff --git a/wcfsetup/install/files/lib/page/UsersOnlineListPage.class.php b/wcfsetup/install/files/lib/page/UsersOnlineListPage.class.php index 2598b32524..7c013c47e3 100644 --- a/wcfsetup/install/files/lib/page/UsersOnlineListPage.class.php +++ b/wcfsetup/install/files/lib/page/UsersOnlineListPage.class.php @@ -23,11 +23,6 @@ use wcf\util\HeaderUtil; * @category Community Framework */ class UsersOnlineListPage extends SortablePage { - /** - * @inheritDoc - */ - public $activeMenuItem = 'wcf.user.usersOnline'; - /** * @inheritDoc */ diff --git a/wcfsetup/install/files/lib/system/cache/builder/PageMenuCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/PageMenuCacheBuilder.class.php deleted file mode 100644 index 36c6592e1f..0000000000 --- a/wcfsetup/install/files/lib/system/cache/builder/PageMenuCacheBuilder.class.php +++ /dev/null @@ -1,34 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.cache.builder - * @category Community Framework - */ -class PageMenuCacheBuilder extends AbstractCacheBuilder { - /** - * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild() - */ - public function rebuild(array $parameters) { - $data = array(); - - $menuItemList = new PageMenuItemList(); - $menuItemList->getConditionBuilder()->add("(page_menu_item.isDisabled = ? OR page_menu_item.isLandingPage = ?)", array(0, 1)); - $menuItemList->sqlOrderBy = "page_menu_item.showOrder ASC"; - $menuItemList->readObjects(); - - foreach ($menuItemList as $menuItem) { - $index = ($menuItem->parentMenuItem) ? $menuItem->parentMenuItem : $menuItem->menuPosition; - $data[$index][] = $menuItem; - } - - return $data; - } -} diff --git a/wcfsetup/install/files/lib/system/menu/page/DefaultPageMenuItemProvider.class.php b/wcfsetup/install/files/lib/system/menu/page/DefaultPageMenuItemProvider.class.php deleted file mode 100644 index 9f2c03e22a..0000000000 --- a/wcfsetup/install/files/lib/system/menu/page/DefaultPageMenuItemProvider.class.php +++ /dev/null @@ -1,42 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.menu.page - * @category Community Framework - */ -class DefaultPageMenuItemProvider extends DatabaseObjectDecorator implements IPageMenuItemProvider { - /** - * @see \wcf\data\DatabaseObjectDecorator::$baseClass - */ - protected static $baseClass = 'wcf\data\page\menu\item\PageMenuItem'; - - /** - * @see \wcf\system\menu\page\IPageMenuItemProvider::isVisible() - */ - public function isVisible() { - return true; - } - - /** - * @see \wcf\system\menu\page\IPageMenuItemProvider::getNotifications() - */ - public function getNotifications() { - return 0; - } - - /** - * @see \wcf\system\menu\page\IPageMenuItemProvider::getLink() - */ - public function getLink() { - // explicit call to satisfy our interface - return $this->getDecoratedObject()->getLink(); - } -} diff --git a/wcfsetup/install/files/lib/system/menu/page/IPageMenuItemProvider.class.php b/wcfsetup/install/files/lib/system/menu/page/IPageMenuItemProvider.class.php deleted file mode 100644 index 9f093f4275..0000000000 --- a/wcfsetup/install/files/lib/system/menu/page/IPageMenuItemProvider.class.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.menu.page - * @category Community Framework - */ -interface IPageMenuItemProvider extends IDatabaseObjectProcessor { - /** - * Returns true if the associated menu item should be visible for the active user. - * - * @return boolean - */ - public function isVisible(); - - /** - * Returns the number of notifications for the associated menu item. - * - * @return integer - */ - public function getNotifications(); - - /** - * Returns the href of the associated menu item. - * - * @return string - */ - public function getLink(); -} diff --git a/wcfsetup/install/files/lib/system/menu/page/PageMenu.class.php b/wcfsetup/install/files/lib/system/menu/page/PageMenu.class.php deleted file mode 100644 index a19c065f06..0000000000 --- a/wcfsetup/install/files/lib/system/menu/page/PageMenu.class.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.menu.page - * @category Community Framework - */ -class PageMenu extends TreeMenu { - /** - * @inheritDoc - * @throws SystemException - */ - protected function init() { - // get menu items from cache - $this->loadCache(); - - // check menu items - $this->checkMenuItems('header'); - $this->checkMenuItems('footer'); - - // build plain menu item list - $this->buildMenuItemList('header'); - $this->buildMenuItemList('footer'); - - // call init event - EventHandler::getInstance()->fireAction($this, 'init'); - } - - /** - * @inheritDoc - */ - protected function loadCache() { - parent::loadCache(); - - // get cache - $this->menuItems = PageMenuCacheBuilder::getInstance()->getData(); - } - - /** - * @inheritDoc - */ - protected function checkMenuItem(ITreeMenuItem $item) { - if (!parent::checkMenuItem($item)) return false; - - if ($item instanceof ProcessibleDatabaseObject && $item->getProcessor() instanceof IPageMenuItemProvider) { - return $item->getProcessor()->isVisible(); - } - - return true; - } - - /** - * @inheritDoc - */ - public function setActiveMenuItem($menuItem) { - if (isset($this->menuItemList[$menuItem]) && $this->menuItemList[$menuItem]->menuPosition == 'footer') { - // ignore footer items - return; - } - - parent::setActiveMenuItem($menuItem); - } -} diff --git a/wcfsetup/install/files/lib/system/menu/user/UserMenu.class.php b/wcfsetup/install/files/lib/system/menu/user/UserMenu.class.php index 0fb8d7a9b5..8a13b286d7 100644 --- a/wcfsetup/install/files/lib/system/menu/user/UserMenu.class.php +++ b/wcfsetup/install/files/lib/system/menu/user/UserMenu.class.php @@ -2,7 +2,6 @@ namespace wcf\system\menu\user; use wcf\data\ProcessibleDatabaseObject; use wcf\system\cache\builder\UserMenuCacheBuilder; -use wcf\system\menu\page\IPageMenuItemProvider; use wcf\system\menu\ITreeMenuItem; use wcf\system\menu\TreeMenu; @@ -32,9 +31,9 @@ class UserMenu extends TreeMenu { protected function checkMenuItem(ITreeMenuItem $item) { if (!parent::checkMenuItem($item)) return false; - if ($item instanceof ProcessibleDatabaseObject && $item->getProcessor() instanceof IPageMenuItemProvider) { + /*if ($item instanceof ProcessibleDatabaseObject && $item->getProcessor() instanceof IPageMenuItemProvider) { @todo return $item->getProcessor()->isVisible(); - } + }*/ return true; } diff --git a/wcfsetup/install/files/lib/system/package/plugin/PageMenuPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/PageMenuPackageInstallationPlugin.class.php deleted file mode 100644 index ea2f337bbf..0000000000 --- a/wcfsetup/install/files/lib/system/package/plugin/PageMenuPackageInstallationPlugin.class.php +++ /dev/null @@ -1,125 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.package.plugin - * @category Community Framework - */ -class PageMenuPackageInstallationPlugin extends AbstractMenuPackageInstallationPlugin { - /** - * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$className - */ - public $className = 'wcf\data\page\menu\item\PageMenuItemEditor'; - - /** - * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport() - */ - protected function prepareImport(array $data) { - $result = parent::prepareImport($data); - - // position - $result['menuPosition'] = (!empty($data['elements']['position']) && $data['elements']['position'] == 'footer') ? 'footer' : 'header'; - - // class name - if (!empty($data['elements']['classname'])) { - $result['className'] = $data['elements']['classname']; - } - - // validate controller and link (cannot be empty at the same time) - if (empty($result['menuItemLink']) && empty($result['menuItemController'])) { - throw new SystemException("Menu item '".$result['menuItem']."' neither has a link nor a controller given"); - } - - $result['originIsSystem'] = 1; - - return $result; - } - - /** - * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::cleanup() - */ - protected function cleanup() { - PageMenuItemEditor::updateLandingPage(); - } - - /** - * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::import() - */ - protected function import(array $row, array $data) { - if (!empty($row)) { - // ignore show order if null - if ($data['showOrder'] === null) { - unset($data['showOrder']); - } - else if ($data['showOrder'] != $row['showOrder']) { - $data['showOrder'] = $this->getMenuItemPosition($data); - } - } - else { - $data['showOrder'] = $this->getMenuItemPosition($data); - } - - parent::import($row, $data); - } - - /** - * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::getShowOrder() - */ - protected function getShowOrder($showOrder, $parentName = null, $columnName = null, $tableNameExtension = '') { - // will be recalculated anyway - return $showOrder; - } - - /** - * Returns menu item position. - * - * @param array $data - * @return integer - */ - protected function getMenuItemPosition(array $data) { - if ($data['showOrder'] === null) { - // get greatest showOrder value - $conditions = new PreparedStatementConditionBuilder(); - $conditions->add("menuPosition = ?", array($data['menuPosition'])); - if ($data['parentMenuItem']) $conditions->add("parentMenuItem = ?", array($data['parentMenuItem'])); - - $sql = "SELECT MAX(showOrder) AS showOrder - FROM wcf".WCF_N."_".$this->tableName." - ".$conditions; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute($conditions->getParameters()); - $maxShowOrder = $statement->fetchArray(); - return (!$maxShowOrder) ? 1 : ($maxShowOrder['showOrder'] + 1); - } - else { - // increase all showOrder values which are >= $showOrder - $sql = "UPDATE wcf".WCF_N."_".$this->tableName." - SET showOrder = showOrder + 1 - WHERE showOrder >= ? - AND menuPosition = ? - AND parentMenuItem = ".($data['parentMenuItem'] ? "?" : "''"); - $statement = WCF::getDB()->prepareStatement($sql); - - $parameters = array( - $data['showOrder'], - $data['menuPosition'] - ); - if ($data['parentMenuItem']) $parameters[] = $data['parentMenuItem']; - - $statement->execute($parameters); - - // return the wanted showOrder level - return $data['showOrder']; - } - } -} diff --git a/wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php b/wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php index ba6f6e224f..58c6a6defe 100644 --- a/wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php +++ b/wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php @@ -1,6 +1,5 @@ isACPRequest()) { - $landingPage = PageMenu::getInstance()->getLandingPage(); + // TODO + //$landingPage = PageMenu::getInstance()->getLandingPage(); + $landingPage = null; // check if this is the default controller if (strcasecmp(RouteHandler::getInstance()->getDefaultController($application), $components['controller']) === 0) { diff --git a/wcfsetup/install/files/lib/system/request/LinkHandler.class.php b/wcfsetup/install/files/lib/system/request/LinkHandler.class.php index 8e77ba2da9..c6bc115f5b 100644 --- a/wcfsetup/install/files/lib/system/request/LinkHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/LinkHandler.class.php @@ -3,7 +3,6 @@ namespace wcf\system\request; use wcf\data\DatabaseObjectDecorator; use wcf\system\application\ApplicationHandler; use wcf\system\language\LanguageFactory; -use wcf\system\menu\page\PageMenu; use wcf\system\Regex; use wcf\system\SingletonFactory; use wcf\system\WCF; diff --git a/wcfsetup/install/files/lib/system/request/Route.class.php b/wcfsetup/install/files/lib/system/request/Route.class.php index 883690a14e..3e5eccc35d 100644 --- a/wcfsetup/install/files/lib/system/request/Route.class.php +++ b/wcfsetup/install/files/lib/system/request/Route.class.php @@ -2,7 +2,6 @@ namespace wcf\system\request; use wcf\system\application\ApplicationHandler; use wcf\system\exception\SystemException; -use wcf\system\menu\page\PageMenu; use wcf\system\WCF; /** @@ -276,10 +275,11 @@ class Route implements IRoute { $ignoreController = true; } else if (!RequestHandler::getInstance()->isACPRequest()) { + /* TODO: $landingPage = PageMenu::getInstance()->getLandingPage(); if ($landingPage !== null && strcasecmp($landingPage->getController(), $components['controller']) == 0) { $ignoreController = true; - } + }*/ // check if this is the default controller of the requested application /* diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 43a980866c..e4801016b8 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -582,9 +582,6 @@ - - - @@ -1262,35 +1259,6 @@ GmbH=Gesellschaft mit beschränkter Haftung]]> title|language}“ wirklich löschen?]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ihre PHP-Version wurde ohne Unterstützung für OpenSSL kompiliert und kann daher keine sicheren Verbindungen aufbauen, bitte wenden Sie sich an Ihren Anbieter oder System-Administrator um diesen Umstand zu korrigieren.]]>
diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index e5730ed2d0..2ee2c72b4d 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -580,9 +580,6 @@ Examples for medium ID detection: - - - @@ -1260,35 +1257,6 @@ GmbH=Gesellschaft mit beschränkter Haftung]]> title|language}”?]]>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Your PHP version has been compiled without OpenSSL support required to establish secure connections, please contact your hosting company or system-administrator to resolve this shortcoming.]]>
diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index 6eb26c6b2c..fd012e4fb6 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -935,25 +935,6 @@ CREATE TABLE wcf1_page_content ( UNIQUE KEY (pageID, languageID) ); -DROP TABLE IF EXISTS wcf1_page_menu_item; -CREATE TABLE wcf1_page_menu_item ( - menuItemID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, - packageID INT(10) NOT NULL, - menuItem VARCHAR(255) NOT NULL DEFAULT '', - parentMenuItem VARCHAR(255) NOT NULL DEFAULT '', - menuItemController VARCHAR(255) NOT NULL DEFAULT '', - menuItemLink VARCHAR(255) NOT NULL DEFAULT '', - menuPosition ENUM('header', 'footer') NOT NULL DEFAULT 'header', - showOrder INT(10) NOT NULL DEFAULT 0, - permissions TEXT NULL, - options TEXT NULL, - isDisabled TINYINT(1) NOT NULL DEFAULT 0, - className VARCHAR(255) NOT NULL DEFAULT '', - isLandingPage TINYINT(1) NOT NULL DEFAULT 0, - originIsSystem TINYINT(1) NOT NULL DEFAULT 0, - UNIQUE KEY (packageID, menuItem) -); - DROP TABLE IF EXISTS wcf1_paid_subscription; CREATE TABLE wcf1_paid_subscription ( subscriptionID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -1766,8 +1747,6 @@ ALTER TABLE wcf1_page ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packa ALTER TABLE wcf1_page_content ADD FOREIGN KEY (pageID) REFERENCES wcf1_page (pageID) ON DELETE CASCADE; ALTER TABLE wcf1_page_content ADD FOREIGN KEY (languageID) REFERENCES wcf1_language (languageID) ON DELETE CASCADE; -ALTER TABLE wcf1_page_menu_item ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE; - ALTER TABLE wcf1_search ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE; ALTER TABLE wcf1_session ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE;