Dotclear

Changeset 2986:1e5a2d6a0074 for plugins


Ignore:
Timestamp:
03/31/15 20:42:36 (10 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Message:

Fix #1647
Allow user to add the same word for severals blogs not necessary global.
Add behat tests for that feature.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/antispam/filters/class.dc.filter.words.php

    r2566 r2986  
    113113 
    114114          if ($core->auth->isSuperAdmin()) { 
    115                $res .= '<label class="classic" for="globalsw">'.form::checkbox('globalsw',1).'</label> '. 
    116                __('Global word (used for all blogs)'); 
     115               $res .= form::checkbox('globalsw',1). 
     116               '<label class="classic" for="globalsw">'.__('Global word (used for all blogs)').'</label> '; 
    117117          } 
    118118 
     
    167167                    } 
    168168               } 
    169                $res .= $res_local.$res_global; 
     169               $res .= '<div class="local">'.$res_local.'</div>'; 
     170               $res .= '<div class="global">'.$res_global.'</div>'; 
    170171 
    171172               $res .= 
     
    208209                    "WHERE rule_type = 'word' ". 
    209210                    "AND rule_content = '".$this->con->escape($content)."' "; 
     211          if (!$general) { 
     212               $strReq .= ' AND blog_id = \''.$this->core->blog->id.'\''; 
     213          } 
    210214          $rs = $this->con->select($strReq); 
    211215 
    212           if (!$rs->isEmpty()) { 
     216          if (!$rs->isEmpty() && !$general) { 
    213217               throw new Exception(__('This word exists')); 
    214218          } 
     
    228232          } 
    229233 
    230           $cur->insert(); 
     234          if (!$rs->isEmpty() && $general) { 
     235               $cur->update(); 
     236          } else { 
     237               $cur->insert(); 
     238          } 
    231239     } 
    232240 
Note: See TracChangeset for help on using the changeset viewer.

Sites map