1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-31 02:00:14 +02:00

Issue #2818 Moved core database update check to ajax.

This commit is contained in:
Cameron
2017-11-15 17:51:46 -08:00
parent ab76e96e86
commit 1069998c42
7 changed files with 87 additions and 4 deletions

View File

@@ -29,13 +29,61 @@ class adminstyle_infopanel
function __construct()
{
$coreUpdateCheck = '';
if( e107::getSession()->get('core-update-status') !== true)
{
$coreUpdateCheck = "
$('#e-admin-core-update').html('<i title=\"Checking for updates\" class=\"fa fa-spinner fa-spin\"></i>');
$.get('".e_ADMIN."admin.php?mode=core&type=update', function( data ) {
var res = $.parseJSON(data);
if(res === true)
{
$('#e-admin-core-update').html('<span class=\"text-info\"><i class=\"fa fa-database\"></i></span>');
$('[data-toggle=\"popover\"]').popover('show');
$('.popover').on('click', function()
{
$('[data-toggle=\"popover\"]').popover('hide');
});
}
else
{
$('#e-admin-core-update').text('');
}
});
";
}
$code = "
jQuery(function($){
$('#e-adminfeed').load('".e_ADMIN."admin.php?mode=core&type=feed');
$('#e-adminfeed-plugin').load('".e_ADMIN."admin.php?mode=addons&type=plugin');
$('#e-adminfeed-theme').load('".e_ADMIN."admin.php?mode=addons&type=theme');
".$coreUpdateCheck."
});
";
e107::js('inline',$code,'jquery');