X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Foptions.php;h=f900140248ee29fee0d21bd2c10dddbc6f7221a4;hp=036e43c7589f9278435e5d10964cc1a5847f3599;hb=5a42c1017d480d84a59ec0ec994db74f002cd340;hpb=21f6d2ea3a607714be0fabb7e29d5c0f9b8e0c27 diff --git a/functions/options.php b/functions/options.php index 036e43c7..f9001402 100644 --- a/functions/options.php +++ b/functions/options.php @@ -202,6 +202,14 @@ class SquirrelOption { } } + /** Convenience function that identifies which types of + widgets are stored as (serialized) array values. */ + function is_multiple_valued() { + return ($this->type == SMOPT_TYPE_FLDRLIST_MULTI + || $this->type == SMOPT_TYPE_STRLIST_MULTI + || $this->type == SMOPT_TYPE_EDIT_LIST); + } + /** * Set the value for this option. * @param mixed $value @@ -673,8 +681,7 @@ function save_option($option) { // Certain option types need to be serialized because // they are not scalar // - } else if ($option->type == SMOPT_TYPE_FLDRLIST_MULTI - || $option->type == SMOPT_TYPE_STRLIST_MULTI) + } else if ($option->is_multiple_valued()) setPref($data_dir, $username, $option->name, serialize($option->new_value)); else