-{hascontent}
- <table class="table">
- <thead>
+<table class="table">
+ <thead>
+ <tr>
+ <th colspan="2" class="columnTitle">{lang}wcf.acp.package.name{/lang}</th>
+ <th class="columnText">{lang}wcf.acp.package.author{/lang}</a></th>
+ <th class="columnText">{lang}wcf.acp.package.license{/lang}</th>
+ <th class="columnDate">{lang}wcf.acp.package.packageDate{/lang}</a></th>
+
+ {event name='headColumns'}
+ </tr>
+ </thead>
+
+ <tbody>
+ <tr>
+ <td colspan="5"><small>{lang count=$trustedSources|count}wcf.acp.package.search.result.trusted{/lang}</small></td>
+ </tr>
+ {foreach from=$trustedSources item=$package}
+ <tr class="jsPackageRow">
+ <td class="columnIcon">
+ <a href="#" class="jsInstallPackage" data-confirm-message="{lang __encode=true}wcf.acp.package.install.confirmMessage{/lang}" data-package="{$package->package}" data-package-version="{$package->getAccessibleVersion()->packageVersion}"><span class="icon icon16 fa-plus jsTooltip" title="{lang}wcf.acp.package.button.installPackage{/lang}"></span></a>
+ </td>
+ <td class="columnTitle" title="{$package->packageDescription}">
+ <div class="packageSearchName">{$package->packageName} <span class="packageSearchVersion">{$package->getAccessibleVersion()->packageVersion}</span></div>
+ <span class="packageSearchPackage">{$package->package}</span>
+ </td>
+ <td class="columnText">{if $package->authorURL}<a href="{$package->authorURL}" class="externalURL">{$package->author}</a>{else}{$package->author}{/if}</td>
+ <td class="columnText">{if $package->getAccessibleVersion()->licenseURL}<a href="{$package->getAccessibleVersion()->licenseURL}" class="externalURL">{$package->getAccessibleVersion()->license}</a>{else}{$package->getAccessibleVersion()->license}{/if}</td>
+ <td class="columnDate">{@$package->getAccessibleVersion()->packageDate|time}</td>
+ </tr>
+ {/foreach}
+ {hascontent}
<tr>
- <th colspan="2" class="columnTitle">{lang}wcf.acp.package.name{/lang}</th>
- <th class="columnText">{lang}wcf.acp.package.author{/lang}</a></th>
- <th class="columnText">{lang}wcf.acp.package.license{/lang}</th>
- <th class="columnDate">{lang}wcf.acp.package.packageDate{/lang}</a></th>
-
- {event name='headColumns'}
+ <td colspan="5"><small>{lang count=$thirdPartySources|count}wcf.acp.package.search.result.thirdParty{/lang}</small></td>
</tr>
- </thead>
-
- <tbody>
{content}
- {foreach from=$packageUpdates item=$package}
+ {foreach from=$thirdPartySources item=$package}
<tr class="jsPackageRow">
<td class="columnIcon">
<a href="#" class="jsInstallPackage" data-confirm-message="{lang __encode=true}wcf.acp.package.install.confirmMessage{/lang}" data-package="{$package->package}" data-package-version="{$package->getAccessibleVersion()->packageVersion}"><span class="icon icon16 fa-plus jsTooltip" title="{lang}wcf.acp.package.button.installPackage{/lang}"></span></a>
-
- {event name='buttons'}
</td>
<td class="columnTitle" title="{$package->packageDescription}">
<div class="packageSearchName">{$package->packageName} <span class="packageSearchVersion">{$package->getAccessibleVersion()->packageVersion}</span></div>
<td class="columnText">{if $package->authorURL}<a href="{$package->authorURL}" class="externalURL">{$package->author}</a>{else}{$package->author}{/if}</td>
<td class="columnText">{if $package->getAccessibleVersion()->licenseURL}<a href="{$package->getAccessibleVersion()->licenseURL}" class="externalURL">{$package->getAccessibleVersion()->license}</a>{else}{$package->getAccessibleVersion()->license}{/if}</td>
<td class="columnDate">{@$package->getAccessibleVersion()->packageDate|time}</td>
-
- {event name='columns'}
</tr>
{/foreach}
{/content}
- </tbody>
- </table>
-{hascontentelse}
- <p class="info">{lang}wcf.acp.package.search.error.noMatches{/lang}</p>
-{/hascontent}
+ {/hascontent}
+ </tbody>
+</table>
$updateVersions = $statement->fetchObjects(PackageUpdateVersion::class, 'packageUpdateVersionID');
// assign versions
+ /**
+ * @var ViewablePackageUpdate[] $thirdPartySources
+ * @var ViewablePackageUpdate[] $trustedSources
+ */
+ $thirdPartySources = $trustedSources = [];
/**
* @var int $packageUpdateID
* @var ViewablePackageUpdate $packageUpdate
$packageUpdate->setAccessibleVersion($updateVersions[$versionIDs['accessible']]);
$packageUpdate->setLatestVersion($updateVersions[$versionIDs['existing']]);
$packageUpdate->setUpdateServer($updateServers[$packageUpdate->packageUpdateServerID]);
- }
-
- uasort($packageUpdates, function(ViewablePackageUpdate $a, ViewablePackageUpdate $b) {
- $aIsTrusted = $a->getUpdateServer()->isTrustedServer() || $a->getUpdateServer()->isWoltLabStoreServer();
- $bIsTrusted = $b->getUpdateServer()->isTrustedServer() || $b->getUpdateServer()->isWoltLabStoreServer();
- if ($aIsTrusted === $bIsTrusted) {
- return strnatcasecmp($a->getName(), $b->getName());
+ if ($packageUpdate->getUpdateServer()->isTrustedServer() || $packageUpdate->getUpdateServer()->isWoltLabStoreServer()) {
+ $trustedSources[] = $packageUpdate;
}
-
- return $aIsTrusted ? -1 : 1;
+ else {
+ $thirdPartySources[] = $packageUpdate;
+ }
+ }
+
+ uasort($thirdPartySources, function(ViewablePackageUpdate $a, ViewablePackageUpdate $b) {
+ return strnatcasecmp($a->getName(), $b->getName());
+ });
+ uasort($trustedSources, function(ViewablePackageUpdate $a, ViewablePackageUpdate $b) {
+ return strnatcasecmp($a->getName(), $b->getName());
});
WCF::getTPL()->assign([
- 'packageUpdates' => $packageUpdates,
+ 'thirdPartySources' => $thirdPartySources,
+ 'trustedSources' => $trustedSources,
]);
return [
- 'count' => count($updateData),
+ 'count' => count($thirdPartySources) + count($trustedSources),
'template' => WCF::getTPL()->fetch('packageSearchResultList'),
];
}
<item name="wcf.acp.package.search.input"><![CDATA[Suchbegriff eingeben]]></item>
<item name="wcf.acp.package.search.input.description"><![CDATA[Es wird nach Teilübereinstimmungen des Paketnamens, dessen Beschreibung sowie dem internen Bezeichner gesucht.]]></item>
<item name="wcf.acp.package.search.status.idle"><![CDATA[Geben Sie mehr als drei Buchstaben ein, um die Suche zu starten.]]></item>
- <item name="wcf.acp.package.search.status.loading"><![CDATA[Suche läuft…]]></item>
+ <item name="wcf.acp.package.search.status.loading"><![CDATA[Suche läuft …]]></item>
<item name="wcf.acp.package.search.status.noResults"><![CDATA[Die Suche ergab keine Treffer.]]></item>
- <item name="wcf.acp.package.search.status.refreshDatabase"><![CDATA[Die Paketlisten werden aktualisiert…]]></item>
+ <item name="wcf.acp.package.search.status.refreshDatabase"><![CDATA[Die Paketlisten werden aktualisiert …]]></item>
+ <item name="wcf.acp.package.search.result.thirdParty"><![CDATA[{if $count === 0}Keine{elseif $count === 1}Ein{else}{#$count}{/if} Treffer in Paketquellen von Drittanbietern]]></item>
+ <item name="wcf.acp.package.search.result.trusted"><![CDATA[{if $count === 0}Keine{elseif $count === 1}Ein{else}{#$count}{/if} Treffer in offizielle Paketquellen]]></item>
</category>
<category name="wcf.acp.page">
<item name="wcf.acp.page.add"><![CDATA[Seite hinzufügen]]></item>
<item name="wcf.acp.package.search.status.loading"><![CDATA[Searching…]]></item>
<item name="wcf.acp.package.search.status.noResults"><![CDATA[There were no matches.]]></item>
<item name="wcf.acp.package.search.status.refreshDatabase"><![CDATA[Retrieving the package lists…]]></item>
+ <item name="wcf.acp.package.search.result.thirdParty"><![CDATA[{if $count === 0}No matches{elseif $count === 1}One match{else}{#$count} matches{/if} in package sources maintained by third parties]]></item>
+ <item name="wcf.acp.package.search.result.trusted"><![CDATA[{if $count === 0}No matches{elseif $count === 1}One match{else}{#$count} matches{/if} in official package sources]]></item>
</category>
<category name="wcf.acp.paidSubscription">
<item name="wcf.acp.paidSubscription.list"><![CDATA[Paid Subscriptions]]></item>