Revert "Renamed templates and classes"
authorLuzifr <szekely@woltlab.com>
Thu, 13 Oct 2011 17:08:17 +0000 (19:08 +0200)
committerLuzifr <szekely@woltlab.com>
Thu, 13 Oct 2011 17:08:17 +0000 (19:08 +0200)
This reverts commit 0892d9e28c5d25f939f408d2ba4e146c0944719f.

13 files changed:
wcfsetup/install/files/acp/templates/detailedPackageList.tpl [new file with mode: 0644]
wcfsetup/install/files/acp/templates/packageInstallation.tpl [deleted file]
wcfsetup/install/files/acp/templates/packageList.tpl
wcfsetup/install/files/acp/templates/packageListDetailed.tpl [deleted file]
wcfsetup/install/files/acp/templates/packageListPlugins.tpl
wcfsetup/install/files/acp/templates/packageStartInstall.tpl [new file with mode: 0644]
wcfsetup/install/files/acp/templates/packageUninstallationDependencies.tpl
wcfsetup/install/files/acp/templates/packageView.tpl
wcfsetup/install/files/lib/acp/form/PackageInstallationForm.class.php [deleted file]
wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php [new file with mode: 0755]
wcfsetup/install/files/lib/acp/page/DetailedPackageListPage.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php [deleted file]
wcfsetup/install/files/lib/system/package/PackageArchive.class.php

