X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Foptions.php;h=7b60af67ea5b414d51ad394437ac07a85b677bf0;hb=991c88e71dc934df78cc7db33bceac29e0343c98;hp=421fe5572921a3e8b1a68803d5353968d77bcd7d;hpb=598294a727a2789b7c562ee7083da703c8bb0628;p=squirrelmail.git diff --git a/functions/options.php b/functions/options.php index 421fe557..7b60af67 100644 --- a/functions/options.php +++ b/functions/options.php @@ -3,13 +3,13 @@ /** * 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 */ /**********************************************/ @@ -142,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 @@ -168,11 +175,11 @@ class SquirrelOption { $this->script = ''; $this->post_script = ''; - /* Check for a current value. */ - if (!empty($initial_value)) { - $this->value = $initial_value; - } else if (isset($GLOBALS[$name])) { + //Check for a current value. + if (isset($GLOBALS[$name])) { $this->value = $GLOBALS[$name]; + } else if (!empty($initial_value)) { + $this->value = $initial_value; } else { $this->value = ''; } @@ -254,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 * @@ -383,14 +399,14 @@ class SquirrelOption { function createWidget_FolderList() { $selected = array(strtolower($this->value)); - /* Begin the select tag. */ - $result = "\n"; + return ($ret); + } } /** @@ -610,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'])) { @@ -649,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; } @@ -703,4 +734,3 @@ function OptionSubmit( $name ) { } // vim: et ts=4 -?> \ No newline at end of file