From eb89d921e8c78bf916173eaa12074f7ff63f16d1 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 6 Oct 2011 21:02:09 +0200 Subject: [PATCH] Fixed request handling --- .../MultipleSelectionFormElementContainer.class.php | 9 --------- .../SelectionFormElementContainer.class.php | 1 + .../form/element/AbstractNamedFormElement.class.php | 3 +++ .../element/MultipleSelectionFormElement.class.php | 13 +++++++++++++ .../package/PackageInstallationDispatcher.class.php | 9 +++++++++ 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/wcfsetup/install/files/lib/system/form/container/MultipleSelectionFormElementContainer.class.php b/wcfsetup/install/files/lib/system/form/container/MultipleSelectionFormElementContainer.class.php index 425d550bdf..c0d27e38c8 100644 --- a/wcfsetup/install/files/lib/system/form/container/MultipleSelectionFormElementContainer.class.php +++ b/wcfsetup/install/files/lib/system/form/container/MultipleSelectionFormElementContainer.class.php @@ -27,15 +27,6 @@ class MultipleSelectionFormElementContainer extends SelectionFormElementContaine $this->value = $value; } - /** - * Returns container value. - * - * @return array - */ - public function getValue() { - return $this->value; - } - /** * @see wcf\system\form\IFormElementContainer::getHTML() */ diff --git a/wcfsetup/install/files/lib/system/form/container/SelectionFormElementContainer.class.php b/wcfsetup/install/files/lib/system/form/container/SelectionFormElementContainer.class.php index 1380ab033d..b6140acbf7 100644 --- a/wcfsetup/install/files/lib/system/form/container/SelectionFormElementContainer.class.php +++ b/wcfsetup/install/files/lib/system/form/container/SelectionFormElementContainer.class.php @@ -1,5 +1,6 @@ value = StringUtil::trim($value); } diff --git a/wcfsetup/install/files/lib/system/form/element/MultipleSelectionFormElement.class.php b/wcfsetup/install/files/lib/system/form/element/MultipleSelectionFormElement.class.php index cbd0098157..31f0d65d10 100644 --- a/wcfsetup/install/files/lib/system/form/element/MultipleSelectionFormElement.class.php +++ b/wcfsetup/install/files/lib/system/form/element/MultipleSelectionFormElement.class.php @@ -1,5 +1,6 @@ value = array_map(array('wcf\util\StringUtil', 'trim'), $value); + } + } + /** * @see wcf\system\form\IFormElement::getHTML() */ diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 9da7230fb4..ed565dcd61 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -385,6 +385,7 @@ class PackageInstallationDispatcher { */ protected function promptPackageDir() { if (!PackageInstallationFormManager::findForm($this->queue, 'packageDir')) { + $container = new container\GroupFormElementContainer(); $packageDir = new element\TextInputFormElement($container); $packageDir->setName('packageDir'); @@ -423,9 +424,11 @@ class PackageInstallationDispatcher { protected function promptOptionalPackages(array $packages) { if (!PackageInstallationFormManager::findForm($this->queue, 'optionalPackages')) { $container = new container\MultipleSelectionFormElementContainer(); + $container->setName('optionalPackages'); foreach ($packages as $package) { $optionalPackage = new element\MultipleSelectionFormElement($container); + $optionalPackage->setName('optionalPackages'); $optionalPackage->setLabel($package['packageName']); $optionalPackage->setValue($package['package']); @@ -443,6 +446,12 @@ class PackageInstallationDispatcher { $document->handleRequest(); $packages = $document->getValue('optionalPackages'); + if (!empty($packages)) { + foreach ($packages as $package) { + // haha, this is going to be mad + + } + } die('
'.print_r($packages, true));
 		}
 	}
-- 
2.20.1