Umfragen
|
container base class. Container widgets should extend this. More...
Public Member Functions | |
__construct () | |
get_option_by_id ($ID) | |
gets an option from the container::option_list by ID | |
get_widget_by_id ($ID) | |
gets a widget from the container::widget_list by ID | |
get_all_childs () | |
gets a list of all child widgets and options | |
set_options ($options) | |
sets a list of options | |
set_widgets ($widgets) | |
sets a list of child widgets | |
insert_option ($index=-1, &$opt) | |
inserts an option into container::option_list | |
insert_widget ($index=-1, &$opt) | |
inserts a widget into container::widget_list | |
delete_option ($db, $id) | |
deletes an option | |
delete_widget ($db, $id) | |
deletes a widget | |
move_option ($db, $index1, $index2) | |
moves an option from one index to another | |
move_widget ($db, $index1, $index2) | |
moves a widget from one index to another | |
set_default_values ($db) | |
sets the widget and option list | |
check_required () | |
checks for each child widget widget::check_required() | |
display_option_list_edit ($polltype) | |
prints the edit form for the option list. | |
handle_option_list_edit () | |
handles the edit form for the option list. | |
save_option_list ($db) | |
saves the option list to database using db::mass_update_widget() | |
save_widget_list ($db) | |
saves the widget list to database using db::mass_update_widget() | |
display () | |
handle_inpt () | |
![]() | |
serialize_config () | |
makes a string (php serializer) of the widget config and stores it in widget::config | |
unserialize_config () | |
takes widget::config in string form (php serializer) and makes an array | |
init_config () | |
initialise config. unserialize when necessary | |
set_config ($name, $val) | |
sets a config variable | |
get_config ($name) | |
gets an config variable or it's default value | |
set_data ($name, $val) | |
sets a data variable. Data is meant for non persistend data storage such as count | |
get_data ($name) | |
gets a data variable or it's default value | |
check_vital_vars () | |
checks if widget::typ widget::name widget::index and widget::pollID are set | |
check_max () | |
checks if a maximum limit of different answers to a question has been exceeded | |
set_dispName ($dispName) | |
sets widget's display name by escaping html characters ant checking for a maximum length of 256 chars | |
set_name ($name) | |
sets widget's name. Max 25 chars. Sets the widget's ID if input is empty | |
display_edit_begin () | |
prints edit toolbar and widget container div for a widget. Used as link to widget's edit page | |
display_name_edit () | |
prints edit widget name | |
handle_name_edit () | |
handles widget name edit and sets widget::name | |
display_dispName_edit () | |
prints display name edit | |
handle_dispName_edit () | |
handles widget display name edit and sets widget:: dispName | |
display_required_edit () | |
prints widget is_required checkbox edit | |
handle_required_edit () | |
handles widget is_required checkbox edit and sets widget::is_required | |
display_chartType_edit_generic ($allowed, $allowed_names) | |
prints widget chart type select edit | |
handle_chartType_edit_generic ($allowed) | |
handles widget chart type select edit and sets config value | |
save_config ($db) | |
saves the widget config array to database | |
save_dispName ($db) | |
saves the widget's display name widget::dispName | |
save_required ($db) | |
saves the widget's is required widget::is_required | |
save_name ($db, $new_name) | |
sets the widget's name in the result table and the widget table |
Data Fields | |
$typ = "container" | |
$direct_result = false | |
true if the container itself holds the result of the question, false if the containing widgets should do this | |
$child_widgets_whitelist = array("*") | |
defines a whitelist of widgettypes "*" means all widgets | |
$child_options_whitelist = array("*") | |
defines a whitelist of widgettypes "*" means all widgets | |
$option_list = array() | |
the list of options to choose from (e.g. radioButtonList) | |
$widget_list = array() | |
the list of child widgets | |
![]() | |
$pollID | |
ID of the poll the widget belongs to. | |
$name | |
The name of the widget, used for columname in the result table. Using the widget's ID in simple poll mode. | |
$value | |
Place to store data. For output_widget it's the shown data, for input_widget it's the result data. | |
$config | |
Config array, can be serialized as string. | |
$is_required = false | |
Is the widget a required question? | |
$dispName | |
User friendly name for the widget. Used to ask the question. | |
$index | |
Index in the widget_list. | |
$ID | |
widget's ID | |
$is_child = false | |
is the widget a child of another widget or a child of a poll? | |
$parent = -1 | |
the parent's ID if the widget is a child | |
$long_result = false | |
$direct_result = true | |
widget has a row in the result table |
container base class. Container widgets should extend this.
Definition at line 209 of file container.class.php.
__construct | ( | ) |
Reimplemented in radioButtonList, and checkBoxList.
Definition at line 219 of file container.class.php.
check_required | ( | ) |
checks for each child widget widget::check_required()
Reimplemented from widget.
Reimplemented in radioButtonList, and checkBoxList.
Definition at line 396 of file container.class.php.
delete_option | ( | $db, | |
$id | |||
) |
deletes an option
db | $db | database objetc |
int | $id | option's ID |
Definition at line 321 of file container.class.php.
delete_widget | ( | $db, | |
$id | |||
) |
deletes a widget
db | $db | database objetc |
int | $id | widget's ID |
Definition at line 333 of file container.class.php.
display | ( | ) |
Reimplemented in schedule, textExt, matrix, label, radioButtonList, and checkBoxList.
Definition at line 500 of file container.class.php.
display_option_list_edit | ( | $polltype | ) |
prints the edit form for the option list.
int | $polltype | the type of the poll (advanced or simple) |
should be overriden when extending
Reimplemented in matrix.
Definition at line 419 of file container.class.php.
get_all_childs | ( | ) |
gets a list of all child widgets and options
Definition at line 245 of file container.class.php.
get_option_by_id | ( | $ID | ) |
gets an option from the container::option_list by ID
int | $ID | the ID of the option we want to get |
Definition at line 228 of file container.class.php.
get_widget_by_id | ( | $ID | ) |
gets a widget from the container::widget_list by ID
int | $ID | the ID of the widget we want to get |
Definition at line 237 of file container.class.php.
handle_inpt | ( | ) |
Reimplemented in schedule, matrix, textExt, radioButtonList, label, and checkBoxList.
Definition at line 504 of file container.class.php.
handle_option_list_edit | ( | ) |
handles the edit form for the option list.
should be overriden when extending
Reimplemented in matrix.
Definition at line 443 of file container.class.php.
insert_option | ( | $index = -1 , |
|
& | $opt | ||
) |
inserts an option into container::option_list
int | $index | the option's index |
widget | &$opt | the option to be inserted |
Definition at line 286 of file container.class.php.
insert_widget | ( | $index = -1 , |
|
& | $opt | ||
) |
inserts a widget into container::widget_list
int | $index | the widget's index |
widget | &$opt | the widget to be inserted |
Definition at line 304 of file container.class.php.
move_option | ( | $db, | |
$index1, | |||
$index2 | |||
) |
moves an option from one index to another
db | $db | database objetc |
int | $index1 | the index to move from |
int | $index2 | the index to move to |
Definition at line 348 of file container.class.php.
move_widget | ( | $db, | |
$index1, | |||
$index2 | |||
) |
moves a widget from one index to another
db | $db | database objetc |
int | $index1 | the index to move from |
int | $index2 | the index to move to |
Definition at line 366 of file container.class.php.
save_option_list | ( | $db | ) |
saves the option list to database using db::mass_update_widget()
db | $db | database object |
Definition at line 488 of file container.class.php.
save_widget_list | ( | $db | ) |
saves the widget list to database using db::mass_update_widget()
db | $db | database object |
Definition at line 496 of file container.class.php.
set_default_values | ( | $db | ) |
sets the widget and option list
db | $db | database objetc |
should be overriden when extending
Reimplemented in label, checkBoxList, radioButtonList, matrix, textExt, and schedule.
Definition at line 384 of file container.class.php.
set_options | ( | $options | ) |
sets a list of options
array | $options | a list of options (widgets) to be set. Ordered by index |
Definition at line 260 of file container.class.php.
set_widgets | ( | $widgets | ) |
sets a list of child widgets
array | $widgets | a list of widgets to be set. Ordered by index |
Definition at line 272 of file container.class.php.
$child_options_whitelist = array("*") |
defines a whitelist of widgettypes "*" means all widgets
Definition at line 213 of file container.class.php.
$child_widgets_whitelist = array("*") |
defines a whitelist of widgettypes "*" means all widgets
Definition at line 212 of file container.class.php.
$direct_result = false |
true if the container itself holds the result of the question, false if the containing widgets should do this
Definition at line 211 of file container.class.php.
$option_list = array() |
the list of options to choose from (e.g. radioButtonList)
Definition at line 215 of file container.class.php.
$typ = "container" |
Definition at line 210 of file container.class.php.
$widget_list = array() |
the list of child widgets
Definition at line 216 of file container.class.php.