From f5ef4fddd7ce277f27ef4face7933fe5a7406200 Mon Sep 17 00:00:00 2001 From: patdenice Date: Thu, 21 Apr 2011 15:12:38 +0000 Subject: feature:2271 Add pwg.extensions.checkUpdates method to webservices. Add a warning message on intro page if update is availble for piwigo or extensions. Add an "Ignore All" button on extensions update page. git-svn-id: http://piwigo.org/svn/trunk@10538 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/themes/default/template/intro.tpl | 28 +++++++++++++++++++++++++-- admin/themes/default/template/updates_ext.tpl | 20 ++++++++++++++----- 2 files changed, 41 insertions(+), 7 deletions(-) (limited to 'admin/themes') diff --git a/admin/themes/default/template/intro.tpl b/admin/themes/default/template/intro.tpl index aa744ac48..0f4dc7c00 100644 --- a/admin/themes/default/template/intro.tpl +++ b/admin/themes/default/template/intro.tpl @@ -1,13 +1,37 @@ {combine_script id='jquery.cluetip' load='async' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'} {footer_script require='jquery.cluetip'} -jQuery().ready(function(){ldelim} - jQuery('.cluetip').cluetip({ldelim} +var piwigo_need_update_msg = '{"A new version of Piwigo is available."|@translate|@escape:"javascript"}'; +var ext_need_update_msg = '{"Some upgrades are available for extensions."|@translate|@escape:"javascript"}'; + +{literal} +jQuery().ready(function(){ + jQuery('.cluetip').cluetip({ width: 300, splitTitle: '|', positionBy: 'bottomTop' }); + jQuery.ajax({ + type: 'GET', + url: 'ws.php', + dataType: 'json', + data: { method: 'pwg.extensions.checkUpdates', format: 'json' }, + timeout: 5000, + success: function (data) { + if (data['stat'] != 'ok') + return; + piwigo_update = data['result']['piwigo_need_update']; + ext_update = data['result']['ext_need_update'] + if ((piwigo_update || ext_update) && !jQuery(".warnings").is('div')) + jQuery("#content").prepend('
'); + if (piwigo_update) + jQuery(".warnings ul").append('
  • '+piwigo_need_update_msg+'
  • '); + if (ext_update) + jQuery(".warnings ul").append('
  • '+ext_need_update_msg+'
  • '); + } + }); }); +{/literal} {/footer_script}

    {'Piwigo Administration'|@translate}

    diff --git a/admin/themes/default/template/updates_ext.tpl b/admin/themes/default/template/updates_ext.tpl index a2ffccd4d..a4f52f10b 100644 --- a/admin/themes/default/template/updates_ext.tpl +++ b/admin/themes/default/template/updates_ext.tpl @@ -29,6 +29,13 @@ function updateAll() { } }; +function ignoreAll() { + jQuery('.ignoreExtension').each( function() { + if (jQuery(this).parents('div').css('display') == 'block') + jQuery(this).click(); + }); +}; + function resetIgnored() { jQuery.ajax({ type: 'GET', @@ -39,6 +46,7 @@ function resetIgnored() { if (data['stat'] == 'ok') { jQuery(".pluginBox, fieldset").show(); jQuery("#update_all").show(); + jQuery("#ignore_all").show(); jQuery("#up_to_date").hide(); jQuery("#reset_ignore").hide(); jQuery("#ignored").hide(); @@ -67,6 +75,7 @@ function checkFieldsets() { if (total == 0) { jQuery("#update_all").hide(); + jQuery("#ignore_all").hide(); jQuery("#up_to_date").show(); } if (ignored > 0) { @@ -96,7 +105,7 @@ function updateExtension(type, id, revision) { }; function ignoreExtension(type, id) { - jQuery.ajax({ + queuedManager.add({ type: 'GET', url: 'ws.php', dataType: 'json', @@ -137,10 +146,11 @@ checkFieldsets();

    +
    @@ -159,7 +169,7 @@ checkFieldsets(); {'Install'|@translate} | {'Download'|@translate} - | {'Ignore this update'|@translate} + | {'Ignore this update'|@translate} @@ -201,7 +211,7 @@ checkFieldsets(); {'Install'|@translate} | {'Download'|@translate} - | {'Ignore this update'|@translate} + | {'Ignore this update'|@translate} @@ -243,7 +253,7 @@ checkFieldsets(); {'Install'|@translate} | {'Download'|@translate} - | {'Ignore this update'|@translate} + | {'Ignore this update'|@translate} -- cgit v1.2.3