Changeset 1617 for trunk/admin/configuration.php
- Timestamp:
- Nov 22, 2006, 5:41:25 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r1571 r1617 47 47 $page['section'] = $_GET['section']; 48 48 } 49 50 $general_checkboxes = array( 51 'log', 52 'history_admin', 53 'history_guest', 54 'login_history', 55 'email_admin_on_new_user' 56 ); 57 58 $comments_checkboxes = array( 59 'comments_forall', 60 'comments_validation', 61 'email_admin_on_comment', 62 'email_admin_on_comment_validation', 63 ); 64 49 65 //------------------------------ verification and registration of modifications 50 66 if (isset($_POST['submit']) and !is_adviser()) … … 59 75 array_push($page['errors'], $lang['conf_gallery_url_error']); 60 76 } 61 $_POST['log'] = empty($_POST['log'])?'false':'true';62 $_POST['history_admin'] = empty($_POST['history_admin'])?'false':'true';63 $_POST['history_guest'] = empty($_POST['history_guest'])?'false':'true';64 $_POST['login_history'] = empty($_POST['login_history'])?'false':'true';77 foreach( $general_checkboxes as $checkbox) 78 { 79 $_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true'; 80 } 65 81 break; 66 82 } … … 74 90 { 75 91 array_push($page['errors'], $lang['conf_nb_comment_page_error']); 92 } 93 foreach( $comments_checkboxes as $checkbox) 94 { 95 $_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true'; 76 96 } 77 97 break; … … 161 181 )); 162 182 183 $html_check='checked="checked"'; 184 163 185 switch ($page['section']) 164 186 { 165 187 case 'general' : 166 188 { 167 $html_check='checked="checked"';168 169 189 $lock_yes = ($conf['gallery_locked']=='true')?'checked="checked"':''; 170 190 $lock_no = ($conf['gallery_locked']=='false')?'checked="checked"':''; 171 $history_users = ($conf['log']=='true')?$html_check:'';172 $history_admin = ($conf['history_admin']=='true')?$html_check:'';173 $history_guest = ($conf['history_guest']=='true')?$html_check:'';174 $login_history = ($conf['login_history']=='true')?$html_check:'';175 191 176 192 $template->assign_block_vars( 177 193 'general', 178 194 array( 179 'HISTORY_USERS'=>$history_users,180 'HISTORY_ADMIN'=>$history_admin,181 'HISTORY_GUEST'=>$history_guest,182 'LOGIN_HISTORY'=>$login_history,183 195 'GALLERY_LOCKED_YES'=>$lock_yes, 184 196 'GALLERY_LOCKED_NO'=>$lock_no, … … 190 202 'CONF_GALLERY_URL' => $conf['gallery_url'], 191 203 )); 204 205 foreach( $general_checkboxes as $checkbox) 206 { 207 $template->merge_block_vars( 208 'general', 209 array( 210 strtoupper($checkbox) => ($conf[$checkbox]=='true')?$html_check:'' 211 ) 212 ); 213 } 192 214 break; 193 215 } 194 216 case 'comments' : 195 217 { 196 $all_yes = ($conf['comments_forall']=='true')?'checked="checked"':'';197 $all_no = ($conf['comments_forall']=='false')?'checked="checked"':'';198 $validate_yes = ($conf['comments_validation']=='true')?'checked="checked"':'';199 $validate_no = ($conf['comments_validation']=='false')?'checked="checked"':'';200 201 218 $template->assign_block_vars( 202 219 'comments', 203 220 array( 204 221 'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'], 205 'COMMENTS_ALL_YES'=>$all_yes,206 'COMMENTS_ALL_NO'=>$all_no,207 'VALIDATE_YES'=>$validate_yes,208 'VALIDATE_NO'=>$validate_no209 222 )); 223 224 foreach( $comments_checkboxes as $checkbox) 225 { 226 $template->merge_block_vars( 227 'comments', 228 array( 229 strtoupper($checkbox) => ($conf[$checkbox]=='true')?$html_check:'' 230 ) 231 ); 232 } 210 233 break; 211 234 }
Note: See TracChangeset
for help on using the changeset viewer.