X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Foptions.php;h=189f1f714cec8fd6630ad260e47fbae44a06d9a5;hb=c3806a9dc07e4bf45491e7120a1c931332f2e555;hp=0e8d32ed4d87938dd399bd808c9091bf1bb28d53;hpb=ca479ad18c00a6a4ff2ddfb58a2f0af40bc81379;p=squirrelmail.git diff --git a/functions/options.php b/functions/options.php index 0e8d32ed..189f1f71 100644 --- a/functions/options.php +++ b/functions/options.php @@ -3,11 +3,10 @@ /** * options.php * - * Copyright (c) 1999-2005 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. - * * Functions needed to display the options pages. * + * @copyright © 1999-2006 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail * @subpackage prefs @@ -143,6 +142,13 @@ class SquirrelOption { * @var bool */ var $htmlencoded=false; + /** + * Controls folder list limits in SMOPT_TYPE_FLDRLIST widget. + * See $flag argument in sqimap_mailbox_option_list() function. + * @var string + * @since 1.5.1 + */ + var $folder_filter='noselect'; /** * Constructor function @@ -170,10 +176,10 @@ class SquirrelOption { $this->post_script = ''; /* Check for a current value. */ - if (!empty($initial_value)) { - $this->value = $initial_value; - } else if (isset($GLOBALS[$name])) { + if (isset($GLOBALS[$name])) { $this->value = $GLOBALS[$name]; + } else if (!empty($initial_value)) { + $this->value = $initial_value; } else { $this->value = ''; } @@ -255,6 +261,15 @@ class SquirrelOption { $this->save_function = $save_function; } + /** + * Set the trailing_text for this option. + * @param string $folder_filter + * @since 1.5.1 + */ + function setFolderFilter($folder_filter) { + $this->folder_filter = $folder_filter; + } + /** * Creates fields on option pages according to option type * @@ -384,14 +399,14 @@ class SquirrelOption { function createWidget_FolderList() { $selected = array(strtolower($this->value)); - /* Begin the select tag. */ - $result = "\n"; + return ($ret); + } } /** @@ -611,14 +636,14 @@ function create_option_groups($optgrps, $optvals) { foreach ($grpopts as $optset) { /* Create a new option with all values given. */ $next_option = new SquirrelOption( - $optset['name'], - $optset['caption'], - $optset['type'], - (isset($optset['refresh']) ? $optset['refresh'] : SMOPT_REFRESH_NONE), - (isset($optset['initial_value']) ? $optset['initial_value'] : ''), - (isset($optset['posvals']) ? $optset['posvals'] : ''), - (isset($optset['htmlencoded']) ? $optset['htmlencoded'] : false) - ); + $optset['name'], + $optset['caption'], + $optset['type'], + (isset($optset['refresh']) ? $optset['refresh'] : SMOPT_REFRESH_NONE), + (isset($optset['initial_value']) ? $optset['initial_value'] : ''), + (isset($optset['posvals']) ? $optset['posvals'] : ''), + (isset($optset['htmlencoded']) ? $optset['htmlencoded'] : false) + ); /* If provided, set the size for this option. */ if (isset($optset['size'])) { @@ -650,6 +675,11 @@ function create_option_groups($optgrps, $optvals) { $next_option->setPostScript($optset['post_script']); } + /* If provided, set the folder_filter for this option. */ + if (isset($optset['folder_filter'])) { + $next_option->setFolderFilter($optset['folder_filter']); + } + /* Add this option to the option array. */ $result[$grpkey]['options'][] = $next_option; } @@ -704,4 +734,4 @@ function OptionSubmit( $name ) { } // vim: et ts=4 -?> \ No newline at end of file +?>