Removed page location table
authorMarcel Werk <burntime@woltlab.com>
Tue, 28 Aug 2012 10:37:16 +0000 (12:37 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 28 Aug 2012 10:37:16 +0000 (12:37 +0200)
wcfsetup/install/files/lib/data/page/location/PageLocation.class.php [deleted file]
wcfsetup/install/files/lib/data/page/location/PageLocationAction.class.php [deleted file]
wcfsetup/install/files/lib/data/page/location/PageLocationEditor.class.php [deleted file]
wcfsetup/install/files/lib/data/page/location/PageLocationList.class.php [deleted file]
wcfsetup/install/files/lib/data/page/menu/item/PageMenuItem.class.php [deleted file]
wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemAction.class.php [deleted file]
wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemEditor.class.php [deleted file]
wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemList.class.php [deleted file]
wcfsetup/install/files/lib/system/page/location/IPageLocation.class.php [deleted file]
wcfsetup/setup/db/install.sql

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 (file)
index c85efc4..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-namespace wcf\data\page\location;
-use wcf\data\ProcessibleDatabaseObject;
-
-/**
- * Represents a page location.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @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 (file)
index aeed932..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace wcf\data\page\location;
-use wcf\data\AbstractDatabaseObjectAction;
-
-/**
- * Executes page location-related actions.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @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 (file)
index c47a537..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace wcf\data\page\location;
-use wcf\data\DatabaseObjectEditor;
-
-/**
- * Provides functions to edit page locations.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @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 (file)
index ea03b99..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace wcf\data\page\location;
-use wcf\data\DatabaseObjectList;
-
-/**
- * Represents a list of page locations.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @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 (file)
index da0cfff..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-namespace wcf\data\page\menu\item;
-use wcf\data\ProcessibleDatabaseObject;
-use wcf\system\application\ApplicationHandler;
-use wcf\system\menu\page\DefaultPageMenuItemProvider;
-use wcf\system\menu\ITreeMenuItem;
-use wcf\system\request\LinkHandler;
-
-/**
- * Represents an page menu item.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @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 (file)
index 6cdf31d..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace wcf\data\page\menu\item;
-use wcf\data\AbstractDatabaseObjectAction;
-
-/**
- * Executes page menu item-related actions.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @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 (file)
index 298bdb7..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-<?php
-namespace wcf\data\page\menu\item;
-use wcf\data\DatabaseObjectEditor;
-use wcf\data\IEditableCachedObject;
-use wcf\system\cache\CacheHandler;
-use wcf\system\WCF;
-
-/**
- * Provides functions to edit page menu items.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @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 (file)
index b4c11f7..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-namespace wcf\data\page\menu\item;
-use wcf\data\DatabaseObjectList;
-
-/**
- * Represents a list of page menu items.
- * 
- * @author     Alexander Ebert
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @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 (file)
index 7d7b256..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-namespace wcf\system\page\location;
-use wcf\data\page\location\PageLocation;
-use wcf\data\IDatabaseObjectProcessor;
-
-/**
- * Any page location class should implement this interface.
- *
- * @author     Marcel Werk
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @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);
-}
index 909c293bb92a03e339648490519202ce69a75225..99c5d955d2e05b0d78e3c55575dad870b470fc66 100644 (file)
@@ -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,