\web\lib\adminOptionDisplay

We need to display previously set options in various forms. This class covers the ways to do that; the generated page content can then be parsed with OptionParser.

Summary

Methods
Properties
Constants
__construct()
prefilledOptionTable()
optiontext()
No public properties found
TYPECODE_STRING
TYPECODE_INTEGER
TYPECODE_TEXT
TYPECODE_BOOLEAN
No protected methods found
No protected properties found
N/A
addOption()
noPrefillText()
prefillText()
$listOfOptions
$level
$allLocationCount
$optionIterator
N/A

Constants

TYPECODE_STRING

TYPECODE_STRING = 0

TYPECODE_INTEGER

TYPECODE_INTEGER = 4

TYPECODE_TEXT

TYPECODE_TEXT = 1

TYPECODE_BOOLEAN

TYPECODE_BOOLEAN = 3

Properties

$listOfOptions

$listOfOptions : mixed|string|int

stores all the options we are caring about

Type

mixed|string|int —

$level

$level : 

on which level are we operating?

Type

$allLocationCount

$allLocationCount : 

a counter storing how many locations are to be displayed

Type

$optionIterator

$optionIterator : 

When "fresh" options are displayed (HTML select/otion fields, optionally with language, and of varying data types) we want to give each option the same prominence and iterate over all options in the list. This variable keeps track how many option HTML code we've already sent, so that we can iterate correctly.

Only used inside noPrefillText variant of the optiontext() call

Type

Methods

__construct()

__construct(mixed|string|int  options,   level) 

Which attributes are we talking about?

Parameters

mixed|string|int options

the options of interest

level

the level on which these options were defined by the user

prefilledOptionTable()

prefilledOptionTable(  attributePrefix) : 

creates a table with all the set options prefilled. Only displays options of the category indicated.

Parameters

attributePrefix

category of option to display

Returns

HTML code

None found

optiontext()

optiontext(mixed|string|int  list,   prefillValue = NULL,   prefillLang = NULL) : 

Displays a container for options. Either with prefilled data or empty; if empty then has HTML <input> tags with clever javaScript to allow selection of different option names and types

Parameters

mixed|string|int list

options which should be displayed; can be only exactly one if existing option, or multiple if new option type

prefillValue

for an existing option, it's value to be displayed

prefillLang

for an existing option, the language of the value to be displayed

Returns

HTML code

addOption()

addOption(  class, mixed|string|int  prepopulate = []) 

Displays options for a given option class.

Parameters

class

the class of options that is to be displayed

mixed|string|int prepopulate

should an empty set of fillable options be displayed, or do we have existing data to prefill with

noPrefillText()

noPrefillText(  rowid, mixed|string|int  list) : 

HTML code to display a "fresh" option (including type selector and JavaScript to show/hide relevant input fields)

Parameters

rowid

the HTML field base name of the option to be displayed

mixed|string|int list

the list of option names to include in the type selector

Throws

\Exception

Returns

HTML code

prefillText()

prefillText(  rowid,   optionName,   optionValue,   optionLang) : 

generates HTML code that displays an already set option.

Parameters

rowid

the HTML field base name of the option to be displayed

optionName

the name of the option to display

optionValue

the value of the option to display

optionLang

the language of the option to display

Throws

\Exception

Returns

HTML code