Added "Update all Plugins" button to plugins page

This commit is contained in:
bergware
2018-03-21 17:37:27 +01:00
parent 725c30357f
commit 67c15c92e7
3 changed files with 48 additions and 5 deletions
+20 -4
View File
@@ -41,7 +41,8 @@ function resize(bind) {
}
<?endif;?>
function loadlist(id) {
$.get('/plugins/dynamix.plugin.manager/include/ShowPlugins.php',{audit:id,check:<?=$check?>},function(data) {
$.get('/plugins/dynamix.plugin.manager/include/ShowPlugins.php',{audit:id,check:<?=$check?>},function(d) {
var data = d.split(/\0/);
if (id) {
var tmp = id.split(':');
var list = $('#plugin_list');
@@ -49,10 +50,21 @@ function loadlist(id) {
switch (tmp[1]) {
case 'remove' : list.find(tr).remove(); break;
case 'update' : list.find(tr).remove();
case 'install': if (!list.find(tr).length) list.append(data).trigger('update'); break;
case 'install': if (!list.find(tr).length) list.append(data[0]).trigger('update'); break;
}
} else {
$('#plugin_list').html(data);
$('#plugin_list').html(data[0]);
}
if (data[1]>1) {
$('#updateall').show();
<?if ($check):?>
$('#checkall').hide();
<?endif;?>
} else {
$('#updateall').hide();
<?if ($check):?>
$('#checkall').show();
<?endif;?>
}
<?if ($display['resize']):?>
resize();
@@ -60,13 +72,17 @@ function loadlist(id) {
<?endif;?>
$('#plugin_table').tablesorter({sortList:[[4,0],[1,0]],sortAppend:[[1,0]],headers:{0:{sorter:false},5:{sorter:false}},textAttribute:'data'});
$('.desc_readmore').readmore({maxHeight:66,moreLink:"<a href='#'><i class='fa fa-chevron-down'></i></a>",lessLink:"<a href='#'><i class='fa fa-chevron-up'></i></a>"});
<?if ($check):?>
$('#checkall').find('input').prop('disabled',false);
<?endif;?>
});
}
$(function() {
loadlist();
$('#plugin_tree').fileTree({root:'/boot/',filter:'plg'}, function(file) {$('#plugin_file').val(file);});
$('.tabs').append("<span id='updateall' class='status vhshift' style='display:none'><input type='button' value='Update all Plugins' onclick='openBox(\"/plugins/dynamix.plugin.manager/scripts/plugin&arg1=updateall\",\"Plugin Update All Plugins\",490,430,true)'></span>");
<?if ($check):?>
$('.tabs').append("<span class='status vhshift'><input type='button' value='Check for Updates' onclick='openBox(\"/plugins/dynamix.plugin.manager/scripts/plugin&arg1=checkall\",\"Plugin Update Check\",490,430,true)'></span>");
$('.tabs').append("<span id='checkall' class='status vhshift'><input type='button' value='Check for Updates' onclick='openBox(\"/plugins/dynamix.plugin.manager/scripts/plugin&arg1=checkall\",\"Plugin Update Check\",490,430,true)' disabled></span>");
<?endif;?>
});
</script>