summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-07-07 12:12:54 +0200
committerVincent Petry <pvince81@owncloud.com>2015-08-19 18:03:35 +0200
commitb919ae96f093a927e83f9f114a34400a4095ea5e (patch)
tree74f8631b639ba72d7eecd761092ae84a4d40a98a /lib/base.php
parent645600ae03101c1212576022548781641f2b4970 (diff)
downloadnextcloud-server-b919ae96f093a927e83f9f114a34400a4095ea5e.tar.gz
nextcloud-server-b919ae96f093a927e83f9f114a34400a4095ea5e.zip
Display app names in update page for app updates
Whenever the update page is displayed for apps, show app names instead of the core update text.
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php56
1 files changed, 35 insertions, 21 deletions
diff --git a/lib/base.php b/lib/base.php
index 9a682a7e90f..0a0d66aaf25 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -346,27 +346,7 @@ class OC {
if (\OCP\Util::needUpgrade()) {
$systemConfig = \OC::$server->getSystemConfig();
if ($showTemplate && !$systemConfig->getValue('maintenance', false)) {
- $version = OC_Util::getVersion();
- $oldTheme = $systemConfig->getValue('theme');
- $systemConfig->setValue('theme', '');
- OC_Util::addScript('config'); // needed for web root
- OC_Util::addScript('update');
- $tmpl = new OC_Template('', 'update.admin', 'guest');
- $tmpl->assign('version', OC_Util::getVersionString());
-
- // get third party apps
- $apps = OC_App::getEnabledApps();
- $incompatibleApps = array();
- foreach ($apps as $appId) {
- $info = OC_App::getAppInfo($appId);
- if(!OC_App::isAppCompatible($version, $info)) {
- $incompatibleApps[] = $info;
- }
- }
- $tmpl->assign('appList', $incompatibleApps);
- $tmpl->assign('productName', 'ownCloud'); // for now
- $tmpl->assign('oldTheme', $oldTheme);
- $tmpl->printPage();
+ self::printUpgradePage();
exit();
} else {
return true;
@@ -375,6 +355,40 @@ class OC {
return false;
}
+ /**
+ * Prints the upgrade page
+ */
+ private static function printUpgradePage() {
+ $systemConfig = \OC::$server->getSystemConfig();
+ $oldTheme = $systemConfig->getValue('theme');
+ $systemConfig->setValue('theme', '');
+ \OCP\Util::addScript('config'); // needed for web root
+ \OCP\Util::addScript('update');
+
+ // check whether this is a core update or apps update
+ $installedVersion = $systemConfig->getValue('version', '0.0.0');
+ $currentVersion = implode('.', OC_Util::getVersion());
+
+ $appManager = \OC::$server->getAppManager();
+
+ $tmpl = new OC_Template('', 'update.admin', 'guest');
+ $tmpl->assign('version', OC_Util::getVersionString());
+
+ // if not a core upgrade, then it's apps upgrade
+ if (version_compare($currentVersion, $installedVersion, '=')) {
+ $tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade());
+ $tmpl->assign('isAppsOnlyUpgrade', true);
+ } else {
+ // get third party apps
+ $version = OC_Util::getVersion();
+ $tmpl->assign('appList', $appManager->getIncompatibleApps($version));
+ $tmpl->assign('isAppsOnlyUpgrade', false);
+ }
+ $tmpl->assign('productName', 'ownCloud'); // for now
+ $tmpl->assign('oldTheme', $oldTheme);
+ $tmpl->printPage();
+ }
+
public static function initTemplateEngine() {
// Add the stuff we need always
// following logic will import all vendor libraries that are