diff options
author | Bharat Mediratta <bharat@menalto.com> | 2011-01-16 23:14:57 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2011-01-16 23:14:57 -0800 |
commit | 66bb496b6c2ad9c5341644b2e303e694078374d1 (patch) | |
tree | 7521d11a5eae53a2ea854e16588980ec91fa8447 /modules/gallery/helpers/gallery_theme.php | |
parent | 167f635a6ce5a71b35450844f9b5c647aa14bcc1 (diff) |
If the logged in user is an admin and it's been more than 7 days since
the last check and auto upgrade checking is enabled, fire off an XHR
to check for a possible upgrade. Finishes off #1605.
Diffstat (limited to 'modules/gallery/helpers/gallery_theme.php')
-rw-r--r-- | modules/gallery/helpers/gallery_theme.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index d75c6fc6..a6ca5eb7 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -76,13 +76,22 @@ class gallery_theme_Core { $profiler = new Profiler(); $profiler->render(); } + $content = ""; if ($session->get("l10n_mode", false)) { - return L10n_Client_Controller::l10n_form(); + $content .= L10n_Client_Controller::l10n_form(); } if ($session->get_once("after_install")) { - return new View("welcome_message_loader.html"); + $content .= new View("welcome_message_loader.html"); } + + if (identity::active_user()->admin && upgrade_checker::should_auto_check()) { + $content .= '<script type="text/javascript"> + $.ajax({url: "' . url::site("admin/upgrade_checker/check_now?csrf=" . + access::csrf_token()) . '"}); + </script>'; + } + return $content; } static function admin_page_bottom($theme) { @@ -107,6 +116,13 @@ class gallery_theme_Core { setInterval("adminReauthCheck();", 60 * 1000); </script>'; + if (upgrade_checker::should_auto_check()) { + $content .= '<script type="text/javascript"> + $.ajax({url: "' . url::site("admin/upgrade_checker/check_now?csrf=" . + access::csrf_token()) . '"}); + </script>'; + } + if ($session->get("l10n_mode", false)) { $content .= "\n" . L10n_Client_Controller::l10n_form(); } |