From a60d139d873b77852658ddac04279b6f1e5570ce Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Thu, 28 Jun 2012 03:26:59 -0400 Subject: [PATCH] Define array variable in case none of zones is valid (shouldn't happen) --- program/steps/settings/func.inc | 30 +++++++++++++++++++++--------- 1 files changed, 21 insertions(+), 9 deletions(-) diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 48d1d5a..f44a96d 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -17,9 +17,6 @@ +-----------------------------------------------------------------------+ | Author: Thomas Bruederli <roundcube@gmail.com> | +-----------------------------------------------------------------------+ - - $Id$ - */ if (!$OUTPUT->ajax_call) @@ -184,13 +181,16 @@ $select_timezone = new html_select(array('name' => '_timezone', 'id' => $field_id)); $select_timezone->add(rcube_label('autodetect'), 'auto'); - $now = new DateTime(); + $zones = array(); foreach (DateTimeZone::listIdentifiers() as $i => $tzs) { - $tz = new DateTimeZone($tzs); - $date = new DateTime('2012-12-21', $tz); - $offset = $date->format('Z') + 45000; - $sortkey = sprintf('%06d.%s', $offset, $tzs); - $zones[$sortkey] = array($tzs, $date->format('P')); + try { + $tz = new DateTimeZone($tzs); + $date = new DateTime('2012-12-21', $tz); + $offset = $date->format('Z') + 45000; + $sortkey = sprintf('%06d.%s', $offset, $tzs); + $zones[$sortkey] = array($tzs, $date->format('P')); + } + catch (Exception $e) {} } ksort($zones); @@ -617,6 +617,18 @@ ); } + if (!isset($no_override['forward_attachment'])) { + $field_id = 'rcmfd_forward_attachment'; + $select = new html_select(array('name' => '_forward_attachment', 'id' => $field_id)); + $select->add(rcube_label('inline'), 0); + $select->add(rcube_label('asattachment'), 1); + + $blocks['main']['options']['forward_attachment'] = array( + 'title' => html::label($field_id, Q(rcube_label('forwardmode'))), + 'content' => $select->show(intval($config['forward_attachment'])), + ); + } + if (!isset($no_override['default_font'])) { $field_id = 'rcmfd_default_font'; $fonts = rcube_fontdefs(); -- Gitblit v1.9.1