From: Luzifr Date: Thu, 13 Oct 2011 16:55:23 +0000 (+0200) Subject: Renamed templates and classes X-Git-Tag: 2.0.0_Beta_1~1686^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0892d9e28c5d25f939f408d2ba4e146c0944719f;p=GitHub%2FWoltLab%2FWCF.git Renamed templates and classes *detailedPackageList* -> *packageListDetailed*; *startInstall* -> *installation*. Please check back if everything still works properly! The second change (install) seems to produce problems! --- diff --git a/wcfsetup/install/files/acp/templates/detailedPackageList.tpl b/wcfsetup/install/files/acp/templates/detailedPackageList.tpl deleted file mode 100644 index 74c99dcac1..0000000000 --- a/wcfsetup/install/files/acp/templates/detailedPackageList.tpl +++ /dev/null @@ -1,108 +0,0 @@ -{include file='header'} - - - -
- -
-

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

-
-
- -
- {pages print=true assign=pagesLinks controller='DetailedPackageList' link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder"} - - {if $__wcf->session->getPermission('admin.system.package.canInstallPackage') || $additionalLargeButtons|isset} - - {/if} -
- -{if $objects|count > 0} -
-
-

{lang}wcf.acp.package.list{/lang} {#$items}

-
- - - - - - - - - - - {if $additionalHeadColumns|isset}{@$additionalHeadColumns}{/if} - - - - - {foreach from=$objects item=$package} - - - - - - - - - - {if $additionalColumns[$package->packageID]|isset}{@$additionalColumns[$package->packageID]}{/if} - - {/foreach} - -
{lang}wcf.acp.package.list.id{/lang}{if $sortField == 'packageID'} {/if}{lang}wcf.acp.package.list.name{/lang}{if $sortField == 'packageName'} {/if}{lang}wcf.acp.package.list.author{/lang}{if $sortField == 'author'} {/if}{lang}wcf.acp.package.list.version{/lang}{if $sortField == 'packageVersion'} {/if}{lang}wcf.acp.package.updateDate{/lang}{if $sortField == 'updateDate'} {/if}
- {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')} - - {else} - - {/if} - {if $__wcf->session->getPermission('admin.system.package.canUninstallPackage') && $package->package != 'com.woltlab.wcf' && $package->packageID != PACKAGE_ID} - - {else} - - {/if} - - {if $additionalButtons[$package->packageID]|isset}{@$additionalButtons[$package->packageID]}{/if} -

{@$package->packageID}

- {if $package->standalone} - - {elseif $package->isPlugin()} - - {else} - - {/if} - - {$package->getName()}{if $package->instanceNo > 1 && $package->instanceName == ''} (#{#$package->instanceNo}){/if} - authorURL|rawurlencode}" class="externalURL">{$package->author}{else}{$package->author}{/if}

{$package->packageVersion}

{@$package->updateDate|time}

- -
-{/if} - -
- {@$pagesLinks} - - {if $__wcf->session->getPermission('admin.system.package.canInstallPackage') || $additionalLargeButtons|isset} - - {/if} -
- -{include file='footer'} diff --git a/wcfsetup/install/files/acp/templates/packageInstallation.tpl b/wcfsetup/install/files/acp/templates/packageInstallation.tpl new file mode 100644 index 0000000000..0d3d0f2053 --- /dev/null +++ b/wcfsetup/install/files/acp/templates/packageInstallation.tpl @@ -0,0 +1,82 @@ +{include file='header'} + +
+ {if $packageID == 0} + +
+

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

+
+ {else} + +
+

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

+
+ {/if} +
+ +{if $errorField != ''} +

{lang}wcf.global.form.error{/lang}

+{/if} + +
+ +
+ +
+
+ +
+ {lang}wcf.acp.package.installation.source{/lang} + + +
+
+ + {if $errorField == 'uploadPackage'} + + {if $errorType == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {elseif $errorType == 'phpRequirements'} + {* todo: use language variable (-> else) *} +
{$phpRequirements|print_r}
+ {else} + {lang}wcf.acp.package.installation.error.{@$errorType}{/lang} + {/if} +
+ {/if} + {lang}wcf.acp.package.installation.source.upload.description{/lang} +
+ + + +
+
+ + {if $errorField == 'downloadPackage'} + + {lang}wcf.acp.package.installation.error.{@$errorType}{/lang} + + {/if} + {lang}wcf.acp.package.installation.source.download.description{/lang} +
+ +
+ + {if $additionalFields|isset}{@$additionalFields}{/if} +
+ +
+ + + {@SID_INPUT_TAG} + + {if $packageID != 0}{/if} +
+
+ +{include file='footer'} diff --git a/wcfsetup/install/files/acp/templates/packageList.tpl b/wcfsetup/install/files/acp/templates/packageList.tpl index 489887f456..9cfe50a308 100644 --- a/wcfsetup/install/files/acp/templates/packageList.tpl +++ b/wcfsetup/install/files/acp/templates/packageList.tpl @@ -72,7 +72,7 @@ @@ -102,7 +102,7 @@
diff --git a/wcfsetup/install/files/acp/templates/packageListDetailed.tpl b/wcfsetup/install/files/acp/templates/packageListDetailed.tpl new file mode 100644 index 0000000000..36672ca0f4 --- /dev/null +++ b/wcfsetup/install/files/acp/templates/packageListDetailed.tpl @@ -0,0 +1,108 @@ +{include file='header'} + + + +
+ +
+

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

+
+
+ +
+ {pages print=true assign=pagesLinks controller='PackageListDetailed' link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder"} + + {if $__wcf->session->getPermission('admin.system.package.canInstallPackage') || $additionalLargeButtons|isset} + + {/if} +
+ +{if $objects|count > 0} +
+
+

{lang}wcf.acp.package.list{/lang} {#$items}

+
+ + + + + + + + + + + {if $additionalHeadColumns|isset}{@$additionalHeadColumns}{/if} + + + + + {foreach from=$objects item=$package} + + + + + + + + + + {if $additionalColumns[$package->packageID]|isset}{@$additionalColumns[$package->packageID]}{/if} + + {/foreach} + +
{lang}wcf.acp.package.list.id{/lang}{if $sortField == 'packageID'} {/if}{lang}wcf.acp.package.list.name{/lang}{if $sortField == 'packageName'} {/if}{lang}wcf.acp.package.list.author{/lang}{if $sortField == 'author'} {/if}{lang}wcf.acp.package.list.version{/lang}{if $sortField == 'packageVersion'} {/if}{lang}wcf.acp.package.updateDate{/lang}{if $sortField == 'updateDate'} {/if}
+ {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')} + + {else} + + {/if} + {if $__wcf->session->getPermission('admin.system.package.canUninstallPackage') && $package->package != 'com.woltlab.wcf' && $package->packageID != PACKAGE_ID} + + {else} + + {/if} + + {if $additionalButtons[$package->packageID]|isset}{@$additionalButtons[$package->packageID]}{/if} +

{@$package->packageID}

+ {if $package->standalone} + + {elseif $package->isPlugin()} + + {else} + + {/if} + + {$package->getName()}{if $package->instanceNo > 1 && $package->instanceName == ''} (#{#$package->instanceNo}){/if} + authorURL|rawurlencode}" class="externalURL">{$package->author}{else}{$package->author}{/if}

{$package->packageVersion}

{@$package->updateDate|time}

+ +
+{/if} + +
+ {@$pagesLinks} + + {if $__wcf->session->getPermission('admin.system.package.canInstallPackage') || $additionalLargeButtons|isset} + + {/if} +
+ +{include file='footer'} diff --git a/wcfsetup/install/files/acp/templates/packageListPlugins.tpl b/wcfsetup/install/files/acp/templates/packageListPlugins.tpl index 986926054a..380537306b 100644 --- a/wcfsetup/install/files/acp/templates/packageListPlugins.tpl +++ b/wcfsetup/install/files/acp/templates/packageListPlugins.tpl @@ -5,7 +5,7 @@ diff --git a/wcfsetup/install/files/acp/templates/packageStartInstall.tpl b/wcfsetup/install/files/acp/templates/packageStartInstall.tpl deleted file mode 100644 index 25f189cd39..0000000000 --- a/wcfsetup/install/files/acp/templates/packageStartInstall.tpl +++ /dev/null @@ -1,82 +0,0 @@ -{include file='header'} - -
- {if $packageID == 0} - -
-

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

-
- {else} - -
-

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

-
- {/if} -
- -{if $errorField != ''} -

{lang}wcf.global.form.error{/lang}

-{/if} - -
- -
- -
-
- -
- {lang}wcf.acp.package.startInstall.source{/lang} - - -
-
- - {if $errorField == 'uploadPackage'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {elseif $errorType == 'phpRequirements'} - {* todo: use language variable (-> else) *} -
{$phpRequirements|print_r}
- {else} - {lang}wcf.acp.package.startInstall.error.{@$errorType}{/lang} - {/if} -
- {/if} - {lang}wcf.acp.package.startInstall.source.upload.description{/lang} -
- - - -
-
- - {if $errorField == 'downloadPackage'} - - {lang}wcf.acp.package.startInstall.error.{@$errorType}{/lang} - - {/if} - {lang}wcf.acp.package.startInstall.source.download.description{/lang} -
- -
- - {if $additionalFields|isset}{@$additionalFields}{/if} -
- -
- - - {@SID_INPUT_TAG} - - {if $packageID != 0}{/if} -
-
- -{include file='footer'} diff --git a/wcfsetup/install/files/acp/templates/packageUninstallationDependencies.tpl b/wcfsetup/install/files/acp/templates/packageUninstallationDependencies.tpl index b5ad9c4a46..ad42675cf0 100644 --- a/wcfsetup/install/files/acp/templates/packageUninstallationDependencies.tpl +++ b/wcfsetup/install/files/acp/templates/packageUninstallationDependencies.tpl @@ -93,7 +93,7 @@ {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')} - + {else} {/if} diff --git a/wcfsetup/install/files/acp/templates/packageView.tpl b/wcfsetup/install/files/acp/templates/packageView.tpl index e4b16a0618..044a1ef63d 100644 --- a/wcfsetup/install/files/acp/templates/packageView.tpl +++ b/wcfsetup/install/files/acp/templates/packageView.tpl @@ -138,7 +138,7 @@ {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')} - + {else} {/if} @@ -196,7 +196,7 @@ {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')} - + {else} {/if} @@ -246,7 +246,7 @@ {if $package->standalone && $package->package != 'com.woltlab.wcf'}
  • {lang}wcf.acp.package.view.button.makeActive{/lang}
  • {/if} {if $__wcf->session->getPermission('admin.system.package.canUninstallPackage') && $noDependentIsActive}
  • {lang}wcf.acp.package.view.button.uninstall{/lang}
  • {/if} {/if} - {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')}
  • {lang}wcf.acp.package.view.button.update{/lang}
  • {/if} + {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')}
  • {lang}wcf.acp.package.view.button.update{/lang}
  • {/if} {if $additionalLargeButtons|isset}{@$additionalLargeButtons}{/if} diff --git a/wcfsetup/install/files/lib/acp/form/PackageInstallationForm.class.php b/wcfsetup/install/files/lib/acp/form/PackageInstallationForm.class.php new file mode 100755 index 0000000000..95aba17d81 --- /dev/null +++ b/wcfsetup/install/files/lib/acp/form/PackageInstallationForm.class.php @@ -0,0 +1,264 @@ + + * @package com.woltlab.wcf + * @subpackage acp.form + * @category Community Framework + */ +class PackageStartInstallForm extends ACPForm { + /** + * @see wcf\page\AbstractPage::$templateName + */ + public $templateName = 'packageInstallation'; + + /** + * @see wcf\acp\form\ACPForm::$activeMenuItem + */ + public $activeMenuItem = 'wcf.acp.menu.link.package.install'; + + /** + * id of the updated package + * @var integer + */ + public $packageID = 0; + + /** + * updated package object + * @var wcf\system\package\Package + */ + public $package = null; + + /** + * url to the package to download + * @var string + */ + public $downloadPackage = ''; + + /** + * data of the uploaded package + * @var array + */ + public $uploadPackage = ''; + + /** + * archive of the installation/update package + * @var wcf\system\package\PackageArchive + */ + public $archive = null; + + /** + * package installation/update queue + * @var wcf\data\package\installation\queue\PackageInstallationQueue + */ + public $queue = null; + + /** + * @see wcf\form\IForm::readParameters() + */ + public function readParameters() { + parent::readParameters(); + + if (isset($_REQUEST['packageID'])) { + $this->packageID = intval($_REQUEST['packageID']); + if ($this->packageID != 0) { + try { + $this->package = new Package($this->packageID); + } + catch (SystemException $e) { + throw new IllegalLinkException(); + } + } + } + } + + /** + * @see wcf\form\IForm::readFormParameters() + */ + public function readFormParameters() { + parent::readFormParameters(); + + if (isset($_POST['downloadPackage'])) $this->downloadPackage = StringUtil::trim($_POST['downloadPackage']); + if (isset($_FILES['uploadPackage'])) $this->uploadPackage = $_FILES['uploadPackage']; + } + + /** + * @see wcf\form\IForm::validate() + */ + public function validate() { + parent::validate(); + + if (!empty($this->uploadPackage['name'])) { + $this->validateUploadPackage(); + } + else if (!empty($this->downloadPackage)) { + $this->validateDownloadPackage(); + } + else { + throw new UserInputException('uploadPackage'); + } + } + + /** + * Validates the upload package input. + */ + protected function validateUploadPackage() { + if (empty($this->uploadPackage['tmp_name'])) { + throw new UserInputException('uploadPackage', 'uploadFailed'); + } + + // get filename + $this->uploadPackage['name'] = FileUtil::getTemporaryFilename('package_', preg_replace('!^.*(?=\.(?:tar\.gz|tgz|tar)$)!i', '', basename($this->uploadPackage['name']))); + + if (!@move_uploaded_file($this->uploadPackage['tmp_name'], $this->uploadPackage['name'])) { + throw new UserInputException('uploadPackage', 'uploadFailed'); + } + + $this->archive = new PackageArchive($this->uploadPackage['name'], $this->package); + $this->validateArchive('uploadPackage'); + } + + /** + * Validates the download package input. + */ + protected function validateDownloadPackage() { + if (FileUtil::isURL($this->downloadPackage)) { + // download package + $this->archive = new PackageArchive($this->downloadPackage, $this->package); + + try { + $this->downloadPackage = $this->archive->downloadArchive(); + //$this->archive->downloadArchive(); + } + catch (SystemException $e) { + throw new UserInputException('downloadPackage', 'notFound'); + } + } + else { + // probably local path + if (!file_exists($this->downloadPackage)) { + throw new UserInputException('downloadPackage', 'notFound'); + } + + $this->archive = new PackageArchive($this->downloadPackage, $this->package); + } + + $this->validateArchive('downloadPackage'); + } + + /** + * Validates the package archive. + * + * @param string $type upload or download package + */ + protected function validateArchive($type) { + // try to open the archive + try { + // TODO: Exceptions thrown within openArchive() are discarded, resulting in + // the meaningless message 'not a valid package' + $this->archive->openArchive(); + } + catch (SystemException $e) { + throw new UserInputException($type, 'noValidPackage'); + } + + // validate php requirements + $errors = PackageInstallationDispatcher::validatePHPRequirements($this->archive->getPhpRequirements()); + if (count($errors)) { + WCF::getTPL()->assign('phpRequirements', $errors); + throw new UserInputException($type, 'phpRequirements'); + } + + // check update or install support + if ($this->package !== null) { + if (!$this->archive->isValidUpdate()) { + throw new UserInputException($type, 'noValidUpdate'); + } + } + else { + if (!$this->archive->isValidInstall()) { + throw new UserInputException($type, 'noValidInstall'); + } + elseif ($this->archive->isAlreadyInstalled()) { + throw new UserInputException($type, 'uniqueAlreadyInstalled'); + } + } + } + + /** + * @see wcf\form\IForm::save() + */ + public function save() { + parent::save(); + + // get new process no + $processNo = PackageInstallationQueue::getNewProcessNo(); + + // obey foreign key + $packageID = ($this->packageID) ? $this->packageID : null; + + // insert queue + $this->queue = PackageInstallationQueueEditor::create(array( + 'processNo' => $processNo, + 'userID' => WCF::getUser()->userID, + 'package' => $this->archive->getPackageInfo('name'), + 'packageName' => $this->archive->getPackageInfo('packageName'), + 'packageID' => $packageID, + 'archive' => (!empty($this->uploadPackage['tmp_name']) ? $this->uploadPackage['name'] : $this->downloadPackage), + 'action' => ($this->package != null ? 'update' : 'install'), + 'confirmInstallation' => 1, + 'cancelable' => ($this->package != null ? 0 : 1) + )); + + $this->saved(); + + // open queue + $url = LinkHandler::getInstance()->getLink('Package', array(), 'action=openQueue&processNo='.$processNo); + HeaderUtil::redirect($url); + exit; + } + + /** + * @see wcf\page\IPage::assignVariables() + */ + public function assignVariables() { + parent::assignVariables(); + + WCF::getTPL()->assign(array( + 'packageID' => $this->packageID, + 'package' => $this->package + )); + } + + /** + * @see wcf\page\IPage::show() + */ + public function show() { + if ($this->action == 'install') WCF::getSession()->checkPermissions(array('admin.system.package.canInstallPackage')); + else WCF::getSession()->checkPermissions(array('admin.system.package.canUpdatePackage')); + + // check master password + WCFACP::checkMasterPassword(); + + parent::show(); + } +} diff --git a/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php b/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php deleted file mode 100755 index 70c64570ab..0000000000 --- a/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php +++ /dev/null @@ -1,264 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage acp.form - * @category Community Framework - */ -class PackageStartInstallForm extends ACPForm { - /** - * @see wcf\page\AbstractPage::$templateName - */ - public $templateName = 'packageStartInstall'; - - /** - * @see wcf\acp\form\ACPForm::$activeMenuItem - */ - public $activeMenuItem = 'wcf.acp.menu.link.package.install'; - - /** - * id of the updated package - * @var integer - */ - public $packageID = 0; - - /** - * updated package object - * @var wcf\system\package\Package - */ - public $package = null; - - /** - * url to the package to download - * @var string - */ - public $downloadPackage = ''; - - /** - * data of the uploaded package - * @var array - */ - public $uploadPackage = ''; - - /** - * archive of the installation/update package - * @var wcf\system\package\PackageArchive - */ - public $archive = null; - - /** - * package installation/update queue - * @var wcf\data\package\installation\queue\PackageInstallationQueue - */ - public $queue = null; - - /** - * @see wcf\form\IForm::readParameters() - */ - public function readParameters() { - parent::readParameters(); - - if (isset($_REQUEST['packageID'])) { - $this->packageID = intval($_REQUEST['packageID']); - if ($this->packageID != 0) { - try { - $this->package = new Package($this->packageID); - } - catch (SystemException $e) { - throw new IllegalLinkException(); - } - } - } - } - - /** - * @see wcf\form\IForm::readFormParameters() - */ - public function readFormParameters() { - parent::readFormParameters(); - - if (isset($_POST['downloadPackage'])) $this->downloadPackage = StringUtil::trim($_POST['downloadPackage']); - if (isset($_FILES['uploadPackage'])) $this->uploadPackage = $_FILES['uploadPackage']; - } - - /** - * @see wcf\form\IForm::validate() - */ - public function validate() { - parent::validate(); - - if (!empty($this->uploadPackage['name'])) { - $this->validateUploadPackage(); - } - else if (!empty($this->downloadPackage)) { - $this->validateDownloadPackage(); - } - else { - throw new UserInputException('uploadPackage'); - } - } - - /** - * Validates the upload package input. - */ - protected function validateUploadPackage() { - if (empty($this->uploadPackage['tmp_name'])) { - throw new UserInputException('uploadPackage', 'uploadFailed'); - } - - // get filename - $this->uploadPackage['name'] = FileUtil::getTemporaryFilename('package_', preg_replace('!^.*(?=\.(?:tar\.gz|tgz|tar)$)!i', '', basename($this->uploadPackage['name']))); - - if (!@move_uploaded_file($this->uploadPackage['tmp_name'], $this->uploadPackage['name'])) { - throw new UserInputException('uploadPackage', 'uploadFailed'); - } - - $this->archive = new PackageArchive($this->uploadPackage['name'], $this->package); - $this->validateArchive('uploadPackage'); - } - - /** - * Validates the download package input. - */ - protected function validateDownloadPackage() { - if (FileUtil::isURL($this->downloadPackage)) { - // download package - $this->archive = new PackageArchive($this->downloadPackage, $this->package); - - try { - $this->downloadPackage = $this->archive->downloadArchive(); - //$this->archive->downloadArchive(); - } - catch (SystemException $e) { - throw new UserInputException('downloadPackage', 'notFound'); - } - } - else { - // probably local path - if (!file_exists($this->downloadPackage)) { - throw new UserInputException('downloadPackage', 'notFound'); - } - - $this->archive = new PackageArchive($this->downloadPackage, $this->package); - } - - $this->validateArchive('downloadPackage'); - } - - /** - * Validates the package archive. - * - * @param string $type upload or download package - */ - protected function validateArchive($type) { - // try to open the archive - try { - // TODO: Exceptions thrown within openArchive() are discarded, resulting in - // the meaningless message 'not a valid package' - $this->archive->openArchive(); - } - catch (SystemException $e) { - throw new UserInputException($type, 'noValidPackage'); - } - - // validate php requirements - $errors = PackageInstallationDispatcher::validatePHPRequirements($this->archive->getPhpRequirements()); - if (count($errors)) { - WCF::getTPL()->assign('phpRequirements', $errors); - throw new UserInputException($type, 'phpRequirements'); - } - - // check update or install support - if ($this->package !== null) { - if (!$this->archive->isValidUpdate()) { - throw new UserInputException($type, 'noValidUpdate'); - } - } - else { - if (!$this->archive->isValidInstall()) { - throw new UserInputException($type, 'noValidInstall'); - } - elseif ($this->archive->isAlreadyInstalled()) { - throw new UserInputException($type, 'uniqueAlreadyInstalled'); - } - } - } - - /** - * @see wcf\form\IForm::save() - */ - public function save() { - parent::save(); - - // get new process no - $processNo = PackageInstallationQueue::getNewProcessNo(); - - // obey foreign key - $packageID = ($this->packageID) ? $this->packageID : null; - - // insert queue - $this->queue = PackageInstallationQueueEditor::create(array( - 'processNo' => $processNo, - 'userID' => WCF::getUser()->userID, - 'package' => $this->archive->getPackageInfo('name'), - 'packageName' => $this->archive->getPackageInfo('packageName'), - 'packageID' => $packageID, - 'archive' => (!empty($this->uploadPackage['tmp_name']) ? $this->uploadPackage['name'] : $this->downloadPackage), - 'action' => ($this->package != null ? 'update' : 'install'), - 'confirmInstallation' => 1, - 'cancelable' => ($this->package != null ? 0 : 1) - )); - - $this->saved(); - - // open queue - $url = LinkHandler::getInstance()->getLink('Package', array(), 'action=openQueue&processNo='.$processNo); - HeaderUtil::redirect($url); - exit; - } - - /** - * @see wcf\page\IPage::assignVariables() - */ - public function assignVariables() { - parent::assignVariables(); - - WCF::getTPL()->assign(array( - 'packageID' => $this->packageID, - 'package' => $this->package - )); - } - - /** - * @see wcf\page\IPage::show() - */ - public function show() { - if ($this->action == 'install') WCF::getSession()->checkPermissions(array('admin.system.package.canInstallPackage')); - else WCF::getSession()->checkPermissions(array('admin.system.package.canUpdatePackage')); - - // check master password - WCFACP::checkMasterPassword(); - - parent::show(); - } -} diff --git a/wcfsetup/install/files/lib/acp/page/DetailedPackageListPage.class.php b/wcfsetup/install/files/lib/acp/page/DetailedPackageListPage.class.php deleted file mode 100644 index c196d40dd5..0000000000 --- a/wcfsetup/install/files/lib/acp/page/DetailedPackageListPage.class.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage acp.page - * @category Community Framework - */ -class DetailedPackageListPage extends SortablePage { - /** - * @see wcf\page\AbstractPage::$neededPermissions - */ - public $neededPermissions = array('admin.system.package.canUpdatePackage', 'admin.system.package.canUninstallPackage'); - - /** - * @see wcf\page\MultipleLinkPage::$itemsPerPage - */ - public $itemsPerPage = 50; - - /** - * @see wcf\page\SortablePage::$defaultSortField - */ - public $defaultSortField = 'packageType'; - - /** - * @see wcf\page\SortablePage::$defaultSortOrder - */ - public $defaultSortOrder = 'DESC'; - - /** - * @see wcf\page\SortablePage::$validSortFields - */ - public $validSortFields = array('packageID', 'package', 'packageDir', 'packageName', 'instanceNo', 'packageDescription', 'packageVersion', 'packageDate', 'packageURL', 'parentPackageID', 'isUnique', 'standalone', 'author', 'authorURL', 'installDate', 'updateDate'); - - /** - * @see wcf\page\MultipleLinkPage::$objectListClassName - */ - public $objectListClassName = 'wcf\data\package\PackageList'; - - /** - * @see wcf\page\MultipleLinkPage::readObjects() - */ - protected function readObjects() { - $this->sqlOrderBy = 'package.'.($this->sortField == 'packageType' ? 'standalone '.$this->sortOrder.', package.parentPackageID '.$this->sortOrder : $this->sortField.' '.$this->sortOrder).($this->sortField != 'packageName' ? ', package.packageName ASC' : ''); - - parent::readObjects(); - } - - /** - * @see wcf\page\IPage::show() - */ - public function show() { - // enable menu item - ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.package.list'); - - parent::show(); - } -} diff --git a/wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php b/wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php new file mode 100644 index 0000000000..fabb7be423 --- /dev/null +++ b/wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php @@ -0,0 +1,67 @@ + + * @package com.woltlab.wcf + * @subpackage acp.page + * @category Community Framework + */ +class PackageListDetailedPage extends SortablePage { + /** + * @see wcf\page\AbstractPage::$neededPermissions + */ + public $neededPermissions = array('admin.system.package.canUpdatePackage', 'admin.system.package.canUninstallPackage'); + + /** + * @see wcf\page\MultipleLinkPage::$itemsPerPage + */ + public $itemsPerPage = 50; + + /** + * @see wcf\page\SortablePage::$defaultSortField + */ + public $defaultSortField = 'packageType'; + + /** + * @see wcf\page\SortablePage::$defaultSortOrder + */ + public $defaultSortOrder = 'DESC'; + + /** + * @see wcf\page\SortablePage::$validSortFields + */ + public $validSortFields = array('packageID', 'package', 'packageDir', 'packageName', 'instanceNo', 'packageDescription', 'packageVersion', 'packageDate', 'packageURL', 'parentPackageID', 'isUnique', 'standalone', 'author', 'authorURL', 'installDate', 'updateDate'); + + /** + * @see wcf\page\MultipleLinkPage::$objectListClassName + */ + public $objectListClassName = 'wcf\data\package\PackageList'; + + /** + * @see wcf\page\MultipleLinkPage::readObjects() + */ + protected function readObjects() { + $this->sqlOrderBy = 'package.'.($this->sortField == 'packageType' ? 'standalone '.$this->sortOrder.', package.parentPackageID '.$this->sortOrder : $this->sortField.' '.$this->sortOrder).($this->sortField != 'packageName' ? ', package.packageName ASC' : ''); + + parent::readObjects(); + } + + /** + * @see wcf\page\IPage::show() + */ + public function show() { + // enable menu item + ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.package.list'); + + parent::show(); + } +} diff --git a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php index a8f132aa67..d1efd4f422 100644 --- a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php @@ -108,7 +108,7 @@ class PackageArchive { */ public function __construct($archive, Package $package = null) { $this->archive = $archive; // be careful: this is a string within this class, - // but an object in the packageStartInstallForm.class! + // but an object in the packageInstallationForm.class! $this->package = $package; }