Class SquirrelOption

Description

SquirrelOption: An option for SquirrelMail.

Located in /functions/options.php (line 21)


	
			
Variable Summary
string $caption
boolean $caption_wrap
string $comment
string $name
mixed $new_value
string $no_text
string $post_script
integer $refresh_level
integer $size
integer $type
boolean $use_add_widget
mixed $value
string $yes_text
Method Summary
SquirrelOption SquirrelOption (array $raw_option_array, string $name, string $caption, integer $type, integer $refresh_level, [mixed $initial_value = ''], [array $possible_values = ''], [bool $htmlencoded = false])
void changed ()
string createWidget ()
string createWidget_Boolean ([boolean $checkbox = TRUE])
string createWidget_Float ()
string createWidget_FolderList ([boolean $multiple_select = FALSE])
string createWidget_Info ()
string createWidget_String ([boolean $password = FALSE])
string createWidget_StrList ([boolean $multiple_select = FALSE], [boolean $radio_buttons = FALSE])
void save ()
void setCaptionWrap (boolean $caption_wrap)
void setComment (string $comment)
void setExtraAttributes (array $aExtraAttribs)
void setFolderFilter (string $folder_filter)
void setLayoutType (int $layout_type)
void setNewValue (mixed $new_value)
void setNoText (string $no_text)
void setPossValueFolders ( $poss_value_folders)
void setPostScript (string $post_script)
void setSaveFunction (string $save_function)
void setSize (integer $size)
void setTrailingText (string $trailing_text)
void setUseAddWidget ( $use_add_widget)
void setUseDeleteWidget ( $use_delete_widget)
void setValue (mixed $value)
void setYesText (string $yes_text)
Variables
array $aExtraAttribs (line 132)

additional javascript or other widget attributes added to the user input; must be an array where keys are attribute names ("onclick", etc) and values are the attribute values.

string $caption (line 36)

The text that prefaces setting on the preferences page

boolean $caption_wrap (line 41)

Whether or not the caption text is allowed to wrap

string $comment (line 125)

text displayed to the user

Used with SMOPT_TYPE_COMMENT options

string $folder_filter = 'noselect' (line 182)

Controls folder list limits in SMOPT_TYPE_FLDRLIST and

SMOPT_TYPE_FLDRLIST_MULTI widgets as well as the optional embedded folder lists provided for inputting values for the SMOPT_TYPE_EDIT_LIST and SMOPT_TYPE_EDIT_LIST_ASSOCIATIVE :idgets. See $flag argument in sqimap_mailbox_option_list() function.

  • since: 1.5.1
bool $htmlencoded = false (line 171)

disables html sanitizing.

WARNING - don't use it, if user input is possible in option or use own sanitizing functions. Currently only works for SMOPT_TYPE_STRLIST.

int $layout_type (line 91)

Some widgets support more than one layout type

string $name (line 31)

The name of this setting

mixed $new_value (line 156)

new option value

string $no_text (line 85)

Text that overrides the "No" label for boolean radio option widgets

array $possible_values (line 163)

associative array, where each key is an actual input value

and the corresponding value is what is displayed to the user for that list item in the drop-down list

array $poss_value_folders (line 118)

associative array, treated the same as $possible_values

(see its documentation below), but usually expected to have its first value contain a list of IMAP folders, an array itself in the format as passed back by sqimap_mailbox_list(). Used to display folder selector for possible values of an associative edit list option widget

  • since: 1.5.2
string $post_script (line 138)

script (usually Javascript) that will be placed after (outside of)

the INPUT tag

array $raw_option_array (line 26)

The original option configuration array

integer $refresh_level (line 56)

Indicates if a link should be shown to refresh part or all of the window

See SMOPT_REFRESH_* defines

string $save_function (line 144)

The name of the Save Function for this option.

integer $size (line 63)

Specifies the size of certain input items

See SMOPT_SIZE_* defines

string $trailing_text (line 71)

Text that follows a text input or select list input on the preferences page

useful for indicating units, meanings of special values, etc.

integer $type (line 48)

The type of INPUT element

See SMOPT_TYPE_* defines

boolean $use_add_widget (line 98)

Indicates if the Add widget should be included with edit lists.

boolean $use_delete_widget (line 105)

Indicates if the Delete widget should be included with edit lists.

mixed $value (line 151)

default/preselected value for this option

string $yes_text (line 78)

Text that overrides the "Yes" label for boolean radio option widgets

Methods
Constructor SquirrelOption (line 195)

Constructor function

SquirrelOption SquirrelOption (array $raw_option_array, string $name, string $caption, integer $type, integer $refresh_level, [mixed $initial_value = ''], [array $possible_values = ''], [bool $htmlencoded = false])
  • array $raw_option_array
  • string $name
  • string $caption
  • integer $type
  • integer $refresh_level
  • mixed $initial_value
  • array $possible_values
  • bool $htmlencoded
changed (line 914)
void changed ()
createWidget (line 381)

Creates fields on option pages according to option type

This is the function that calls all other createWidget* functions.

  • return: The formated option field
string createWidget ()
createWidget_Boolean (line 709)

Create boolean widget

When creating Yes/No radio buttons, the "yes_text" and "no_text" option attributes are used to override the typical "Yes" and "No" text.

  • return: html formated boolean widget
