Changeset 3265:fb9870e49400 for admin/preferences.php
- Timestamp:
- 07/10/16 17:43:26 (9 years ago)
- Branch:
- default
- Children:
- 3266:7af12b0d86d2, 3286:756eedc2fc15
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.