diff options
| author | Tristan Darricau <github@nicofuma.fr> | 2017-01-22 23:15:26 +0100 |
|---|---|---|
| committer | Tristan Darricau <github@nicofuma.fr> | 2017-01-22 23:15:26 +0100 |
| commit | 7c77e333138e6c705ffbfd3028ce1d2002404965 (patch) | |
| tree | c0fa7de1eac82faa1cd758fe6ed92920570d311a /phpBB/includes | |
| parent | f7ccd7af8ef529bd8a43b8a3e0b342f9b228d961 (diff) | |
| parent | 085a839963b61e9812aa06601b1ffeb2eb077ab9 (diff) | |
| download | forums-7c77e333138e6c705ffbfd3028ce1d2002404965.tar forums-7c77e333138e6c705ffbfd3028ce1d2002404965.tar.gz forums-7c77e333138e6c705ffbfd3028ce1d2002404965.tar.bz2 forums-7c77e333138e6c705ffbfd3028ce1d2002404965.tar.xz forums-7c77e333138e6c705ffbfd3028ce1d2002404965.zip | |
Merge branch '3.1.x' into 3.2.x
* 3.1.x:
[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')
| -rw-r--r-- | phpBB/includes/acp/acp_main.php | 14 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_update.php | 9 |
2 files changed, 19 insertions, 4 deletions
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 68d7384865..bb85d080ce 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -439,14 +439,22 @@ class acp_main if ($auth->acl_get('a_board')) { - /* @var $version_helper \phpbb\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 b88e6d3984..df376765f8 100644 --- a/phpBB/includes/acp/acp_update.php +++ b/phpBB/includes/acp/acp_update.php @@ -38,7 +38,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) { @@ -62,6 +67,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? |
