Changeset 31954 for extensions


Ignore:
Timestamp:
Nov 28, 2018, 4:11:12 PM (21 months ago)
Author:
plg
Message:

Simplify yes/no settings (use checkboxes instead of radio buttons)

Localisation (EN/FR for now)

Location:
extensions/AntiAspi
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/AntiAspi/admin.php

    r31953 r31954  
    6666        'DATE' => $ipban2['date'],
    6767        'STATUS' => $ipban2['status'],
     68        'STATUS_LABEL' => l10n('status-'.$ipban2['status']),
    6869        'U_DELETE' => $admin_base_url . '&delete=' . $ipban2['id'],
    6970      );
     
    155156  $tempssamesec=$tempssame[2]+($tempssame[1]*60)+($tempssame[0]*60*60);
    156157
    157   $onlyguest = array(l10n('Yes'), l10n('No'));
    158   $onlyguestv = array(true, false);
    159   $onlypicture = array(l10n('Yes'), l10n('No'));
    160   $onlypicturev = array(true,false);
    161 
    162158  $template->assign(
    163159    'ipconfiggest',
     
    167163      'SAMEA' => $same[0],
    168164      'SAMEB' => $tempssamesec,
    169       'ONLYGUEST' => $onlyguest,
    170       'ONLYGUESTV' => $onlyguestv,
    171       'ONLYGUESTSELECT' => $antiaspi['only guest'],
    172       'ONLYPICTURE' => $onlypicture,
    173       'ONLYPICTUREV' => $onlypicturev,
    174       'ONLYPICTURESELECT' => $antiaspi['only picture'],
     165      'ONLYGUEST' => $antiaspi['only guest'],
     166      'ONLYPICTURE' => $antiaspi['only picture'],
    175167    )
    176168  );
     
    181173    $antiaspi['diff'] = $_POST['insdiffa'].' pages in '.date('00:i:s', ($_POST['insdiffb']));
    182174    $antiaspi['same'] = $_POST['inssamea'].' pages in '.date('00:i:s', ($_POST['inssameb']));
    183     $antiaspi['only guest'] = $_POST['insonlyguest'];
    184     $antiaspi['only picture'] = $_POST['insonlypicturet'];
     175    $antiaspi['only guest'] = isset($_POST['insonlyguest']);
     176    $antiaspi['only picture'] = isset($_POST['insonlypicture']);
    185177
    186178    conf_update_param('antiaspi', $antiaspi);
  • extensions/AntiAspi/admin.tpl

    r31953 r31954  
     1{combine_script id='common' load='footer' path='admin/themes/default/js/common.js'}
    12{combine_script id='jquery.ui.slider' require='jquery.ui' load='footer' path='themes/default/js/ui/minified/jquery.ui.slider.min.js'}
    23{combine_css path="themes/default/js/ui/theme/jquery.ui.slider.css"}
     
    6566                        <td><!-- {$ipban.ID} --> {$ipban.IP}</td>
    6667                        <td>{$ipban.DATE}</td>
    67                         <td><span class="badge badge-{$ipban.STATUS}">{$ipban.STATUS}</span></td>
     68                        <td><span class="badge badge-{$ipban.STATUS}">{$ipban.STATUS_LABEL}</span></td>
    6869                        <td>
    6970                        <a href="{$ipban.U_DELETE}" onclick="return confirm( document.getElementById('btn_delete').title + '\n\n' + '{'Are you sure?'|@translate|@escape:'javascript'}');">
     
    114115
    115116                <p class="input" style="width: 700px;margin-top: 50px;">
    116                   <label for="inssamea"><strong>{'IP banned if same '|@translate}<span></span></strong></label>
     117                  <label for="inssamea"><strong>{'IP banned if same page viewed '|@translate}<span></span></strong></label>
    117118                  <input type="text" name="inssamea" data-min="10" data-max="500" class="range" value="{$ipconfiggest.SAMEA}"/> 
    118119                </p>   
    119120                <p class="input" style="width: 700px;margin-bottom: 50px;">
    120                         <label for="inssameb"><strong>{' different pages viewed in <span></span> seconds'|@translate} </strong></label>
     121                        <label for="inssameb"><strong>{' times viewed in <span></span> seconds'|@translate} </strong></label>
    121122                        <input type="text" name="inssameb" data-min="5" data-max="3599" class="range" value="{$ipconfiggest.SAMEB}"/>
    122123                </p>
    123124
    124125        <p>
    125         <strong>{'only guest'|@translate}</strong>
    126         {html_radios separator="  " name="insonlyguest" values=$ipconfiggest.ONLYGUESTV output=$ipconfiggest.ONLYGUEST selected="{$ipconfiggest.ONLYGUESTSELECT}"}
    127                 ({'If yes, don\'t ban registered users'|@translate})
     126        <label class="font-checkbox">
     127          <span class="icon-check"></span>
     128          <input type="checkbox" name="insonlyguest" {if ($ipconfiggest.ONLYGUEST)}checked="checked"{/if}>
     129          {'only guest'|@translate} <span class="configSettingHelp"><i class="icon-help-circled"></i>{'If yes, don\'t ban registered users'|@translate}</span>
     130        </label>
    128131    </p>
    129132        <p>
    130         <strong>{'only picture'|@translate}</strong>
    131         {html_radios separator="  " name="insonlypicturet" values=$ipconfiggest.ONLYPICTUREV output=$ipconfiggest.ONLYPICTURE selected="{$ipconfiggest.ONLYPICTURESELECT}"}
    132                 ({'If yes, apply antiaspi only on picture page'|@translate})
     133        <label class="font-checkbox">
     134          <span class="icon-check"></span>
     135          <input type="checkbox" name="insonlypicture" {if ($ipconfiggest.ONLYPICTURE)}checked="checked"{/if}>
     136          {'only picture'|@translate} <span class="configSettingHelp"><i class="icon-help-circled"></i>{'If yes, apply antiaspi only on picture page'|@translate}</span>
     137        </label>
    133138    </p>
    134139    <p style="margin-top: 50px">
  • extensions/AntiAspi/antiaspi.css

    r31953 r31954  
    4343        margin-bottom: 20px;
    4444}
     45
     46.configSettingHelp {
     47        background-color: #ddd;
     48        padding: 2px 5px;
     49        border-radius: 5px;
     50        font-size: 90%;
     51}
  • extensions/AntiAspi/language/en_UK/plugin.lang.php

    r31372 r31954  
    22//admin
    33$lang['AntiAspi'] = 'AntiAspi';
    4 $lang['IP ban'] = 'IP ban';
    5 $lang['IP ban deleted'] = 'IP ban deleted';
    6 $lang['List IP banned'] = 'List IP banned';
    7 $lang['Action IP banned'] = 'Action IP banned';
    8 $lang['IP banned if'] = 'IP banned if';
    9 $lang['different pages viewed in'] = 'different pages viewed in';
    10 $lang['IP banned if same'] = 'IP banned if same';
    11 $lang['different pages viewed in <span></span> seconds'] = 'different pages viewed in <span></span> seconds';
     4$lang['IP banned if '] = 'IP banned if ';
     5$lang[' different pages viewed in'] = ' different pages viewed in';
     6$lang['IP banned if same page viewed '] = 'IP banned if same page viewed ';
     7$lang[' times viewed in <span></span> seconds'] = ' times viewed in <span></span> seconds';
    128$lang['only guest'] = 'only guest';
    139$lang['If yes, don\'t ban registered users'] = 'If yes, don\'t ban registered users';
    1410$lang['only picture'] = 'only picture';
    1511$lang['If yes, apply antiaspi only on picture page'] = 'If yes, apply antiaspi only on picture page';
    16 $lang['Add IP allowed'] = 'Add IP allowed';
    17 $lang['IP'] = 'IP';
    1812$lang['IP already allowed'] = 'IP already allowed';
    1913
     14$lang['IP addresses'] = 'IP addresses';
     15$lang['Banned IP addresses'] = 'Banned IP addresses';
     16$lang['Delete all'] = 'Delete all';
     17$lang['Delete deprecated only'] = 'Delete deprecated only';
     18$lang['status-active'] = 'active';
     19$lang['status-deprecated'] = 'deprecated';
     20$lang['Whitelist (allowed ip addresses)'] = 'Whitelist (allowed ip addresses)';
     21$lang['Add allowed IP'] = 'Add allowed IP';
     22$lang['Add IP'] = 'Add IP';
  • extensions/AntiAspi/language/fr_FR/plugin.lang.php

    r31366 r31954  
    2121// | USA.                                                                  |
    2222// +-----------------------------------------------------------------------+
    23 $lang['Add IP ban'] = 'Ajouter une IP à bannir';
     23
    2424$lang['AntiAspi'] = 'AntiAspi';
    25 $lang['IP ban'] = 'IP banni';
    26 $lang['IP banned'] = 'Ip banni';
    27 $lang['IP banned edit'] = 'Édition de IP banni ';
    28 $lang['IP ban deleted'] = 'IP banni supprimé';
    29 $lang['Ip ban insert'] = 'IP banni inséré ';
    30 $lang['Ip ban update'] = 'IP banni mise à jour';
    31 $lang['List IP banned'] = 'Liste des IP banni';
     25$lang['IP banned if '] = 'Bannir adresse IP si ';
     26$lang[' different pages viewed in'] = 'pages vues différentes en ';
     27$lang['IP banned if same page viewed '] = 'Bannir adresse IP si même page vue ';
     28$lang[' times viewed in <span></span> seconds'] = ' fois en <span></span> secondes';
     29$lang['only guest'] = 'invités uniquement';
     30$lang['If yes, don\'t ban registered users'] = 'Si oui, ne pas bannir les utilisateurs identifiés';
     31$lang['only picture'] = 'uniquement page de la photo';
     32$lang['If yes, apply antiaspi only on picture page'] = 'Si oui, AntiAspi ne s\'applique que sur la page de la photo';
     33$lang['IP already allowed'] = 'addresse IP déjà autorisée';
     34
     35$lang['IP addresses'] = 'adresses IP';
     36$lang['Banned IP addresses'] = 'Adresses IP bannies';
     37$lang['Delete all'] = 'Supprimer tout';
     38$lang['Delete deprecated only'] = 'Supprimer uniquement les obsolètes';
     39$lang['status-active'] = 'actif';
     40$lang['status-deprecated'] = 'obsolète';
     41$lang['Whitelist (allowed ip addresses)'] = 'Liste blanche (adresses IP autorisées)';
     42$lang['Add allowed IP'] = 'Ajouter une adresse IP autorisée';
     43$lang['Add IP'] = 'Ajouter IP';
Note: See TracChangeset for help on using the changeset viewer.