Dotclear


Ignore:
Timestamp:
05/08/11 21:44:10 (14 years ago)
Author:
annso <as.tranchet@…>
Branch:
default
Children:
224:23ec5a339bcf, 225:411ee50a8664, 249:d0a17b7ca6e0
Message:

Ajout de label et title dans les formulaires du plugin antispam

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/antispam/index.php

    r3 r223  
    2828               throw new Exception(__('Filter does not exist.')); 
    2929          } 
    30            
     30 
    3131          if (!$filters[$_GET['f']]->hasGUI()) { 
    3232               throw new Exception(__('Filter has no user interface.')); 
    3333          } 
    34            
     34 
    3535          $filter = $filters[$_GET['f']]; 
    3636          $filter_gui = $filter->gui($filter->guiURL()); 
    3737     } 
    38       
     38 
    3939     # Remove all spam 
    4040     if (!empty($_POST['delete_all'])) 
    4141     { 
    4242          $ts = dt::str('%Y-%m-%d %H:%M:%S',$_POST['ts'],$core->blog->settings->system->blog_timezone); 
    43            
     43 
    4444          dcAntispam::delAllSpam($core,$ts); 
    4545          http::redirect($p_url.'&del=1'); 
    4646     } 
    47       
     47 
    4848     # Update filters 
    4949     if (isset($_POST['filters_upd'])) 
     
    5555               $i++; 
    5656          } 
    57            
     57 
    5858          # Enable active filters 
    5959          if (isset($_POST['filters_active']) && is_array($_POST['filters_active'])) { 
     
    6262               } 
    6363          } 
    64            
     64 
    6565          # Order filters 
    6666          if (!empty($_POST['f_order']) && empty($_POST['filters_order'])) 
     
    7474               $order = explode(',',trim($_POST['filters_order'],',')); 
    7575          } 
    76            
     76 
    7777          if (isset($order)) { 
    7878               foreach ($order as $i => $f) { 
     
    8080               } 
    8181          } 
    82            
     82 
    8383          # Set auto delete flag 
    8484          if (isset($_POST['filters_auto_del']) && is_array($_POST['filters_auto_del'])) { 
     
    8787               } 
    8888          } 
    89            
     89 
    9090          dcAntispam::$filters->saveFilterOpts($filters_opt); 
    9191          http::redirect($p_url.'&upd=1'); 
     
    116116     echo '<p><a href="'.$p_url.'">'.__('Return to filters').'</a></p>'; 
    117117     printf('<h3>'.__('%s configuration').'</h3>',$filter->name); 
    118       
     118 
    119119     echo $filter_gui; 
    120120} 
     
    125125     $published_count = dcAntispam::countPublishedComments($core); 
    126126     $moderationTTL = $core->blog->settings->antispam->antispam_moderation_ttl; 
    127       
     127 
    128128     echo 
    129129     '<form action="'.$p_url.'" method="post">'. 
    130130     '<fieldset><legend>'.__('Information').'</legend>'; 
    131       
     131 
    132132     if (!empty($_GET['del'])) { 
    133133          echo '<p class="message">'.__('Spam comments have been successfully deleted.').'</p>'; 
    134134     } 
    135       
     135 
    136136     echo 
    137137     '<ul class="spaminfo">'. 
     
    141141     $published_count.'</li>'. 
    142142     '</ul>'; 
    143       
     143 
    144144     if ($spam_count > 0) 
    145145     { 
     
    153153     } 
    154154     echo '</fieldset></form>'; 
    155       
    156       
     155 
     156 
    157157     # Filters 
    158158     echo 
    159159     '<form action="'.$p_url.'" method="post">'. 
    160160     '<fieldset><legend>'.__('Available spam filters').'</legend>'; 
    161       
     161 
    162162     if (!empty($_GET['upd'])) { 
    163163          echo '<p class="message">'.__('Filters configuration has been successfully saved.').'</p>'; 
    164164     } 
    165       
     165 
    166166     echo 
    167167     '<table class="dragable">'. 
     
    169169     '<th>'.__('Order').'</th>'. 
    170170     '<th>'.__('Active').'</th>'. 
    171      '<th>'.__('Auto Del.').'</th>'.     
     171     '<th>'.__('Auto Del.').'</th>'. 
    172172     '<th class="nowrap">'.__('Filter name').'</th>'. 
    173173     '<th colspan="2">'.__('Description').'</th>'. 
    174174     '</tr></thead>'. 
    175175     '<tbody id="filters-list" >'; 
    176       
     176 
    177177     $i = 0; 
    178178     foreach ($filters as $fid => $f) 
     
    185185               'title="'.__('Filter configuration').'" /></a>'; 
    186186          } 
    187            
     187 
    188188          echo 
    189189          '<tr class="line'.($f->active ? '' : ' offline').'" id="f_'.$fid.'">'. 
    190           '<td class="handle">'.form::field(array('f_order['.$fid.']'),2,5,(string) $i).'</td>'. 
    191           '<td class="nowrap">'.form::checkbox(array('filters_active[]'),$fid,$f->active).'</td>'. 
    192           '<td class="nowrap">'.form::checkbox(array('filters_auto_del[]'),$fid,$f->auto_delete).'</td>'.           
     190          '<td class="handle">'.form::field(array('f_order['.$fid.']'),2,5,(string) $i, '', '', false, 'title="'.__('position').'"').'</td>'. 
     191          '<td class="nowrap">'.form::checkbox(array('filters_active[]'),$fid,$f->active, '', '', false, 'title="'.__('Active').'"').'</td>'. 
     192          '<td class="nowrap">'.form::checkbox(array('filters_auto_del[]'),$fid,$f->auto_delete, '', '', false, 'title="'.__('Auto Del.').'"').'</td>'. 
    193193          '<td class="nowrap">'.$f->name.'</td>'. 
    194194          '<td class="maximal">'.$f->description.'</td>'. 
     
    203203     '<input type="submit" name="filters_upd" value="'.__('Save').'" /></p>'. 
    204204     '</fieldset></form>'; 
    205       
    206       
     205 
     206 
    207207     # Syndication 
    208208     if (DC_ADMIN_URL) 
    209209     { 
    210           $ham_feed = $core->blog->url.$core->url->getBase('hamfeed').'/'.$code = dcAntispam::getUserCode($core);  
     210          $ham_feed = $core->blog->url.$core->url->getBase('hamfeed').'/'.$code = dcAntispam::getUserCode($core); 
    211211          $spam_feed = $core->blog->url.$core->url->getBase('spamfeed').'/'.$code = dcAntispam::getUserCode($core); 
    212            
     212 
    213213          echo 
    214214          '<fieldset><legend>'.__('Syndication').'</legend>'. 
     
    224224</body> 
    225225</html> 
     226 
Note: See TracChangeset for help on using the changeset viewer.

Sites map