fixes #1596 plugin filters work fine now

This commit is contained in:
Matthieu Leproux
2022-01-05 14:20:17 +01:00
parent 303f8b87a3
commit 262d9a5221
5 changed files with 21 additions and 8 deletions

View File

@@ -160,11 +160,13 @@ if (count($missing_plugin_ids) > 0)
{
$tpl_plugins[] = array(
'NAME' => $plugin_id,
'ID' => $plugin_id,
'VERSION' => $plugins->db_plugins_by_id[$plugin_id]['version'],
'DESC' => l10n('ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW.'),
'U_ACTION' => sprintf($action_url, $plugin_id),
'STATE' => 'missing',
);
$count_types_plugins['missing']++;
}
$template->append('plugin_states', 'missing');
}

View File

@@ -213,11 +213,16 @@ function uninstallPlugin(id) {
success: function (data) {
nb_plugin.other -=1;
nb_plugin.all -=1;
actualizeFilter()
actualizeFilter();
$("#"+id).remove();
},
error: function (e) {
console.log(e);
console.log("It didn't work");
console.log(e);
console.log("It didn't work");
$("#" + id + " .pluginNotif").stop(false, true);
$("#" + id + " .PluginActionError label span:first").html(plugin_action_error);
$("#" + id + " .PluginActionError").css("display", "flex");
$("#" + id + " .PluginActionError").delay(1500).fadeOut(2500);
}
})
}
@@ -264,7 +269,8 @@ $(document).ready(function () {
if (!$(this).hasClass("plugin-active")) {
$(this).hide();
}
})
});
$("#seeActive").trigger("click");
} else {
$(".pluginMiniBox").show();
}
@@ -405,7 +411,7 @@ $(document).ready(function () {
let plugin_name = $(this).closest(".pluginContent").find(".pluginMiniBoxNameCell").html().trim();
let plugin_id = $(this).closest(".pluginContent").parent().attr("id");
$.confirm({
title: restore_plugin_msg.replace('%s', plugin_name),
title: uninstall_plugin_msg.replace('%s', plugin_name),
buttons: {
confirm: {
text: confirm_msg,

View File

@@ -28,6 +28,7 @@ const cancel_msg = "{"No, I have changed my mind"|@translate}";
let delete_plugin_msg = '{'Are you sure you want to delete the plugin "%s"?'|@translate|@escape:'javascript'}';
let deleted_plugin_msg = '{'Plugin "%s" deleted!'|@translate|@escape:'javascript'}';
let restore_plugin_msg = '{'Are you sure you want to restore the plugin "%s"?'|@translate|@escape:'javascript'}';
let uninstall_plugin_msg = '{'Are you sure you want to uninstall the plugin "%s"?'|@translate|@escape:'javascript'}';
const restore_tip_msg = "{'Restore default configuration. You will lose your plugin settings!'|@translate|@escape:'javascript'}";
const plugin_added_str = '{'Activated'|@translate|@escape:'javascript'}';
const plugin_deactivated_str = '{'Deactivated'|@translate|@escape:'javascript'}';
@@ -262,6 +263,8 @@ function actualizeFilter() {
$("label[for='seeInactive'] .filter-badge").html(nb_plugin.inactive);
$("label[for='seeOther'] .filter-badge").html(nb_plugin.other);
console.log(nb_plugin)
$(".filterLabel").show();
$(".pluginMiniBox").each(function () {
if (nb_plugin.active == 0) {
@@ -405,11 +408,11 @@ jQuery(".pluginMiniBox").each(function(index){
{/if}
{elseif $plugin.STATE == 'missing'}
<div class="tiptip" title="{'Uninstall'|@translate}">
<a class="uninstall-plugin-button" href="{$plugin.U_ACTION}&amp;action=uninstall"></a>
<a class="uninstall-plugin-button">{'Uninstall'|@translate}</a>
</div>
{elseif $plugin.STATE == 'merged'}
<div class="tiptip" title="{'Delete'|@translate}">
<a class="" href="{$plugin.U_ACTION}&amp;action=delete"></a>
<a class="" href="{$plugin.U_ACTION}&amp;action=delete">{'Delete'|@translate}</a>
</div>
{/if}
</div>
@@ -442,7 +445,7 @@ jQuery(".pluginMiniBox").each(function(index){
<a class="pluginUnavailableAction icon-cog tiptip" title="{'N/A'|translate}">{'Settings'|@translate}</a>
{/if}
{elseif $plugin.STATE == 'missing'}
<a class="pluginActionLevel3 uninstall-plugin-button" href="{$plugin.U_ACTION}&amp;action=uninstall">{'Uninstall'|@translate}</a>
<a class="pluginActionLevel3 uninstall-plugin-button">{'Uninstall'|@translate}</a>
{elseif $plugin.STATE == 'merged'}
<a class="pluginActionLevel3" href="{$plugin.U_ACTION}&amp;action=delete">{'Delete'|@translate}</a>
{/if}

View File

@@ -1066,6 +1066,7 @@ $lang['Are you sure you want to delete the ratings of the user "%s"?'] = 'Are yo
$lang['Are you sure you want to install the plugin "%s"?'] = 'Are you sure you want to install the plugin "%s"?';
$lang['Are you sure you want to delete the plugin "%s"?'] = 'Are you sure you want to delete the plugin "%s"?';
$lang['Are you sure you want to restore the plugin "%s"?'] = 'Are you sure you want to restore the plugin "%s"?';
$lang['Are you sure you want to uninstall the plugin "%s"?'] = 'Are you sure you want to uninstall the plugin "%s"?';
$lang['Are you sure you want to delete all sizes?'] = 'Are you sure you want to delete all sizes?';
$lang['Are you sure you want to lock the gallery?'] = 'Are you sure you want to lock the gallery?';
$lang['Are you sure you want to unlock the gallery?'] = 'Are you sure you want to unlock the gallery?';

View File

@@ -1064,6 +1064,7 @@ $lang['Are you sure you want to delete the ratings of the user "%s"?'] = 'Êtes-
$lang['Are you sure you want to install the plugin "%s"?'] = 'Êtes-vous sûr de vouloir installer le plugin "%s"&nbsp?';
$lang['Are you sure you want to delete the plugin "%s"?'] = 'Êtes-vous sûr de vouloir supprimer le plugin "%s"&nbsp?';
$lang['Are you sure you want to restore the plugin "%s"?'] = 'Êtes-vous sûr de vouloir restaurer le plugin "%s"&nbsp?';
$lang['Are you sure you want to uninstall the plugin "%s"?'] = 'Êtes-vous sûr de vouloir désinstaller le plugin "%s"&nbsp?';
$lang['Are you sure you want to delete all sizes?'] = 'Êtes-vous sûr de vouloir supprimer toutes les tailles&nbsp?';
$lang['Are you sure you want to lock the gallery?'] = 'Êtes-vous sûr de vouloir verrouiller la galerie&nbsp?';
$lang['Are you sure you want to unlock the gallery?'] = 'Êtes-vous sûr de vouloir déverrouiller la galerie&nbsp?';