diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-08-20 11:50:01 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-08-20 11:50:01 +0200 |
commit | 06d8edd9637f59f914ec7f3d7f6846f3cbe88eaf (patch) | |
tree | 49833fd9a8a80255b7ae2d91291e5371a047870b /lib/base.php | |
parent | 2fe070ca37c76bc118c0fe360b9c7008bf01e52b (diff) | |
parent | a2674b2b303c6b2a5935638af04f0e4a61afae24 (diff) | |
download | nextcloud-server-06d8edd9637f59f914ec7f3d7f6846f3cbe88eaf.tar.gz nextcloud-server-06d8edd9637f59f914ec7f3d7f6846f3cbe88eaf.zip |
Merge pull request #17434 from owncloud/update-showappnameonappupdate
Display app names in update page for app updates
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 57 |
1 files changed, 36 insertions, 21 deletions
diff --git a/lib/base.php b/lib/base.php index c0f3e50142e..42e1d7f8586 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,41 @@ 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('isAppsOnlyUpgrade', true); + } else { + $tmpl->assign('isAppsOnlyUpgrade', false); + } + + // get third party apps + $ocVersion = OC_Util::getVersion(); + $tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion)); + $tmpl->assign('incompatibleAppsList', $appManager->getIncompatibleApps($ocVersion)); + $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 |