Plugin Directory

Changeset 3349006


Ignore:
Timestamp:
08/23/2025 02:51:47 PM (7 months ago)
Author:
tlloancy
Message:

better css + better overall guessing especially select

Location:
bulk-content-toolkit
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • bulk-content-toolkit/tags/1.1.0/bulk-content-toolkit.php

    r3290986 r3349006  
    33Plugin Name: Bulk Content Toolkit
    44Description: A comprehensive toolkit for efficiently managing bulk actions on various types of content in WordPress, including posts, pages, and custom post types.
    5 Version: 1.0.5
     5Version: 1.1
    66Requires at least: 5.0
    77Tested up to: 6.8
  • bulk-content-toolkit/tags/1.1.0/css/admin.css

    r3188505 r3349006  
    1 /* Ajoutez ici le style pour rendre votre interface utilisateur plus agréable */
    2 /*.wrap form {
    3     background: #fff;
    4     padding: 20px;
    5     margin-top: 20px;
    6     box-shadow: 0 1px 3px rgba(0,0,0,0.13);
    7 }
    8 
    9 .wrap form input[type="text"], .wrap form select {
    10     width: 100%;
    11     max-width: 500px;
    12     padding: 10px;
    13     margin-top: 10px;
    14 }*/
     1/* Admin styling: modern with subtle neon glow inspired by user.css */
    152.wrap {
    163    font-family: 'Arial', sans-serif;
     
    218    border-radius: 4px;
    229}
    23 
    2410h1 {
    2511    color: #23282d;
    2612    margin-bottom: 20px;
    2713}
    28 
    2914form {
    3015    width: 100%;
    3116    max-width: 800px;
    3217}
    33 
    3418#post_type, #field_name, #new_field_name {
    3519    width: 100%;
    3620    padding: 10px;
    3721    margin: 10px 0;
    38     border: 1px solid #ddd;
    39     border-radius: 4px;
     22    border: none; /* Remove solid border */
     23    border-radius: 4px; /* Matches user.css */
    4024    box-sizing: border-box;
    4125    font-size: 16px;
     26    background: linear-gradient(180deg, #fff, #f5f5f5); /* Subtle gradient */
     27    box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow contour */
     28    transition: box-shadow 0.3s ease, transform 0.2s ease;
    4229}
    43 
     30#post_type:hover, #field_name:hover, #new_field_name:hover {
     31    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Neon glow on hover */
     32    transform: translateY(-1px); /* Slight lift */
     33}
     34#post_type:focus, #field_name:focus, #new_field_name:focus {
     35    box-shadow: 0 0 8px rgba(0, 255, 136, 0.7); /* Neon focus glow */
     36    outline: none;
     37}
    4438#field_name_container {
    4539    margin-top: 20px;
    4640}
    47 
    4841label {
    4942    display: block;
     
    5144    font-weight: bold;
    5245}
    53 
    5446input[type="submit"] {
    55     background-color: #0073aa;
    56     border: none;
     47    background: linear-gradient(90deg, #0073aa, #00b7ff); /* Gradient inspired by user.css neon */
     48    border: none; /* Remove solid border */
    5749    color: white;
    5850    padding: 15px 32px;
     
    6456    cursor: pointer;
    6557    border-radius: 4px;
    66     transition: background-color 0.3s ease;
     58    box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */
     59    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    6760}
    68 
    6961input[type="submit"]:hover {
    70     background-color: #005177;
     62    background: linear-gradient(90deg, #005177, #00ff88); /* Neon hover effect */
     63    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Stronger glow */
     64    transform: translateY(-1px);
    7165}
    72 
    7366input[type="text"] {
    7467    width: 100%;
    7568    max-width: 400px;
    7669}
    77 
    7870select {
    79     background: white;
     71    background: linear-gradient(180deg, #fff, #f5f5f5); /* Subtle gradient */
    8072    cursor: pointer;
    8173}
    82 
    83 /* Pour rendre le formulaire responsive */
    8474@media (max-width: 782px) {
    8575    .wrap {
    8676        margin-right: 10px;
    8777    }
    88    
    8978    input[type="text"], select {
    9079        width: 100%;
    9180    }
    9281}
    93 
    9482#field-selection-container {
    9583    display: flex;
    9684    justify-content: space-between;
    97     align-items: flex-start; /* Pour s'assurer que les éléments sont alignés en haut si leur hauteur diffère */
     85    align-items: flex-start;
    9886    margin-top: 20px;
    9987}
    100 
    10188.field-list {
    102     width: calc(50% - 40px); /* Réduit la largeur pour tenir compte de l'espace entre les deux listes et des flèches */
    103     border: 1px solid #ddd;
     89    width: calc(50% - 40px);
     90    border: none; /* Remove solid border */
    10491    padding: 10px;
    10592    height: 300px;
    10693    overflow-y: auto;
    107     box-sizing: border-box; /* S'assure que le padding ne s'ajoute pas à la largeur */
     94    box-sizing: border-box;
     95    box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */
    10896}
    109 
    11097.field-list ul {
    11198    list-style-type: none;
     
    113100    margin: 0;
    114101}
    115 
    116102.field-list li {
    117     border: 1px solid #ddd;
    118     margin-top: -1px; /* Pour supprimer l'espace double entre les éléments */
     103    border: none; /* Remove solid border */
     104    margin-top: -1px;
    119105    background-color: #f6f6f6;
    120106    padding: 12px;
    121107    text-decoration: none;
    122108    font-size: 18px;
    123     color: black;
     109    color: #1a1a1a;
    124110    display: block;
    125111    cursor: pointer;
     112    transition: background 0.3s ease, box-shadow 0.3s ease;
     113    box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */
    126114}
    127 
    128115.field-list li:hover {
    129     background-color: #ddd;
     116    background-color: #e0e0e0;
     117    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Neon glow on hover */
    130118}
    131 
    132119.field-list li.selected {
    133     background-color: #b3d4fc;
     120    background: linear-gradient(90deg, #00ff88, #00b7ff); /* Neon gradient */
     121    color: #fff;
     122    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Stronger neon glow */
    134123}
    135 
    136124.arrows {
    137125    display: flex;
    138126    flex-direction: column;
    139127    justify-content: center;
    140     margin: 0 20px; /* Ajoute un peu de marge autour des flèches */
     128    margin: 0 20px;
    141129}
    142 
    143130.arrow-btn {
    144131    margin: 10px 0;
     
    146133    font-size: 24px;
    147134    cursor: pointer;
    148     background-color: #0073aa;
     135    background: linear-gradient(90deg, #0073aa, #00b7ff); /* Neon gradient */
    149136    color: #fff;
    150     border: none;
    151     border-radius: 5px;
    152     transition: background-color 0.3s;
     137    border: none; /* Remove solid border */
     138    border-radius: 4px;
     139    box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */
     140    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    153141}
    154 
    155142.arrow-btn:hover {
    156     background-color: #005177;
     143    background: linear-gradient(90deg, #005177, #00ff88); /* Neon hover effect */
     144    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Stronger glow */
     145    transform: translateY(-1px);
    157146}
    158 
    159147.arrow-btn:focus {
     148    box-shadow: 0 0 8px rgba(0, 255, 136, 0.7); /* Neon focus glow */
    160149    outline: none;
    161     box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
    162150}
  • bulk-content-toolkit/tags/1.1.0/css/user.css

    r3188505 r3349006  
     1/* Switch styling: rounded rectangle, neon, glowing knob with soft blue border */
    12.bulk-edit-switch, .bulk-edit-checkbox {
    23    position: relative;
    34    display: inline-block;
    4     width: 60px;
    5     height: 34px;
     5    width: 50px; /* Bold and compact */
     6    height: 26px; /* Slim for elegance */
     7    margin: 10px 0 10px 10px; /* Spacing to separate from label */
    68}
    7 
    8 .bulk-edit-switch input, .bulk-edit-checkbox input {
     9.bulk-edit-switch input, .bulk-edit-checkbox input {
    910    opacity: 0;
    1011    width: 0;
    1112    height: 0;
    1213}
    13 
    1414.slider {
    1515    position: absolute;
     
    1919    right: 0;
    2020    bottom: 0;
    21     background-color: #ccc;
    22     -webkit-transition: .4s;
    23     transition: .4s;
     21    background: linear-gradient(90deg, #3a3a3a, #5a5a5a); /* Sleek dark gradient for off state */
     22    transition: background 0.3s ease, box-shadow 0.3s ease;
     23    border: 1px solid #00b7ff; /* Soft blue border */
     24    border-radius: 6px; /* Rounded rectangle for modern look */
     25    box-shadow: 0 0 4px rgba(0, 183, 255, 0.4); /* Feathered blue glow */
    2426}
    25 
    2627.slider:before {
    2728    position: absolute;
    2829    content: "";
    29     height: 26px;
    30     width: 26px;
    31     left: 4px;
    32     bottom: 4px;
    33     background-color: white;
    34     -webkit-transition: .4s;
    35     transition: .4s;
     30    width: 20px; /* Compact knob */
     31    height: 20px;
     32    left: 3px;
     33    bottom: 2px;
     34    background: linear-gradient(90deg, #a0a0a0, #d0d0d0); /* Subtle metallic gradient for off state */
     35    transition: transform 0.2s ease, background 0.3s ease, box-shadow 0.3s ease;
     36    border: 1px solid #00b7ff; /* Soft blue border for knob */
     37    border-radius: 4px; /* Slightly rounded knob */
     38    box-shadow: 0 2px 6px rgba(0, 183, 255, 0.3); /* Feathered blue glow */
     39}
     40input:checked + .slider {
     41    background: linear-gradient(90deg, #00ff88, #00b7ff); /* Vibrant neon green to blue */
     42    box-shadow: 0 0 12px rgba(0, 255, 136, 0.6); /* Stronger glow */
     43}
     44input:checked + .slider:before {
     45    transform: translateX(24px); /* Adjusted for width */
     46    background: linear-gradient(90deg, #00ff88, #00b7ff); /* Neon gradient to match slider */
     47    box-shadow: 0 0 10px rgba(0, 255, 136, 0.8), 0 0 15px rgba(0, 255, 136, 0.6); /* Intense glowing effect */
     48    animation: glow-pulse 1.2s infinite ease-in-out; /* Fast, vibrant pulse */
     49}
     50input:focus + .slider {
     51    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.4); /* Vibrant focus ring */
     52}
     53/* Indeterminate state */
     54.bulk-edit-switch input[type="checkbox"]:indeterminate + .slider,
     55.bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider {
     56    background: linear-gradient(90deg, #ff9500, #ffcc00); /* Orange-yellow gradient */
     57    box-shadow: 0 0 10px rgba(255, 149, 0, 0.6); /* Subtle glow */
     58}
     59.bulk-edit-switch input[type="checkbox"]:indeterminate + .slider:before,
     60.bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider:before {
     61    transform: translateX(12px); /* Centered for indeterminate */
     62    background: linear-gradient(90deg, #ff9500, #ffcc00); /* Orange-yellow to match */
     63    box-shadow: 0 0 10px rgba(255, 149, 0, 0.8), 0 0 15px rgba(255, 149, 0, 0.6); /* Intense glow */
     64    animation: glow-pulse-indeterminate 1.2s infinite ease-in-out; /* Fast pulse */
     65}
     66/* Hover effect for interactivity */
     67.slider:hover {
     68    box-shadow: 0 0 14px rgba(0, 255, 136, 0.5); /* Stronger hover glow */
     69}
     70/* Glow pulse animations */
     71@keyframes glow-pulse {
     72    0% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.8), 0 0 15px rgba(0, 255, 136, 0.6); }
     73    50% { box-shadow: 0 0 16px rgba(0, 255, 136, 1), 0 0 22px rgba(0, 255, 136, 0.8); }
     74    100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.8), 0 0 15px rgba(0, 255, 136, 0.6); }
     75}
     76@keyframes glow-pulse-indeterminate {
     77    0% { box-shadow: 0 0 10px rgba(255, 149, 0, 0.8), 0 0 15px rgba(255, 149, 0, 0.6); }
     78    50% { box-shadow: 0 0 16px rgba(255, 149, 0, 1), 0 0 22px rgba(255, 149, 0, 0.8); }
     79    100% { box-shadow: 0 0 10px rgba(255, 149, 0, 0.8), 0 0 15px rgba(255, 149, 0, 0.6); }
    3680}
    3781
    38 input:checked + .slider {
    39     background: linear-gradient(to right, #ff4b2b, #4b88ff);
     82/* Select styling: matching the neon, rounded rectangle aesthetic with soft blue border */
     83.bulk-edit-select select {
     84    width: 100%;
     85    max-width: 200px;
     86    padding: 8px 12px;
     87    border: 1px solid #00b7ff; /* Soft blue border */
     88    border-radius: 4px; /* Slightly rounded for balance */
     89    font-size: 14px;
     90    font-weight: 500; /* Bold text for impact */
     91    background: linear-gradient(180deg, #fff, #f5f5f5); /* Subtle gradient for depth */
     92    color: #1a1a1a; /* Dark text for contrast */
     93    cursor: pointer;
     94    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
     95    box-shadow: 0 0 4px rgba(0, 183, 255, 0.4); /* Feathered blue glow */
    4096}
    41 
    42 input:checked + .slider:before {
    43     -webkit-transform: translateX(26px);
    44     -ms-transform: translateX(26px);
    45     transform: translateX(26px);
     97.bulk-edit-select select:hover {
     98    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3); /* Hover glow to match switches */
     99    transform: translateY(-1px); /* Slight lift for interactivity */
    46100}
    47 
    48 .slider.round {
    49     border-radius: 34px;
     101.bulk-edit-select select:focus {
     102    border-color: #00ff88; /* Neon green to match on state */
     103    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.4); /* Matching focus ring */
     104    outline: none;
    50105}
    51 
    52 .slider.round:before {
    53     border-radius: 50%;
    54 }
    55 
    56 .switch-labels {
    57     display: flex;
    58     justify-content: space-between;
    59     width: 60px;
    60     font-size: 10px;
    61     position: absolute;
    62     top: 35px;
    63 }
    64 
    65 .off {
    66     color: red;
    67     margin-left: 2px;
    68 }
    69 
    70 .on {
    71     color: blue;
    72     margin-right: 2px;
    73 }
    74 
    75 /* Ajoutez ceci pour représenter l'état neutre */
    76 .bulk-edit-switch input[type="checkbox"]:indeterminate + .slider:before,
    77 .bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider:before {
    78     -webkit-transform: translateX(13px);
    79     -ms-transform: translateX(13px);
    80     transform: translateX(13px);
    81     background: #808080; /* Couleur grise ou autre pour indiquer l'état neutre */
    82 }
    83 
    84 .bulk-edit-switch input[type="checkbox"]:indeterminate + .slider,
    85 .bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider {
    86     background: linear-gradient(to right, #ff4b2b, #808080, #4b88ff); /* Gradient ou autre style pour l'état mixte */
    87 }
  • bulk-content-toolkit/tags/1.1.0/includes/admin/quick-edit.php

    r3200067 r3349006  
    8585        'data-initial-state' => true,
    8686    ),
     87    'select' => array(
     88            'name' => true,
     89            'id' => true,
     90            'aria-label' => true,
     91        ),
     92    'option' => array(
     93        'value' => true,
     94        'selected' => true,
     95    ),
    8796    // Add other tags and attributes as needed
    8897);
     
    131140
    132141function bulkedittoolkit_generate_switch_html($field_name, $context) {
    133     return '<input type="checkbox" name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '" value="yes" data-initial-state="mixed" />' .
    134            '<!-- Supprimez ou modifiez le label interne -->' .
    135            '<div class="slider round"></div>' .
    136            '<div class="switch-labels">' .
    137                '<span class="off">Off</span>' .
    138                '<span class="on">On</span>' .
    139            '</div>';
     142    return '<input type="checkbox" name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '" value="yes" data-initial-state="mixed" />' .
     143           '<div class="slider"></div>';
    140144}
    141145
    142146function bulkedittoolkit_generate_select_html($field_name, $context) {
    143     // Logique pour générer un select
    144     return '<select name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '">...</select>';
     147    global $wpdb;
     148
     149    // Récupérer les valeurs distinctes pour le champ
     150    $results = $wpdb->get_results(
     151        $wpdb->prepare(
     152            "SELECT DISTINCT meta_value FROM {$wpdb->postmeta} WHERE meta_key = %s AND meta_value != ''",
     153            $field_name
     154        )
     155    );
     156
     157    // Débogage : enregistrer les valeurs récupérées
     158    bulkedittoolkit_debug_log("Valeurs récupérées pour $field_name : " . print_r($results, true), $GLOBALS["bulkedittoolkit_is_debug_active"]);
     159
     160    // Créer le select
     161    $html = '<select name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '" aria-label="' . esc_attr__('Select value for ', 'bulk-content-toolkit') . esc_html($field_name) . '">';
     162
     163    // Ajouter une option par défaut
     164    $html .= '<option value="">' . esc_html__('Select a value', 'bulk-content-toolkit') . '</option>';
     165
     166    // Ajouter les options
     167    foreach ($results as $result) {
     168        $value = trim($result->meta_value);
     169        if ($value !== '') {
     170            $html .= '<option value="' . esc_attr($value) . '">' . esc_html($value) . '</option>';
     171        }
     172    }
     173
     174    $html .= '</select>';
     175
     176    // Débogage : enregistrer le HTML généré
     177    bulkedittoolkit_debug_log("HTML généré pour $field_name : $html", $GLOBALS["bulkedittoolkit_is_debug_active"]);
     178
     179    return $html;
    145180}
    146181
  • bulk-content-toolkit/tags/1.1.0/includes/api/ajax-handlers.php

    r3200067 r3349006  
    192192    }
    193193
    194     $distinct_count = count(array_unique(array_column($results, 'meta_value')));
     194        // Calculer le nombre total de valeurs et de valeurs distinctes
     195    $total_count = count($results);
     196    $distinct_values = array_unique(array_column($results, 'meta_value'));
     197    $distinct_count = count($distinct_values);
     198
    195199    $potential_types = [];
    196200
     
    252256        return filter_var($value, FILTER_VALIDATE_URL);
    253257    };
     258   
     259        // Vérification pour un champ de type select
     260    $isSelect = function($distinct_count, $total_count, $distinct_values) {
     261        // Critères pour un select :
     262        // 1. Nombre de valeurs distinctes raisonnable (par exemple, entre 2 et 20)
     263        // 2. Les valeurs doivent être répétées (distinct_count < total_count)
     264        // 3. Les valeurs ne doivent pas être trop longues (moins de 50 caractères)
     265        // 4. Les valeurs ne doivent pas correspondre à un autre type spécifique
     266        if ($distinct_count >= 2 && $distinct_count <= 20 && $distinct_count < $total_count) {
     267            foreach ($distinct_values as $value) {
     268                if (strlen($value) > 50) {
     269                    return false; // Les valeurs longues suggèrent un text, pas un select
     270                }
     271            }
     272            return true;
     273        }
     274        return false;
     275    };
    254276
    255277    // Analyse des valeurs
     
    267289        } elseif ($isDateTime($value)) {
    268290            $potential_types['datetime'] = true;
    269         }
    270 
    271         if ($isNumber($value)) {
     291        } elseif ($isEmail($value)) {
     292            $potential_types['email'] = true;
     293        } elseif ($isUrl($value)) {
     294            $potential_types['url'] = true;
     295        } elseif ($isNumber($value)) {
    272296            if (!isset($potential_types['number']) && !isset($potential_types['range'])) {
    273297                $potential_types[strpos($value, '.') === false ? 'number' : 'range'] = true; // Distinguer entre int et float pour number vs range
     
    275299        }
    276300
    277         if ($isEmail($value)) {
    278             $potential_types['email'] = true;
    279         } elseif ($isUrl($value)) {
    280             $potential_types['url'] = true;
    281         }
    282 
    283301        // Si la longueur de la valeur est importante, on pourrait suggérer un textarea
    284302        if (strlen($value) > 255) {
     
    286304        }
    287305    }
     306   
     307        // Vérifier si c'est un select (après les autres types pour éviter les conflits)
     308    if ($isSelect($distinct_count, $total_count, $distinct_values)) {
     309        $potential_types['select'] = true;
     310    }
    288311
    289312    // Décision basée sur les types potentiels
    290     $type_priority = ['checkbox', 'select', 'date', 'datetime', 'email', 'url', 'number', 'range', 'textarea', 'text'];
     313    $type_priority = ['checkbox', 'date', 'datetime', 'email', 'url', 'number', 'range', 'select', 'textarea', 'text'];
    291314    foreach ($type_priority as $type) {
    292315        if (isset($potential_types[$type])) {
  • bulk-content-toolkit/tags/1.1.0/readme.txt

    r3290986 r3349006  
    44Tags: bulk edit, content management, wordpress plugin, bulk actions
    55Requires at least: 5.0
    6 Tested up to: 6.8.1
     6Tested up to: 6.8
    77Requires PHP: 7.4
    8 Stable Tag: 1.0.5
     8Stable Tag: 1.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     11
     12A WordPress plugin for bulk editing posts, pages, and custom post types with quick actions and custom fields.
    1113
    1214== Description ==
     
    4547== Changelog ==
    4648
     49= 1.1 =
     50- Improved: Enhanced styling for switches and select fields with a subtle neon glow effect, removing solid borders for a cleaner, modern look.
     51- Improved: Added spacing to switches in quick edit to prevent overlap with labels.
     52- Fixed: Corrected rendering of select fields in quick edit to properly display options instead of concatenated values.
     53- Updated: Admin interface styling to align with the neon aesthetic of the quick edit interface.
     54- Tested: Verified compatibility with WordPress 6.8.1.
     55
    4756= 1.0.5 =
    4857- Vérification et confirmation de la compatibilité avec WordPress 6.8.1.
  • bulk-content-toolkit/trunk/bulk-content-toolkit.php

    r3290986 r3349006  
    33Plugin Name: Bulk Content Toolkit
    44Description: A comprehensive toolkit for efficiently managing bulk actions on various types of content in WordPress, including posts, pages, and custom post types.
    5 Version: 1.0.5
     5Version: 1.1
    66Requires at least: 5.0
    77Tested up to: 6.8
  • bulk-content-toolkit/trunk/css/admin.css

    r3188505 r3349006  
    1 /* Ajoutez ici le style pour rendre votre interface utilisateur plus agréable */
    2 /*.wrap form {
    3     background: #fff;
    4     padding: 20px;
    5     margin-top: 20px;
    6     box-shadow: 0 1px 3px rgba(0,0,0,0.13);
    7 }
    8 
    9 .wrap form input[type="text"], .wrap form select {
    10     width: 100%;
    11     max-width: 500px;
    12     padding: 10px;
    13     margin-top: 10px;
    14 }*/
     1/* Admin styling: modern with subtle neon glow inspired by user.css */
    152.wrap {
    163    font-family: 'Arial', sans-serif;
     
    218    border-radius: 4px;
    229}
    23 
    2410h1 {
    2511    color: #23282d;
    2612    margin-bottom: 20px;
    2713}
    28 
    2914form {
    3015    width: 100%;
    3116    max-width: 800px;
    3217}
    33 
    3418#post_type, #field_name, #new_field_name {
    3519    width: 100%;
    3620    padding: 10px;
    3721    margin: 10px 0;
    38     border: 1px solid #ddd;
    39     border-radius: 4px;
     22    border: none; /* Remove solid border */
     23    border-radius: 4px; /* Matches user.css */
    4024    box-sizing: border-box;
    4125    font-size: 16px;
     26    background: linear-gradient(180deg, #fff, #f5f5f5); /* Subtle gradient */
     27    box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow contour */
     28    transition: box-shadow 0.3s ease, transform 0.2s ease;
    4229}
    43 
     30#post_type:hover, #field_name:hover, #new_field_name:hover {
     31    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Neon glow on hover */
     32    transform: translateY(-1px); /* Slight lift */
     33}
     34#post_type:focus, #field_name:focus, #new_field_name:focus {
     35    box-shadow: 0 0 8px rgba(0, 255, 136, 0.7); /* Neon focus glow */
     36    outline: none;
     37}
    4438#field_name_container {
    4539    margin-top: 20px;
    4640}
    47 
    4841label {
    4942    display: block;
     
    5144    font-weight: bold;
    5245}
    53 
    5446input[type="submit"] {
    55     background-color: #0073aa;
    56     border: none;
     47    background: linear-gradient(90deg, #0073aa, #00b7ff); /* Gradient inspired by user.css neon */
     48    border: none; /* Remove solid border */
    5749    color: white;
    5850    padding: 15px 32px;
     
    6456    cursor: pointer;
    6557    border-radius: 4px;
    66     transition: background-color 0.3s ease;
     58    box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */
     59    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    6760}
    68 
    6961input[type="submit"]:hover {
    70     background-color: #005177;
     62    background: linear-gradient(90deg, #005177, #00ff88); /* Neon hover effect */
     63    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Stronger glow */
     64    transform: translateY(-1px);
    7165}
    72 
    7366input[type="text"] {
    7467    width: 100%;
    7568    max-width: 400px;
    7669}
    77 
    7870select {
    79     background: white;
     71    background: linear-gradient(180deg, #fff, #f5f5f5); /* Subtle gradient */
    8072    cursor: pointer;
    8173}
    82 
    83 /* Pour rendre le formulaire responsive */
    8474@media (max-width: 782px) {
    8575    .wrap {
    8676        margin-right: 10px;
    8777    }
    88    
    8978    input[type="text"], select {
    9079        width: 100%;
    9180    }
    9281}
    93 
    9482#field-selection-container {
    9583    display: flex;
    9684    justify-content: space-between;
    97     align-items: flex-start; /* Pour s'assurer que les éléments sont alignés en haut si leur hauteur diffère */
     85    align-items: flex-start;
    9886    margin-top: 20px;
    9987}
    100 
    10188.field-list {
    102     width: calc(50% - 40px); /* Réduit la largeur pour tenir compte de l'espace entre les deux listes et des flèches */
    103     border: 1px solid #ddd;
     89    width: calc(50% - 40px);
     90    border: none; /* Remove solid border */
    10491    padding: 10px;
    10592    height: 300px;
    10693    overflow-y: auto;
    107     box-sizing: border-box; /* S'assure que le padding ne s'ajoute pas à la largeur */
     94    box-sizing: border-box;
     95    box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */
    10896}
    109 
    11097.field-list ul {
    11198    list-style-type: none;
     
    113100    margin: 0;
    114101}
    115 
    116102.field-list li {
    117     border: 1px solid #ddd;
    118     margin-top: -1px; /* Pour supprimer l'espace double entre les éléments */
     103    border: none; /* Remove solid border */
     104    margin-top: -1px;
    119105    background-color: #f6f6f6;
    120106    padding: 12px;
    121107    text-decoration: none;
    122108    font-size: 18px;
    123     color: black;
     109    color: #1a1a1a;
    124110    display: block;
    125111    cursor: pointer;
     112    transition: background 0.3s ease, box-shadow 0.3s ease;
     113    box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */
    126114}
    127 
    128115.field-list li:hover {
    129     background-color: #ddd;
     116    background-color: #e0e0e0;
     117    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Neon glow on hover */
    130118}
    131 
    132119.field-list li.selected {
    133     background-color: #b3d4fc;
     120    background: linear-gradient(90deg, #00ff88, #00b7ff); /* Neon gradient */
     121    color: #fff;
     122    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Stronger neon glow */
    134123}
    135 
    136124.arrows {
    137125    display: flex;
    138126    flex-direction: column;
    139127    justify-content: center;
    140     margin: 0 20px; /* Ajoute un peu de marge autour des flèches */
     128    margin: 0 20px;
    141129}
    142 
    143130.arrow-btn {
    144131    margin: 10px 0;
     
    146133    font-size: 24px;
    147134    cursor: pointer;
    148     background-color: #0073aa;
     135    background: linear-gradient(90deg, #0073aa, #00b7ff); /* Neon gradient */
    149136    color: #fff;
    150     border: none;
    151     border-radius: 5px;
    152     transition: background-color 0.3s;
     137    border: none; /* Remove solid border */
     138    border-radius: 4px;
     139    box-shadow: 0 0 6px rgba(0, 183, 255, 0.5); /* Subtle neon glow */
     140    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    153141}
    154 
    155142.arrow-btn:hover {
    156     background-color: #005177;
     143    background: linear-gradient(90deg, #005177, #00ff88); /* Neon hover effect */
     144    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5); /* Stronger glow */
     145    transform: translateY(-1px);
    157146}
    158 
    159147.arrow-btn:focus {
     148    box-shadow: 0 0 8px rgba(0, 255, 136, 0.7); /* Neon focus glow */
    160149    outline: none;
    161     box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
    162150}
  • bulk-content-toolkit/trunk/css/user.css

    r3188505 r3349006  
     1/* Switch styling: rounded rectangle, neon, glowing knob with soft blue border */
    12.bulk-edit-switch, .bulk-edit-checkbox {
    23    position: relative;
    34    display: inline-block;
    4     width: 60px;
    5     height: 34px;
     5    width: 50px; /* Bold and compact */
     6    height: 26px; /* Slim for elegance */
     7    margin: 10px 0 10px 10px; /* Spacing to separate from label */
    68}
    7 
    8 .bulk-edit-switch input, .bulk-edit-checkbox input {
     9.bulk-edit-switch input, .bulk-edit-checkbox input {
    910    opacity: 0;
    1011    width: 0;
    1112    height: 0;
    1213}
    13 
    1414.slider {
    1515    position: absolute;
     
    1919    right: 0;
    2020    bottom: 0;
    21     background-color: #ccc;
    22     -webkit-transition: .4s;
    23     transition: .4s;
     21    background: linear-gradient(90deg, #3a3a3a, #5a5a5a); /* Sleek dark gradient for off state */
     22    transition: background 0.3s ease, box-shadow 0.3s ease;
     23    border: 1px solid #00b7ff; /* Soft blue border */
     24    border-radius: 6px; /* Rounded rectangle for modern look */
     25    box-shadow: 0 0 4px rgba(0, 183, 255, 0.4); /* Feathered blue glow */
    2426}
    25 
    2627.slider:before {
    2728    position: absolute;
    2829    content: "";
    29     height: 26px;
    30     width: 26px;
    31     left: 4px;
    32     bottom: 4px;
    33     background-color: white;
    34     -webkit-transition: .4s;
    35     transition: .4s;
     30    width: 20px; /* Compact knob */
     31    height: 20px;
     32    left: 3px;
     33    bottom: 2px;
     34    background: linear-gradient(90deg, #a0a0a0, #d0d0d0); /* Subtle metallic gradient for off state */
     35    transition: transform 0.2s ease, background 0.3s ease, box-shadow 0.3s ease;
     36    border: 1px solid #00b7ff; /* Soft blue border for knob */
     37    border-radius: 4px; /* Slightly rounded knob */
     38    box-shadow: 0 2px 6px rgba(0, 183, 255, 0.3); /* Feathered blue glow */
     39}
     40input:checked + .slider {
     41    background: linear-gradient(90deg, #00ff88, #00b7ff); /* Vibrant neon green to blue */
     42    box-shadow: 0 0 12px rgba(0, 255, 136, 0.6); /* Stronger glow */
     43}
     44input:checked + .slider:before {
     45    transform: translateX(24px); /* Adjusted for width */
     46    background: linear-gradient(90deg, #00ff88, #00b7ff); /* Neon gradient to match slider */
     47    box-shadow: 0 0 10px rgba(0, 255, 136, 0.8), 0 0 15px rgba(0, 255, 136, 0.6); /* Intense glowing effect */
     48    animation: glow-pulse 1.2s infinite ease-in-out; /* Fast, vibrant pulse */
     49}
     50input:focus + .slider {
     51    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.4); /* Vibrant focus ring */
     52}
     53/* Indeterminate state */
     54.bulk-edit-switch input[type="checkbox"]:indeterminate + .slider,
     55.bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider {
     56    background: linear-gradient(90deg, #ff9500, #ffcc00); /* Orange-yellow gradient */
     57    box-shadow: 0 0 10px rgba(255, 149, 0, 0.6); /* Subtle glow */
     58}
     59.bulk-edit-switch input[type="checkbox"]:indeterminate + .slider:before,
     60.bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider:before {
     61    transform: translateX(12px); /* Centered for indeterminate */
     62    background: linear-gradient(90deg, #ff9500, #ffcc00); /* Orange-yellow to match */
     63    box-shadow: 0 0 10px rgba(255, 149, 0, 0.8), 0 0 15px rgba(255, 149, 0, 0.6); /* Intense glow */
     64    animation: glow-pulse-indeterminate 1.2s infinite ease-in-out; /* Fast pulse */
     65}
     66/* Hover effect for interactivity */
     67.slider:hover {
     68    box-shadow: 0 0 14px rgba(0, 255, 136, 0.5); /* Stronger hover glow */
     69}
     70/* Glow pulse animations */
     71@keyframes glow-pulse {
     72    0% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.8), 0 0 15px rgba(0, 255, 136, 0.6); }
     73    50% { box-shadow: 0 0 16px rgba(0, 255, 136, 1), 0 0 22px rgba(0, 255, 136, 0.8); }
     74    100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.8), 0 0 15px rgba(0, 255, 136, 0.6); }
     75}
     76@keyframes glow-pulse-indeterminate {
     77    0% { box-shadow: 0 0 10px rgba(255, 149, 0, 0.8), 0 0 15px rgba(255, 149, 0, 0.6); }
     78    50% { box-shadow: 0 0 16px rgba(255, 149, 0, 1), 0 0 22px rgba(255, 149, 0, 0.8); }
     79    100% { box-shadow: 0 0 10px rgba(255, 149, 0, 0.8), 0 0 15px rgba(255, 149, 0, 0.6); }
    3680}
    3781
    38 input:checked + .slider {
    39     background: linear-gradient(to right, #ff4b2b, #4b88ff);
     82/* Select styling: matching the neon, rounded rectangle aesthetic with soft blue border */
     83.bulk-edit-select select {
     84    width: 100%;
     85    max-width: 200px;
     86    padding: 8px 12px;
     87    border: 1px solid #00b7ff; /* Soft blue border */
     88    border-radius: 4px; /* Slightly rounded for balance */
     89    font-size: 14px;
     90    font-weight: 500; /* Bold text for impact */
     91    background: linear-gradient(180deg, #fff, #f5f5f5); /* Subtle gradient for depth */
     92    color: #1a1a1a; /* Dark text for contrast */
     93    cursor: pointer;
     94    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
     95    box-shadow: 0 0 4px rgba(0, 183, 255, 0.4); /* Feathered blue glow */
    4096}
    41 
    42 input:checked + .slider:before {
    43     -webkit-transform: translateX(26px);
    44     -ms-transform: translateX(26px);
    45     transform: translateX(26px);
     97.bulk-edit-select select:hover {
     98    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3); /* Hover glow to match switches */
     99    transform: translateY(-1px); /* Slight lift for interactivity */
    46100}
    47 
    48 .slider.round {
    49     border-radius: 34px;
     101.bulk-edit-select select:focus {
     102    border-color: #00ff88; /* Neon green to match on state */
     103    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.4); /* Matching focus ring */
     104    outline: none;
    50105}
    51 
    52 .slider.round:before {
    53     border-radius: 50%;
    54 }
    55 
    56 .switch-labels {
    57     display: flex;
    58     justify-content: space-between;
    59     width: 60px;
    60     font-size: 10px;
    61     position: absolute;
    62     top: 35px;
    63 }
    64 
    65 .off {
    66     color: red;
    67     margin-left: 2px;
    68 }
    69 
    70 .on {
    71     color: blue;
    72     margin-right: 2px;
    73 }
    74 
    75 /* Ajoutez ceci pour représenter l'état neutre */
    76 .bulk-edit-switch input[type="checkbox"]:indeterminate + .slider:before,
    77 .bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider:before {
    78     -webkit-transform: translateX(13px);
    79     -ms-transform: translateX(13px);
    80     transform: translateX(13px);
    81     background: #808080; /* Couleur grise ou autre pour indiquer l'état neutre */
    82 }
    83 
    84 .bulk-edit-switch input[type="checkbox"]:indeterminate + .slider,
    85 .bulk-edit-checkbox input[type="checkbox"]:indeterminate + .slider {
    86     background: linear-gradient(to right, #ff4b2b, #808080, #4b88ff); /* Gradient ou autre style pour l'état mixte */
    87 }
  • bulk-content-toolkit/trunk/includes/admin/quick-edit.php

    r3200067 r3349006  
    8585        'data-initial-state' => true,
    8686    ),
     87    'select' => array(
     88            'name' => true,
     89            'id' => true,
     90            'aria-label' => true,
     91        ),
     92    'option' => array(
     93        'value' => true,
     94        'selected' => true,
     95    ),
    8796    // Add other tags and attributes as needed
    8897);
     
    131140
    132141function bulkedittoolkit_generate_switch_html($field_name, $context) {
    133     return '<input type="checkbox" name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '" value="yes" data-initial-state="mixed" />' .
    134            '<!-- Supprimez ou modifiez le label interne -->' .
    135            '<div class="slider round"></div>' .
    136            '<div class="switch-labels">' .
    137                '<span class="off">Off</span>' .
    138                '<span class="on">On</span>' .
    139            '</div>';
     142    return '<input type="checkbox" name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '" value="yes" data-initial-state="mixed" />' .
     143           '<div class="slider"></div>';
    140144}
    141145
    142146function bulkedittoolkit_generate_select_html($field_name, $context) {
    143     // Logique pour générer un select
    144     return '<select name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '">...</select>';
     147    global $wpdb;
     148
     149    // Récupérer les valeurs distinctes pour le champ
     150    $results = $wpdb->get_results(
     151        $wpdb->prepare(
     152            "SELECT DISTINCT meta_value FROM {$wpdb->postmeta} WHERE meta_key = %s AND meta_value != ''",
     153            $field_name
     154        )
     155    );
     156
     157    // Débogage : enregistrer les valeurs récupérées
     158    bulkedittoolkit_debug_log("Valeurs récupérées pour $field_name : " . print_r($results, true), $GLOBALS["bulkedittoolkit_is_debug_active"]);
     159
     160    // Créer le select
     161    $html = '<select name="' . esc_attr('custom_' . $field_name) . '" id="bulk_edit_custom_' . esc_attr($field_name) . '_' . esc_attr($context) . '" aria-label="' . esc_attr__('Select value for ', 'bulk-content-toolkit') . esc_html($field_name) . '">';
     162
     163    // Ajouter une option par défaut
     164    $html .= '<option value="">' . esc_html__('Select a value', 'bulk-content-toolkit') . '</option>';
     165
     166    // Ajouter les options
     167    foreach ($results as $result) {
     168        $value = trim($result->meta_value);
     169        if ($value !== '') {
     170            $html .= '<option value="' . esc_attr($value) . '">' . esc_html($value) . '</option>';
     171        }
     172    }
     173
     174    $html .= '</select>';
     175
     176    // Débogage : enregistrer le HTML généré
     177    bulkedittoolkit_debug_log("HTML généré pour $field_name : $html", $GLOBALS["bulkedittoolkit_is_debug_active"]);
     178
     179    return $html;
    145180}
    146181
  • bulk-content-toolkit/trunk/includes/api/ajax-handlers.php

    r3200067 r3349006  
    192192    }
    193193
    194     $distinct_count = count(array_unique(array_column($results, 'meta_value')));
     194        // Calculer le nombre total de valeurs et de valeurs distinctes
     195    $total_count = count($results);
     196    $distinct_values = array_unique(array_column($results, 'meta_value'));
     197    $distinct_count = count($distinct_values);
     198
    195199    $potential_types = [];
    196200
     
    252256        return filter_var($value, FILTER_VALIDATE_URL);
    253257    };
     258   
     259        // Vérification pour un champ de type select
     260    $isSelect = function($distinct_count, $total_count, $distinct_values) {
     261        // Critères pour un select :
     262        // 1. Nombre de valeurs distinctes raisonnable (par exemple, entre 2 et 20)
     263        // 2. Les valeurs doivent être répétées (distinct_count < total_count)
     264        // 3. Les valeurs ne doivent pas être trop longues (moins de 50 caractères)
     265        // 4. Les valeurs ne doivent pas correspondre à un autre type spécifique
     266        if ($distinct_count >= 2 && $distinct_count <= 20 && $distinct_count < $total_count) {
     267            foreach ($distinct_values as $value) {
     268                if (strlen($value) > 50) {
     269                    return false; // Les valeurs longues suggèrent un text, pas un select
     270                }
     271            }
     272            return true;
     273        }
     274        return false;
     275    };
    254276
    255277    // Analyse des valeurs
     
    267289        } elseif ($isDateTime($value)) {
    268290            $potential_types['datetime'] = true;
    269         }
    270 
    271         if ($isNumber($value)) {
     291        } elseif ($isEmail($value)) {
     292            $potential_types['email'] = true;
     293        } elseif ($isUrl($value)) {
     294            $potential_types['url'] = true;
     295        } elseif ($isNumber($value)) {
    272296            if (!isset($potential_types['number']) && !isset($potential_types['range'])) {
    273297                $potential_types[strpos($value, '.') === false ? 'number' : 'range'] = true; // Distinguer entre int et float pour number vs range
     
    275299        }
    276300
    277         if ($isEmail($value)) {
    278             $potential_types['email'] = true;
    279         } elseif ($isUrl($value)) {
    280             $potential_types['url'] = true;
    281         }
    282 
    283301        // Si la longueur de la valeur est importante, on pourrait suggérer un textarea
    284302        if (strlen($value) > 255) {
     
    286304        }
    287305    }
     306   
     307        // Vérifier si c'est un select (après les autres types pour éviter les conflits)
     308    if ($isSelect($distinct_count, $total_count, $distinct_values)) {
     309        $potential_types['select'] = true;
     310    }
    288311
    289312    // Décision basée sur les types potentiels
    290     $type_priority = ['checkbox', 'select', 'date', 'datetime', 'email', 'url', 'number', 'range', 'textarea', 'text'];
     313    $type_priority = ['checkbox', 'date', 'datetime', 'email', 'url', 'number', 'range', 'select', 'textarea', 'text'];
    291314    foreach ($type_priority as $type) {
    292315        if (isset($potential_types[$type])) {
  • bulk-content-toolkit/trunk/readme.txt

    r3290986 r3349006  
    44Tags: bulk edit, content management, wordpress plugin, bulk actions
    55Requires at least: 5.0
    6 Tested up to: 6.8.1
     6Tested up to: 6.8
    77Requires PHP: 7.4
    8 Stable Tag: 1.0.5
     8Stable Tag: 1.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     11
     12A WordPress plugin for bulk editing posts, pages, and custom post types with quick actions and custom fields.
    1113
    1214== Description ==
     
    4547== Changelog ==
    4648
     49= 1.1 =
     50- Improved: Enhanced styling for switches and select fields with a subtle neon glow effect, removing solid borders for a cleaner, modern look.
     51- Improved: Added spacing to switches in quick edit to prevent overlap with labels.
     52- Fixed: Corrected rendering of select fields in quick edit to properly display options instead of concatenated values.
     53- Updated: Admin interface styling to align with the neon aesthetic of the quick edit interface.
     54- Tested: Verified compatibility with WordPress 6.8.1.
     55
    4756= 1.0.5 =
    4857- Vérification et confirmation de la compatibilité avec WordPress 6.8.1.
Note: See TracChangeset for help on using the changeset viewer.