Dotclear

Changeset 246:b59b563d221b for inc


Ignore:
Timestamp:
05/12/11 11:40:28 (14 years ago)
Author:
Tomtom33 <tbouron@…>
Branch:
formfilters
Children:
251:152b093d9925, 276:2735b6d59082
Message:

Saved list' displayed information using user preferences

File:
1 edited

Legend:

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

    r242 r246  
    159159     public function setColumnsVisibility() 
    160160     { 
     161          $ws = $this->core->auth->user_prefs->addWorkspace('lists'); 
     162           
     163          $user_pref = !is_null($ws->{$this->context}) ? unserialize($ws->{$this->context}) : array(); 
     164           
     165          foreach ($this->columns[$this->context] as $k => $v) { 
     166               $visibility =  array_key_exists($k,$user_pref) ? $user_pref[$k] : true; 
     167               if (array_key_exists($this->form_trigger,$_REQUEST)) { 
     168                    $key = sprintf($this->form_prefix,$k); 
     169                    $visibility = !array_key_exists($key,$_REQUEST) ? false : true; 
     170               } 
     171               $v->setVisibility($visibility); 
     172               $user_pref[$k] = $visibility; 
     173          } 
     174           
    161175          if (array_key_exists($this->form_trigger,$_REQUEST)) { 
    162                foreach ($this->columns[$this->context] as $k => $v) { 
    163                     $key = sprintf($this->form_prefix,$k); 
    164                     if (!array_key_exists($key,$_REQUEST)) { 
    165                          $v->setVisibility(false); 
    166                     } 
    167                } 
     176               $this->core->auth->user_prefs->lists->put($this->context,serialize($user_pref),'string'); 
    168177          } 
    169178     } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map