Dotclear


Ignore:
Timestamp:
07/10/16 17:43:26 (9 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Children:
3266:7af12b0d86d2, 3286:756eedc2fc15
Message:

Optional display of columns in posts and pages lists, closes #1074

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/lib.pager.php

    r3239 r3265  
    147147          $this->html_next = __('next &#187;'); 
    148148     } 
     149 
     150     public function userColumns($type,$cols) 
     151     { 
     152          $cols_user = @$this->core->auth->user_prefs->interface->cols; 
     153          if (is_array($cols_user)) { 
     154               if (isset($cols_user[$type])) { 
     155                    foreach ($cols_user[$type] as $cn => $cd) { 
     156                         if (!$cd && isset($cols[$cn])) { 
     157                              unset($cols[$cn]); 
     158                         } 
     159                    } 
     160               } 
     161          } 
     162     } 
    149163} 
    150164 
     
    218232               $this->core->callBehavior('adminPostListHeader',$this->core,$this->rs,$cols); 
    219233 
     234               // Cope with optional columns 
     235               $this->userColumns('posts',$cols); 
     236 
    220237               $html_block .= '<tr>'.implode(iterator_to_array($cols)).'</tr>%s</table></div>'; 
    221238               if ($enclose_block) { 
     
    313330          $this->core->callBehavior('adminPostListValue',$this->core,$this->rs,$cols); 
    314331 
     332          // Cope with optional columns 
     333          $this->userColumns('posts',$cols); 
     334 
    315335          $res .= implode(iterator_to_array($cols)); 
    316336          $res .= '</tr>'; 
     
    345365               $cols = new ArrayObject($cols); 
    346366               $this->core->callBehavior('adminPostMiniListHeader',$this->core,$this->rs,$cols); 
     367 
     368               // Cope with optional columns 
     369               $this->userColumns('posts',$cols); 
    347370 
    348371               $html_block .= '<tr>'.implode(iterator_to_array($cols)).'</tr>%s</table></div>'; 
     
    423446          $cols = new ArrayObject($cols); 
    424447          $this->core->callBehavior('adminPostMiniListValue',$this->core,$this->rs,$cols); 
     448 
     449          // Cope with optional columns 
     450          $this->userColumns('posts',$cols); 
    425451 
    426452          $res .= implode(iterator_to_array($cols)); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map