diff options
| author | Tristan Darricau <github@nicofuma.fr> | 2017-01-22 23:10:22 +0100 |
|---|---|---|
| committer | Tristan Darricau <github@nicofuma.fr> | 2017-01-22 23:10:22 +0100 |
| commit | 085a839963b61e9812aa06601b1ffeb2eb077ab9 (patch) | |
| tree | 0704c11cc4046d2ad235515774b62e2ab9ee8750 /phpBB/includes/acp | |
| parent | dcadfe092c16b539121d2118169419ed01a6cc2c (diff) | |
| parent | 38d0f2892e9d8f55c6e6af2d004da9621ee7f8f5 (diff) | |
| download | forums-085a839963b61e9812aa06601b1ffeb2eb077ab9.tar forums-085a839963b61e9812aa06601b1ffeb2eb077ab9.tar.gz forums-085a839963b61e9812aa06601b1ffeb2eb077ab9.tar.bz2 forums-085a839963b61e9812aa06601b1ffeb2eb077ab9.tar.xz forums-085a839963b61e9812aa06601b1ffeb2eb077ab9.zip | |
Merge pull request #4662 from marc1706/ticket/14968
[ticket/14968] Distinguish between update/upgrade & show upgrade info in ACP index
* marc1706/ticket/14968:
[ticket/14968] Use earlier version as written in comment
[ticket/14968] Update docblock and ensure method returns array
[ticket/14968] Display possible upgrade on acp index and update page
[ticket/14968] Add method for retrieving updates on current branch
Diffstat (limited to 'phpBB/includes/acp')
| -rw-r--r-- | phpBB/includes/acp/acp_main.php | 14 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_update.php | 9 |
2 files changed, 20 insertions, 3 deletions
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 7630875f47..6e7bd91a86 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -431,13 +431,23 @@ class acp_main if ($auth->acl_get('a_board')) { + /** @var \phpbb\version_helper $version_helper */ $version_helper = $phpbb_container->get('version_helper'); try { $recheck = $request->variable('versioncheck_force', false); - $updates_available = $version_helper->get_suggested_updates($recheck); + $updates_available = $version_helper->get_update_on_branch($recheck); + $upgrades_available = $version_helper->get_suggested_updates(); + if (!empty($upgrades_available)) + { + $upgrades_available = array_pop($upgrades_available); + } - $template->assign_var('S_VERSION_UP_TO_DATE', empty($updates_available)); + $template->assign_vars(array( + 'S_VERSION_UP_TO_DATE' => empty($updates_available), + 'S_VERSION_UPGRADEABLE' => !empty($upgrades_available), + 'UPGRADE_INSTRUCTIONS' => !empty($upgrades_available) ? $user->lang('UPGRADE_INSTRUCTIONS', $upgrades_available['current'], $upgrades_available['announcement']) : false, + )); } catch (\RuntimeException $e) { diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php index 529f0f2185..0f79d39ea2 100644 --- a/phpBB/includes/acp/acp_update.php +++ b/phpBB/includes/acp/acp_update.php @@ -37,7 +37,12 @@ class acp_update try { $recheck = $request->variable('versioncheck_force', false); - $updates_available = $version_helper->get_suggested_updates($recheck); + $updates_available = $version_helper->get_update_on_branch($recheck); + $upgrades_available = $version_helper->get_suggested_updates(); + if (!empty($upgrades_available)) + { + $upgrades_available = array_pop($upgrades_available); + } } catch (\RuntimeException $e) { @@ -61,6 +66,8 @@ class acp_update 'CURRENT_VERSION' => $config['version'], 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $update_link), + 'S_VERSION_UPGRADEABLE' => !empty($upgrades_available), + 'UPGRADE_INSTRUCTIONS' => !empty($upgrades_available) ? $user->lang('UPGRADE_INSTRUCTIONS', $upgrades_available['current'], $upgrades_available['announcement']) : false, )); // Incomplete update? |
