From: Marcel Werk Date: Tue, 28 Aug 2012 10:37:16 +0000 (+0200) Subject: Removed page location table X-Git-Tag: 2.0.0_Beta_1~948^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a3a2a1722e08a4413099c0a3b7e0ea13ad3bc49b;p=GitHub%2FWoltLab%2FWCF.git Removed page location table --- diff --git a/wcfsetup/install/files/lib/data/page/location/PageLocation.class.php b/wcfsetup/install/files/lib/data/page/location/PageLocation.class.php deleted file mode 100644 index c85efc46e2..0000000000 --- a/wcfsetup/install/files/lib/data/page/location/PageLocation.class.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage data.page.location - * @category Community Framework - */ -class PageLocation extends ProcessibleDatabaseObject { - /** - * @see wcf\data\DatabaseObject::$databaseTableName - */ - protected static $databaseTableName = 'page_location'; - - /** - * @see wcf\data\DatabaseObject::$databaseIndexName - */ - protected static $databaseIndexName = 'locationID'; - - /** - * @see wcf\data\ProcessibleDatabaseObject::$processorInterface - */ - protected static $processorInterface = 'wcf\system\page\location\IPageLocation'; -} diff --git a/wcfsetup/install/files/lib/data/page/location/PageLocationAction.class.php b/wcfsetup/install/files/lib/data/page/location/PageLocationAction.class.php deleted file mode 100644 index aeed932938..0000000000 --- a/wcfsetup/install/files/lib/data/page/location/PageLocationAction.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage data.page.location - * @category Community Framework - */ -class PageLocationAction extends AbstractDatabaseObjectAction { - /** - * @see wcf\data\AbstractDatabaseObjectAction::$className - */ - protected $className = 'wcf\data\page\location\PageLocationEditor'; -} diff --git a/wcfsetup/install/files/lib/data/page/location/PageLocationEditor.class.php b/wcfsetup/install/files/lib/data/page/location/PageLocationEditor.class.php deleted file mode 100644 index c47a5370e0..0000000000 --- a/wcfsetup/install/files/lib/data/page/location/PageLocationEditor.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage data.page.location - * @category Community Framework - */ -class PageLocationEditor extends DatabaseObjectEditor { - /** - * @see wcf\data\DatabaseObjectDecorator::$baseClass - */ - protected static $baseClass = 'wcf\data\page\location\PageLocation'; -} diff --git a/wcfsetup/install/files/lib/data/page/location/PageLocationList.class.php b/wcfsetup/install/files/lib/data/page/location/PageLocationList.class.php deleted file mode 100644 index ea03b99483..0000000000 --- a/wcfsetup/install/files/lib/data/page/location/PageLocationList.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage data.page.location - * @category Community Framework - */ -class PageLocationList extends DatabaseObjectList { - /** - * @see wcf\data\DatabaseObjectList::$className - */ - public $className = 'wcf\data\page\location\PageLocation'; -} 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 da0cfff9bc..0000000000 --- a/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItem.class.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage data.page.menu.item - * @category Community Framework - */ -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'; - - /** - * @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() { - $abbreviation = ApplicationHandler::getInstance()->getAbbreviation($this->packageID); - - $parameters = array(); - if ($abbreviation) { - $parameters['application'] = $abbreviation; - } - - return LinkHandler::getInstance()->getLink(null, $parameters, $this->menuItemLink); - } -} 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 6cdf31d201..0000000000 --- a/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemAction.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage data.page.menu.item - * @category Community Framework - */ -class PageMenuItemAction extends AbstractDatabaseObjectAction { - /** - * @see wcf\data\AbstractDatabaseObjectAction::$className - */ - protected $className = 'wcf\data\page\menu\item\PageMenuItemEditor'; -} 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 298bdb7cf0..0000000000 --- a/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemEditor.class.php +++ /dev/null @@ -1,188 +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::create() - * - * @todo Handle language id and create related language item - */ - public static function create(array $parameters = array()) { - // calculate show order - $parameters['showOrder'] = self::getShowOrder($parameters['showOrder'], $parameters['menuPosition']); - - return parent::create($parameters); - } - - /** - * @see wcf\data\IEditableObject::update() - * - * @todo Handle language id and update related language item - */ - public function update(array $parameters = array()) { - if (isset($parameters['menuPosition']) && isset($parameters['showOrder'])) { - $this->updateShowOrder($parameters['showOrder'], $parameters['menuPosition']); - } - - parent::update($parameters); - } - - /** - * @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(); - } - - /** - * 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 - )); - } - - /** - * Updates show order for current menu item. - * - * @param integer $showOrder - * @param string $menuPosition - */ - protected function updateShowOrder($showOrder, $menuPosition) { - if ($menuPosition == $this->menuPosition) { - if ($this->showOrder != $showOrder) { - if ($showOrder < $this->showOrder) { - $sql = "UPDATE wcf".WCF_N."_page_menu_item - SET showOrder = showOrder + 1 - WHERE showOrder >= ? - AND showOrder < ? - AND menuPosition = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array( - $showOrder, - $this->showOrder, - $menuPosition - )); - } - else if ($showOrder > $this->showOrder) { - $sql = "UPDATE wcf".WCF_N."_page_menu_item - SET showOrder = showOrder - 1 - WHERE showOrder <= ? - AND showOrder > ? - AND menuPosition = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array( - $showOrder, - $this->showOrder, - $menuPosition - )); - } - } - } - else { - $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 - )); - - $sql = "UPDATE wcf".WCF_N."_page_menu_item - SET showOrder = showOrder + 1 - WHERE showOrder >= ? - AND menuPosition = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array( - $showOrder, - $menuPosition - )); - } - } - - /** - * Returns show order for a new menu item. - * - * @param integer $showOrder - * @param string $menuPosition - * @return integer - */ - protected static function getShowOrder($showOrder, $menuPosition) { - if ($showOrder == 0) { - // get next number in row - $sql = "SELECT MAX(showOrder) AS showOrder - FROM wcf".WCF_N."_page_menu_item - WHERE menuPosition = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array($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 showOrder >= ? - AND menuPosition = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array( - $showOrder, - $menuPosition - )); - } - - return $showOrder; - } - - /** - * @see wcf\data\IEditableCachedObject::resetCache() - */ - public static function resetCache() { - CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.pageMenu-*.php'); - } -} 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 b4c11f73ec..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/system/page/location/IPageLocation.class.php b/wcfsetup/install/files/lib/system/page/location/IPageLocation.class.php deleted file mode 100644 index 7d7b2560fe..0000000000 --- a/wcfsetup/install/files/lib/system/page/location/IPageLocation.class.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.page.location - * @category Community Framework - */ -interface IPageLocation extends IDatabaseObjectProcessor { - /** - * Caches the information of a page location. - * - * @param wcf\data\page\location\PageLocation $location - * @param string $requestURI - * @param string $requestMethod - * @param array $match - */ - public function cache(PageLocation $location, $requestURI, $requestMethod, array $match); - - /** - * Returns the information of a page location. - * - * @param wcf\data\page\location\PageLocation $location - * @param string $requestURI - * @param string $requestMethod - * @param array $match - * @return string - */ - public function get(PageLocation $location, $requestURI, $requestMethod, array $match); -} diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index 909c293bb9..99c5d955d2 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -487,16 +487,6 @@ CREATE TABLE wcf1_package_update_version ( UNIQUE KEY packageUpdateID (packageUpdateID, packageVersion) ); -DROP TABLE IF EXISTS wcf1_page_location; -CREATE TABLE wcf1_page_location ( - locationID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, - locationPattern VARCHAR(255) NOT NULL DEFAULT '', - locationName VARCHAR(255) NOT NULL DEFAULT '', - packageID INT(10) NOT NULL, - className varchar(255) NOT NULL DEFAULT '', - UNIQUE KEY (packageID, locationName) -); - DROP TABLE IF EXISTS wcf1_page_menu_item; CREATE TABLE wcf1_page_menu_item ( menuItemID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,