Umfragen
|
the widget base class, all widgets should extend it More...
Public Member Functions | |
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_required () | |
checks if widget's name is in $_POST (question answered) if the widget is a required question | |
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 | |
$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 |
Private Attributes | |
$data = array() |
the widget base class, all widgets should extend it
Definition at line 13 of file widgetBaseClass.class.php.
check_max | ( | ) |
checks if a maximum limit of different answers to a question has been exceeded
Reimplemented in checkBoxSingle.
Definition at line 363 of file widgetBaseClass.class.php.
check_required | ( | ) |
checks if widget's name is in $_POST (question answered) if the widget is a required question
Reimplemented in container, radioButtonList, and checkBoxList.
Definition at line 335 of file widgetBaseClass.class.php.
check_vital_vars | ( | ) |
checks if widget::typ widget::name widget::index and widget::pollID are set
varException | "widget cars not set" |
Definition at line 321 of file widgetBaseClass.class.php.
display_chartType_edit_generic | ( | $allowed, | |
$allowed_names | |||
) |
prints widget chart type select edit
array | $allowed | list of allowed chartypes for this widget |
array | $allowed_names | list of allowed chartypes for this widget pretty print names |
Definition at line 561 of file widgetBaseClass.class.php.
display_dispName_edit | ( | ) |
prints display name edit
Reimplemented in textExt, and matrix.
Definition at line 505 of file widgetBaseClass.class.php.
display_edit_begin | ( | ) |
prints edit toolbar and widget container div for a widget. Used as link to widget's edit page
Definition at line 443 of file widgetBaseClass.class.php.
display_name_edit | ( | ) |
prints edit widget name
Definition at line 477 of file widgetBaseClass.class.php.
display_required_edit | ( | ) |
prints widget is_required checkbox edit
Definition at line 533 of file widgetBaseClass.class.php.
get_config | ( | $name | ) |
gets an config variable or it's default value
string | $name | variable name |
Reimplemented in buttonListContainer, text, schedule, checkBox, radioButtonList, checkBoxList, and radioButton.
Definition at line 181 of file widgetBaseClass.class.php.
get_data | ( | $name | ) |
gets a data variable or it's default value
string | $name | variable name |
Reimplemented in checkBox, radioButton, schedule, checkBoxSingle, and matrixQuestion.
Definition at line 306 of file widgetBaseClass.class.php.
handle_chartType_edit_generic | ( | $allowed | ) |
handles widget chart type select edit and sets config value
array | $allowed | list of allowed chartypes for this widget |
Definition at line 582 of file widgetBaseClass.class.php.
handle_dispName_edit | ( | ) |
handles widget display name edit and sets widget:: dispName
Reimplemented in textExt, and matrix.
Definition at line 516 of file widgetBaseClass.class.php.
handle_name_edit | ( | ) |
handles widget name edit and sets widget::name
Definition at line 488 of file widgetBaseClass.class.php.
handle_required_edit | ( | ) |
handles widget is_required checkbox edit and sets widget::is_required
Definition at line 546 of file widgetBaseClass.class.php.
init_config | ( | ) |
initialise config. unserialize when necessary
exception | when serialized config is corrupted |
Definition at line 59 of file widgetBaseClass.class.php.
save_config | ( | $db | ) |
saves the widget config array to database
db | $db | the database instance |
Definition at line 599 of file widgetBaseClass.class.php.
save_dispName | ( | $db | ) |
saves the widget's display name widget::dispName
db | $db | the database instance |
Definition at line 611 of file widgetBaseClass.class.php.
save_name | ( | $db, | |
$new_name | |||
) |
sets the widget's name in the result table and the widget table
db | $db | the database instance |
string | $new_name | the name to be set |
Definition at line 629 of file widgetBaseClass.class.php.
save_required | ( | $db | ) |
saves the widget's is required widget::is_required
db | $db | the database instance |
Definition at line 620 of file widgetBaseClass.class.php.
serialize_config | ( | ) |
makes a string (php serializer) of the widget config and stores it in widget::config
Definition at line 33 of file widgetBaseClass.class.php.
set_config | ( | $name, | |
$val | |||
) |
sets a config variable
string | $name | configvar name to be set |
mixed | $val | value to be set |
Reimplemented in buttonListContainer, schedule, text, checkBox, radioButtonList, radioButton, and checkBoxList.
Definition at line 78 of file widgetBaseClass.class.php.
set_data | ( | $name, | |
$val | |||
) |
sets a data variable. Data is meant for non persistend data storage such as count
string | $name | data name to be set |
mixed | $val | value to be set |
Reimplemented in checkBox, checkBoxSingle, radioButton, schedule, and matrixQuestion.
Definition at line 293 of file widgetBaseClass.class.php.
set_dispName | ( | $dispName | ) |
sets widget's display name by escaping html characters ant checking for a maximum length of 256 chars
string | $dispName | name to be set |
Definition at line 389 of file widgetBaseClass.class.php.
set_name | ( | $name | ) |
sets widget's name. Max 25 chars. Sets the widget's ID if input is empty
string | $name | name to be set Only 0-9 a-z A-Z and _ are allowed. |
Definition at line 411 of file widgetBaseClass.class.php.
unserialize_config | ( | ) |
takes widget::config in string form (php serializer) and makes an array
Definition at line 42 of file widgetBaseClass.class.php.
Config array, can be serialized as string.
Definition at line 18 of file widgetBaseClass.class.php.
|
private |
Definition at line 25 of file widgetBaseClass.class.php.
$direct_result = true |
widget has a row in the result table
Definition at line 28 of file widgetBaseClass.class.php.
$dispName |
User friendly name for the widget. Used to ask the question.
Definition at line 20 of file widgetBaseClass.class.php.
$ID |
widget's ID
Definition at line 22 of file widgetBaseClass.class.php.
$index |
Index in the widget_list.
Definition at line 21 of file widgetBaseClass.class.php.
$is_child = false |
is the widget a child of another widget or a child of a poll?
Definition at line 23 of file widgetBaseClass.class.php.
$is_required = false |
Is the widget a required question?
Definition at line 19 of file widgetBaseClass.class.php.
$long_result = false |
Definition at line 27 of file widgetBaseClass.class.php.
$name |
The name of the widget, used for columname in the result table. Using the widget's ID in simple poll mode.
Definition at line 16 of file widgetBaseClass.class.php.
$parent = -1 |
the parent's ID if the widget is a child
Definition at line 24 of file widgetBaseClass.class.php.
ID of the poll the widget belongs to.
Definition at line 15 of file widgetBaseClass.class.php.
Place to store data. For output_widget it's the shown data, for input_widget it's the result data.
Definition at line 17 of file widgetBaseClass.class.php.