diff options
-rw-r--r-- | program/steps/settings/func.inc | 65 | ||||
-rw-r--r-- | program/steps/settings/save_prefs.inc | 4 |
2 files changed, 58 insertions, 11 deletions
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index c52025379..4921906a8 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -145,18 +145,24 @@ function rcmail_user_prefs_form($attrib) $input_pagesize->show($config['pagesize'])); } - if (!isset($no_override['mdn_requests'])) + // show drop-down for available skins + if (!isset($no_override['skin'])) { - $field_id = 'rcmfd_mdn_requests'; - $select_mdn_requests = new html_select(array('name' => '_mdn_requests', 'id' => $field_id)); - $select_mdn_requests->add(rcube_label('askuser'), 0); - $select_mdn_requests->add(rcube_label('autosend'), 1); - $select_mdn_requests->add(rcube_label('ignore'), 2); - - $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", - $field_id, - Q(rcube_label('mdnrequests')), - $select_mdn_requests->show($config['mdn_requests'])); + $skins = rcmail_get_skins(); + + if (count($skins) > 1) + { + $field_id = 'rcmfd_skin'; + $input_skin = new html_select(array('name'=>'_skin', 'id'=>$field_id)); + + foreach($skins as $skin) + $input_skin->add($skin, $skin); + + $out .= sprintf("<tr><td class=\"title\"><lable for=\"%s\">%s</label></td><td>%s</td></tr>\n", + $field_id, + Q(rcube_label('skin')), + $input_skin->show($config['skin'])); + } } $out .= "</table></fieldset>\n<fieldset><legend>" . Q(rcube_label('mailboxview')) . "</legend>\n<table" . $attrib_str . ">\n\n"; @@ -172,6 +178,20 @@ function rcmail_user_prefs_form($attrib) $input_preview->show($config['preview_pane']?1:0)); } + if (!isset($no_override['mdn_requests'])) + { + $field_id = 'rcmfd_mdn_requests'; + $select_mdn_requests = new html_select(array('name' => '_mdn_requests', 'id' => $field_id)); + $select_mdn_requests->add(rcube_label('askuser'), 0); + $select_mdn_requests->add(rcube_label('autosend'), 1); + $select_mdn_requests->add(rcube_label('ignore'), 2); + + $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", + $field_id, + Q(rcube_label('mdnrequests')), + $select_mdn_requests->show($config['mdn_requests'])); + } + $out .= "</table></fieldset>\n<fieldset><legend>" . Q(rcube_label('messagesdisplaying')) . "</legend>\n<table" . $attrib_str . ">\n\n"; // show checkbox for HTML/plaintext messages @@ -340,6 +360,29 @@ function get_form_tags($attrib, $action, $add_hidden=array()) return array($form_start, $form_end); } +function rcmail_get_skins() + { + $path = 'skins'; + $skins = array(); + + $dir = opendir($path); + + if (!$dir) + return false; + + while (($file = readdir($dir)) !== false) + { + $filename = $path.'/'.$file; + if (is_dir($filename) && is_readable($filename) + && !in_array($file, array('.', '..', '.svn'))) + $skins[] = $file; + } + + closedir($dir); + + return $skins; + } + // register UI objects $OUTPUT->add_handlers(array( diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index 4498b7b32..6a0498b93 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -35,6 +35,7 @@ $a_user_prefs = array( 'logout_expunge' => isset($_POST['_logout_expunge']) ? TRUE : FALSE, 'draft_autosave' => isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0, 'mdn_requests' => isset($_POST['_mdn_requests']) ? intval($_POST['_mdn_requests']) : 0, + 'skin' => isset($_POST['_skin']) ? get_input_value('_skin', RCUBE_INPUT_POST) : $CONFIG['default_skin'], ); // don't override these parameters @@ -47,6 +48,9 @@ if (isset($_POST['_language'])) { $RCMAIL->load_language(get_input_value('_language', RCUBE_INPUT_POST)); } +// switch skin +$OUTPUT->set_skin($a_user_prefs['skin']); + // force min size if ($a_user_prefs['pagesize'] < 1) $a_user_prefs['pagesize'] = 10; |