<title>{if $pageTitle|isset}{@$pageTitle|language} - {/if}{lang}wcf.global.acp{/lang}{if PACKAGE_ID} - {PAGE_TITLE|language}{/if}</title>
<!-- Stylesheets -->
- <!--<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600' rel='stylesheet' type='text/css'>-->
+ <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600' rel='stylesheet' type='text/css'>
{@$__wcf->getStyleHandler()->getStylesheet(true)}
<link href="{@$__wcf->getPath()}acp/style/acpMenu.css" type="text/css" rel="stylesheet">
{event name='stylesheets'}
</nav>
<div id="packageSearch" class="container containerPadding tabMenuContent">
- <fieldset>
- <legend>{lang}wcf.acp.package.search.conditions{/lang}</legend>
+ <section>
+ <h1>{lang}wcf.acp.package.search.conditions{/lang}</h1>
<dl>
<dt><label for="packageName">{lang}wcf.acp.package.search.packageName{/lang}</label></dt>
<small>{lang}wcf.acp.package.search.package.description{/lang}</small>
</dd>
</dl>
- </fieldset>
+ </section>
<div class="formSubmit">
<button class="jsButtonPackageSearch">{lang}wcf.global.button.submit{/lang}</button>
<div id="upload" class="container containerPadding tabMenuContent">
<form method="post" action="{link controller='PackageStartInstall'}{/link}" enctype="multipart/form-data">
- <fieldset>
- <legend>{lang}wcf.acp.package.source{/lang}</legend>
+ <section>
+ <h1>{lang}wcf.acp.package.source{/lang}</h1>
<dl{if $errorField == 'uploadPackage'} class="formError"{/if}>
<dt><label for="uploadPackage">{lang}wcf.acp.package.source.upload{/lang}</label></dt>
<small>{lang}wcf.acp.package.source.upload.description{/lang}</small>
</dd>
</dl>
-
- <dl{if $errorField == 'downloadPackage'} class="formError"{/if}>
- <dt><label for="downloadPackage">{lang}wcf.acp.package.source.download{/lang}</label></dt>
- <dd>
- <input type="text" id="downloadPackage" name="downloadPackage" value="" class="long" />
- {if $errorField == 'downloadPackage'}
- <small class="innerError">
- {lang}wcf.acp.package.error.{@$errorType}{/lang}
- </small>
- {/if}
- <small>{lang}wcf.acp.package.source.download.description{/lang}</small>
- </dd>
- </dl>
-
- {event name='sourceFields'}
- </fieldset>
-
- {event name='fieldsets'}
+ </section>
<div class="formSubmit">
<input type="submit" name="submitButton" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
*/
public $package = null;
- /**
- * url to the package to download
- * @var string
- */
- public $downloadPackage = '';
-
/**
* data of the uploaded package
* @var array<string>
parent::readFormParameters();
if (!$this->stylePackageImportLocation) {
- if (isset($_POST['downloadPackage'])) $this->downloadPackage = StringUtil::trim($_POST['downloadPackage']);
if (isset($_FILES['uploadPackage'])) $this->uploadPackage = $_FILES['uploadPackage'];
}
}
else if (!empty($this->uploadPackage['name'])) {
$this->validateUploadPackage();
}
- else if (!empty($this->downloadPackage)) {
- $this->validateDownloadPackage();
- }
else {
throw new UserInputException('uploadPackage');
}
$this->package = PackageValidationManager::getInstance()->getPackageValidationArchive()->getPackage();
}
- /**
- * Validates the download package input.
- */
- protected function validateDownloadPackage() {
- $this->activeTabMenuItem = 'upload';
-
- if (FileUtil::isURL($this->downloadPackage)) {
- // download package
- $this->archive = new PackageArchive($this->downloadPackage, $this->package);
-
- try {
- $this->downloadPackage = $this->archive->downloadArchive();
- }
- catch (SystemException $e) {
- throw new UserInputException('downloadPackage', 'downloadFailed');
- }
- }
- else {
- // probably local path
- if (!file_exists($this->downloadPackage)) {
- throw new UserInputException('downloadPackage', 'downloadFailed');
- }
- }
-
- if (!PackageValidationManager::getInstance()->validate($this->downloadPackage, false)) {
- $exception = PackageValidationManager::getInstance()->getException();
- if ($exception instanceof PackageValidationException) {
- switch ($exception->getCode()) {
- case PackageValidationException::INVALID_PACKAGE_NAME:
- case PackageValidationException::MISSING_PACKAGE_XML:
- throw new UserInputException('downloadPackage', 'noValidPackage');
- break;
- }
- }
- }
-
- $this->package = PackageValidationManager::getInstance()->getPackageValidationArchive()->getPackage();
-
- }
-
/**
* @see \wcf\form\IForm::save()
*/
// obey foreign key
$packageID = ($this->package) ? $this->package->packageID : null;
- $archive = $this->downloadPackage;
if ($this->stylePackageImportLocation) {
$archive = $this->stylePackageImportLocation;
}