Class SquirrelOption

Description

SquirrelOption: An option for SquirrelMail.

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


	
			
Variable Summary
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])
SquirrelOption __construct (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 setTrailingTextIsHtml (boolean $trailing_text_is_html)
void setTrailingTextSmall (boolean $trailing_text_small)
void setUseAddWidget ( $use_add_widget)
void setUseDeleteWidget ( $use_delete_widget)
void setValue (mixed $value)
void setYesText (string $yes_text)
Variables
array $aExtraAttribs (line 147)

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 140)

text displayed to the user

Used with SMOPT_TYPE_COMMENT options

string $folder_filter = 'noselect' (line 197)

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 186)

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 106)

Some widgets support more than one layout type

string $name (line 31)

The name of this setting

mixed $new_value (line 171)

new option value

string $no_text (line 100)

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

array $possible_values (line 178)

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 133)

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 153)

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 159)

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.

boolean $trailing_text_is_html (line 86)

Indicates that the widget's "trailing text" contains HTML and should not thus be sanitized (encoded)

boolean $trailing_text_small (line 78)

Indicates that the widget's "trailing text" should be displayed in a smaller sized font

integer $type (line 48)

The type of INPUT element

See SMOPT_TYPE_* defines

boolean $use_add_widget (line 113)

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

boolean $use_delete_widget (line 120)

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

mixed $value (line 166)

default/preselected value for this option

string $yes_text (line 93)

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

Methods
Constructor SquirrelOption (line 272)

Constructor (PHP4 style, kept for compatibility reasons)

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
Constructor __construct (line 210)

Constructor (PHP5 style, required in some future version of PHP)

SquirrelOption __construct (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 972)
void changed ()
createWidget (line 432)

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 762)

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 804)

Creates comment

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

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 883)

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 733)

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 646)

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 796)

Creates hidden field

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

Creates info block

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

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 538)

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 591)

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 955)

Creates a submit button

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

Creates textarea

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

Convenience function that identifies which types of

void is_multiple_valued ()
save (line 964)
void save ()
setCaptionWrap (line 306)

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

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

Set the comment for this option.

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

Set the extra attributes for this option.

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

Set the folder_filter for this option.

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

Set the layout type for this option.

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

Set the new value for this option.

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

Set the no_text for this option.

void setNoText (string $no_text)
  • string $no_text
setPossValueFolders (line 371)
void setPossValueFolders ( $poss_value_folders)
  • $poss_value_folders
setPostScript (line 403)

Set the "post script" for this option.

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

Set the save function for this option.

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

Set the size for this option.

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

Set the trailing_text for this option.

void setTrailingText (string $trailing_text)
  • string $trailing_text
setTrailingTextIsHtml (line 338)

Set the trailing_text_is_html for this option.

void setTrailingTextIsHtml (boolean $trailing_text_is_html)
  • boolean $trailing_text_is_html
setTrailingTextSmall (line 330)

Set the trailing_text_small for this option.

void setTrailingTextSmall (boolean $trailing_text_small)
  • boolean $trailing_text_small
setUseAddWidget (line 359)
void setUseAddWidget ( $use_add_widget)
  • $use_add_widget
setUseDeleteWidget (line 364)
void setUseDeleteWidget ( $use_delete_widget)
  • $use_delete_widget
setValue (line 290)

Set the value for this option.

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

Set the yes_text for this option.

void setYesText (string $yes_text)
  • string $yes_text

Documentation generated on Mon, 13 Jan 2020 04:23:14 +0100 by phpDocumentor 1.4.3