string createWidget_Boolean ([boolean $checkbox = TRUE])
  • boolean $checkbox: When TRUE, the widget will be constructed as a checkbox, otherwise it will be a set of Yes/No radio buttons (OPTIONAL; default is TRUE (checkbox)).
createWidget_Comment (line 750)

Creates comment

  • return: comment
string createWidget_Comment ()
createWidget_EditList (line 765)

Creates a (non-associative) edit list

Note that multiple layout types are supported for this widget. $this->layout_type must be one of the SMOPT_EDIT_LIST_LAYOUT_* constants.

  • return: html formated list of edit fields and their associated controls
string createWidget_EditList ()
createWidget_EditListAssociative (line 827)

Creates an associative edit list

Note that multiple layout types are supported for this widget. $this->layout_type must be one of the SMOPT_EDIT_LIST_LAYOUT_* constants.

  • return: html formated list of edit fields and their associated controls
string createWidget_EditListAssociative ()
createWidget_Float (line 680)

Creates field for floating number

Difference from createWidget_String is visible only when javascript is enabled

  • return: html formated option field
string createWidget_Float ()
createWidget_FolderList (line 593)

Create folder selection box

  • return: html formated selection box
string createWidget_FolderList ([boolean $multiple_select = FALSE])
  • boolean $multiple_select: When TRUE, the select widget will allow multiple selections (OPTIONAL; default is FALSE (single select list))
createWidget_Hidden (line 742)

Creates hidden field

  • return: html formated hidden input field
string createWidget_Hidden ()
createWidget_Info (line 471)

Creates info block

  • return: html formated output
string createWidget_Info ()
createWidget_Integer (line 662)

Creates field for integer

Difference from createWidget_String is visible only when javascript is enabled

  • return: html formated option field
string createWidget_Integer ()
createWidget_String (line 485)

Create string field

  • return: html formated option field
string createWidget_String ([boolean $password = FALSE])
  • boolean $password: When TRUE, the text in the input widget will be obscured (OPTIONAL; default = FALSE).
createWidget_StrList (line 538)

Create selection box or radio button group

When $this->htmlencoded is TRUE, the keys and values in $this->possible_values are assumed to be display-safe. Use with care!

Note that when building radio buttons instead of a select widget, if the "size" attribute is SMOPT_SIZE_TINY, the radio buttons will be output one after another without linebreaks between them. Otherwise, each radio button goes on a line of its own.

  • return: html formated selection box or radio buttons
string createWidget_StrList ([boolean $multiple_select = FALSE], [boolean $radio_buttons = FALSE])
  • boolean $multiple_select: When TRUE, the select widget will allow multiple selections (OPTIONAL; default is FALSE (single select list))
  • boolean $radio_buttons: When TRUE, the widget will instead be built as a group of radio buttons (and $multiple_select will be forced to FALSE) (OPTIONAL; default is FALSE (select widget))
createWidget_Submit (line 897)

Creates a submit button

  • return: html formated submit button widget
string createWidget_Submit ()
createWidget_TextArea (line 644)

Creates textarea

  • return: html formated textarea field
string createWidget_TextArea ()
is_multiple_valued (line 244)

Convenience function that identifies which types of

void is_multiple_valued ()
save (line 906)
void save ()
setCaptionWrap (line 271)

Set whether the caption is allowed to wrap for this option.

void setCaptionWrap (boolean $caption_wrap)
  • boolean $caption_wrap
setComment (line 336)

Set the comment for this option.

void setComment (string $comment)
  • string $comment
setExtraAttributes (line 344)

Set the extra attributes for this option.

void setExtraAttributes (array $aExtraAttribs)
  • array $aExtraAttribs
setFolderFilter (line 369)

Set the folder_filter for this option.

  • since: 1.5.1
void setFolderFilter (string $folder_filter)
  • string $folder_filter
setLayoutType (line 328)

Set the layout type for this option.

void setLayoutType (int $layout_type)
  • int $layout_type
setNewValue (line 263)

Set the new value for this option.

void setNewValue (mixed $new_value)
  • mixed $new_value
setNoText (line 303)

Set the no_text for this option.

void setNoText (string $no_text)
  • string $no_text
setPossValueFolders (line 320)
void setPossValueFolders ( $poss_value_folders)
  • $poss_value_folders
setPostScript (line 352)

Set the "post script" for this option.

void setPostScript (string $post_script)
  • string $post_script
setSaveFunction (line 360)

Set the save function for this option.

void setSaveFunction (string $save_function)
  • string $save_function
setSize (line 279)

Set the size for this option.

void setSize (integer $size)
  • integer $size
setTrailingText (line 287)

Set the trailing_text for this option.

void setTrailingText (string $trailing_text)
  • string $trailing_text
setUseAddWidget (line 308)
void setUseAddWidget ( $use_add_widget)
  • $use_add_widget
setUseDeleteWidget (line 313)
void setUseDeleteWidget ( $use_delete_widget)
  • $use_delete_widget
setValue (line 255)

Set the value for this option.

void setValue (mixed $value)
  • mixed $value
setYesText (line 295)

Set the yes_text for this option.

void setYesText (string $yes_text)
  • string $yes_text

Documentation generated on Sat, 25 Oct 2014 04:18:58 +0200 by phpDocumentor 1.4.3