Dotclear

Changeset 2493:168bf692d29a


Ignore:
Timestamp:
10/26/13 07:36:50 (10 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
2.6
Message:

Reduce checkbox cell width to it's minimum on action's list, fixes #1819

Location:
inc/admin/actions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/actions/class.dcaction.php

    r2243 r2493  
    4343     /** @var string form field name for "entries" (usually "entries") */ 
    4444     protected $field_entries; 
    45       
     45 
    4646     /** @var string title for checkboxes list, if displayed */ 
    4747     protected $cb_title; 
    48       
     48 
    4949     /** @var string title for caller page title */ 
    5050     protected $caller_title; 
    5151 
    5252     /** @var boolean true if we are acting inside a plugin (different handling of begin/endpage) */ 
    53      protected $in_plugin;     
    54       
     53     protected $in_plugin; 
     54 
    5555     /** @var boolean true if we enable to keep selection when redirecting */ 
    56      protected $enable_redir_selection;  
     56     protected $enable_redir_selection; 
    5757 
    5858    /** 
    5959     * Class constructor 
    60      *  
     60     * 
    6161     * @param mixed  $core   dotclear core 
    6262     * @param mixed  $uri   form uri 
     
    8989          $this->enable_redir_selection = true; 
    9090     } 
    91       
     91 
    9292    /** 
    9393     * setEnableRedirSelection - define whether to keep selection when redirecting 
     
    101101          $this->enable_redir_selection = $enable; 
    102102     } 
    103       
     103 
    104104    /** 
    105105     * addAction - adds an action 
     
    138138          return $this; 
    139139     } 
    140       
     140 
    141141    /** 
    142142     * getCombo - returns the actions combo, useable through form::combo 
     
    149149          return $this->combo; 
    150150     } 
    151       
    152       
     151 
     152 
    153153    /** 
    154154     * getIDS() - returns the list of selected entries 
     
    161161          return array_keys($this->entries); 
    162162     } 
    163       
     163 
    164164    /** 
    165165     * getIDS() - returns the list of selected entries as HTML hidden fields string 
     
    176176          return $ret; 
    177177     } 
    178       
     178 
    179179    /** 
    180180     * getHiddenFields() - returns all redirection parameters as HTML hidden fields 
     
    185185      * 
    186186     * @return string the HTML code for hidden fields 
    187      */    
     187     */ 
    188188     public function getHiddenFields($with_ids = false) { 
    189189          $ret = ''; 
     
    196196          return $ret; 
    197197     } 
    198       
    199       
     198 
     199 
    200200     /** 
    201201     * getRS() - get record from DB Query containing requested IDs 
     
    210210          return $this->rs; 
    211211     } 
    212       
     212 
    213213     /** 
    214214     * setupRedir - setup redirection arguments 
     
    233233     * 
    234234     * @param array $params extra parameters to append to redirection 
    235       *                            must be an array : each key is the name,  
     235      *                            must be an array : each key is the name, 
    236236      *                            each value is the wanted value 
    237237     * @param boolean $with_selected_entries if true, add selected entries in url 
     
    246246               unset($redir_args['redir']); 
    247247          } 
    248            
     248 
    249249          if ($with_selected_entries && $this->enable_redir_selection) { 
    250250               $redir_args[$this->field_entries] = array_keys($this->entries); 
     
    252252          return $this->uri.'?'.http_build_query($redir_args).$this->redir_anchor; 
    253253     } 
    254       
     254 
    255255     /** 
    256256     * redirect - redirects to redirection page 
     
    263263          http::redirect($this->getRedirection($with_selected_entries,$params)); 
    264264          exit; 
    265      }     
    266       
     265     } 
     266 
    267267     /** 
    268268     * getURI - returns current form URI, if any 
     
    286286          return $this->caller_title; 
    287287     } 
    288       
     288 
    289289     /** 
    290290     * getAction - returns current action, if any 
     
    309309 
    310310          $this->setupRedir($this->from); 
    311           $this->fetchEntries($this->from);   
     311          $this->fetchEntries($this->from); 
    312312          if (isset($this->from['action'])) { 
    313313               $this->action = $this->from['action']; 
     
    339339     */ 
    340340     public function getCheckboxes() { 
    341           $ret =  
     341          $ret = 
    342342               '<table class="posts-list"><tr>'. 
    343343               '<th colspan="2">'.$this->cb_title.'</th>'. 
    344344               '</tr>'; 
    345345          foreach ($this->entries as $id=>$title) { 
    346                $ret .=  
    347                     '<tr><td>'. 
     346               $ret .= 
     347                    '<tr><td class="minimal">'. 
    348348                    form::checkbox(array($this->field_entries.'[]'),$id,true,'','').'</td>'. 
    349349                    '<td>'.   $title.'</td></tr>'; 
     
    352352          return $ret; 
    353353     } 
    354       
     354 
    355355     /** 
    356356     * beginPage, endPage - displays the beginning/ending of a page, if action does not redirects dirtectly 
  • inc/admin/actions/class.dcactioncomments.php

    r2256 r2493  
    2929          dcDefaultCommentActions::adminCommentsActionsPage($this->core,$this); 
    3030     } 
    31       
     31 
    3232     public function beginPage($breadcrumb='',$head='') { 
    3333          if ($this->in_plugin) { 
     
    4343                    $head, 
    4444                    $breadcrumb 
    45                );    
     45               ); 
    4646 
    4747          } 
    4848          echo '<p><a class="back" href="'.$this->getRedirection(true).'">'.__('Back to comments list').'</a></p>'; 
    4949     } 
    50       
     50 
    5151     public function endPage() { 
    5252          dcPage::close(); 
     
    6464          $this->endPage(); 
    6565     } 
    66       
     66 
    6767     /** 
    6868     * getcheckboxes -returns html code for selected entries 
     
    7474     */ 
    7575     public function getCheckboxes() { 
    76           $ret =  
     76          $ret = 
    7777               '<table class="posts-list"><tr>'. 
    7878               '<th colspan="2">'.__('Author').'</th><th>'.__('Title').'</th>'. 
    7979               '</tr>'; 
    8080          foreach ($this->entries as $id=>$title) { 
    81                $ret .=  
    82                     '<tr><td>'. 
     81               $ret .= 
     82                    '<tr><td class="minimal">'. 
    8383                    form::checkbox(array($this->field_entries.'[]'),$id,true,'','').'</td>'. 
    8484                    '<td>'.   $title['author'].'</td><td>'.$title['title'].'</td></tr>'; 
     
    9191          if (!empty($from['comments'])) { 
    9292               $comments = $from['comments']; 
    93                 
     93 
    9494               foreach ($comments as $k => $v) { 
    9595                    $comments[$k] = (integer) $v; 
    9696               } 
    97                 
     97 
    9898               $params['sql'] = 'AND C.comment_id IN('.implode(',',$comments).') '; 
    99                 
     99 
    100100               if (!isset($from['full_content']) || empty($from['full_content'])) { 
    101101                    $params['no_content'] = true; 
    102102               } 
    103                 
     103 
    104104               $co = $this->core->blog->getComments($params); 
    105105               while ($co->fetch())     { 
     
    116116} 
    117117 
    118 class dcDefaultCommentActions  
     118class dcDefaultCommentActions 
    119119{ 
    120120     public static function adminCommentsActionsPage($core, dcCommentsActionsPage $ap) { 
     
    127127               $ap->addAction(array(__('Mark as junk') => 'junk'), $action); 
    128128          } 
    129       
     129 
    130130          if ($core->auth->check('delete,contentadmin',$core->blog->id)) 
    131131          { 
     
    147147               default : $status = 1; break; 
    148148          } 
    149            
     149 
    150150          $core->blog->updCommentsStatus($co_ids,$status); 
    151151 
     
    163163          { 
    164164               # --BEHAVIOR-- adminBeforeCommentDelete 
    165                $core->callBehavior('adminBeforeCommentDelete',$comment_id);                     
     165               $core->callBehavior('adminBeforeCommentDelete',$comment_id); 
    166166          } 
    167            
     167 
    168168          # --BEHAVIOR-- adminBeforeCommentsDelete 
    169169          $core->callBehavior('adminBeforeCommentsDelete',$co_ids); 
    170            
     170 
    171171          $core->blog->delComments($co_ids); 
    172172          dcPage::addSuccessNotice(__('Selected comments have been successfully deleted.')); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map