diff --git a/wcfsetup/install/files/acp/templates/detailedPackageList.tpl b/wcfsetup/install/files/acp/templates/detailedPackageList.tpl
new file mode 100644 (file)
index 0000000..74c99dc
--- /dev/null
@@ -0,0 +1,108 @@
+{include file='header'}
+
+<script type="text/javascript">
+       //<![CDATA[
+       $(function() {
+               WCF.Language.add('wcf.acp.package.view.button.uninstall.sure', '{lang}wcf.acp.package.view.button.uninstall.sure{/lang}');
+               
+               new WCF.ACP.PackageUninstallation($('.packageRow .uninstallButton'));
+       });
+       //]]>
+</script>
+
+<header class="mainHeading">
+       <img src="{@RELATIVE_WCF_DIR}icon/packageStandalone1.svg" alt="" />
+       <hgroup>
+               <h1>{lang}wcf.acp.package.list{/lang}</h1>
+       </hgroup>
+</header>
+
+<div class="contentHeader">
+       {pages print=true assign=pagesLinks controller='DetailedPackageList' link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder"}
+
+       {if $__wcf->session->getPermission('admin.system.package.canInstallPackage') || $additionalLargeButtons|isset}
+               <nav class="largeButtons">
+                       <ul>
+                               {if $__wcf->session->getPermission('admin.system.package.canInstallPackage')}<li><a href="{link controller='PackageStartInstall'}action=install{/link}" title="{lang}wcf.acp.package.startInstall{/lang}"><img src="{@RELATIVE_WCF_DIR}icon/add1.svg" alt="" /> <span>{lang}wcf.acp.package.startInstall{/lang}</span></a></li>{/if}
+                               {if $additionalLargeButtons|isset}{@$additionalLargeButtons}{/if}
+                       </ul>
+               </nav>
+       {/if}
+</div>
+
+{if $objects|count > 0}
+       <div class="border boxTitle">
+               <hgroup>
+                       <h1><a href="#">{lang}wcf.acp.package.list{/lang} <span class="badge" title="{lang}wcf.acp.package.list.count{/lang}">{#$items}</span></a></h1>
+               </hgroup>
+               
+               <table>
+                       <thead>
+                               <tr>
+                                       <th colspan="2" class="columnID{if $sortField == 'packageID'} active{/if}"><a href="{link controller='DetailedPackageList'}pageNo={@$pageNo}&sortField=packageID&sortOrder={if $sortField == 'packageID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.package.list.id{/lang}{if $sortField == 'packageID'} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
+                                       <th colspan="2" class="columnTitle{if $sortField == 'packageName'} active{/if}"><a href="{link controller='DetailedPackageList'}pageNo={@$pageNo}&sortField=packageName&sortOrder={if $sortField == 'packageName' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.package.list.name{/lang}{if $sortField == 'packageName'} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
+                                       <th class="columnText{if $sortField == 'author'} active{/if}"><a href="{link controller='DetailedPackageList'}pageNo={@$pageNo}&sortField=author&sortOrder={if $sortField == 'author' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.package.list.author{/lang}{if $sortField == 'author'} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
+                                       <th class="columnText{if $sortField == 'packageVersion'}active{/if}"><a href="{link controller='DetailedPackageList'}pageNo={@$pageNo}&sortField=packageVersion&sortOrder={if $sortField == 'packageVersion' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.package.list.version{/lang}{if $sortField == 'packageVersion'} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
+                                       <th class="columnDate{if $sortField == 'updateDate'} active{/if}"><a href="{link controller='DetailedPackageList'}pageNo={@$pageNo}&sortField=updateDate&sortOrder={if $sortField == 'updateDate' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.package.updateDate{/lang}{if $sortField == 'updateDate'} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
+                                       
+                                       {if $additionalHeadColumns|isset}{@$additionalHeadColumns}{/if}
+                               </tr>
+                       </thead>
+                       
+                       <tbody>
+                               {foreach from=$objects item=$package}
+                                       <tr class="packageRow">
+                                               <td class="columnIcon">
+                                                       {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')}
+                                                               <a href="{link controller='PackageStartInstall' id=$package->packageID}action=update{/link}"><img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" class="balloonTooltip" /></a>
+                                                       {else}
+                                                               <img src="{@RELATIVE_WCF_DIR}icon/update1D.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" />
+                                                       {/if}
+                                                       {if $__wcf->session->getPermission('admin.system.package.canUninstallPackage') && $package->package != 'com.woltlab.wcf' && $package->packageID != PACKAGE_ID}
+                                                               <img src="{@RELATIVE_WCF_DIR}icon/delete1.svg" alt="" title="{lang}wcf.acp.package.view.button.uninstall{/lang}" class="uninstallButton balloonTooltip" data-objectID="{@$package->packageID}" />
+                                                       {else}
+                                                               <img src="{@RELATIVE_WCF_DIR}icon/delete1D.svg" alt="" title="{lang}wcf.acp.package.view.button.uninstall{/lang}" />
+                                                       {/if}
+                                                       
+                                                       {if $additionalButtons[$package->packageID]|isset}{@$additionalButtons[$package->packageID]}{/if}
+                                               </td>
+                                               <td class="columnID"><p>{@$package->packageID}</p></td>
+                                               <td class="columnIcon">
+                                                       {if $package->standalone}
+                                                               <img src="{@RELATIVE_WCF_DIR}icon/packageStandalone1.svg" alt="" title="{lang}wcf.acp.package.list.standalone{/lang}" class="balloonTooltip" />
+                                                       {elseif $package->isPlugin()}
+                                                               <img src="{@RELATIVE_WCF_DIR}icon/packagePlugin1.svg" alt="" title="{lang}wcf.acp.package.list.plugin{/lang}" class="balloonTooltip" />
+                                                       {else}
+                                                               <img src="{@RELATIVE_WCF_DIR}icon/package1.svg" alt="" title="{lang}wcf.acp.package.list.other{/lang}" class="balloonTooltip" />
+                                                       {/if}
+                                               </td>
+                                               <td id="packageName{@$package->packageID}" class="columnTitle" title="{$package->packageDescription}">
+                                                       <a href="{link controller='PackageView' id=$package->packageID}{/link}"><span>{$package->getName()}{if $package->instanceNo > 1 && $package->instanceName == ''} (#{#$package->instanceNo}){/if}</span></a>
+                                               </td>
+                                               <td class="columnText><p>{if $package->authorURL}<a href="{@RELATIVE_WCF_DIR}acp/dereferrer.php?url={$package->authorURL|rawurlencode}" class="externalURL">{$package->author}</a>{else}{$package->author}{/if}</p></td>
+                                               <td class="columnText"><p>{$package->packageVersion}</p></td>
+                                               <td class="columnDate"><p>{@$package->updateDate|time}</p></td>
+                                               
+                                               {if $additionalColumns[$package->packageID]|isset}{@$additionalColumns[$package->packageID]}{/if}
+                                       </tr>
+                               {/foreach}
+                       </tbody>
+               </table>
+               
+       </div>
+{/if}
+
+<div class="contentFooter">
+       {@$pagesLinks}
+       
+       {if $__wcf->session->getPermission('admin.system.package.canInstallPackage') || $additionalLargeButtons|isset}
+               <nav class="largeButtons">
+                       <ul>
+                               {if $__wcf->session->getPermission('admin.system.package.canInstallPackage')}<li><a href="{link controller='PackageStartInstall'}action=install{/link}" title="{lang}wcf.acp.package.startInstall{/lang}"><img src="{@RELATIVE_WCF_DIR}icon/add1.svg" alt="" /> <span>{lang}wcf.acp.package.startInstall{/lang}</span></a></li>{/if}
+                               {if $additionalLargeButtons|isset}{@$additionalLargeButtons}{/if}
+                       </ul>
+               </nav>
+       {/if}
+</div>
+
+{include file='footer'}
diff --git a/wcfsetup/install/files/acp/templates/packageInstallation.tpl b/wcfsetup/install/files/acp/templates/packageInstallation.tpl
deleted file mode 100644 (file)
index 0d3d0f2..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-{include file='header'}
-
-<header class="mainHeading">
-       {if $packageID == 0}
-               <img src="{@RELATIVE_WCF_DIR}icon/add1.svg" alt="" />
-               <hgroup>
-                       <h1>{lang}wcf.acp.package.installation{/lang}</h1>
-               </hgroup>
-       {else}
-               <img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" />
-               <hgroup>
-                       <h1>{lang}wcf.acp.package.startUpdate{/lang}</h1>
-               </hgroup>
-       {/if}
-</header>
-
-{if $errorField != ''}
-       <p class="error">{lang}wcf.global.form.error{/lang}</p>
-{/if}
-
-<div class="contentHeader">
-       <nav class="largeButtons">
-               <ul>
-                       <li><a href="{link controller='PackageList'}{/link}" title="{lang}wcf.acp.menu.link.package.list{/lang}"><img src="{@RELATIVE_WCF_DIR}icon/package1.svg" alt="" /> <span>{lang}wcf.acp.menu.link.package.list{/lang}</span></a></li>
-                       {if $additionalLargeButtons|isset}{@$additionalLargeButtons}{/if}
-               </ul>
-       </nav>
-</div>
-
-<form method="post" action="{link controller='PackageInstallation'}{/link}" enctype="multipart/form-data">
-       <div class="border content">
-               
-               <fieldset>
-                       <legend>{lang}wcf.acp.package.installation.source{/lang}</legend>
-               
-                       <dl{if $errorField == 'uploadPackage'} class="formError"{/if}>
-                               <dt><label for="uploadPackage">{lang}wcf.acp.package.installation.source.upload{/lang}</label></dt>
-                               <dd>
-                                       <input type="file" id="uploadPackage" name="uploadPackage" value="" />
-                                       {if $errorField == 'uploadPackage'}
-                                               <small class="innerError">
-                                                       {if $errorType == 'empty'}
-                                                               {lang}wcf.global.form.error.empty{/lang}
-                                                       {elseif $errorType == 'phpRequirements'}
-                                                               {* todo: use language variable (-> else) *}
-                                                               <pre>{$phpRequirements|print_r}</pre>
-                                                       {else}
-                                                               {lang}wcf.acp.package.installation.error.{@$errorType}{/lang}
-                                                       {/if}
-                                               </small>
-                                       {/if}
-                                       <small>{lang}wcf.acp.package.installation.source.upload.description{/lang}</small>
-                               </dd>
-                       </dl>
-                       
-                       <dl{if $errorField == 'downloadPackage'} class="formError"{/if}>
-                               <dt><label for="downloadPackage">{lang}wcf.acp.package.installation.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.installation.error.{@$errorType}{/lang}
-                                               </small>
-                                       {/if}
-                                       <small>{lang}wcf.acp.package.installation.source.download.description{/lang}</small>
-                               </dd>
-                       </dl>
-               </fieldset>
-               
-               {if $additionalFields|isset}{@$additionalFields}{/if}
-       </div>
-
-       <div class="formSubmit">
-               <input type="reset" value="{lang}wcf.global.button.reset{/lang}" accesskey="r" />
-               <input type="submit" name="submitButton" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
-               {@SID_INPUT_TAG}
-               <input type="hidden" name="action" value="{$action}" />
-               {if $packageID != 0}<input type="hidden" name="id" value="{@$packageID}" />{/if}
-       </div>
-</form>
-
-{include file='footer'}
index 9cfe50a308dbeaede67d078c602f8dd4285cfd5d..489887f456a29e7c342a900257e5e98e9dcfb6a3 100644 (file)
@@ -72,7 +72,7 @@
                                        <nav>
                                                <ul class="smallButtons">
                                                        <li><a href="{link controller='PackageView' id=$packageID}{/link}"><img src="{@RELATIVE_WCF_DIR}icon/info1.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" class="bal loonTooltip" /> Details</a></li>
-                                                       <li><a href="{link controller='PackageInstallation' id=$packageID}action=update{/link}"><img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" class="bal loonTooltip" /> Update</a></li>
+                                                       <li><a href="{link controller='PackageStartInstall' id=$packageID}action=update{/link}"><img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" class="bal loonTooltip" /> Update</a></li>
                                                </ul>
                                        </nav>
                                </footer>
 <div class="contentFooter">
        <nav class="largeButtons">
                <ul>
-                       <li><a href="{link controller='PackageListDetailed'}{/link}" title="{lang}wcf.acp.menu.link.package.list{/lang}"><img src="{@RELATIVE_WCF_DIR}icon/package1.svg" alt="" /> <span>detailed package list</span></a></li>
+                       <li><a href="{link controller='DetailedPackageList'}{/link}" title="{lang}wcf.acp.menu.link.package.list{/lang}"><img src="{@RELATIVE_WCF_DIR}icon/package1.svg" alt="" /> <span>detailed package list</span></a></li>
                </ul>
        </nav>
 </div>
diff --git a/wcfsetup/install/files/acp/templates/packageListDetailed.tpl b/wcfsetup/install/files/acp/templates/packageListDetailed.tpl
deleted file mode 100644 (file)
index 36672ca..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-{include file='header'}
-
-<script type="text/javascript">
-       //<![CDATA[
-       $(function() {
-               WCF.Language.add('wcf.acp.package.view.button.uninstall.sure', '{lang}wcf.acp.package.view.button.uninstall.sure{/lang}');
-               
-               new WCF.ACP.PackageUninstallation($('.packageRow .uninstallButton'));
-       });
-       //]]>
-</script>
-
-<header class="mainHeading">
-       <img src="{@RELATIVE_WCF_DIR}icon/packageStandalone1.svg" alt="" />
-       <hgroup>
-               <h1>{lang}wcf.acp.package.list{/lang}</h1>
-       </hgroup>
-</header>
-
-<div class="contentHeader">
-       {pages print=true assign=pagesLinks controller='PackageListDetailed' link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder"}
-
-       {if $__wcf->session->getPermission('admin.system.package.canInstallPackage') || $additionalLargeButtons|isset}
-               <nav class="largeButtons">
-                       <ul>
-                               {if $__wcf->session->getPermission('admin.system.package.canInstallPackage')}<li><a href="{link controller='PackageInstall'}action=install{/link}" title="{lang}wcf.acp.package.installation{/lang}"><img src="{@RELATIVE_WCF_DIR}icon/add1.svg" alt="" /> <span>{lang}wcf.acp.package.installation{/lang}</span></a></li>{/if}
-                               {if $additionalLargeButtons|isset}{@$additionalLargeButtons}{/if}
-                       </ul>
-               </nav>
-       {/if}
-</div>
-
-{if $objects|count > 0}
-       <div class="border boxTitle">
-               <hgroup>
-                       <h1><a href="#">{lang}wcf.acp.package.list{/lang} <span class="badge" title="{lang}wcf.acp.package.list.count{/lang}">{#$items}</span></a></h1>
-               </hgroup>
-               
-               <table>
-                       <thead>
-                               <tr>
-                                       <th colspan="2" class="columnID{if $sortField == 'packageID'} active{/if}"><a href="{link controller='PackageListDetailed'}pageNo={@$pageNo}&sortField=packageID&sortOrder={if $sortField == 'packageID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.package.list.id{/lang}{if $sortField == 'packageID'} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
-                                       <th colspan="2" class="columnTitle{if $sortField == 'packageName'} active{/if}"><a href="{link controller='PackageListDetailed'}pageNo={@$pageNo}&sortField=packageName&sortOrder={if $sortField == 'packageName' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.package.list.name{/lang}{if $sortField == 'packageName'} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
-                                       <th class="columnText{if $sortField == 'author'} active{/if}"><a href="{link controller='PackageListDetailed'}pageNo={@$pageNo}&sortField=author&sortOrder={if $sortField == 'author' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.package.list.author{/lang}{if $sortField == 'author'} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
-                                       <th class="columnText{if $sortField == 'packageVersion'}active{/if}"><a href="{link controller='PackageListDetailed'}pageNo={@$pageNo}&sortField=packageVersion&sortOrder={if $sortField == 'packageVersion' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.package.list.version{/lang}{if $sortField == 'packageVersion'} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
-                                       <th class="columnDate{if $sortField == 'updateDate'} active{/if}"><a href="{link controller='PackageListDetailed'}pageNo={@$pageNo}&sortField=updateDate&sortOrder={if $sortField == 'updateDate' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.package.updateDate{/lang}{if $sortField == 'updateDate'} <img src="{@RELATIVE_WCF_DIR}icon/sort{@$sortOrder}.svg" alt="" />{/if}</a></th>
-                                       
-                                       {if $additionalHeadColumns|isset}{@$additionalHeadColumns}{/if}
-                               </tr>
-                       </thead>
-                       
-                       <tbody>
-                               {foreach from=$objects item=$package}
-                                       <tr class="packageRow">
-                                               <td class="columnIcon">
-                                                       {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')}
-                                                               <a href="{link controller='PackageInstallation' id=$package->packageID}action=update{/link}"><img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" class="balloonTooltip" /></a>
-                                                       {else}
-                                                               <img src="{@RELATIVE_WCF_DIR}icon/update1D.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" />
-                                                       {/if}
-                                                       {if $__wcf->session->getPermission('admin.system.package.canUninstallPackage') && $package->package != 'com.woltlab.wcf' && $package->packageID != PACKAGE_ID}
-                                                               <img src="{@RELATIVE_WCF_DIR}icon/delete1.svg" alt="" title="{lang}wcf.acp.package.view.button.uninstall{/lang}" class="uninstallButton balloonTooltip" data-objectID="{@$package->packageID}" />
-                                                       {else}
-                                                               <img src="{@RELATIVE_WCF_DIR}icon/delete1D.svg" alt="" title="{lang}wcf.acp.package.view.button.uninstall{/lang}" />
-                                                       {/if}
-                                                       
-                                                       {if $additionalButtons[$package->packageID]|isset}{@$additionalButtons[$package->packageID]}{/if}
-                                               </td>
-                                               <td class="columnID"><p>{@$package->packageID}</p></td>
-                                               <td class="columnIcon">
-                                                       {if $package->standalone}
-                                                               <img src="{@RELATIVE_WCF_DIR}icon/packageStandalone1.svg" alt="" title="{lang}wcf.acp.package.list.standalone{/lang}" class="balloonTooltip" />
-                                                       {elseif $package->isPlugin()}
-                                                               <img src="{@RELATIVE_WCF_DIR}icon/packagePlugin1.svg" alt="" title="{lang}wcf.acp.package.list.plugin{/lang}" class="balloonTooltip" />
-                                                       {else}
-                                                               <img src="{@RELATIVE_WCF_DIR}icon/package1.svg" alt="" title="{lang}wcf.acp.package.list.other{/lang}" class="balloonTooltip" />
-                                                       {/if}
-                                               </td>
-                                               <td id="packageName{@$package->packageID}" class="columnTitle" title="{$package->packageDescription}">
-                                                       <a href="{link controller='PackageView' id=$package->packageID}{/link}"><span>{$package->getName()}{if $package->instanceNo > 1 && $package->instanceName == ''} (#{#$package->instanceNo}){/if}</span></a>
-                                               </td>
-                                               <td class="columnText><p>{if $package->authorURL}<a href="{@RELATIVE_WCF_DIR}acp/dereferrer.php?url={$package->authorURL|rawurlencode}" class="externalURL">{$package->author}</a>{else}{$package->author}{/if}</p></td>
-                                               <td class="columnText"><p>{$package->packageVersion}</p></td>
-                                               <td class="columnDate"><p>{@$package->updateDate|time}</p></td>
-                                               
-                                               {if $additionalColumns[$package->packageID]|isset}{@$additionalColumns[$package->packageID]}{/if}
-                                       </tr>
-                               {/foreach}
-                       </tbody>
-               </table>
-               
-       </div>
-{/if}
-
-<div class="contentFooter">
-       {@$pagesLinks}
-       
-       {if $__wcf->session->getPermission('admin.system.package.canInstallPackage') || $additionalLargeButtons|isset}
-               <nav class="largeButtons">
-                       <ul>
-                               {if $__wcf->session->getPermission('admin.system.package.canInstallPackage')}<li><a href="{link controller='PackageInstallation'}action=install{/link}" title="{lang}wcf.acp.package.installation{/lang}"><img src="{@RELATIVE_WCF_DIR}icon/add1.svg" alt="" /> <span>{lang}wcf.acp.package.installation{/lang}</span></a></li>{/if}
-                               {if $additionalLargeButtons|isset}{@$additionalLargeButtons}{/if}
-                       </ul>
-               </nav>
-       {/if}
-</div>
-
-{include file='footer'}
index 380537306bc560f0edb926775af81bebb64caec4..986926054ada3ecd404f12c0fa4ceaf161bc6d95 100644 (file)
@@ -5,7 +5,7 @@
                        <img src="http://s-ak.buzzfed.com/static/enhanced/web05/2011/3/18/1/enhanced-buzz-15854-1300424464-1.jpg" alt="" style="width: 100px;" />
                </a>
                <ul style="text-align: right;">
-                       <li style="display: inline-block;"><a href="index.php?form=PackageInstallation&amp;action=update&amp;packageID={@$packageID}{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" class="balloonTooltip" /></a></li>
+                       <li style="display: inline-block;"><a href="index.php?form=PackageStartInstall&amp;action=update&amp;packageID={@$packageID}{@SID_ARG_2ND}"><img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" class="balloonTooltip" /></a></li>
                        <li style="display: inline-block;"><img src="{@RELATIVE_WCF_DIR}icon/delete1.svg" alt="" title="{lang}wcf.acp.package.view.button.uninstall{/lang}" class="uninstallButton balloonTooltip" data-objectID="{@$package->packageID}" /></li>
                </ul>
        </li>
diff --git a/wcfsetup/install/files/acp/templates/packageStartInstall.tpl b/wcfsetup/install/files/acp/templates/packageStartInstall.tpl
new file mode 100644 (file)
index 0000000..25f189c
--- /dev/null
@@ -0,0 +1,82 @@
+{include file='header'}
+
+<header class="mainHeading">
+       {if $packageID == 0}
+               <img src="{@RELATIVE_WCF_DIR}icon/add1.svg" alt="" />
+               <hgroup>
+                       <h1>{lang}wcf.acp.package.startInstall{/lang}</h1>
+               </hgroup>
+       {else}
+               <img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" />
+               <hgroup>
+                       <h1>{lang}wcf.acp.package.startUpdate{/lang}</h1>
+               </hgroup>
+       {/if}
+</header>
+
+{if $errorField != ''}
+       <p class="error">{lang}wcf.global.form.error{/lang}</p>
+{/if}
+
+<div class="contentHeader">
+       <nav class="largeButtons">
+               <ul>
+                       <li><a href="{link controller='PackageList'}{/link}" title="{lang}wcf.acp.menu.link.package.list{/lang}"><img src="{@RELATIVE_WCF_DIR}icon/package1.svg" alt="" /> <span>{lang}wcf.acp.menu.link.package.list{/lang}</span></a></li>
+                       {if $additionalLargeButtons|isset}{@$additionalLargeButtons}{/if}
+               </ul>
+       </nav>
+</div>
+
+<form method="post" action="{link controller='PackageStartInstall'}{/link}" enctype="multipart/form-data">
+       <div class="border content">
+               
+               <fieldset>
+                       <legend>{lang}wcf.acp.package.startInstall.source{/lang}</legend>
+               
+                       <dl{if $errorField == 'uploadPackage'} class="formError"{/if}>
+                               <dt><label for="uploadPackage">{lang}wcf.acp.package.startInstall.source.upload{/lang}</label></dt>
+                               <dd>
+                                       <input type="file" id="uploadPackage" name="uploadPackage" value="" />
+                                       {if $errorField == 'uploadPackage'}
+                                               <small class="innerError">
+                                                       {if $errorType == 'empty'}
+                                                               {lang}wcf.global.form.error.empty{/lang}
+                                                       {elseif $errorType == 'phpRequirements'}
+                                                               {* todo: use language variable (-> else) *}
+                                                               <pre>{$phpRequirements|print_r}</pre>
+                                                       {else}
+                                                               {lang}wcf.acp.package.startInstall.error.{@$errorType}{/lang}
+                                                       {/if}
+                                               </small>
+                                       {/if}
+                                       <small>{lang}wcf.acp.package.startInstall.source.upload.description{/lang}</small>
+                               </dd>
+                       </dl>
+                       
+                       <dl{if $errorField == 'downloadPackage'} class="formError"{/if}>
+                               <dt><label for="downloadPackage">{lang}wcf.acp.package.startInstall.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.startInstall.error.{@$errorType}{/lang}
+                                               </small>
+                                       {/if}
+                                       <small>{lang}wcf.acp.package.startInstall.source.download.description{/lang}</small>
+                               </dd>
+                       </dl>
+               </fieldset>
+               
+               {if $additionalFields|isset}{@$additionalFields}{/if}
+       </div>
+
+       <div class="formSubmit">
+               <input type="reset" value="{lang}wcf.global.button.reset{/lang}" accesskey="r" />
+               <input type="submit" name="submitButton" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
+               {@SID_INPUT_TAG}
+               <input type="hidden" name="action" value="{$action}" />
+               {if $packageID != 0}<input type="hidden" name="id" value="{@$packageID}" />{/if}
+       </div>
+</form>
+
+{include file='footer'}
index ad42675cf0ea29b45c30e62daf7439e487e98394..b5ad9c4a46782a96e169aad405e25995a5b6b93b 100644 (file)
@@ -93,7 +93,7 @@
                                <tr>
                                        <td class="columnIcon">
                                                {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')}
-                                                       <a href="{link controller='PackageInstallation' id=$package.packageID}action=update{/link}"><img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" class="balloonTooltip" /></a>
+                                                       <a href="{link controller='PackageStartInstall' id=$package.packageID}action=update{/link}"><img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" class="balloonTooltip" /></a>
                                                {else}
                                                        <img src="{@RELATIVE_WCF_DIR}icon/updateD1.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" />
                                                {/if}
index 044a1ef63d8c4d5eb04b300d6a8728d4abe42c73..e4b16a0618b6e536a14976ea66eb8ae69aea402f 100644 (file)
                                                                        <tr>
                                                                                <td class="columnIcon">
                                                                                        {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')}
-                                                                                               <a href="{link controller='PackageInstallation' id=$requiredPackage.packageID}action=update{/link}"><img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" class="balloonTooltip" /></a>
+                                                                                               <a href="{link controller='PackageStartInstall' id=$requiredPackage.packageID}action=update{/link}"><img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" class="balloonTooltip" /></a>
                                                                                        {else}
                                                                                                <img src="{@RELATIVE_WCF_DIR}icon/update1D.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" />
                                                                                        {/if}
                                                                        <tr>
                                                                                <td class="columnIcon">
                                                                                        {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')}
-                                                                                               <a href="{link controller='PackageInstallation' id=$dependentPackage.packageID}action=update{/link}"><img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" class="balloonTooltip" /></a>
+                                                                                               <a href="{link controller='PackageStartInstall' id=$dependentPackage.packageID}action=update{/link}"><img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" class="balloonTooltip" /></a>
                                                                                        {else}
                                                                                                <img src="{@RELATIVE_WCF_DIR}icon/update1D.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" />
                                                                                        {/if}
                                {if $package->standalone && $package->package != 'com.woltlab.wcf'}<li><a href="{@RELATIVE_WCF_DIR}{$package->packageDir}acp/index.php{@SID_ARG_1ST}" title="{lang}wcf.acp.package.view.button.makeActive{/lang}"><img src="{@RELATIVE_WCF_DIR}icon/packageACP1.svg" alt="" /> <span>{lang}wcf.acp.package.view.button.makeActive{/lang}</span></a></li>{/if}
                                {if $__wcf->session->getPermission('admin.system.package.canUninstallPackage') && $noDependentIsActive}<li><a href="{link controller='Package'}action=startUninstall&packageID={@$package->packageID}{/link}" onclick="return confirm('{lang}wcf.acp.package.view.button.uninstall.sure{/lang}')" title="{lang}wcf.acp.package.view.button.uninstall{/lang}"><img src="{@RELATIVE_WCF_DIR}icon/delete1.svg" alt="" /> <span>{lang}wcf.acp.package.view.button.uninstall{/lang}</span></a></li>{/if}
                        {/if}
-                       {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')}<li><a href="{link controller='PackageInstallation' id=$package->packageID}action=update{/link}" title="{lang}wcf.acp.package.view.button.update{/lang}"><img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" /> <span>{lang}wcf.acp.package.view.button.update{/lang}</span></a></li>{/if}
+                       {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage')}<li><a href="{link controller='PackageStartInstall' id=$package->packageID}action=update{/link}" title="{lang}wcf.acp.package.view.button.update{/lang}"><img src="{@RELATIVE_WCF_DIR}icon/update1.svg" alt="" /> <span>{lang}wcf.acp.package.view.button.update{/lang}</span></a></li>{/if}
                        {if $additionalLargeButtons|isset}{@$additionalLargeButtons}{/if}
                </ul>
        </nav>
diff --git a/wcfsetup/install/files/lib/acp/form/PackageInstallationForm.class.php b/wcfsetup/install/files/lib/acp/form/PackageInstallationForm.class.php
deleted file mode 100755 (executable)
index 95aba17..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-<?php
-namespace wcf\acp\form;
-use wcf\data\package\Package;
-use wcf\data\package\installation\queue\PackageInstallationQueue;
-use wcf\data\package\installation\queue\PackageInstallationQueueEditor;
-use wcf\system\WCF;
-use wcf\system\WCFACP;
-use wcf\system\exception\IllegalLinkException;
-use wcf\system\exception\SystemException;
-use wcf\system\exception\UserInputException;
-use wcf\system\package\PackageArchive;
-use wcf\system\package\PackageInstallationDispatcher;
-use wcf\system\request\LinkHandler;
-use wcf\util\FileUtil;
-use wcf\util\HeaderUtil;
-use wcf\util\StringUtil;
-
-/**
- * Shows the package install and update form.
- *
- * @author     Marcel Werk
- * @copyright  2001-2009 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @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<string>
-        */
-       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
new file mode 100755 (executable)
index 0000000..70c6457
--- /dev/null
@@ -0,0 +1,264 @@
+<?php
+namespace wcf\acp\form;
+use wcf\data\package\Package;
+use wcf\data\package\installation\queue\PackageInstallationQueue;
+use wcf\data\package\installation\queue\PackageInstallationQueueEditor;
+use wcf\system\WCF;
+use wcf\system\WCFACP;
+use wcf\system\exception\IllegalLinkException;
+use wcf\system\exception\SystemException;
+use wcf\system\exception\UserInputException;
+use wcf\system\package\PackageArchive;
+use wcf\system\package\PackageInstallationDispatcher;
+use wcf\system\request\LinkHandler;
+use wcf\util\FileUtil;
+use wcf\util\HeaderUtil;
+use wcf\util\StringUtil;
+
+/**
+ * Shows the package install and update form.
+ *
+ * @author     Marcel Werk
+ * @copyright  2001-2009 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @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<string>
+        */
+       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
new file mode 100644 (file)
index 0000000..c196d40
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+namespace wcf\acp\page;
+use wcf\system\menu\acp\ACPMenu;
+use wcf\data\package\PackageList;
+use wcf\page\SortablePage;
+use wcf\system\WCF;
+
+/**
+ * Shows a list of all installed packages.
+ * 
+ * @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 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
deleted file mode 100644 (file)
index fabb7be..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-namespace wcf\acp\page;
-use wcf\system\menu\acp\ACPMenu;
-use wcf\data\package\PackageList;
-use wcf\page\SortablePage;
-use wcf\system\WCF;
-
-/**
- * Shows a list of all installed packages.
- * 
- * @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 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();
-       }
-}
index d1efd4f422d4596866e9f5db016e01dde006b97d..a8f132aa677896033339ef1a64d3753200bb95ce 100644 (file)
@@ -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 packageInstallationForm.class!
+                                               // but an object in the packageStartInstallForm.class!
                $this->package = $package;
        }