Skip to content

Commit

Permalink
v 0.20.1
Browse files Browse the repository at this point in the history
- Filter on empty user.
  • Loading branch information
Darklg committed Jun 13, 2024
1 parent 4b70276 commit 6d4b2f5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 25 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 WPUtilities
Copyright (c) 2024 WPUtilities

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
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','Delete filtered lines'=>'Supprimer les lignes filtrées','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'=>'Envoi d\'un nouveau média','Language'=>'Langue','Save'=>'Sauvegarder','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.','Actions'=>'Actions','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','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','Purge old logs'=>'Purger les vieux journaux','Delete all logs'=>'Supprimer tous les journaux','All logs have been deleted'=>'Tous les journaux ont été supprimés','Old logs have been purged'=>'Les vieux journaux ont été purgés','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','Delete filtered lines'=>'Supprimer les lignes filtrées','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'=>'Envoi d\'un nouveau média','Language'=>'Langue','Save'=>'Sauvegarder','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.','Actions'=>'Actions','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','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','None'=>'Aucun','ID'=>'ID','Date'=>'Date','Account'=>'Compte','Save Changes'=>'Sauvegarder','Purge old logs'=>'Purger les vieux journaux','Delete all logs'=>'Supprimer tous les journaux','All logs have been deleted'=>'Tous les journaux ont été supprimés','Old logs have been purged'=>'Les vieux journaux ont été purgés','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.
40 changes: 22 additions & 18 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-06-10 23:20+0300\n"
"POT-Creation-Date: 2024-06-13 22:18+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down Expand Up @@ -138,19 +138,19 @@ msgstr "Actions"
msgid "User ID"
msgstr "ID de l’utilisateur"

#: wpuactionlogs.php:172 wpuactionlogs.php:354
#: wpuactionlogs.php:172 wpuactionlogs.php:356
msgid "Action type"
msgstr "Type d’action"

#: wpuactionlogs.php:176 wpuactionlogs.php:356
#: wpuactionlogs.php:176 wpuactionlogs.php:358
msgid "Action detail"
msgstr "Détails de l’action"

#: wpuactionlogs.php:181 wpuactionlogs.php:355
#: wpuactionlogs.php:181 wpuactionlogs.php:357
msgid "Action source"
msgstr "Source de l’action"

#: wpuactionlogs.php:185 wpuactionlogs.php:357
#: wpuactionlogs.php:185 wpuactionlogs.php:359
msgid "Action interface"
msgstr "Interface"

Expand Down Expand Up @@ -240,54 +240,58 @@ msgstr ""
"Les logs seront automatiquement supprimés après ce nombre de jours. Définir "
"à 0 pour désactiver"

#: wpuactionlogs.php:337
#: wpuactionlogs.php:338
msgid "Select an user: "
msgstr "Sélectionnez un utilisateur : "

#: wpuactionlogs.php:338
#: wpuactionlogs.php:339
msgid "All"
msgstr "Tous"

#: wpuactionlogs.php:351
#: wpuactionlogs.php:340
msgid "None"
msgstr "Aucun"

#: wpuactionlogs.php:353
msgid "ID"
msgstr "ID"

#: wpuactionlogs.php:352
#: wpuactionlogs.php:354
msgid "Date"
msgstr "Date"

#: wpuactionlogs.php:353
#: wpuactionlogs.php:355
msgid "Account"
msgstr "Compte"

#: wpuactionlogs.php:441
#: wpuactionlogs.php:443
msgid "Save Changes"
msgstr "Sauvegarder"

#: wpuactionlogs.php:450
#: wpuactionlogs.php:452
msgid "Purge old logs"
msgstr "Purger les vieux journaux"

#: wpuactionlogs.php:451
#: wpuactionlogs.php:453
msgid "Delete all logs"
msgstr "Supprimer tous les journaux"

