mirror of
https://github.com/e107inc/e107.git
synced 2025-08-20 13:21:54 +02:00
Issue #2818 Moved core database update check to ajax.
This commit is contained in:
@@ -226,7 +226,7 @@ class adminstyle_flexpanel extends adminstyle_infopanel
|
||||
// --------------------- Add-on updates ---------------------------
|
||||
$ns->setStyle('flexpanel');
|
||||
$ns->setUniqueId('e-addon-updates');
|
||||
$addonUpdates = $tp->parseTemplate("{ADMIN_ADDON_UPDATES}", true, $admin_sc);
|
||||
$addonUpdates = $admin_sc->sc_admin_addon_updates();
|
||||
$info = $this->getMenuPosition('e-addon-updates');
|
||||
$panels[$info['area']][$info['weight']] .= $addonUpdates;
|
||||
|
||||
|
@@ -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');
|
||||
|
||||
|
Reference in New Issue
Block a user