From e40b0e8e41f95e772e5557fcdf15cfcc4e015165 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Tue, 7 Oct 2008 04:48:28 +0000 Subject: [PATCH] Allow control over white space wrapping of auto-generated SquirrelMail option widgets git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13295 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 2 ++ functions/options.php | 19 +++++++++++++++++++ templates/default/options.tpl | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b8629051..9d29f920 100644 --- a/ChangeLog +++ b/ChangeLog @@ -263,6 +263,8 @@ Version 1.5.2 - SVN using POP before SMTP. - Seed random number generator in one place during script init. - Add native output buffering. + - Allow control over white space wrapping of auto-generated SquirrelMail + option widgets. Version 1.5.1 (branched on 2006-02-12) -------------------------------------- diff --git a/functions/options.php b/functions/options.php index 84b8b9ae..022cc224 100644 --- a/functions/options.php +++ b/functions/options.php @@ -34,6 +34,11 @@ class SquirrelOption { * @var string */ var $caption; + /** + * Whether or not the caption text is allowed to wrap + * @var boolean + */ + var $caption_wrap; /** * The type of INPUT element * @@ -177,6 +182,7 @@ class SquirrelOption { $this->raw_option_array = $raw_option_array; $this->name = $name; $this->caption = $caption; + $this->caption_wrap = TRUE; $this->type = $type; $this->refresh_level = $refresh_level; $this->possible_values = $possible_values; @@ -238,6 +244,14 @@ class SquirrelOption { $this->new_value = $new_value; } + /** + * Set whether the caption is allowed to wrap for this option. + * @param boolean $caption_wrap + */ + function setCaptionWrap($caption_wrap) { + $this->caption_wrap = $caption_wrap; + } + /** * Set the size for this option. * @param integer $size @@ -910,6 +924,11 @@ function create_option_groups($optgrps, $optvals) { (isset($optset['htmlencoded']) ? $optset['htmlencoded'] : false) ); + /* If provided, set if the caption is allowed to wrap for this option. */ + if (isset($optset['caption_wrap'])) { + $next_option->setCaptionWrap($optset['caption_wrap']); + } + /* If provided, set the size for this option. */ if (isset($optset['size'])) { $next_option->setSize($optset['size']); diff --git a/templates/default/options.tpl b/templates/default/options.tpl index 17a2b550..03e23d44 100644 --- a/templates/default/options.tpl +++ b/templates/default/options.tpl @@ -45,7 +45,7 @@ foreach ($options as $option) { foreach ($option['options'] as $opt) { if ($opt->type != SMOPT_TYPE_HIDDEN) { echo "\n" . - " \n "; + " caption_wrap ? '' : ' style="white-space:nowrap"') . ">\n "; if ($opt->type == SMOPT_TYPE_BOOLEAN_CHECKBOX || $opt->type == SMOPT_TYPE_BOOLEAN) { -- 2.25.1