Documentation

SelectOptionsBuilder
in package

Builder class for generating HTML select options.

Provides methods for building various types of select option lists used throughout the application.

Tags
since
3.0.0

Table of Contents

Methods

buildChooseOption()  : string
Build a choose prompt option for select elements.
buildFilterOffOption()  : string
Build a filter-off option for select elements.
buildFromArray()  : string
Build options from an associative array.
forAllTagsActions()  : string
Build all tags actions dropdown options.
forAllWordsActions()  : string
Build all words actions dropdown options.
forAndOr()  : string
Build AND/OR logical operator options.
forAnnotationPosition()  : string
Build annotation position selection options.
forHoverTranslation()  : string
Build hover/click translation settings options.
forLanguages()  : string
Build language select options from data array.
forLanguageSize()  : string
Build language size selection options (100% to 250%).
forMultipleArchivedTextsActions()  : string
Build multiple archived texts actions dropdown options.
forMultipleTagsActions()  : string
Build multiple tags actions dropdown options.
forMultipleTextsActions()  : string
Build multiple texts actions dropdown options.
forMultipleWordsActions()  : string
Build multiple words actions dropdown options.
forPagination()  : string
Build pagination options.
forPlaybackRate()  : string
Build playback rate selection options (0.5x to 1.5x).
forRegexMode()  : string
Build regex mode selection options.
forSeconds()  : string
Build seconds selection options (1-10 seconds).
forSentenceCount()  : string
Build sentence count selection options.
forTagSort()  : string
Build tag sorting options.
forTexts()  : string
Build text select options from data array.
forTextSort()  : string
Build text sorting options.
forThemes()  : string
Build theme select options from data array.
forTooltipType()  : string
Build tooltip type selection options.
forWordSort()  : string
Build word sorting options.
forWordStatus()  : string
Build word status select options with optional ranges.
forWordStatusRadio()  : string
Build word status radio options.
forWordsToDoButtons()  : string
Build "words to do" button options.

Methods

buildChooseOption()

Build a choose prompt option for select elements.

public static buildChooseOption() : string
Return values
string

HTML option element

buildFilterOffOption()

Build a filter-off option for select elements.

public static buildFilterOffOption([int|string|null $selected = null ]) : string
Parameters
$selected : int|string|null = null

Currently selected value

Return values
string

HTML option element

buildFromArray()

Build options from an associative array.

public static buildFromArray(array<int|string, string> $options[, int|string|null $selected = null ]) : string
Parameters
$options : array<int|string, string>

Array of value => label pairs

$selected : int|string|null = null

Currently selected value

Return values
string

HTML options string

forAllTagsActions()

Build all tags actions dropdown options.

public static forAllTagsActions() : string
Return values
string

HTML options string

forAllWordsActions()

Build all words actions dropdown options.

public static forAllWordsActions() : string
Return values
string

HTML options string

forAndOr()

Build AND/OR logical operator options.

public static forAndOr([int|string|null $selected = null ]) : string
Parameters
$selected : int|string|null = null

Currently selected value (default: 0)

Return values
string

HTML options string

forAnnotationPosition()

Build annotation position selection options.

public static forAnnotationPosition([int|string|null $selected = null ]) : string
Parameters
$selected : int|string|null = null

Currently selected value (default: 1)

Return values
string

HTML options string

forHoverTranslation()

Build hover/click translation settings options.

public static forHoverTranslation([int|string|null $selected = null ]) : string
Parameters
$selected : int|string|null = null

Currently selected value (default: 1)

Return values
string

HTML options string

forLanguages()

Build language select options from data array.

public static forLanguages(array<int, array{id: int, name: string}> $languages, int|string|null $selected[, string $defaultText = '[Filter off]' ]) : string
Parameters
$languages : array<int, array{id: int, name: string}>

Language data from LanguageFacade

$selected : int|string|null

Selected language ID

$defaultText : string = '[Filter off]'

Default option text

Return values
string

HTML options string

forLanguageSize()

Build language size selection options (100% to 250%).

public static forLanguageSize([int|string|null $selected = null ]) : string
Parameters
$selected : int|string|null = null

Currently selected value (default: 100)

Return values
string

HTML options string

forMultipleArchivedTextsActions()

Build multiple archived texts actions dropdown options.

public static forMultipleArchivedTextsActions() : string
Return values
string

HTML options string

