From 790a9c0b1614efcf436abb843cf501562afff291 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 1 Jan 2013 22:01:32 +0100 Subject: [PATCH] Removed PackageListPage, will be replace with "old" list --- wcfsetup/install/files/acp/js/WCF.ACP.js | 109 ----------------- .../files/acp/templates/packageList.tpl | 110 ------------------ .../lib/acp/page/PackageListPage.class.php | 97 --------------- .../lib/data/package/PackageAction.class.php | 32 +---- 4 files changed, 1 insertion(+), 347 deletions(-) delete mode 100644 wcfsetup/install/files/acp/templates/packageList.tpl delete mode 100755 wcfsetup/install/files/lib/acp/page/PackageListPage.class.php diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.js b/wcfsetup/install/files/acp/js/WCF.ACP.js index 311ad34575..260f843482 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.js @@ -191,115 +191,6 @@ WCF.ACP.Menu = Class.extend({ */ WCF.ACP.Package = {}; -/** - * Paginated package list. - * - * @param integer pages - */ -WCF.ACP.Package.List = Class.extend({ - /** - * page cache - * @var object - */ - _pages: {}, - - /** - * plugin list references - * @var object - */ - _pluginLists: [], - - /** - * action proxy - * @var WCF.Action.Proxy - */ - _proxy: null, - - /** - * target container - * @var jQuery - */ - _template: null, - - /** - * Initializes the package list. - * - * @param integer pages - */ - init: function(pages) { - // handle pagination - $('.jsPluginListPagination').each($.proxy(function(index, pluginList) { - var $wcfPages = $(pluginList).wcfPages({ - activePage: 1, - maxPage: pages - }).bind('wcfpagesshouldswitch', $.proxy(this._cachePage, this)).bind('wcfpagesswitched', $.proxy(this._loadPage, this)); - - this._pluginLists.push($wcfPages); - }, this)); - - // initialize - if (this._pluginLists.length > 0) { - this._proxy = new WCF.Action.Proxy({ - success: $.proxy(this._success, this) - }); - this._template = $('#plugins ol'); - } - }, - - /** - * Caches currently active page. - * - * @param object event - * @param object data - */ - _cachePage: function(event, data) { - if (!this._pages[data.currentPage]) { - this._pages[data.currentPage] = $('#plugins ol').html(); - } - }, - - /** - * Loads the request page using AJAX. - * - * @param object event - * @param object data - */ - _loadPage: function(event, data) { - // update active page - for (var $i = 0, $size = this._pluginLists.length; $i < $size; $i++) { - this._pluginLists[$i].wcfPages('switchPage', data.activePage); - } - - // load page from cache if applicable - if (this._pages[data.activePage]) { - this._template.html(this._pages[data.activePage]); - return; - } - - // load content using AJAX - this._proxy.setOption('data', { - actionName: 'getPluginList', - className: 'wcf\\data\\package\\PackageAction', - parameters: { - activePage: data.activePage - } - }); - this._proxy.sendRequest(); - }, - - /** - * Displays the fetched page. - * - * @param object data - * @param string textStatus - * @param jQuery jqXHR - */ - _success: function(data, textStatus, jqXHR) { - this._pages[data.returnValues.activePage] = data.returnValues.template; - this._loadPage(null, { activePage: data.returnValues.activePage }); - } -}); - /** * Provides the package installation. * diff --git a/wcfsetup/install/files/acp/templates/packageList.tpl b/wcfsetup/install/files/acp/templates/packageList.tpl deleted file mode 100644 index 8560945f2e..0000000000 --- a/wcfsetup/install/files/acp/templates/packageList.tpl +++ /dev/null @@ -1,110 +0,0 @@ -{include file='header' pageTitle='wcf.acp.package.list'} - - - -
-
-

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

-
-
- -
- - - - - {hascontent} - - {/hascontent} -
- -
- -
- -{include file='footer'} diff --git a/wcfsetup/install/files/lib/acp/page/PackageListPage.class.php b/wcfsetup/install/files/lib/acp/page/PackageListPage.class.php deleted file mode 100755 index 65aedd9dfa..0000000000 --- a/wcfsetup/install/files/lib/acp/page/PackageListPage.class.php +++ /dev/null @@ -1,97 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage acp.page - * @category Community Framework - */ -class PackageListPage extends AbstractPage { - /** - * @see wcf\page\AbstractPage::$activeMenuItem - */ - public $activeMenuItem = 'wcf.acp.menu.link.package.list'; - - /** - * list of applications - * @var wcf\data\package\PackageList - */ - protected $applicationList = null; - - /** - * plugin count - * @var integer - */ - protected $pluginCount = 0; - - /** - * list of plugins - * @var wcf\data\package\PackageList - */ - protected $pluginList = null; - - /** - * @see wcf\page\IPage::readData() - */ - public function readData() { - parent::readData(); - - // read applications - $this->applicationList = new PackageList(); - $this->applicationList->getConditionBuilder()->add("package.isApplication = ?", array(1)); - $this->applicationList->getConditionBuilder()->add("package.packageID <> ?", array(1)); - $this->applicationList->sqlLimit = 0; - $this->applicationList->readObjects(); - - // read plugins - $this->pluginList = Package::getPluginList(); - - // count total plugins - $this->pluginCount = $this->pluginList->countObjects(); - - // read plugins - $this->pluginList->sqlLimit = 20; - $this->pluginList->readObjects(); - } - - /** - * @see wcf\page\IPage::assignVariables() - */ - public function assignVariables() { - parent::assignVariables(); - - WCF::getTPL()->assign(array( - 'applications' => $this->applicationList, - 'plugins' => $this->pluginList, - 'pluginsCount' => $this->pluginCount - )); - } - - /** - * @see wcf\page\IPage::show() - */ - public function show() { - // use detailed view if accessing WCF ACP directly - if (PACKAGE_ID == 1) { - // base tag is determined on runtime - $host = RouteHandler::getHost(); - $path = RouteHandler::getPath(); - - HeaderUtil::redirect($host . $path . 'index.php/PackageListDetailed/' . SID_ARG_1ST); - exit; - } - - parent::show(); - } -} diff --git a/wcfsetup/install/files/lib/data/package/PackageAction.class.php b/wcfsetup/install/files/lib/data/package/PackageAction.class.php index e509cf2db0..8edd8b4866 100644 --- a/wcfsetup/install/files/lib/data/package/PackageAction.class.php +++ b/wcfsetup/install/files/lib/data/package/PackageAction.class.php @@ -1,8 +1,7 @@ parameters['activePage']) || !intval($this->parameters['activePage'])) { - throw new UserInputException('activePage'); - } - } - - /** - * Returns a list of plugins. - * - * @return array - */ - public function getPluginList() { - $pluginList = Package::getPluginList(); - $pluginList->sqlLimit = 20; - $pluginList->sqlOffset = (($this->parameters['activePage'] - 1) * $pluginList->sqlLimit); - $pluginList->readObjects(); - - WCF::getTPL()->assign(array( - 'plugins' => $pluginList - )); - return array( - 'activePage' => $this->parameters['activePage'], - 'template' => WCF::getTPL()->fetch('packageListPlugins') - ); - } - /** * Validates parameters to return the confirm message for package uninstallation. */ -- 2.20.1