#: wpuactionlogs.php:463
#: wpuactionlogs.php:465
msgid "All logs have been deleted"
msgstr "Tous les journaux ont été supprimés"

#: wpuactionlogs.php:468
#: wpuactionlogs.php:470
msgid "Old logs have been purged"
msgstr "Les vieux journaux ont été purgés"

#: wpuactionlogs.php:480
#: wpuactionlogs.php:482
msgid "No active users"
msgstr "Aucun utilisateur actif"

#: wpuactionlogs.php:891
#: wpuactionlogs.php:893
msgid "Online here:"
msgstr "En ligne ici :"

#: wpuactionlogs.php:896
#: wpuactionlogs.php:898
msgid "(you)"
msgstr "(vous)"
12 changes: 7 additions & 5 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.20.0
Version: 0.20.1
Author: Darklg
Author URI: https://darklg.me/
Text Domain: wpuactionlogs
Expand All @@ -26,7 +26,7 @@ class WPUActionLogs {
public $baseadmindatas;
public $settings_details;
public $settings;
private $plugin_version = '0.20.0';
private $plugin_version = '0.20.1';
private $plugin_settings = array(
'id' => 'wpuactionlogs',
'name' => 'WPU Action Logs',
Expand Down Expand Up @@ -330,14 +330,16 @@ public function page_content__main() {

/* Filter by user */
$current_user = isset($_GET['filter_key'], $_GET['filter_value']) && $_GET['filter_key'] == 'user_id' && is_numeric($_GET['filter_value']) ? $_GET['filter_value'] : '';
$current_user_empty = isset($_GET['filter_key'], $_GET['filter_value']) && $_GET['filter_key'] == 'user_id' && $_GET['filter_value'] == '';
$table = $this->plugin_settings['id'];
global $wpdb;
$users = $wpdb->get_col("SELECT DISTINCT user_id FROM {$wpdb->prefix}{$table} WHERE user_id != ''");
if ($users) {
echo '<p><label for="wpuactionlogs_select_user">' . __('Select an user: ', 'wpuactionlogs') . '</label><select id="wpuactionlogs_select_user" onchange="window.location=this.value?this.getAttribute(\'data-base-url\')+\'&amp;filter_key=user_id&amp;filter_value=\'+this.value:this.getAttribute(\'data-base-url\')" data-base-url="' . admin_url('admin.php?page=' . $this->admin_page_id) . '" name="user_id" id="user_id">';
echo '<option ' . ($current_user == '' ? 'selected' : '') . ' value="">' . __('All', 'wpuactionlogs') . '</option>';
echo '<p><label for="wpuactionlogs_select_user">' . __('Select an user: ', 'wpuactionlogs') . '</label><select id="wpuactionlogs_select_user" onchange="window.location=this.value?this.getAttribute(\'data-base-url\')+\'&amp;filter_key=user_id&amp;filter_value=\'+(this.value==\'-\'?\'\':this.value):this.getAttribute(\'data-base-url\')" data-base-url="' . admin_url('admin.php?page=' . $this->admin_page_id) . '" name="user_id" id="user_id">';
echo '<option ' . (!$current_user_empty && $current_user == '' ? 'selected' : '') . ' value="">' . __('All', 'wpuactionlogs') . '</option>';
echo '<option ' . ($current_user_empty ? 'selected' : '') . ' value="-">' . __('None', 'wpuactionlogs') . '</option>';
foreach ($users as $usr_id) {
echo '<option ' . ($current_user == $usr_id ? 'selected' : '') . ' value="' . $usr_id . '">' . get_the_author_meta('nicename', $usr_id) . '</option>';
echo '<option ' . ($current_user == $usr_id ? 'selected' : '') . ' value="' . $usr_id . '">' . esc_html(get_the_author_meta('display_name', $usr_id)) . '</option>';
}
echo '</select></p>';
}
Expand Down

0 comments on commit 6d4b2f5

Please sign in to comment.