|
Umfragen
|
Public Member Functions | |
| set_status ($db, $status) | |
| sets the status of the poll and saves it to the database | |
| set_anonymous ($db, $au, $val) | |
| set or unset the poll anonymous status. Saves to db and checks if the result table is empty | |
| set_is_public ($db, $au, $val) | |
| make the poll public. Saving to database | |
| set_name ($name) | |
| sets the poll's name. does not save to database. | |
| make_id_hash () | |
| generates a more or less random but unique identifier harder to guess than a bare ID | |
| delete ($db) | |
| sets the status of the poll to deleted. Savng to database | |
| set_config ($name, $value) | |
| sets a config variable | |
| get_config ($name) | |
| gets a config variable | |
| serialize_config () | |
| serialize the config into a string | |
| get_widget_by_id ($ID) | |
| get a widget by it's ID, searches also recursively in container widgets | |
| get_widget_by_name ($name) | |
| get a widget by it's name. Searches recursively in container widgets and returnes the first widget found | |
| is_group_in_groups ($group) | |
| checks if the given group is in the poll's group array. | |
| get_active_since_timestammp () | |
| gets a unix timestamp for active_since saved in MYSQL format | |
| get_timeout_timestamp () | |
| gets a unix timestamp for timeout date saved in MYSQL format | |
| get_timeout_string () | |
| gets a human readable string for the timeout date | |
| get_widget_default_font_config ($conf) | |
| checks all widgets for the most used font config values | |
| check_setup_complete ($r=false) | |
| checks if the setup si complete for activation of the poll | |
| load ($db) | |
| loads only the widget list from thew database the pollID has to be set | |
| load_from_id ($db, $pollID) | |
| loads the complete poll ready to use from the database | |
| load_values_from_id ($db, $username) | |
| loads the result values for a username | |
| load_widget_result_count ($db) | |
| executes the count method on every countable widget so the count data is available | |
| insert_widget ($index=-1, $w) | |
| inserts a widget into the widget list at a given position | |
| delete_widget ($db, $id) | |
| delete a widget by ID, delete also from database | |
| move_widget ($db, $index1, $index2) | |
| moves a widget from index1 to index2 | |
| save_name ($db) | |
| save the poll name to the database | |
| save_groups ($db) | |
| save the group settings for the poll | |
| save_timeout ($db) | |
| save the timeout settings. The format must be correct for the database | |
| save_noDisplay ($db) | |
| save setting if we want to display the poll onto the start page db $db the database object | |
| save_theme ($db) | |
| save the selected theme db $db the database object | |
| save_config ($db) | |
| serialize and save the config db $db the database object | |
| display () | |
| display the widgets if they implement output_widget | |
| handle_inpt () | |
| executes handle_input on all widgets implementing input_widget | |
| display_name_edit () | |
| display name edit for poll's name | |
| handle_name_edit () | |
| hande the name edit name has to be less than 256 characters | |
| display_groups_edit ($auth, $whitelist=array()) | |
| display a list of all groups for selection | |
| handle_groups_edit ($auth, $whitelist=array()) | |
| handles the groups edit and sets the groups | |
| display_timeout_edit () | |
| display the edit for the poll's timeout. Uses jquerry but has a non js fallback | |
| handle_timeout_edit () | |
| handles the timeout edit of the poll and checks the date | |
| display_status_edit () | |
| displays the status edit. active incomplete deactivated template and archive | |
| handle_status_edit ($db) | |
| handles the status edit throws error if not possible to activate sets direct to the database | |
| display_export_edit () | |
| displays a export box for exporting the polls results | |
| handle_export_edit (db $db, $dl) | |
| handles the export edit and exports the results | |
| display_font_family_edit () | |
| displays a select for the font family | |
| handle_font_family_edit () | |
| handles the font family config and sets the font family for all widgets | |
| display_font_size_edit () | |
| displays a drop down for selecting the poll's font size | |
| handle_font_size_edit () | |
| handles pol's font size and sets it into all widget's config | |
| display_questions_bold_edit () | |
| displays a checkbox for selecting if the questions of the poll should be bold | |
| handle_questions_bold_edit () | |
| handles if the questions should be bold and saves the config to all widgets | |
| display_noDisplay_edit () | |
| displays a checkbox for selectig if we display the poll onto the start page | |
| handle_noDisplay_edit () | |
| display_anonymous2_edit () | |
| display a drop down menu for selecting if the poll is anonymous, public or normal | |
| handle_anonymous2_edit ($db, $au) | |
| tries to set anonymous status according to the user's selection | |
| handle_anonymous_edit () | |
| sets anonymous status use anonymous2 functions instead | |
| display_theme_edit () | |
| displays a drop down list of available themes. Themes are located in /CSS/Themes | |
| handle_theme_edit () | |
| handles the theme edit. reset to none on error | |
| display_notification_edit () | |
| display checkboxes for email notification feature | |
| handle_notification_edit () | |
| handles notification edit | |
Data Fields | |
| $widget_list | |
| list containing the widgets. | |
| $ID | |
| the unique poll ID .. should be always set | |
| $hashID | |
| a more or less unique ID difficult to guess. Used in public polls as ID | |
| $name | |
| the polls's name provided by the user | |
| $timeout | |
| time out string in MYSQL format | |
| $active_since | |
| MYSQL timestamp since when the poll came active. Used by "new" indicator. | |
| $groups = array() | |
| list of group IDs for who has access to the poll | |
| $status | |
| polls status integer .. for a list see config.php | |
| $owner = 0 | |
| numerical user ID of the owner and creator of the poll. | |
| $owner_fn = "" | |
| Full name of the owner for displaying. | |
| $type = 0 | |
| Integer for advanced mode or simple mode. | |
| $anonymous = false | |
| is this a anonymous poll? | |
| $is_public = false | |
| is this a public poll? note in the DB this is int 2 in the databases anonymous column | |
| $noDisplay = false | |
| shall we display the poll on the home page | |
| $theme = "" | |
| the themes css file name including .css extention | |
| $local_monthNames | |
Private Member Functions | |
| display_timeout_option ($i, $seleced) | |
| used for displaying a select option for the i-th element of a number list | |
| format_int_2digit ($i) | |
| formats a integer to two digits min | |
Private Attributes | |
| $config = array() | |
| containing the config array unserialized from the database | |
Definition at line 25 of file poll.class.php.
| check_setup_complete | ( | $r = false | ) |
checks if the setup si complete for activation of the poll
| bool | $r | if true return a array of the reasons or if false only return a bolean |
the test are the following: name, if not public the groups, timeout and the widget list must not be empty
Definition at line 376 of file poll.class.php.
| delete | ( | $db | ) |
sets the status of the poll to deleted. Savng to database
| db | $db | database object |
Definition at line 176 of file poll.class.php.
| delete_widget | ( | $db, | |
| $id | |||
| ) |
delete a widget by ID, delete also from database
| db | $db | database object |
| int | $id | the widget's ID |
Definition at line 556 of file poll.class.php.
| display | ( | ) |
display the widgets if they implement output_widget
Definition at line 734 of file poll.class.php.
| display_anonymous2_edit | ( | ) |
display a drop down menu for selecting if the poll is anonymous, public or normal
Definition at line 1326 of file poll.class.php.
| display_export_edit | ( | ) |
displays a export box for exporting the polls results
Definition at line 1122 of file poll.class.php.
| display_font_family_edit | ( | ) |
displays a select for the font family
Definition at line 1171 of file poll.class.php.
| display_font_size_edit | ( | ) |
displays a drop down for selecting the poll's font size
Definition at line 1230 of file poll.class.php.
| display_groups_edit | ( | $auth, | |
$whitelist = array() |
|||
| ) |
display a list of all groups for selection
| auth | $auth | authentification object to get the group list |
| array | $whitelist | the group whitelist can be empty |
Definition at line 800 of file poll.class.php.
| display_name_edit | ( | ) |
display name edit for poll's name
Definition at line 767 of file poll.class.php.
| display_noDisplay_edit | ( | ) |
displays a checkbox for selectig if we display the poll onto the start page
Definition at line 1302 of file poll.class.php.
| display_notification_edit | ( | ) |
display checkboxes for email notification feature
Definition at line 1461 of file poll.class.php.
| display_questions_bold_edit | ( | ) |
displays a checkbox for selecting if the questions of the poll should be bold
Definition at line 1275 of file poll.class.php.
| display_status_edit | ( | ) |
displays the status edit. active incomplete deactivated template and archive
Definition at line 1059 of file poll.class.php.
| display_theme_edit | ( | ) |
displays a drop down list of available themes. Themes are located in /CSS/Themes
Definition at line 1399 of file poll.class.php.
| display_timeout_edit | ( | ) |
display the edit for the poll's timeout. Uses jquerry but has a non js fallback
Definition at line 904 of file poll.class.php.
|
private |
used for displaying a select option for the i-th element of a number list
| int | $i | the number most likely out of a iteration loop |
| int | $selected | the number of the selected element |
Definition at line 891 of file poll.class.php.
|
private |
formats a integer to two digits min
| int | $i | the integer to format |
Definition at line 983 of file poll.class.php.
| get_active_since_timestammp | ( | ) |
gets a unix timestamp for active_since saved in MYSQL format
Definition at line 286 of file poll.class.php.
| get_config | ( | $name | ) |
gets a config variable
| string | $name | variable name |
Definition at line 198 of file poll.class.php.
| get_timeout_string | ( | ) |
gets a human readable string for the timeout date
Definition at line 318 of file poll.class.php.
| get_timeout_timestamp | ( | ) |
gets a unix timestamp for timeout date saved in MYSQL format
Definition at line 302 of file poll.class.php.
| get_widget_by_id | ( | $ID | ) |
get a widget by it's ID, searches also recursively in container widgets
| int | the widgett's ID |
Definition at line 229 of file poll.class.php.
| get_widget_by_name | ( | $name | ) |
get a widget by it's name. Searches recursively in container widgets and returnes the first widget found
| int | the widgett's name |
Definition at line 251 of file poll.class.php.
| get_widget_default_font_config | ( | $conf | ) |
checks all widgets for the most used font config values
| string | $conf | config variable name: font-family, font-size or font-bold |
Definition at line 344 of file poll.class.php.
| handle_anonymous2_edit | ( | $db, | |
| $au | |||
| ) |
tries to set anonymous status according to the user's selection
| db | $db | database object |
| auth | $au | authentification object |
Definition at line 1354 of file poll.class.php.
| handle_anonymous_edit | ( | ) |
sets anonymous status use anonymous2 functions instead
Definition at line 1381 of file poll.class.php.
| handle_export_edit | ( | db | $db, |
| $dl | |||
| ) |
handles the export edit and exports the results
| db | $db | the database object |
| bool | $dl | true if we want to present the csv file to download |
Definition at line 1142 of file poll.class.php.
| handle_font_family_edit | ( | ) |
handles the font family config and sets the font family for all widgets
Definition at line 1203 of file poll.class.php.
| handle_font_size_edit | ( | ) |
handles pol's font size and sets it into all widget's config
Definition at line 1255 of file poll.class.php.
| handle_groups_edit | ( | $auth, | |
$whitelist = array() |
|||
| ) |
handles the groups edit and sets the groups
| auth | $auth | the authentification object |
| array | $whitelist | the group whitelist can be an empty array |
Definition at line 834 of file poll.class.php.
| handle_inpt | ( | ) |
executes handle_input on all widgets implementing input_widget
Definition at line 746 of file poll.class.php.
| handle_name_edit | ( | ) |
hande the name edit name has to be less than 256 characters
Definition at line 776 of file poll.class.php.
| handle_noDisplay_edit | ( | ) |
| handle_notification_edit | ( | ) |
handles notification edit
Definition at line 1480 of file poll.class.php.
| handle_questions_bold_edit | ( | ) |
handles if the questions should be bold and saves the config to all widgets
Definition at line 1288 of file poll.class.php.
| handle_status_edit | ( | $db | ) |
handles the status edit throws error if not possible to activate sets direct to the database
| db | $db | database object |
Definition at line 1088 of file poll.class.php.
| handle_theme_edit | ( | ) |
handles the theme edit. reset to none on error
Definition at line 1434 of file poll.class.php.
| handle_timeout_edit | ( | ) |
handles the timeout edit of the poll and checks the date
Definition at line 996 of file poll.class.php.
| insert_widget | ( | $index = -1, |
|
| $w | |||
| ) |
inserts a widget into the widget list at a given position
| int | $index | index where to insert -1 for the end of the list |
| widget | $w | the widget object we want insert |
Definition at line 518 of file poll.class.php.
| is_group_in_groups | ( | $group | ) |
checks if the given group is in the poll's group array.
| int | $group | the numerical ID of the group we want to check |
if the group "*" is in the poll's grouplist then any group will be accepted
Definition at line 273 of file poll.class.php.
| load | ( | $db | ) |
loads only the widget list from thew database the pollID has to be set
| db | $db | database object |
Definition at line 419 of file poll.class.php.
| load_from_id | ( | $db, | |
| $pollID | |||
| ) |
loads the complete poll ready to use from the database
| db | $db | database object |
| int | $pollID | the ID of the poll we want to load |
Definition at line 429 of file poll.class.php.
| load_values_from_id | ( | $db, | |
| $username | |||
| ) |
loads the result values for a username
| db | $db | the databaseobject |
| string | $username | the user's username |
Definition at line 469 of file poll.class.php.
| load_widget_result_count | ( | $db | ) |
executes the count method on every countable widget so the count data is available
| db | $db | database object |
Definition at line 494 of file poll.class.php.
| make_id_hash | ( | ) |
generates a more or less random but unique identifier harder to guess than a bare ID
Definition at line 162 of file poll.class.php.
| move_widget | ( | $db, | |
| $index1, | |||
| $index2 | |||
| ) |
moves a widget from index1 to index2
| db | $db | database object |
| int | $index1 | index of the widget we want to move |
| int | $index2 | index we want to move to bool true on success else false on failure |
Definition at line 596 of file poll.class.php.
| save_config | ( | $db | ) |
serialize and save the config db $db the database object
Definition at line 720 of file poll.class.php.
| save_groups | ( | $db | ) |
save the group settings for the poll
| db | $db | database object |
Definition at line 670 of file poll.class.php.
| save_name | ( | $db | ) |
save the poll name to the database
| db | $db | databaseobject |
Definition at line 661 of file poll.class.php.
| save_noDisplay | ( | $db | ) |
save setting if we want to display the poll onto the start page db $db the database object
Definition at line 702 of file poll.class.php.
| save_theme | ( | $db | ) |
save the selected theme db $db the database object
Definition at line 711 of file poll.class.php.
| save_timeout | ( | $db | ) |
save the timeout settings. The format must be correct for the database
| db | $db | database object |
Definition at line 693 of file poll.class.php.
| serialize_config | ( | ) |
serialize the config into a string
| string | of serialized config |
Definition at line 213 of file poll.class.php.
| set_anonymous | ( | $db, | |
| $au, | |||
| $val | |||
| ) |
set or unset the poll anonymous status. Saves to db and checks if the result table is empty
| db | $db | database object |
| auth | $au | autehntification object (obsolete?) |
| bool | $val | true means anonymous poll |
You can only change anonymousity if the result table ist empty ! This function also makes a Klassenliste if the user is a teacher
Definition at line 80 of file poll.class.php.
| set_config | ( | $name, | |
| $value | |||
| ) |
sets a config variable
| string | $name | variable name |
| mixed | $value | the value we want set |
Definition at line 185 of file poll.class.php.
| set_is_public | ( | $db, | |
| $au, | |||
| $val | |||
| ) |
make the poll public. Saving to database
| db | $db | database object |
| auth | $au | autehntification object |
| bool | $val | true means public poll |
You can only publish a anonymous poll. If zou do not so, an error message ist provided Use set_anonymous for this
Definition at line 119 of file poll.class.php.
| set_name | ( | $name | ) |
sets the poll's name. does not save to database.
| string | $name | a name string with less than 256 characters |
the string is htmlspecialchars escaped and saved so. So zou can print it anywhere
Definition at line 149 of file poll.class.php.
| set_status | ( | $db, | |
| $status | |||
| ) |
sets the status of the poll and saves it to the database
| db | $db | database object |
| integer | $status | a valid status int |
Definition at line 61 of file poll.class.php.
| $active_since |
MYSQL timestamp since when the poll came active. Used by "new" indicator.
Definition at line 32 of file poll.class.php.
| $anonymous = false |
is this a anonymous poll?
Definition at line 38 of file poll.class.php.
|
private |
containing the config array unserialized from the database
Definition at line 48 of file poll.class.php.
| $groups = array() |
list of group IDs for who has access to the poll
Definition at line 33 of file poll.class.php.
| $hashID |
a more or less unique ID difficult to guess. Used in public polls as ID
Definition at line 29 of file poll.class.php.
| $ID |
the unique poll ID .. should be always set
Definition at line 28 of file poll.class.php.
| $is_public = false |
is this a public poll? note in the DB this is int 2 in the databases anonymous column
Definition at line 39 of file poll.class.php.
| $local_monthNames |
Definition at line 43 of file poll.class.php.
| $name |
the polls's name provided by the user
Definition at line 30 of file poll.class.php.
| $noDisplay = false |
shall we display the poll on the home page
Definition at line 40 of file poll.class.php.
| $owner = 0 |
numerical user ID of the owner and creator of the poll.
Definition at line 35 of file poll.class.php.
| $owner_fn = "" |
Full name of the owner for displaying.
Definition at line 36 of file poll.class.php.
| $status |
polls status integer .. for a list see config.php
Definition at line 34 of file poll.class.php.
| $theme = "" |
the themes css file name including .css extention
Definition at line 41 of file poll.class.php.
| $timeout |
time out string in MYSQL format
Definition at line 31 of file poll.class.php.
| $type = 0 |
Integer for advanced mode or simple mode.
Definition at line 37 of file poll.class.php.
| $widget_list |
list containing the widgets.
Definition at line 27 of file poll.class.php.