</div>
{/if}
+ {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage') && $__wcf->getAvailableUpdates()}
+ <p class="info">{lang}wcf.global.availableUpdates{/lang}</p>
+ {/if}
+
<noscript>
<p class="warning">{lang}wcf.page.javascriptDisabled{/lang}</p>
</noscript>
<p style="background-color: rgb(255, 153, 153); border: 2px solid rgb(255, 0, 0); padding: 1em;">{lang}wcf.acp.index.inRescueMode{/lang}</p>
{/if}
+{if $__wcf->session->getPermission('admin.system.package.canUpdatePackage') && $__wcf->getAvailableUpdates()}
+ <p class="info">{lang}wcf.global.availableUpdates{/lang}</p>
+{/if}
+
{if $usersAwaitingApproval}
<p class="info">{lang}wcf.acp.user.usersAwaitingApprovalInfo{/lang}</p>
{/if}
<?php
namespace wcf\system;
+use wcf\system\cache\builder\PackageUpdateCacheBuilder;
+
use wcf\data\application\Application;
use wcf\data\option\OptionEditor;
use wcf\data\package\Package;
return StyleHandler::getInstance();
}
+ /**
+ * Returns number of available updates.
+ *
+ * @return integer
+ */
+ public function getAvailableUpdates() {
+ $data = PackageUpdateCacheBuilder::getInstance()->getData();
+ return $data['updates'];
+ }
+
/**
* Initialises the cronjobs.
*/
--- /dev/null
+<?php
+namespace wcf\system\cache\builder;
+use wcf\system\package\PackageUpdateDispatcher;
+
+/**
+ * Caches the number of outstanding updates.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2013 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.cache.builder
+ * @category Community Framework
+ */
+class PackageUpdateCacheBuilder extends AbstractCacheBuilder {
+ /**
+ * @see wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
+ */
+ public function rebuild(array $parameters) {
+ PackageUpdateDispatcher::getInstance()->refreshPackageDatabase();
+ $updates = PackageUpdateDispatcher::getInstance()->getAvailableUpdates();
+
+ return array('updates' => count($updates));
+ }
+}
</category>
<category name="wcf.global">
+ <item name="wcf.global.availableUpdates"><![CDATA[Es sind <a href="{link controller='PackageUpdate' isACP=true}{/link}">Aktualisierungen für installierte Pakete</a> verfügbar.]]></item>
<item name="wcf.global.button.add"><![CDATA[Hinzufügen]]></item>
<item name="wcf.global.button.back"><![CDATA[« Zurück]]></item>
<item name="wcf.global.button.cancel"><![CDATA[Abbrechen]]></item>
</category>
<category name="wcf.global">
+ <item name="wcf.global.availableUpdates"><![CDATA[There are <a href="{link controller='PackageUpdate' isACP=true}{/link}">updates available</a> for installed packages.]]></item>
<item name="wcf.global.button.add"><![CDATA[Add]]></item>
<item name="wcf.global.button.back"><![CDATA[« Back]]></item>
<item name="wcf.global.button.cancel"><![CDATA[Cancel]]></item>