Ignore:
Timestamp:
Apr 21, 2011, 5:12:38 PM (13 years ago)
Author:
patdenice
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/intro.tpl

    r9553 r10538  
    22
    33{footer_script require='jquery.cluetip'}
    4 jQuery().ready(function(){ldelim}
    5         jQuery('.cluetip').cluetip({ldelim}
     4var piwigo_need_update_msg = '<a href="admin.php?page=updates">{"A new version of Piwigo is available."|@translate|@escape:"javascript"}</a>';
     5var ext_need_update_msg = '<a href="admin.php?page=updates&amp;tab=ext">{"Some upgrades are available for extensions."|@translate|@escape:"javascript"}</a>';
     6
     7{literal}
     8jQuery().ready(function(){
     9        jQuery('.cluetip').cluetip({
    610                width: 300,
    711                splitTitle: '|',
    812                positionBy: 'bottomTop'
    913        });
     14  jQuery.ajax({
     15    type: 'GET',
     16    url: 'ws.php',
     17    dataType: 'json',
     18    data: { method: 'pwg.extensions.checkUpdates', format: 'json' },
     19    timeout: 5000,
     20    success: function (data) {
     21      if (data['stat'] != 'ok')
     22        return;
     23      piwigo_update = data['result']['piwigo_need_update'];
     24      ext_update = data['result']['ext_need_update']
     25      if ((piwigo_update || ext_update) && !jQuery(".warnings").is('div'))
     26        jQuery("#content").prepend('<div class="warnings"><ul></ul></div>');
     27      if (piwigo_update)
     28        jQuery(".warnings ul").append('<li>'+piwigo_need_update_msg+'</li>');
     29      if (ext_update)
     30        jQuery(".warnings ul").append('<li>'+ext_need_update_msg+'</li>');
     31    }
     32  }); 
    1033});
     34{/literal}
    1135{/footer_script}
    1236
Note: See TracChangeset for help on using the changeset viewer.