Changeset 9935


Ignore:
Timestamp:
Mar 30, 2011, 12:14:02 PM (13 years ago)
Author:
patdenice
Message:
 
Location:
extensions/autoupdate/trunk
Files:
1 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/autoupdate/trunk/main.inc.php

    r9712 r9935  
    2323}
    2424
    25 if (script_basename() == 'admin')
    26  add_event_handler('get_admin_plugin_menu_links', 'check_for_auto_upgrade');
     25add_event_handler('get_admin_plugin_menu_links', 'check_for_auto_upgrade');
     26add_event_handler('ws_add_methods', 'add_ws_autoupdate_methods');
    2727
    2828function check_for_auto_upgrade($plugin_menu_links)
     
    5656  return $plugin_menu_links;
    5757}
     58
     59function add_ws_autoupdate_methods($arr)
     60{
     61  include_once(AUTOUPDATE_PATH.'ws_functions.inc.php');
     62}
    5863?>
  • extensions/autoupdate/trunk/template/autoupdate.js

    r9735 r9935  
    1212
    1313function resetIgnored() {
    14   jQuery.post(
    15     "plugins/autoupdate/ajax/ignore_list.php",
    16     { reset: true, pwg_token: pwg_token },
    17     function(data) {
    18       if (data == "ok") {
     14  jQuery.ajax({
     15    type: 'GET',
     16    url: 'ws.php',
     17    dataType: 'json',
     18    data: { method: 'pwg.extensions.ignoreUpdates', reset: true, pwg_token: pwg_token, format: 'json' },
     19    success: function(data) {
     20      if (data['stat'] == 'ok') {
    1921        jQuery(".pluginBox, fieldset").show();
    2022        jQuery("#update_all").show();
     
    2527      }
    2628    }
    27   );
     29  });
    2830};
    2931
     
    5759  jQuery('.autoupdate_bar').toggle();
    5860  jQuery.ajax({
    59     type: 'POST',
    60     url: 'plugins/autoupdate/ajax/update_'+type+'.php',
    61     data: { id: id, revision: revision, pwg_token: pwg_token },
     61    type: 'GET',
     62    url: 'ws.php',
     63    data: { method: 'pwg.'+type+'s.update', id: id, revision: revision, pwg_token: pwg_token, format: 'json' },
    6264    success: function(data) {
    63       if (data['result']) {
     65      if (data['stat'] == 'ok') {
    6466        jQuery("#"+type+"_"+id).remove();
    6567        checkFieldsets();
    6668        jQuery.jGrowl(
    67           data['msg'],
     69          data['result'],
    6870          {
    6971            theme:  'success',
     
    7779      } else {
    7880        jQuery.jGrowl(
    79           data['msg'],
     81          data['result'],
    8082          {
    8183            theme:  'error',
     
    105107
    106108function ignoreExtension(type, id) {
    107   jQuery.post(
    108     "plugins/autoupdate/ajax/ignore_list.php",
    109     { type: type+'s', id: id, pwg_token: pwg_token },
    110     function(data) {
    111       if (data == "ok") {
     109  jQuery.ajax({
     110    type: 'GET',
     111    url: 'ws.php',
     112    dataType: 'json',
     113    data: { method: 'pwg.extensions.ignoreUpdates', type: type+'s', id: id, pwg_token: pwg_token, format: 'json' },
     114    success: function(data) {
     115      if (data['stat'] == 'ok') {
    112116        jQuery("#"+type+"_"+id).hide();
    113117        jQuery("#reset_ignore").show();
     
    115119      }
    116120    }
    117   );
     121  });
    118122};
  • extensions/autoupdate/trunk/template/head.tpl

    r9710 r9935  
    55var up_to_date = '{"Gallery and extensions are up to date"|@translate|@escape:"javascript"}';
    66
    7 window.onload = function () {ldelim}
    8   jQuery.ajax({ldelim}
     7{literal}
     8window.onload = function () {
     9  jQuery.ajax({
    910    type: 'GET',
    10     url: 'plugins/autoupdate/ajax/check_updates.php',
    11     dataType: 'text',
     11    url: 'ws.php',
     12    dataType: 'json',
     13    data: { method: 'pwg.extensions.checkUpdates', format: 'json' },
    1214    timeout: 10000,  // 10 sec timeout
    13     success: function (data) {ldelim}
    14       var reg = new RegExp("^(error|piwigo_upgrade|ext_upgrade|up_to_date)$","i");
    15       if (!data.match(reg))
     15    success: function (data) {
     16      if (data['stat'] == 'ok')
     17        jQuery('#autoupdate').html(eval(data['result']));
     18      else
    1619        jQuery('#autoupdate').html(error);
    17       else
    18         jQuery('#autoupdate').html(eval(data));
    1920    },
    20     error: function() {ldelim}
     21    error: function() {
    2122     jQuery('#autoupdate').html(error);
    2223    }
    2324  });
    2425}
    25 {/footer_script}
     26{/literal}{/footer_script}
    2627<p id="autoupdate"><img src="plugins/autoupdate/template/ajax-loader.gif"> &nbsp; {'Checking upgrades for gallery and plugins...'|@translate}</p>
Note: See TracChangeset for help on using the changeset viewer.