From: Alexander Ebert Date: Thu, 1 Aug 2013 14:19:37 +0000 (+0200) Subject: Displaying notice for available updates X-Git-Tag: 2.0.0_Beta_7~68^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=839b49f19000b9a7b2e0041d31d6188469a83fad;p=GitHub%2FWoltLab%2FWCF.git Displaying notice for available updates --- diff --git a/com.woltlab.wcf/templates/userNotice.tpl b/com.woltlab.wcf/templates/userNotice.tpl index 9f6dfb80df..8e0b6d20fe 100644 --- a/com.woltlab.wcf/templates/userNotice.tpl +++ b/com.woltlab.wcf/templates/userNotice.tpl @@ -6,6 +6,10 @@ {/if} + {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage') && $__wcf->getAvailableUpdates()} +

{lang}wcf.global.availableUpdates{/lang}

+ {/if} + diff --git a/wcfsetup/install/files/acp/templates/index.tpl b/wcfsetup/install/files/acp/templates/index.tpl index 05fe6a9e28..d5080988b0 100644 --- a/wcfsetup/install/files/acp/templates/index.tpl +++ b/wcfsetup/install/files/acp/templates/index.tpl @@ -22,6 +22,10 @@

{lang}wcf.acp.index.inRescueMode{/lang}

{/if} +{if $__wcf->session->getPermission('admin.system.package.canUpdatePackage') && $__wcf->getAvailableUpdates()} +

{lang}wcf.global.availableUpdates{/lang}

+{/if} + {if $usersAwaitingApproval}

{lang}wcf.acp.user.usersAwaitingApprovalInfo{/lang}

{/if} diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index 44e6bcf58e..bf3c872304 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -1,5 +1,7 @@ getData(); + return $data['updates']; + } + /** * Initialises the cronjobs. */ diff --git a/wcfsetup/install/files/lib/system/cache/builder/PackageUpdateCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/PackageUpdateCacheBuilder.class.php new file mode 100644 index 0000000000..8e958cacd6 --- /dev/null +++ b/wcfsetup/install/files/lib/system/cache/builder/PackageUpdateCacheBuilder.class.php @@ -0,0 +1,25 @@ + + * @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)); + } +} diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 6b21babcd1..dc494b7d19 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1593,6 +1593,7 @@ Erlaubte Dateiendungen: {', '|implode:$attachmentHandler->getAllowedExtensions() + Aktualisierungen für installierte Pakete verfügbar.]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 41bedbf947..e5e469a4f3 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1591,6 +1591,7 @@ Allowed extensions: {', '|implode:$attachmentHandler->getAllowedExtensions()}]]> + updates available for installed packages.]]>