Skip to content

Commit

Permalink
v 0.19.3
Browse files Browse the repository at this point in the history
- Handle « uncheck all » in settings.
  • Loading branch information
Darklg committed Jun 2, 2024
1 parent 28b21a8 commit 1651237
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 15 deletions.
28 changes: 23 additions & 5 deletions inc/WPUBaseSettings/WPUBaseSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/*
Class Name: WPU Base Settings
Description: A class to handle native settings in WordPress admin
Version: 0.20.0
Version: 0.21.0
Class URI: https://github.com/WordPressUtilities/wpubaseplugin
Author: Darklg
Author URI: https://darklg.me/
Expand Down Expand Up @@ -202,7 +202,8 @@ public function add_settings() {
$section['after_section'] = '';
}
if (isset($section['wpubasesettings_checkall']) && $section['wpubasesettings_checkall']) {
$section['after_section'] .= '<button class="wpubasesettings-check-all">' . __('Check all', __NAMESPACE__) . '</button>';
$check_label = __('Check all', __NAMESPACE__);
$section['after_section'] .= '<button class="wpubasesettings-check-all" data-check-label="' . $check_label . '" data-uncheck-label="' . __('Uncheck all', __NAMESPACE__) . '">' . $check_label . '</button>';
if (!$has_check_all) {
$has_check_all = true;
add_action('admin_footer', array(&$this, 'admin_footer_checkall'));
Expand Down Expand Up @@ -582,9 +583,26 @@ function admin_footer_checkall() {
echo <<<EOT
<script>
jQuery(document).ready(function() {
jQuery(".wpubasesettings-check-all").on("click", function(e) {
e.preventDefault();
jQuery(this).prev(".form-table").find(":checkbox").prop("checked", true);
jQuery(".wpubasesettings-check-all").each(function() {
var _btn = jQuery(this),
_table = _btn.prev(".form-table"),
_checkboxes = _table.find(":checkbox"),
_check_all = true;
_btn.on("click", function(e) {
e.preventDefault();
_checkboxes.prop("checked", _check_all);
_checkboxes.trigger("change");
});
function check_checkboxes_mode() {
var _checked = _checkboxes.filter(":checked").length;
_check_all = _checked < _checkboxes.length;
_btn.text(_check_all ? _btn.data("check-label") : _btn.data("uncheck-label"));
}
_checkboxes.on("change", check_checkboxes_mode);
check_checkboxes_mode();
});
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion lang/wpuactionlogs-fr_FR.l10n.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?php
return ['domain'=>NULL,'plural-forms'=>NULL,'messages'=>['New Post'=>'Nouvel article','Back'=>'Retour','No'=>'Non','Yes'=>'Oui','Submit'=>'Envoyer','Items %s - %s'=>'Articles %s - %s','<strong>Filter :</strong> %s • <strong>Value :</strong> %s'=>'<strong>Filtre:</strong> %s • <strong>Valeur :</strong> %s','Reset'=>'Réinitialiser','Search'=>'Rechercher','Clear'=>'Vider','Show more details'=>'Afficher plus de détails','Edit'=>'Modifier','View'=>'Voir','Delete'=>'Supprimer','Export all'=>'Tout exporter','Export filtered view'=>'Exporter la vue filtrée','Settings'=>'Réglages','Check all'=>'Tout cocher','Settings saved.'=>'Paramètres sauvegardés.','Upload New Media'=>'','Language'=>'','Save'=>'','Currently online'=>'Actuellement en ligne','Useful logs about what’s happening on your website admin.'=>'Des logs utiles sur ce qui se passe dans l’administration de votre site Web.','User ID'=>'ID de l’utilisateur','Action type'=>'Type d’action','Action detail'=>'Détails de l’action','Action source'=>'Source de l’action','Action interface'=>'Interface','Actions'=>'Actions','Interfaces'=>'Interfaces','Extras'=>'Extras','Enable logs for “%s”'=>'Activer les journaux pour les « %s »','Disable logs on %s'=>'Désactiver les journaux pour %s','Posts'=>'Publications','Menus'=>'Menus','Terms'=>'Termes','Options'=>'Options','Emails'=>'Emails','Users'=>'Utilisateurs','Plugins'=>'Extensions','Disable on web'=>'Désactiver sur web','web interface'=>'l’interface web','Disable on cron'=>'Désactiver sur cron','cron interface'=>'l’interface cron','Disable on CLI'=>'Désactiver sur CLI','CLI interface'=>'l’interface CLI','Display active users'=>'Afficher les utilisateurs actifs','Purge after N days'=>'Purger après N jours','Logs will be automatically deleted after this number of days. Set to 0 to disable'=>'Les logs seront automatiquement supprimés après ce nombre de jours. Définir à 0 pour désactiver','Select an user: '=>'Sélectionnez un utilisateur : ','All'=>'Tous','ID'=>'ID','Date'=>'Date','Account'=>'Compte','Save Changes'=>'Sauvegarder','No active users'=>'Aucun utilisateur actif','Online here:'=>'En ligne ici :','(you)'=>'(vous)'],'language'=>'fr_FR','x-generator'=>'Poedit 3.4.4'];
return ['domain'=>NULL,'plural-forms'=>NULL,'messages'=>['New Post'=>'Nouvel article','Back'=>'Retour','No'=>'Non','Yes'=>'Oui','Submit'=>'Envoyer','Items %s - %s'=>'Articles %s - %s','<strong>Filter :</strong> %s • <strong>Value :</strong> %s'=>'<strong>Filtre:</strong> %s • <strong>Valeur :</strong> %s','Reset'=>'Réinitialiser','Search'=>'Rechercher','Clear'=>'Vider','Show more details'=>'Afficher plus de détails','Edit'=>'Modifier','View'=>'Voir','Delete'=>'Supprimer','Export all'=>'Tout exporter','Export filtered view'=>'Exporter la vue filtrée','Settings'=>'Réglages','Check all'=>'Tout cocher','Uncheck all'=>'Tout décocher','Settings saved.'=>'Paramètres sauvegardés.','Upload New Media'=>'','Language'=>'','Save'=>'','Currently online'=>'Actuellement en ligne','Useful logs about what’s happening on your website admin.'=>'Des logs utiles sur ce qui se passe dans l’administration de votre site Web.','User ID'=>'ID de l’utilisateur','Action type'=>'Type d’action','Action detail'=>'Détails de l’action','Action source'=>'Source de l’action','Action interface'=>'Interface','Actions'=>'Actions','Interfaces'=>'Interfaces','Extras'=>'Extras','Enable logs for “%s”'=>'Activer les journaux pour les « %s »','Disable logs on %s'=>'Désactiver les journaux pour %s','Posts'=>'Publications','Menus'=>'Menus','Terms'=>'Termes','Options'=>'Options','Emails'=>'Emails','Users'=>'Utilisateurs','Plugins'=>'Extensions','Disable on web'=>'Désactiver sur web','web interface'=>'l’interface web','Disable on cron'=>'Désactiver sur cron','cron interface'=>'l’interface cron','Disable on CLI'=>'Désactiver sur CLI','CLI interface'=>'l’interface CLI','Display active users'=>'Afficher les utilisateurs actifs','Purge after N days'=>'Purger après N jours','Logs will be automatically deleted after this number of days. Set to 0 to disable'=>'Les logs seront automatiquement supprimés après ce nombre de jours. Définir à 0 pour désactiver','Select an user: '=>'Sélectionnez un utilisateur : ','All'=>'Tous','ID'=>'ID','Date'=>'Date','Account'=>'Compte','Save Changes'=>'Sauvegarder','No active users'=>'Aucun utilisateur actif','Online here:'=>'En ligne ici :','(you)'=>'(vous)'],'language'=>'fr_FR','x-generator'=>'Poedit 3.4.4'];
Binary file modified lang/wpuactionlogs-fr_FR.mo
Binary file not shown.
18 changes: 11 additions & 7 deletions lang/wpuactionlogs-fr_FR.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: WPU Action Logs\n"
"POT-Creation-Date: 2024-05-28 18:36+0200\n"
"POT-Creation-Date: 2024-06-02 22:44+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down Expand Up @@ -87,8 +87,8 @@ msgid "Export filtered view"
msgstr "Exporter la vue filtrée"

#: inc/WPUBaseSettings/WPUBaseSettings.php:132
#: inc/WPUBaseSettings/WPUBaseSettings.php:593
#: inc/WPUBaseSettings/WPUBaseSettings.php:600 wpuactionlogs.php:113
#: inc/WPUBaseSettings/WPUBaseSettings.php:615
#: inc/WPUBaseSettings/WPUBaseSettings.php:622 wpuactionlogs.php:113
#: wpuactionlogs.php:115
msgid "Settings"
msgstr "Réglages"
Expand All @@ -97,19 +97,23 @@ msgstr "Réglages"
msgid "Check all"
msgstr "Tout cocher"

#: inc/WPUBaseSettings/WPUBaseSettings.php:326
#: inc/WPUBaseSettings/WPUBaseSettings.php:206
msgid "Uncheck all"
msgstr "Tout décocher"

#: inc/WPUBaseSettings/WPUBaseSettings.php:318
msgid "Settings saved."
msgstr "Paramètres sauvegardés."

#: inc/WPUBaseSettings/WPUBaseSettings.php:386
#: inc/WPUBaseSettings/WPUBaseSettings.php:378
msgid "Upload New Media"
msgstr ""

#: inc/WPUBaseSettings/WPUBaseSettings.php:539
#: inc/WPUBaseSettings/WPUBaseSettings.php:531
msgid "Language"
msgstr ""

#: inc/WPUBaseSettings/WPUBaseSettings.php:615
#: inc/WPUBaseSettings/WPUBaseSettings.php:637
msgid "Save"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions wpuactionlogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Plugin URI: https://github.com/WordPressUtilities/wpuactionlogs
Update URI: https://github.com/WordPressUtilities/wpuactionlogs
Description: Useful logs about what’s happening on your website admin.
Version: 0.19.2
Version: 0.19.3
Author: Darklg
Author URI: https://darklg.me/
Text Domain: wpuactionlogs
Expand All @@ -25,7 +25,7 @@ class WPUActionLogs {
public $baseadmindatas;
public $settings_details;
public $settings;
private $plugin_version = '0.19.2';
private $plugin_version = '0.19.3';
private $plugin_settings = array(
'id' => 'wpuactionlogs',
'name' => 'WPU Action Logs',
Expand Down

0 comments on commit 1651237

Please sign in to comment.