Changeset 9935
- Timestamp:
- Mar 30, 2011, 12:14:02 PM (13 years ago)
- Location:
- extensions/autoupdate/trunk
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/autoupdate/trunk/main.inc.php
r9712 r9935 23 23 } 24 24 25 if (script_basename() == 'admin') 26 add_event_handler('get_admin_plugin_menu_links', 'check_for_auto_upgrade');25 add_event_handler('get_admin_plugin_menu_links', 'check_for_auto_upgrade'); 26 add_event_handler('ws_add_methods', 'add_ws_autoupdate_methods'); 27 27 28 28 function check_for_auto_upgrade($plugin_menu_links) … … 56 56 return $plugin_menu_links; 57 57 } 58 59 function add_ws_autoupdate_methods($arr) 60 { 61 include_once(AUTOUPDATE_PATH.'ws_functions.inc.php'); 62 } 58 63 ?> -
extensions/autoupdate/trunk/template/autoupdate.js
r9735 r9935 12 12 13 13 function 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') { 19 21 jQuery(".pluginBox, fieldset").show(); 20 22 jQuery("#update_all").show(); … … 25 27 } 26 28 } 27 );29 }); 28 30 }; 29 31 … … 57 59 jQuery('.autoupdate_bar').toggle(); 58 60 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' }, 62 64 success: function(data) { 63 if (data[' result']) {65 if (data['stat'] == 'ok') { 64 66 jQuery("#"+type+"_"+id).remove(); 65 67 checkFieldsets(); 66 68 jQuery.jGrowl( 67 data[' msg'],69 data['result'], 68 70 { 69 71 theme: 'success', … … 77 79 } else { 78 80 jQuery.jGrowl( 79 data[' msg'],81 data['result'], 80 82 { 81 83 theme: 'error', … … 105 107 106 108 function 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') { 112 116 jQuery("#"+type+"_"+id).hide(); 113 117 jQuery("#reset_ignore").show(); … … 115 119 } 116 120 } 117 );121 }); 118 122 }; -
extensions/autoupdate/trunk/template/head.tpl
r9710 r9935 5 5 var up_to_date = '{"Gallery and extensions are up to date"|@translate|@escape:"javascript"}'; 6 6 7 window.onload = function () {ldelim} 8 jQuery.ajax({ldelim} 7 {literal} 8 window.onload = function () { 9 jQuery.ajax({ 9 10 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' }, 12 14 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 16 19 jQuery('#autoupdate').html(error); 17 else18 jQuery('#autoupdate').html(eval(data));19 20 }, 20 error: function() { ldelim}21 error: function() { 21 22 jQuery('#autoupdate').html(error); 22 23 } 23 24 }); 24 25 } 25 {/ footer_script}26 {/literal}{/footer_script} 26 27 <p id="autoupdate"><img src="plugins/autoupdate/template/ajax-loader.gif"> {'Checking upgrades for gallery and plugins...'|@translate}</p>
Note: See TracChangeset
for help on using the changeset viewer.