forMultipleTagsActions()

Build multiple tags actions dropdown options.

public static forMultipleTagsActions() : string
Return values
string

HTML options string

forMultipleTextsActions()

Build multiple texts actions dropdown options.

public static forMultipleTextsActions() : string
Return values
string

HTML options string

forMultipleWordsActions()

Build multiple words actions dropdown options.

public static forMultipleWordsActions() : string
Return values
string

HTML options string

forPagination()

Build pagination options.

public static forPagination(int $currentPage, int $totalPages) : string
Parameters
$currentPage : int

Current page number

$totalPages : int

Total number of pages

Return values
string

HTML options string

forPlaybackRate()

Build playback rate selection options (0.5x to 1.5x).

public static forPlaybackRate([int|string|null $selected = null ]) : string
Parameters
$selected : int|string|null = null

Currently selected value (default: '10' = 1.0x)

Return values
string

HTML options string

forRegexMode()

Build regex mode selection options.

public static forRegexMode([string|null $selected = null ]) : string
Parameters
$selected : string|null = null

Currently selected value

Return values
string

HTML options string

forSeconds()

Build seconds selection options (1-10 seconds).

public static forSeconds([int|string|null $selected = null ]) : string
Parameters
$selected : int|string|null = null

Currently selected value (default: 5)

Return values
string

HTML options string

forSentenceCount()

Build sentence count selection options.

public static forSentenceCount([int|string|null $selected = null ]) : string
Parameters
$selected : int|string|null = null

Currently selected value (default: 1)

Return values
string

HTML options string

forTagSort()

Build tag sorting options.

public static forTagSort([int|string|null $selected = null ]) : string
Parameters
$selected : int|string|null = null

Currently selected value (default: 1)

Return values
string

HTML options string

forTexts()

Build text select options from data array.

public static forTexts(array<int, array{id: int, title: string, language: string}> $texts, int|string|null $selected[, bool $showLanguage = true ]) : string
Parameters
$texts : array<int, array{id: int, title: string, language: string}>

Text data from TextService

$selected : int|string|null

Selected text ID

$showLanguage : bool = true

Whether to prefix with language name

Return values
string

HTML options string

forTextSort()

Build text sorting options.

public static forTextSort([int|string|null $selected = null ]) : string
Parameters
$selected : int|string|null = null

Currently selected value (default: 1)

Return values
string

HTML options string

forThemes()

Build theme select options from data array.

public static forThemes(array<int, array{path: string, name: string, description?: string, mode?: string, highlighting?: string, wordBreaking?: string}> $themes, string|null $selected) : string
Parameters
$themes : array<int, array{path: string, name: string, description?: string, mode?: string, highlighting?: string, wordBreaking?: string}>

Theme data from ThemeService

$selected : string|null

Selected theme path

Return values
string

HTML options string

forTooltipType()

Build tooltip type selection options.

public static forTooltipType([int|string|null $selected = null ]) : string

Note: JqueryUI option was removed when jQuery was removed from the codebase. Only native tooltips are now supported.

Parameters
$selected : int|string|null = null

Currently selected value (default: 1)

Return values
string

HTML options string

forWordSort()

Build word sorting options.

public static forWordSort([int|string|null $selected = null ]) : string

Note: The original code has duplicate option values (4 and 7 both map to "Oldest first" in different contexts). This method preserves that behavior.

Parameters
$selected : int|string|null = null

Currently selected value (default: 1)

Return values
string

HTML options string

forWordStatus()

Build word status select options with optional ranges.

public static forWordStatus(int|string|null $selected, bool $all, bool $not9899[, bool $off = true ]) : string
Parameters
$selected : int|string|null

Currently selected status

$all : bool

Include "Filter off" and ranges

$not9899 : bool

Exclude statuses 98 and 99

$off : bool = true

Include "Filter off" option (when $all is true)

Return values
string

HTML options string

forWordStatusRadio()

Build word status radio options.

public static forWordStatusRadio([int|string|null $selected = null ]) : string
Parameters
$selected : int|string|null = null

Currently selected status (default: 1)

Return values
string

HTML radio options string

forWordsToDoButtons()

Build "words to do" button options.

public static forWordsToDoButtons([int|string|null $selected = null ]) : string
Parameters
$selected : int|string|null = null

Currently selected value (default: "1")

Return values
string

HTML options string


        
On this page

Search results