Dotclear


Ignore:
Timestamp:
09/03/15 14:07:40 (10 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add behaviors for posts/pages/comments/users lists' column, addresses #2133

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/pages/class.listpage.php

    r2566 r3089  
    3232               $html_block = 
    3333               '<div class="table-outer">'. 
    34                '<table class="maximal dragable"><thead><tr>'. 
    35                '<th colspan="3" scope="col" class="first">'.__('Title').'</th>'. 
    36                '<th scope="col">'.__('Date').'</th>'. 
    37                '<th scope="col">'.__('Author').'</th>'. 
    38                '<th scope="col"><img src="images/comments.png" alt="" title="'.__('Comments').'" /><span class="hidden">'.__('Comments').'</span></th>'. 
    39                '<th scope="col"><img src="images/trackbacks.png" alt="" title="'.__('Trackbacks').'" /><span class="hidden">'.__('Trackbacks').'</span></th>'. 
    40                '<th scope="col">'.__('Status').'</th>'. 
    41                '</tr></thead><tbody id="pageslist">%s</tbody></table></div>'; 
     34               '<table class="maximal dragable"><thead><tr>'; 
     35 
     36               $cols = array( 
     37                    'title' =>               '<th colspan="3" scope="col" class="first">'.__('Title').'</th>', 
     38                    'date' =>           '<th scope="col">'.__('Date').'</th>', 
     39                    'author' =>              '<th scope="col">'.__('Author').'</th>', 
     40                    'comments' =>       '<th scope="col"><img src="images/comments.png" alt="" title="'.__('Comments'). 
     41                                             '" /><span class="hidden">'.__('Comments').'</span></th>', 
     42                    'trackbacks' =>          '<th scope="col"><img src="images/trackbacks.png" alt="" title="'.__('Trackbacks'). 
     43                                             '" /><span class="hidden">'.__('Trackbacks').'</span></th>', 
     44                    'status' =>              '<th scope="col">'.__('Status').'</th>' 
     45               ); 
     46 
     47               $cols = new ArrayObject($cols); 
     48               $this->core->callBehavior('adminPagesListHeader',$this->core,$this->rs,$cols); 
     49 
     50               $html_block .= '<tr>'.implode(iterator_to_array($cols)). 
     51                    '</tr></thead><tbody id="pageslist">%s</tbody></table></div>'; 
    4252 
    4353               if ($enclose_block) { 
     
    102112          ' id="p'.$this->rs->post_id.'">'; 
    103113 
    104           $res .= 
    105           '<td class="nowrap handle minimal">'.form::field(array('order['.$this->rs->post_id.']'),2,3,$count+1,'position','',false,'title="'.sprintf(__('position of %s'),html::escapeHTML($this->rs->post_title)).'"').'</td>'. 
    106           '<td class="nowrap">'. 
    107           form::checkbox(array('entries[]'),$this->rs->post_id,$checked,'','',!$this->rs->isEditable(),'title="'.__('Select this page').'"').'</td>'. 
    108           '<td class="maximal" scope="row"><a href="'.$this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'">'. 
    109           html::escapeHTML($this->rs->post_title).'</a></td>'. 
    110           '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>'. 
    111           '<td class="nowrap">'.$this->rs->user_id.'</td>'. 
    112           '<td class="nowrap count">'.$this->rs->nb_comment.'</td>'. 
    113           '<td class="nowrap count">'.$this->rs->nb_trackback.'</td>'. 
    114           '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'. 
    115           '</tr>'; 
     114          $cols = array( 
     115               'position' =>       '<td class="nowrap handle minimal">'. 
     116                                        form::field(array('order['.$this->rs->post_id.']'),2,3,$count+1,'position','',false,'title="'.sprintf(__('position of %s'),html::escapeHTML($this->rs->post_title)).'"').'</td>', 
     117               'check' =>               '<td class="nowrap">'. 
     118                                        form::checkbox(array('entries[]'),$this->rs->post_id,$checked,'','',!$this->rs->isEditable(),'title="'.__('Select this page').'"').'</td>', 
     119               'title' =>               '<td class="maximal" scope="row"><a href="'. 
     120                                        $this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id).'">'. 
     121                                        html::escapeHTML($this->rs->post_title).'</a></td>', 
     122               'date' =>           '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).'</td>', 
     123               'author' =>              '<td class="nowrap">'.$this->rs->user_id.'</td>', 
     124               'comments' =>       '<td class="nowrap count">'.$this->rs->nb_comment.'</td>', 
     125               'trackbacks' =>          '<td class="nowrap count">'.$this->rs->nb_trackback.'</td>', 
     126               'status' =>              '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>' 
     127          ); 
     128 
     129          $cols = new ArrayObject($cols); 
     130          $this->core->callBehavior('adminPagesListValue',$this->core,$this->rs,$cols); 
     131 
     132          $res .= implode(iterator_to_array($cols)); 
     133          $res .= '</tr>'; 
    116134 
    117135          return $res; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map