Changeset 3265:fb9870e49400
- Timestamp:
- 07/10/16 17:43:26 (9 years ago)
- Branch:
- default
- Children:
- 3266:7af12b0d86d2, 3286:756eedc2fc15
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/preferences.php
r3245 r3265 99 99 $lang_combo = dcAdminCombos::getAdminLangsCombo(); 100 100 101 # Get default colums (admin lists) 102 $cols = array( 103 'posts' => array(__('Posts'), array( 104 'date' => array(true,__('Date')), 105 'category' => array(true,__('Category')), 106 'author' => array(true,__('Author')), 107 'comments' => array(true,__('Comments')), 108 'trackbacks' => array(true,__('Trackbacks')) 109 )) 110 ); 111 $cols = new arrayObject($cols); 112 $core->callBehavior('adminColumnsLists',$core,$cols); 113 # Load user settings 114 $cols_user = @$core->auth->user_prefs->interface->cols; 115 if (is_array($cols_user)) { 116 foreach ($cols_user as $ct => $cv) { 117 foreach ($cv as $cn => $cd) { 118 if (isset($cols[$ct][1][$cn])) { 119 $cols[$ct][1][$cn][0] = $cd; 120 } 121 } 122 } 123 } 124 101 125 # Add or update user 102 126 if (isset($_POST['user_name'])) … … 196 220 $core->auth->user_prefs->interface->put('media_last_dirs',array(),'array',null,false); 197 221 $core->auth->user_prefs->interface->put('media_fav_dirs',array(),'array',null,false); 222 223 # Update user columns (lists) 224 $cu = array(); 225 foreach ($cols as $col_type => $cols_list) { 226 $ct = array(); 227 foreach ($cols_list[1] as $col_name => $col_data) { 228 $ct[$col_name] = isset($_POST['cols_'.$col_type]) && in_array($col_name,$_POST['cols_'.$col_type],true) ? true : false; 229 } 230 if (count($ct)) { 231 $cu[$col_type] = $ct; 232 } 233 } 234 $core->auth->user_prefs->interface->put('cols',$cu,'array'); 198 235 199 236 # Update user … … 463 500 echo 464 501 '<div class="fieldset">'. 502 '<h4>'.__('Optional columns displayed in lists').'</h4>'; 503 foreach ($cols as $col_type => $col_list) { 504 echo '<h5>'.$col_list[0].'</h5>'; 505 foreach ($col_list[1] as $col_name => $col_data) { 506 echo 507 '<p><label for="cols_'.$col_type.'-"'.$col_name.'" class="classic">'. 508 form::checkbox(array('cols_'.$col_type.'[]','cols_'.$col_type.'-'.$col_name),$col_name,$col_data[0]).$col_data[1].'</label>'; 509 } 510 } 511 echo '</div>'; 512 513 echo 514 '<div class="fieldset">'. 465 515 '<h4>'.__('Edition').'</h4>'; 466 516 -
inc/admin/lib.pager.php
r3239 r3265 147 147 $this->html_next = __('next »'); 148 148 } 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 } 149 163 } 150 164 … … 218 232 $this->core->callBehavior('adminPostListHeader',$this->core,$this->rs,$cols); 219 233 234 // Cope with optional columns 235 $this->userColumns('posts',$cols); 236 220 237 $html_block .= '<tr>'.implode(iterator_to_array($cols)).'</tr>%s</table></div>'; 221 238 if ($enclose_block) { … … 313 330 $this->core->callBehavior('adminPostListValue',$this->core,$this->rs,$cols); 314 331 332 // Cope with optional columns 333 $this->userColumns('posts',$cols); 334 315 335 $res .= implode(iterator_to_array($cols)); 316 336 $res .= '</tr>'; … … 345 365 $cols = new ArrayObject($cols); 346 366 $this->core->callBehavior('adminPostMiniListHeader',$this->core,$this->rs,$cols); 367 368 // Cope with optional columns 369 $this->userColumns('posts',$cols); 347 370 348 371 $html_block .= '<tr>'.implode(iterator_to_array($cols)).'</tr>%s</table></div>'; … … 423 446 $cols = new ArrayObject($cols); 424 447 $this->core->callBehavior('adminPostMiniListValue',$this->core,$this->rs,$cols); 448 449 // Cope with optional columns 450 $this->userColumns('posts',$cols); 425 451 426 452 $res .= implode(iterator_to_array($cols)); -
locales/fr/main.po
r3245 r3265 2127 2127 msgstr "Ce choix sera appliqué pour tous les utilisateurs" 2128 2128 2129 msgid "Optional columns displayed in lists" 2130 msgstr "Colonnes optionnelles affichées dans les listes" 2131 2129 2132 msgid "Edition" 2130 2133 msgstr "Édition" -
plugins/pages/_admin.php
r2849 r3265 12 12 if (!defined('DC_CONTEXT_ADMIN')) { return; } 13 13 14 $core->addBehavior('adminColumnsLists',array('pagesColumnsLists','adminColumnsLists')); 14 15 $core->addBehavior('adminDashboardFavorites',array('pagesDashboard','pagesDashboardFavs')); 15 16 $core->addBehavior('adminUsersActionsHeaders','pages_users_actions_headers'); 17 18 class pagesColumnsLists 19 { 20 public static function adminColumnsLists($core,$cols) 21 { 22 // Set optional columns in pages lists 23 $cols['pages'] = array(__('Pages'), array( 24 'date' => array(true,__('Date')), 25 'author' => array(true,__('Author')), 26 'comments' => array(true,__('Comments')), 27 'trackbacks' => array(true,__('Trackbacks')) 28 )); 29 } 30 } 16 31 17 32 class pagesDashboard -
plugins/pages/class.listpage.php
r3118 r3265 47 47 $cols = new ArrayObject($cols); 48 48 $this->core->callBehavior('adminPagesListHeader',$this->core,$this->rs,$cols); 49 50 // Cope with optional columns 51 $this->userColumns('pages',$cols); 49 52 50 53 $html_block .= '<tr>'.implode(iterator_to_array($cols)). … … 135 138 $this->core->callBehavior('adminPagesListValue',$this->core,$this->rs,$cols); 136 139 140 // Cope with optional columns 141 $this->userColumns('pages',$cols); 142 137 143 $res .= implode(iterator_to_array($cols)); 138 144 $res .= '</tr>';
Note: See TracChangeset
for help on using the changeset viewer.