Changeset 49771b1 in github
- Timestamp:
- Oct 23, 2009 2:11:41 PM (4 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 04dcf0d
- Parents:
- 74e5bd4
- Files:
-
- 6 edited
-
CHANGELOG (modified) (1 diff)
-
program/js/app.js (modified) (1 diff)
-
program/js/list.js (modified) (3 diffs)
-
program/steps/settings/edit_prefs.inc (modified) (2 diffs)
-
program/steps/settings/func.inc (modified) (4 diffs)
-
skins/default/templates/settingsedit.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
rb6c512a r49771b1 2 2 =========================== 3 3 4 - Don't display disabled sections in Settings (#1486099) 4 5 - Added server-side e-mail address validation with 'email_dns_check' option (#1485857) 5 6 - Fix login page loading into an iframe when session expires (#1485952) -
program/js/app.js
rb4d940b r49771b1 352 352 this.sections_list.init(); 353 353 this.sections_list.focus(); 354 this.sections_list.select ('general'); // open first section by default354 this.sections_list.select_first(); // open first section by default 355 355 } 356 356 else if (this.gui_objects.subscriptionlist) -
program/js/list.js
r91a35ee r49771b1 321 321 322 322 /** 323 * get next/previous/last rows that are not hidden323 * get first/next/previous/last rows that are not hidden 324 324 */ 325 325 get_next_row: function() … … 347 347 348 348 return new_row; 349 }, 350 351 get_first_row: function() 352 { 353 if (this.rowcount) 354 { 355 var rows = this.list.tBodies[0].rows; 356 357 for(var i=0; i<rows.length-1; i++) 358 if(rows[i].id && String(rows[i].id).match(/rcmrow([a-z0-9\-_=\+\/]+)/i) && this.rows[RegExp.$1] != null) 359 return RegExp.$1; 360 } 361 362 return null; 349 363 }, 350 364 … … 450 464 if (new_row) 451 465 this.select_row(new_row.uid, false, false); 466 }, 467 468 /** 469 * Select first row 470 */ 471 select_first: function() 472 { 473 var first_row = this.get_first_row(); 474 if (first_row) 475 this.select_row(first_row, false, false); 452 476 }, 453 477 -
program/steps/settings/edit_prefs.inc
r93a88c9 r49771b1 25 25 26 26 $CURR_SECTION = get_input_value('_section', RCUBE_INPUT_GPC); 27 list($SECTIONS,) = rcmail_user_prefs($CURR_SECTION); 27 28 28 29 function rcmail_user_prefs_form($attrib) 29 30 { 30 global $RCMAIL, $CURR_SECTION ;31 global $RCMAIL, $CURR_SECTION, $SECTIONS; 31 32 32 33 // add some labels to client … … 39 40 40 41 $out = $form_start; 41 42 $out .= rcmail_user_prefs_block($CURR_SECTION, $attrib);43 44 return $out . $form_end;45 }46 42 47 function rcmail_user_prefs_block($part, $attrib) 48 { 49 global $RCMAIL; 50 51 $config = $RCMAIL->config->all(); 52 $no_override = array_flip($RCMAIL->config->get('dont_override', array())); 53 54 $blocks = array(); 55 56 switch ($part) 57 { 58 // General UI settings 59 case 'general': 60 61 $blocks = array( 62 'main' => array('name' => Q(rcube_label('mainoptions'))), 63 'list' => array('name' => Q(rcube_label('listoptions'))), 64 ); 65 66 // language selection 67 if (!isset($no_override['language'])) { 68 $a_lang = $RCMAIL->list_languages(); 69 asort($a_lang); 70 71 $field_id = 'rcmfd_lang'; 72 $select_lang = new html_select(array('name' => '_language', 'id' => $field_id)); 73 $select_lang->add(array_values($a_lang), array_keys($a_lang)); 74 75 $blocks['main']['options']['language'] = array( 76 'title' => html::label($field_id, Q(rcube_label('language'))), 77 'content' => $select_lang->show($RCMAIL->user->language), 78 ); 79 } 80 81 // show page size selection 82 if (!isset($no_override['timezone'])) { 83 $field_id = 'rcmfd_timezone'; 84 $select_timezone = new html_select(array('name' => '_timezone', 'id' => $field_id, 'onchange' => "document.getElementById('rcmfd_dst').disabled=this.selectedIndex==0")); 85 $select_timezone->add(rcube_label('autodetect'), 'auto'); 86 $select_timezone->add('(GMT -11:00) Midway Island, Samoa', '-11'); 87 $select_timezone->add('(GMT -10:00) Hawaii', '-10'); 88 $select_timezone->add('(GMT -9:30) Marquesas Islands', '-9.5'); 89 $select_timezone->add('(GMT -9:00) Alaska', '-9'); 90 $select_timezone->add('(GMT -8:00) Pacific Time (US/Canada)', '-8'); 91 $select_timezone->add('(GMT -7:00) Mountain Time (US/Canada)', '-7'); 92 $select_timezone->add('(GMT -6:00) Central Time (US/Canada), Mexico City', '-6'); 93 $select_timezone->add('(GMT -5:00) Eastern Time (US/Canada), Bogota, Lima', '-5'); 94 $select_timezone->add('(GMT -4:30) Caracas', '-4.5'); 95 $select_timezone->add('(GMT -4:00) Atlantic Time (Canada), La Paz', '-4'); 96 $select_timezone->add('(GMT -3:30) Nfld Time (Canada), Nfld, S. Labador', '-3.5'); 97 $select_timezone->add('(GMT -3:00) Brazil, Buenos Aires, Georgetown', '-3'); 98 $select_timezone->add('(GMT -2:00) Mid-Atlantic', '-2'); 99 $select_timezone->add('(GMT -1:00) Azores, Cape Verde Islands', '-1'); 100 $select_timezone->add('(GMT) Western Europe, London, Lisbon, Casablanca', '0'); 101 $select_timezone->add('(GMT +1:00) Central European Time', '1'); 102 $select_timezone->add('(GMT +2:00) EET: Tallinn, Helsinki, Kaliningrad, South Africa', '2'); 103 $select_timezone->add('(GMT +3:00) Baghdad, Kuwait, Riyadh, Moscow, Nairobi', '3'); 104 $select_timezone->add('(GMT +3:30) Tehran', '3.5'); 105 $select_timezone->add('(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi', '4'); 106 $select_timezone->add('(GMT +4:30) Kabul', '4.5'); 107 $select_timezone->add('(GMT +5:00) Ekaterinburg, Islamabad, Karachi', '5'); 108 $select_timezone->add('(GMT +5:30) Chennai, Kolkata, Mumbai, New Delhi', '5.5'); 109 $select_timezone->add('(GMT +5:45) Kathmandu', '5.75'); 110 $select_timezone->add('(GMT +6:00) Almaty, Dhaka, Colombo', '6'); 111 $select_timezone->add('(GMT +6:30) Cocos Islands, Myanmar', '6.5'); 112 $select_timezone->add('(GMT +7:00) Bangkok, Hanoi, Jakarta', '7'); 113 $select_timezone->add('(GMT +8:00) Beijing, Perth, Singapore, Taipei', '8'); 114 $select_timezone->add('(GMT +8:45) Caiguna, Eucla, Border Village', '8.75'); 115 $select_timezone->add('(GMT +9:00) Tokyo, Seoul, Yakutsk', '9'); 116 $select_timezone->add('(GMT +9:30) Adelaide, Darwin', '9.5'); 117 $select_timezone->add('(GMT +10:00) EAST/AEST: Sydney, Guam, Vladivostok', '10'); 118 $select_timezone->add('(GMT +10:30) New South Wales', '10.5'); 119 $select_timezone->add('(GMT +11:00) Magadan, Solomon Islands', '11'); 120 $select_timezone->add('(GMT +11:30) Norfolk Island', '11.5'); 121 $select_timezone->add('(GMT +12:00) Auckland, Wellington, Kamchatka', '12'); 122 $select_timezone->add('(GMT +12:45) Chatham Islands', '12.75'); 123 $select_timezone->add('(GMT +13:00) Tonga, Pheonix Islands', '13'); 124 $select_timezone->add('(GMT +14:00) Kiribati', '14'); 125 126 $blocks['main']['options']['timezone'] = array( 127 'title' => html::label($field_id, Q(rcube_label('timezone'))), 128 'content' => $select_timezone->show((string)$config['timezone']), 129 ); 130 } 131 132 // daylight savings 133 if (!isset($no_override['dst_active'])) { 134 $field_id = 'rcmfd_dst'; 135 $input_dst = new html_checkbox(array('name' => '_dst_active', 'id' => $field_id, 'value' => 1, 'disabled' => ($config['timezone'] === 'auto'))); 136 137 $blocks['main']['options']['dstactive'] = array( 138 'title' => html::label($field_id, Q(rcube_label('dstactive'))), 139 'content' => $input_dst->show($config['dst_active']), 140 ); 141 } 142 143 // MM: Show checkbox for toggling 'pretty dates' 144 if (!isset($no_override['prettydate'])) { 145 $field_id = 'rcmfd_prettydate'; 146 $input_prettydate = new html_checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1)); 147 148 $blocks['main']['options']['prettydate'] = array( 149 'title' => html::label($field_id, Q(rcube_label('prettydate'))), 150 'content' => $input_prettydate->show($config['prettydate']?1:0), 151 ); 152 } 153 154 // show page size selection 155 if (!isset($no_override['pagesize'])) { 156 $field_id = 'rcmfd_pgsize'; 157 $input_pagesize = new html_inputfield(array('name' => '_pagesize', 'id' => $field_id, 'size' => 5)); 158 159 $blocks['list']['options']['pagesize'] = array( 160 'title' => html::label($field_id, Q(rcube_label('pagesize'))), 161 'content' => $input_pagesize->show($config['pagesize']), 162 ); 163 } 164 165 // Show checkbox for toggling 'index_sort' 166 if (!isset($no_override['index_sort'])) { 167 $field_id = 'rcmfd_indexsort'; 168 $input_indexsort = new html_checkbox(array('name' => '_index_sort', 'id' => $field_id, 'value' => 1)); 169 170 $blocks['list']['options']['index_sort'] = array( 171 'title' => html::label($field_id, Q(rcube_label('indexsort'))), 172 'content' => $input_indexsort->show($config['index_sort']?1:0), 173 ); 174 } 175 176 // show drop-down for available skins 177 if (!isset($no_override['skin'])) { 178 $skins = rcmail_get_skins(); 179 180 if (count($skins) > 1) { 181 $field_id = 'rcmfd_skin'; 182 $input_skin = new html_select(array('name'=>'_skin', 'id'=>$field_id)); 183 184 foreach($skins as $skin) 185 $input_skin->add($skin, $skin); 186 187 $blocks['main']['options']['skin'] = array( 188 'title' => html::label($field_id, Q(rcube_label('skin'))), 189 'content' => $input_skin->show($config['skin']), 190 ); 191 } 192 } 193 194 break; 195 196 // Mailbox view (mail screen) 197 case 'mailbox': 198 199 $blocks = array( 200 'main' => array('name' => Q(rcube_label('mainoptions'))), 201 'new_message' => array('name' => Q(rcube_label('newmessage'))), 202 ); 203 204 // show config parameter for preview pane 205 if (!isset($no_override['preview_pane'])) { 206 $field_id = 'rcmfd_preview'; 207 $input_preview = new html_checkbox(array('name' => '_preview_pane', 'id' => $field_id, 'value' => 1)); 208 209 $blocks['main']['options']['preview_pane'] = array( 210 'title' => html::label($field_id, Q(rcube_label('previewpane'))), 211 'content' => $input_preview->show($config['preview_pane']?1:0), 212 ); 213 } 214 215 if (!isset($no_override['mdn_requests'])) { 216 $field_id = 'rcmfd_mdn_requests'; 217 $select_mdn_requests = new html_select(array('name' => '_mdn_requests', 'id' => $field_id)); 218 $select_mdn_requests->add(rcube_label('askuser'), 0); 219 $select_mdn_requests->add(rcube_label('autosend'), 1); 220 $select_mdn_requests->add(rcube_label('ignore'), 2); 221 222 $blocks['main']['options']['mdn_requests'] = array( 223 'title' => html::label($field_id, Q(rcube_label('mdnrequests'))), 224 'content' => $select_mdn_requests->show($config['mdn_requests']), 225 ); 226 } 227 228 if (!isset($no_override['focus_on_new_message'])) { 229 $field_id = 'rcmfd_focus_on_new_message'; 230 $input_focus_on_new_message = new html_checkbox(array('name' => '_focus_on_new_message', 'id' => $field_id, 'value' => 1)); 231 232 $blocks['new_message']['options']['focus_on_new_message'] = array( 233 'title' => html::label($field_id, Q(rcube_label('focusonnewmessage'))), 234 'content' => $input_focus_on_new_message->show($config['focus_on_new_message']?1:0), 235 ); 236 } 237 238 if (!isset($no_override['keep_alive'])) { 239 $field_id = 'rcmfd_keep_alive'; 240 $select_keep_alive = new html_select(array('name' => '_keep_alive', 'id' => $field_id)); 241 242 foreach(array(1, 3, 5, 10, 15, 30, 60) as $min) 243 if((!$config['min_keep_alive'] || $config['min_keep_alive'] <= $min * 60) 244 && (!$config['session_lifetime'] || $config['session_lifetime'] > $min)) { 245 $select_keep_alive->add(rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))), $min); 246 } 247 248 $blocks['new_message']['options']['keep_alive'] = array( 249 'title' => html::label($field_id, Q(rcube_label('keepalive'))), 250 'content' => $select_keep_alive->show($config['keep_alive']/60), 251 ); 252 } 253 254 if (!isset($no_override['check_all_folders'])) { 255 $field_id = 'rcmfd_check_all_folders'; 256 $input_check_all = new html_checkbox(array('name' => '_check_all_folders', 'id' => $field_id, 'value' => 1)); 257 258 $blocks['new_message']['options']['check_all_folders'] = array( 259 'title' => html::label($field_id, Q(rcube_label('checkallfolders'))), 260 'content' => $input_check_all->show($config['check_all_folders']?1:0), 261 ); 262 } 263 264 break; 265 266 // Message viewing 267 case 'mailview': 268 269 $blocks = array( 270 'main' => array('name' => Q(rcube_label('mainoptions'))), 271 ); 272 273 // show checkbox for HTML/plaintext messages 274 if (!isset($no_override['prefer_html'])) { 275 $field_id = 'rcmfd_htmlmsg'; 276 $input_preferhtml = new html_checkbox(array('name' => '_prefer_html', 'id' => $field_id, 'value' => 1, 277 'onchange' => JS_OBJECT_NAME.'.toggle_prefer_html(this)')); 278 279 $blocks['main']['options']['prefer_html'] = array( 280 'title' => html::label($field_id, Q(rcube_label('preferhtml'))), 281 'content' => $input_preferhtml->show($config['prefer_html']?1:0), 282 ); 283 } 284 285 if (!isset($no_override['show_images'])) { 286 $field_id = 'rcmfd_show_images'; 287 $input_show_images = new html_select(array('name' => '_show_images', 'id' => $field_id)); 288 $input_show_images->add(rcube_label('never'), 0); 289 $input_show_images->add(rcube_label('fromknownsenders'), 1); 290 $input_show_images->add(rcube_label('always'), 2); 291 292 $blocks['main']['options']['show_images'] = array( 293 'title' => html::label($field_id, Q(rcube_label('showremoteimages'))), 294 'content' => $input_show_images->show($config['show_images']), 295 ); 296 } 297 298 if (!isset($no_override['inline_images'])) { 299 $field_id = 'rcmfd_inline_images'; 300 $input_inline_images = new html_checkbox(array('name' => '_inline_images', 'id' => $field_id, 'value' => 1)); 301 302 $blocks['main']['options']['inline_images'] = array( 303 'title' => html::label($field_id, Q(rcube_label('showinlineimages'))), 304 'content' => $input_inline_images->show($config['inline_images']?1:0), 305 ); 306 } 307 308 // "display after delete" checkbox 309 if (!isset($no_override['display_next'])) { 310 $field_id = 'rcmfd_displaynext'; 311 $input_displaynext = new html_checkbox(array('name' => '_display_next', 'id' => $field_id, 'value' => 1)); 312 313 $blocks['main']['options']['display_next'] = array( 314 'title' => html::label($field_id, Q(rcube_label('displaynext'))), 315 'content' => $input_displaynext->show($config['display_next']?1:0), 316 ); 317 } 318 319 break; 320 321 // Mail composition 322 case 'compose': 323 324 $blocks = array( 325 'main' => array('name' => Q(rcube_label('mainoptions'))), 326 ); 327 328 // Show checkbox for HTML Editor 329 if (!isset($no_override['htmleditor'])) { 330 $field_id = 'rcmfd_htmleditor'; 331 $input_htmleditor = new html_checkbox(array('name' => '_htmleditor', 'id' => $field_id, 'value' => 1)); 332 333 $blocks['main']['options']['htmleditor'] = array( 334 'title' => html::label($field_id, Q(rcube_label('htmleditor'))), 335 'content' => $input_htmleditor->show($config['htmleditor']?1:0), 336 ); 337 } 338 339 if (!isset($no_override['draft_autosave'])) { 340 $field_id = 'rcmfd_autosave'; 341 $select_autosave = new html_select(array('name' => '_draft_autosave', 'id' => $field_id, 'disabled' => empty($config['drafts_mbox']))); 342 $select_autosave->add(rcube_label('never'), 0); 343 foreach (array(1, 3, 5, 10) as $i => $min) 344 $select_autosave->add(rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))), $min*60); 345 346 $blocks['main']['options']['draft_autosave'] = array( 347 'title' => html::label($field_id, Q(rcube_label('autosavedraft'))), 348 'content' => $select_autosave->show($config['draft_autosave']), 349 ); 350 } 351 352 if (!isset($no_override['mime_param_folding'])) { 353 $field_id = 'rcmfd_param_folding'; 354 $select_param_folding = new html_select(array('name' => '_mime_param_folding', 'id' => $field_id)); 355 $select_param_folding->add(rcube_label('2231folding'), 0); 356 $select_param_folding->add(rcube_label('miscfolding'), 1); 357 $select_param_folding->add(rcube_label('2047folding'), 2); 358 359 $blocks['main']['options']['mime_param_folding'] = array( 360 'advanced' => true, 361 'title' => html::label($field_id, Q(rcube_label('mimeparamfolding'))), 362 'content' => $select_param_folding->show($config['mime_param_folding']), 363 ); 364 } 365 366 break; 367 368 // Special IMAP folders 369 case 'folders': 370 371 $blocks = array( 372 'main' => array('name' => Q(rcube_label('mainoptions'))), 373 ); 374 375 // Configure special folders 376 if (!isset($no_override['default_imap_folders'])) { 377 $RCMAIL->imap_init(true); 378 $select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true, 379 'maxlength' => 30, 'exceptions' => array('INBOX'))); 380 381 if (!isset($no_override['drafts_mbox'])) 382 $blocks['main']['options']['drafts_mbox'] = array( 383 'title' => Q(rcube_label('drafts')), 384 'content' => $select->show($config['drafts_mbox'], array('name' => "_drafts_mbox")), 385 ); 386 387 if (!isset($no_override['sent_mbox'])) 388 $blocks['main']['options']['sent_mbox'] = array( 389 'title' => Q(rcube_label('sent')), 390 'content' => $select->show($config['sent_mbox'], array('name' => "_sent_mbox")), 391 ); 392 393 if (!isset($no_override['junk_mbox'])) 394 $blocks['main']['options']['junk_mbox'] = array( 395 'title' => Q(rcube_label('junk')), 396 'content' => $select->show($config['junk_mbox'], array('name' => "_junk_mbox")), 397 ); 398 399 if (!isset($no_override['trash_mbox'])) 400 $blocks['main']['options']['trash_mbox'] = array( 401 'title' => Q(rcube_label('trash')), 402 'content' => $select->show($config['trash_mbox'], array('name' => "_trash_mbox")), 403 ); 404 } 405 break; 406 407 // Server settings 408 case 'server': 409 410 $blocks = array( 411 'main' => array('name' => Q(rcube_label('mainoptions'))), 412 'maintenance' => array('name' => Q(rcube_label('maintenance'))), 413 ); 414 415 if (!isset($no_override['read_when_deleted'])) { 416 $field_id = 'rcmfd_read_deleted'; 417 $input_readdeleted = new html_checkbox(array('name' => '_read_when_deleted', 'id' => $field_id, 'value' => 1)); 418 419 $blocks['main']['options']['read_when_deleted'] = array( 420 'title' => html::label($field_id, Q(rcube_label('readwhendeleted'))), 421 'content' => $input_readdeleted->show($config['read_when_deleted']?1:0), 422 ); 423 } 424 425 if (!isset($no_override['flag_for_deletion'])) { 426 $field_id = 'rcmfd_flag_for_deletion'; 427 $input_flagfordeletion = new html_checkbox(array('name' => '_flag_for_deletion', 'id' => $field_id, 'value' => 1)); 428 429 $blocks['main']['options']['flag_for_deletion'] = array( 430 'title' => html::label($field_id, Q(rcube_label('flagfordeletion'))), 431 'content' => $input_flagfordeletion->show($config['flag_for_deletion']?1:0), 432 ); 433 } 434 435 // don't show deleted messages 436 if (!isset($no_override['skip_deleted'])) { 437 $field_id = 'rcmfd_skip_deleted'; 438 $input_purge = new html_checkbox(array('name' => '_skip_deleted', 'id' => $field_id, 'value' => 1)); 439 440 $blocks['main']['options']['skip_deleted'] = array( 441 'title' => html::label($field_id, Q(rcube_label('skipdeleted'))), 442 'content' => $input_purge->show($config['skip_deleted']?1:0), 443 ); 444 } 445 446 // Trash purging on logout 447 if (!isset($no_override['logout_purge'])) { 448 $field_id = 'rcmfd_logout_purge'; 449 $input_purge = new html_checkbox(array('name' => '_logout_purge', 'id' => $field_id, 'value' => 1)); 450 451 $blocks['maintenance']['options']['logout_purge'] = array( 452 'title' => html::label($field_id, Q(rcube_label('logoutclear'))), 453 'content' => $input_purge->show($config['logout_purge']?1:0), 454 ); 455 } 456 457 // INBOX compacting on logout 458 if (!isset($no_override['logout_expunge'])) { 459 $field_id = 'rcmfd_logout_expunge'; 460 $input_expunge = new html_checkbox(array('name' => '_logout_expunge', 'id' => $field_id, 'value' => 1)); 461 462 $blocks['maintenance']['options']['logout_expunge'] = array( 463 'title' => html::label($field_id, Q(rcube_label('logoutcompact'))), 464 'content' => $input_expunge->show($config['logout_expunge']?1:0), 465 ); 466 } 467 468 break; 469 } 470 471 $data = $RCMAIL->plugins->exec_hook('user_preferences', array('section' => $part, 'blocks' => $blocks)); 472 473 // create output 474 foreach ($data['blocks'] as $idx => $block) { 43 foreach ($SECTIONS[$CURR_SECTION]['blocks'] as $idx => $block) { 475 44 if ($block['options']) { 476 45 $table = new html_table(array('cols' => 2)); 477 46 478 47 foreach ($block['options'] as $option) { 479 if ($option['advanced'])480 $table->set_row_attribs('advanced');481 48 if ($option['advanced']) 49 $table->set_row_attribs('advanced'); 50 482 51 $table->add('title', $option['title']); 483 52 $table->add(null, $option['content']); 53 } 54 55 $out .= html::tag('fieldset', null, html::tag('legend', null, $block['name']) . $table->show($attrib)); 484 56 } 485 486 $out .= html::tag('fieldset', null, html::tag('legend', null, $block['name']) . $table->show($attrib));487 57 } 488 } 489 490 return $out; 491 } 492 493 494 function rcmail_get_skins() 495 { 496 $path = 'skins'; 497 $skins = array(); 498 499 $dir = opendir($path); 500 501 if (!$dir) 502 return false; 503 504 while (($file = readdir($dir)) !== false) 505 { 506 $filename = $path.'/'.$file; 507 if (is_dir($filename) && is_readable($filename) 508 && !in_array($file, array('.', '..', '.svn'))) 509 $skins[] = $file; 510 } 511 512 closedir($dir); 513 514 return $skins; 58 59 return $out . $form_end; 515 60 } 516 61 -
program/steps/settings/func.inc
rf058348 r49771b1 23 23 $OUTPUT->set_pagetitle(rcube_label('preferences')); 24 24 25 // define sections list26 $SECTIONS['general'] = array('id' => 'general', 'section' => rcube_label('uisettings'));27 $SECTIONS['mailbox'] = array('id' => 'mailbox', 'section' => rcube_label('mailboxview'));28 $SECTIONS['compose'] = array('id' => 'compose', 'section' => rcube_label('messagescomposition'));29 $SECTIONS['mailview'] = array('id' => 'mailview','section' => rcube_label('messagesdisplaying'));30 $SECTIONS['folders'] = array('id' => 'folders', 'section' => rcube_label('specialfolders'));31 $SECTIONS['server'] = array('id' => 'server', 'section' => rcube_label('serversettings'));32 33 25 34 26 // similar function as /steps/settings/identities.inc::rcmail_identity_frame() … … 51 43 function rcmail_sections_list($attrib) 52 44 { 53 global $RCMAIL , $SECTIONS;45 global $RCMAIL; 54 46 55 47 // add id to message list table if not specified … … 57 49 $attrib['id'] = 'rcmsectionslist'; 58 50 59 // hook + define list cols 60 $plugin = $RCMAIL->plugins->exec_hook('list_prefs_sections', 61 array('list' => $SECTIONS, 'cols' => array('section'))); 51 list($list, $cols) = rcmail_user_prefs(); 62 52 63 53 // create XHTML table 64 $out = rcube_table_output($attrib, $ plugin['list'], $plugin['cols'], 'id');54 $out = rcube_table_output($attrib, $list, $cols, 'id'); 65 55 66 56 // set client env … … 124 114 125 115 116 function rcmail_user_prefs($current=null) 117 { 118 global $RCMAIL; 119 120 $sections['general'] = array('id' => 'general', 'section' => rcube_label('uisettings')); 121 $sections['mailbox'] = array('id' => 'mailbox', 'section' => rcube_label('mailboxview')); 122 $sections['compose'] = array('id' => 'compose', 'section' => rcube_label('messagescomposition')); 123 $sections['mailview'] = array('id' => 'mailview','section' => rcube_label('messagesdisplaying')); 124 $sections['folders'] = array('id' => 'folders', 'section' => rcube_label('specialfolders')); 125 $sections['server'] = array('id' => 'server', 'section' => rcube_label('serversettings')); 126 127 // hook + define list cols 128 $plugin = $RCMAIL->plugins->exec_hook('list_prefs_sections', 129 array('list' => $sections, 'cols' => array('section'))); 130 131 $sections = $plugin['list']; 132 133 $config = $RCMAIL->config->all(); 134 $no_override = array_flip($RCMAIL->config->get('dont_override', array())); 135 136 foreach ($sections as $idx => $sect) { 137 138 if ($current && $sect['id'] != $current) 139 continue; 140 141 $blocks = array(); 142 143 switch ($sect['id']) { 144 // general 145 case 'general': 146 147 $blocks = array( 148 'main' => array('name' => Q(rcube_label('mainoptions'))), 149 'list' => array('name' => Q(rcube_label('listoptions'))), 150 ); 151 152 // language selection 153 if (!isset($no_override['language'])) { 154 $a_lang = $RCMAIL->list_languages(); 155 asort($a_lang); 156 157 $field_id = 'rcmfd_lang'; 158 $select_lang = new html_select(array('name' => '_language', 'id' => $field_id)); 159 $select_lang->add(array_values($a_lang), array_keys($a_lang)); 160 161 $blocks['main']['options']['language'] = array( 162 'title' => html::label($field_id, Q(rcube_label('language'))), 163 'content' => $select_lang->show($RCMAIL->user->language), 164 ); 165 } 166 167 // show page size selection 168 if (!isset($no_override['timezone'])) { 169 $field_id = 'rcmfd_timezone'; 170 $select_timezone = new html_select(array('name' => '_timezone', 'id' => $field_id, 'onchange' => "document.getElementById('rcmfd_dst').disabled=this.selectedIndex==0")); 171 $select_timezone->add(rcube_label('autodetect'), 'auto'); 172 $select_timezone->add('(GMT -11:00) Midway Island, Samoa', '-11'); 173 $select_timezone->add('(GMT -10:00) Hawaii', '-10'); 174 $select_timezone->add('(GMT -9:30) Marquesas Islands', '-9.5'); 175 $select_timezone->add('(GMT -9:00) Alaska', '-9'); 176 $select_timezone->add('(GMT -8:00) Pacific Time (US/Canada)', '-8'); 177 $select_timezone->add('(GMT -7:00) Mountain Time (US/Canada)', '-7'); 178 $select_timezone->add('(GMT -6:00) Central Time (US/Canada), Mexico City', '-6'); 179 $select_timezone->add('(GMT -5:00) Eastern Time (US/Canada), Bogota, Lima', '-5'); 180 $select_timezone->add('(GMT -4:30) Caracas', '-4.5'); 181 $select_timezone->add('(GMT -4:00) Atlantic Time (Canada), La Paz', '-4'); 182 $select_timezone->add('(GMT -3:30) Nfld Time (Canada), Nfld, S. Labador', '-3.5'); 183 $select_timezone->add('(GMT -3:00) Brazil, Buenos Aires, Georgetown', '-3'); 184 $select_timezone->add('(GMT -2:00) Mid-Atlantic', '-2'); 185 $select_timezone->add('(GMT -1:00) Azores, Cape Verde Islands', '-1'); 186 $select_timezone->add('(GMT) Western Europe, London, Lisbon, Casablanca', '0'); 187 $select_timezone->add('(GMT +1:00) Central European Time', '1'); 188 $select_timezone->add('(GMT +2:00) EET: Tallinn, Helsinki, Kaliningrad, South Africa', '2'); 189 $select_timezone->add('(GMT +3:00) Baghdad, Kuwait, Riyadh, Moscow, Nairobi', '3'); 190 $select_timezone->add('(GMT +3:30) Tehran', '3.5'); 191 $select_timezone->add('(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi', '4'); 192 $select_timezone->add('(GMT +4:30) Kabul', '4.5'); 193 $select_timezone->add('(GMT +5:00) Ekaterinburg, Islamabad, Karachi', '5'); 194 $select_timezone->add('(GMT +5:30) Chennai, Kolkata, Mumbai, New Delhi', '5.5'); 195 $select_timezone->add('(GMT +5:45) Kathmandu', '5.75'); 196 $select_timezone->add('(GMT +6:00) Almaty, Dhaka, Colombo', '6'); 197 $select_timezone->add('(GMT +6:30) Cocos Islands, Myanmar', '6.5'); 198 $select_timezone->add('(GMT +7:00) Bangkok, Hanoi, Jakarta', '7'); 199 $select_timezone->add('(GMT +8:00) Beijing, Perth, Singapore, Taipei', '8'); 200 $select_timezone->add('(GMT +8:45) Caiguna, Eucla, Border Village', '8.75'); 201 $select_timezone->add('(GMT +9:00) Tokyo, Seoul, Yakutsk', '9'); 202 $select_timezone->add('(GMT +9:30) Adelaide, Darwin', '9.5'); 203 $select_timezone->add('(GMT +10:00) EAST/AEST: Sydney, Guam, Vladivostok', '10'); 204 $select_timezone->add('(GMT +10:30) New South Wales', '10.5'); 205 $select_timezone->add('(GMT +11:00) Magadan, Solomon Islands', '11'); 206 $select_timezone->add('(GMT +11:30) Norfolk Island', '11.5'); 207 $select_timezone->add('(GMT +12:00) Auckland, Wellington, Kamchatka', '12'); 208 $select_timezone->add('(GMT +12:45) Chatham Islands', '12.75'); 209 $select_timezone->add('(GMT +13:00) Tonga, Pheonix Islands', '13'); 210 $select_timezone->add('(GMT +14:00) Kiribati', '14'); 211 212 $blocks['main']['options']['timezone'] = array( 213 'title' => html::label($field_id, Q(rcube_label('timezone'))), 214 'content' => $select_timezone->show((string)$config['timezone']), 215 ); 216 } 217 218 // daylight savings 219 if (!isset($no_override['dst_active'])) { 220 $field_id = 'rcmfd_dst'; 221 $input_dst = new html_checkbox(array('name' => '_dst_active', 'id' => $field_id, 'value' => 1, 'disabled' => ($config['timezone'] === 'auto'))); 222 223 $blocks['main']['options']['dstactive'] = array( 224 'title' => html::label($field_id, Q(rcube_label('dstactive'))), 225 'content' => $input_dst->show($config['dst_active']), 226 ); 227 } 228 229 // MM: Show checkbox for toggling 'pretty dates' 230 if (!isset($no_override['prettydate'])) { 231 $field_id = 'rcmfd_prettydate'; 232 $input_prettydate = new html_checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1)); 233 234 $blocks['main']['options']['prettydate'] = array( 235 'title' => html::label($field_id, Q(rcube_label('prettydate'))), 236 'content' => $input_prettydate->show($config['prettydate']?1:0), 237 ); 238 } 239 240 // show page size selection 241 if (!isset($no_override['pagesize'])) { 242 $field_id = 'rcmfd_pgsize'; 243 $input_pagesize = new html_inputfield(array('name' => '_pagesize', 'id' => $field_id, 'size' => 5)); 244 245 $blocks['list']['options']['pagesize'] = array( 246 'title' => html::label($field_id, Q(rcube_label('pagesize'))), 247 'content' => $input_pagesize->show($config['pagesize']), 248 ); 249 } 250 251 // Show checkbox for toggling 'index_sort' 252 if (!isset($no_override['index_sort'])) { 253 $field_id = 'rcmfd_indexsort'; 254 $input_indexsort = new html_checkbox(array('name' => '_index_sort', 'id' => $field_id, 'value' => 1)); 255 256 $blocks['list']['options']['index_sort'] = array( 257 'title' => html::label($field_id, Q(rcube_label('indexsort'))), 258 'content' => $input_indexsort->show($config['index_sort']?1:0), 259 ); 260 } 261 262 // show drop-down for available skins 263 if (!isset($no_override['skin'])) { 264 $skins = rcmail_get_skins(); 265 266 if (count($skins) > 1) { 267 $field_id = 'rcmfd_skin'; 268 $input_skin = new html_select(array('name'=>'_skin', 'id'=>$field_id)); 269 270 foreach($skins as $skin) 271 $input_skin->add($skin, $skin); 272 273 $blocks['main']['options']['skin'] = array( 274 'title' => html::label($field_id, Q(rcube_label('skin'))), 275 'content' => $input_skin->show($config['skin']), 276 ); 277 } 278 } 279 280 break; 281 282 // Mailbox view (mail screen) 283 case 'mailbox': 284 285 $blocks = array( 286 'main' => array('name' => Q(rcube_label('mainoptions'))), 287 'new_message' => array('name' => Q(rcube_label('newmessage'))), 288 ); 289 290 // show config parameter for preview pane 291 if (!isset($no_override['preview_pane'])) { 292 $field_id = 'rcmfd_preview'; 293 $input_preview = new html_checkbox(array('name' => '_preview_pane', 'id' => $field_id, 'value' => 1)); 294 295 $blocks['main']['options']['preview_pane'] = array( 296 'title' => html::label($field_id, Q(rcube_label('previewpane'))), 297 'content' => $input_preview->show($config['preview_pane']?1:0), 298 ); 299 } 300 301 if (!isset($no_override['mdn_requests'])) { 302 $field_id = 'rcmfd_mdn_requests'; 303 $select_mdn_requests = new html_select(array('name' => '_mdn_requests', 'id' => $field_id)); 304 $select_mdn_requests->add(rcube_label('askuser'), 0); 305 $select_mdn_requests->add(rcube_label('autosend'), 1); 306 $select_mdn_requests->add(rcube_label('ignore'), 2); 307 308 $blocks['main']['options']['mdn_requests'] = array( 309 'title' => html::label($field_id, Q(rcube_label('mdnrequests'))), 310 'content' => $select_mdn_requests->show($config['mdn_requests']), 311 ); 312 } 313 314 if (!isset($no_override['focus_on_new_message'])) { 315 $field_id = 'rcmfd_focus_on_new_message'; 316 $input_focus_on_new_message = new html_checkbox(array('name' => '_focus_on_new_message', 'id' => $field_id, 'value' => 1)); 317 318 $blocks['new_message']['options']['focus_on_new_message'] = array( 319 'title' => html::label($field_id, Q(rcube_label('focusonnewmessage'))), 320 'content' => $input_focus_on_new_message->show($config['focus_on_new_message']?1:0), 321 ); 322 } 323 324 if (!isset($no_override['keep_alive'])) { 325 $field_id = 'rcmfd_keep_alive'; 326 $select_keep_alive = new html_select(array('name' => '_keep_alive', 'id' => $field_id)); 327 328 foreach(array(1, 3, 5, 10, 15, 30, 60) as $min) 329 if((!$config['min_keep_alive'] || $config['min_keep_alive'] <= $min * 60) 330 && (!$config['session_lifetime'] || $config['session_lifetime'] > $min)) { 331 $select_keep_alive->add(rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))), $min); 332 } 333 334 $blocks['new_message']['options']['keep_alive'] = array( 335 'title' => html::label($field_id, Q(rcube_label('keepalive'))), 336 'content' => $select_keep_alive->show($config['keep_alive']/60), 337 ); 338 } 339 340 if (!isset($no_override['check_all_folders'])) { 341 $field_id = 'rcmfd_check_all_folders'; 342 $input_check_all = new html_checkbox(array('name' => '_check_all_folders', 'id' => $field_id, 'value' => 1)); 343 344 $blocks['new_message']['options']['check_all_folders'] = array( 345 'title' => html::label($field_id, Q(rcube_label('checkallfolders'))), 346 'content' => $input_check_all->show($config['check_all_folders']?1:0), 347 ); 348 } 349 350 break; 351 352 // Message viewing 353 case 'mailview': 354 355 $blocks = array( 356 'main' => array('name' => Q(rcube_label('mainoptions'))), 357 ); 358 359 // show checkbox for HTML/plaintext messages 360 if (!isset($no_override['prefer_html'])) { 361 $field_id = 'rcmfd_htmlmsg'; 362 $input_preferhtml = new html_checkbox(array('name' => '_prefer_html', 'id' => $field_id, 'value' => 1, 363 'onchange' => JS_OBJECT_NAME.'.toggle_prefer_html(this)')); 364 365 $blocks['main']['options']['prefer_html'] = array( 366 'title' => html::label($field_id, Q(rcube_label('preferhtml'))), 367 'content' => $input_preferhtml->show($config['prefer_html']?1:0), 368 ); 369 } 370 371 if (!isset($no_override['show_images'])) { 372 $field_id = 'rcmfd_show_images'; 373 $input_show_images = new html_select(array('name' => '_show_images', 'id' => $field_id)); 374 $input_show_images->add(rcube_label('never'), 0); 375 $input_show_images->add(rcube_label('fromknownsenders'), 1); 376 $input_show_images->add(rcube_label('always'), 2); 377 378 $blocks['main']['options']['show_images'] = array( 379 'title' => html::label($field_id, Q(rcube_label('showremoteimages'))), 380 'content' => $input_show_images->show($config['show_images']), 381 ); 382 } 383 384 if (!isset($no_override['inline_images'])) { 385 $field_id = 'rcmfd_inline_images'; 386 $input_inline_images = new html_checkbox(array('name' => '_inline_images', 'id' => $field_id, 'value' => 1)); 387 388 $blocks['main']['options']['inline_images'] = array( 389 'title' => html::label($field_id, Q(rcube_label('showinlineimages'))), 390 'content' => $input_inline_images->show($config['inline_images']?1:0), 391 ); 392 } 393 394 // "display after delete" checkbox 395 if (!isset($no_override['display_next'])) { 396 $field_id = 'rcmfd_displaynext'; 397 $input_displaynext = new html_checkbox(array('name' => '_display_next', 'id' => $field_id, 'value' => 1)); 398 399 $blocks['main']['options']['display_next'] = array( 400 'title' => html::label($field_id, Q(rcube_label('displaynext'))), 401 'content' => $input_displaynext->show($config['display_next']?1:0), 402 ); 403 } 404 405 break; 406 407 // Mail composition 408 case 'compose': 409 410 $blocks = array( 411 'main' => array('name' => Q(rcube_label('mainoptions'))), 412 ); 413 414 // Show checkbox for HTML Editor 415 if (!isset($no_override['htmleditor'])) { 416 $field_id = 'rcmfd_htmleditor'; 417 $input_htmleditor = new html_checkbox(array('name' => '_htmleditor', 'id' => $field_id, 'value' => 1)); 418 419 $blocks['main']['options']['htmleditor'] = array( 420 'title' => html::label($field_id, Q(rcube_label('htmleditor'))), 421 'content' => $input_htmleditor->show($config['htmleditor']?1:0), 422 ); 423 } 424 425 if (!isset($no_override['draft_autosave'])) { 426 $field_id = 'rcmfd_autosave'; 427 $select_autosave = new html_select(array('name' => '_draft_autosave', 'id' => $field_id, 'disabled' => empty($config['drafts_mbox']))); 428 $select_autosave->add(rcube_label('never'), 0); 429 foreach (array(1, 3, 5, 10) as $i => $min) 430 $select_autosave->add(rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))), $min*60); 431 432 $blocks['main']['options']['draft_autosave'] = array( 433 'title' => html::label($field_id, Q(rcube_label('autosavedraft'))), 434 'content' => $select_autosave->show($config['draft_autosave']), 435 ); 436 } 437 438 if (!isset($no_override['mime_param_folding'])) { 439 $field_id = 'rcmfd_param_folding'; 440 $select_param_folding = new html_select(array('name' => '_mime_param_folding', 'id' => $field_id)); 441 $select_param_folding->add(rcube_label('2231folding'), 0); 442 $select_param_folding->add(rcube_label('miscfolding'), 1); 443 $select_param_folding->add(rcube_label('2047folding'), 2); 444 445 $blocks['main']['options']['mime_param_folding'] = array( 446 'advanced' => true, 447 'title' => html::label($field_id, Q(rcube_label('mimeparamfolding'))), 448 'content' => $select_param_folding->show($config['mime_param_folding']), 449 ); 450 } 451 452 break; 453 454 // Special IMAP folders 455 case 'folders': 456 457 $blocks = array( 458 'main' => array('name' => Q(rcube_label('mainoptions'))), 459 ); 460 461 // Configure special folders 462 if (!isset($no_override['default_imap_folders'])) { 463 $RCMAIL->imap_init(true); 464 $select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true, 465 'maxlength' => 30, 'exceptions' => array('INBOX'))); 466 467 if (!isset($no_override['drafts_mbox'])) 468 $blocks['main']['options']['drafts_mbox'] = array( 469 'title' => Q(rcube_label('drafts')), 470 'content' => $select->show($config['drafts_mbox'], array('name' => "_drafts_mbox")), 471 ); 472 473 if (!isset($no_override['sent_mbox'])) 474 $blocks['main']['options']['sent_mbox'] = array( 475 'title' => Q(rcube_label('sent')), 476 'content' => $select->show($config['sent_mbox'], array('name' => "_sent_mbox")), 477 ); 478 479 if (!isset($no_override['junk_mbox'])) 480 $blocks['main']['options']['junk_mbox'] = array( 481 'title' => Q(rcube_label('junk')), 482 'content' => $select->show($config['junk_mbox'], array('name' => "_junk_mbox")), 483 ); 484 485 if (!isset($no_override['trash_mbox'])) 486 $blocks['main']['options']['trash_mbox'] = array( 487 'title' => Q(rcube_label('trash')), 488 'content' => $select->show($config['trash_mbox'], array('name' => "_trash_mbox")), 489 ); 490 } 491 492 break; 493 494 // Server settings 495 case 'server': 496 497 $blocks = array( 498 'main' => array('name' => Q(rcube_label('mainoptions'))), 499 'maintenance' => array('name' => Q(rcube_label('maintenance'))), 500 ); 501 502 if (!isset($no_override['read_when_deleted'])) { 503 $field_id = 'rcmfd_read_deleted'; 504 $input_readdeleted = new html_checkbox(array('name' => '_read_when_deleted', 'id' => $field_id, 'value' => 1)); 505 506 $blocks['main']['options']['read_when_deleted'] = array( 507 'title' => html::label($field_id, Q(rcube_label('readwhendeleted'))), 508 'content' => $input_readdeleted->show($config['read_when_deleted']?1:0), 509 ); 510 } 511 512 if (!isset($no_override['flag_for_deletion'])) { 513 $field_id = 'rcmfd_flag_for_deletion'; 514 $input_flagfordeletion = new html_checkbox(array('name' => '_flag_for_deletion', 'id' => $field_id, 'value' => 1)); 515 516 $blocks['main']['options']['flag_for_deletion'] = array( 517 'title' => html::label($field_id, Q(rcube_label('flagfordeletion'))), 518 'content' => $input_flagfordeletion->show($config['flag_for_deletion']?1:0), 519 ); 520 } 521 522 // don't show deleted messages 523 if (!isset($no_override['skip_deleted'])) { 524 $field_id = 'rcmfd_skip_deleted'; 525 $input_purge = new html_checkbox(array('name' => '_skip_deleted', 'id' => $field_id, 'value' => 1)); 526 527 $blocks['main']['options']['skip_deleted'] = array( 528 'title' => html::label($field_id, Q(rcube_label('skipdeleted'))), 529 'content' => $input_purge->show($config['skip_deleted']?1:0), 530 ); 531 } 532 533 // Trash purging on logout 534 if (!isset($no_override['logout_purge'])) { 535 $field_id = 'rcmfd_logout_purge'; 536 $input_purge = new html_checkbox(array('name' => '_logout_purge', 'id' => $field_id, 'value' => 1)); 537 538 $blocks['maintenance']['options']['logout_purge'] = array( 539 'title' => html::label($field_id, Q(rcube_label('logoutclear'))), 540 'content' => $input_purge->show($config['logout_purge']?1:0), 541 ); 542 } 543 544 // INBOX compacting on logout 545 if (!isset($no_override['logout_expunge'])) { 546 $field_id = 'rcmfd_logout_expunge'; 547 $input_expunge = new html_checkbox(array('name' => '_logout_expunge', 'id' => $field_id, 'value' => 1)); 548 549 $blocks['maintenance']['options']['logout_expunge'] = array( 550 'title' => html::label($field_id, Q(rcube_label('logoutcompact'))), 551 'content' => $input_expunge->show($config['logout_expunge']?1:0), 552 ); 553 } 554 555 break; 556 } 557 558 $data = $RCMAIL->plugins->exec_hook('user_preferences', array('section' => $sect['id'], 'blocks' => $blocks)); 559 $found = false; 560 561 // create output 562 foreach ($data['blocks'] as $block) { 563 if ($block['options']) { 564 foreach ($block['options'] as $option) { 565 $found = true; 566 break 2; 567 } 568 } 569 } 570 571 if (!$found) 572 unset($sections[$idx]); 573 else 574 $sections[$idx]['blocks'] = $data['blocks']; 575 } 576 577 return array($sections, $plugin['cols']); 578 } 579 580 581 function rcmail_get_skins() 582 { 583 $path = 'skins'; 584 $skins = array(); 585 586 $dir = opendir($path); 587 588 if (!$dir) 589 return false; 590 591 while (($file = readdir($dir)) !== false) 592 { 593 $filename = $path.'/'.$file; 594 if (is_dir($filename) && is_readable($filename) 595 && !in_array($file, array('.', '..', '.svn'))) 596 $skins[] = $file; 597 } 598 599 closedir($dir); 600 601 return $skins; 602 } 603 604 126 605 // register UI objects 127 606 $OUTPUT->add_handlers(array( -
skins/default/templates/settingsedit.html
r6fff3c8 r49771b1 10 10 <div id="prefs-title" class="boxtitle"><roundcube:object name="sectionname" /></div> 11 11 12 <form name="form" action="./" method="post">13 14 12 <div id="prefs-details" class="boxcontent"> 15 13 <roundcube:object name="userprefs" form="form" /> … … 20 18 <roundcube:button command="save" type="input" class="button mainaction" label="save" /> 21 19 </div> 22 23 20 </div> 24 <p> </p>25 26 </form>27 21 28 22 </body>
Note: See TracChangeset
for help on using the changeset viewer.
