Umfragen
checkBoxSingle Class Reference
Inheritance diagram for checkBoxSingle:
checkBox iWidget input_widget output_widget countable_widget chartable_widget widget iWidget input_widget output_widget

Public Member Functions

 check_max ()
 checks if the maximum for this widget is reached
 set_default_values ($db)
 sets default values and childs. Used when creating a new widget
 get_data ($name)
 gets a data variable or it's default value
 set_data ($name, $value)
 sets a data variable. Data is meant for non persistend data storage such as count
 display_option_edit ($polltype)
 handle_option_edit ()
 display_config_edit ()
 handle_config_edit ()
 display_chartType_edit ()
 handle_chartType_edit ()
 display_show_charts_edit ()
 handle_show_charts_edit ()
 display_max_edit ()
 handle_max_edit ()
 display_edit ()
 prints a widget on screen with edit buttons for the edit page
 display ()
 prints a widget on screen
 handle_inpt ()
 handles the answer to a question on form submit. Sets the values and generates error messages
 count ($db)
 counts results
 chart_make ()
 makes the chartobject and loads count. Must be executed before any chart action
 chart_format_data_doughnutChart ()
 formats the count data to be displayed with a doughnutChart
 chart_format_data ()
 formats data for charting
 chart_display_legend ()
 displays the legend for the chart
 chart_display_chart ()
 display only the chart
 chart_display ()
 display legend and the chart
- Public Member Functions inherited from checkBox
 __construct ()
 set_value ($val)
 get_config ($name)
 set_config ($name, $val)
 display ($sel=false, $columns="columns")
- Public Member Functions inherited from widget
 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
 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
 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
- Public Member Functions inherited from iWidget
 serialize_config ()
 unserialize_config ()
 check_vital_vars ()
 check_required ()
 set_dispName ($dispName)
 set_name ($name)
 display_edit_begin ()
 display_name_edit ()
 handle_name_edit ()
 display_dispName_edit ()
 handle_dispName_edit ()
 display_required_edit ()
 handle_required_edit ()
 display_chartType_edit_generic ($allowed, $allowed_names)
 handle_chartType_edit_generic ($allowed)
 save_config ($db)
 save_dispName ($db)
 save_required ($db)
 save_name ($db, $new_name)

Data Fields

 $typ = "checkBoxSingle"
 $direct_result = true
- Data Fields inherited from checkBox
 $typ = "checkBox"
 $direct_result = false
 widget has a row in the result table
- Data Fields inherited from widget
 $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 Member Functions

 chart_format_data_barChart ()
 formats the count data to be displayed with a barChart
 chart_format_data_pieChart ()
 formats the count data to be displayed with a pieChart
 chart_display_legend_barChart ()
 displays the legend for barChart
 chart_display_legend_pieChart ()
 displays the legend for pieChart
 chart_display_legend_doughnutChart ()
 displays the legend for doughnutChart

Detailed Description

Definition at line 2 of file checkBoxSingle.class.php.

Member Function Documentation

chart_display ( )

display legend and the chart

Implements chartable_widget.

Definition at line 439 of file checkBoxSingle.class.php.

chart_display_chart ( )

display only the chart

Implements chartable_widget.

Definition at line 430 of file checkBoxSingle.class.php.

chart_display_legend ( )

displays the legend for the chart

Implements chartable_widget.

Definition at line 414 of file checkBoxSingle.class.php.

chart_display_legend_barChart ( )
private

displays the legend for barChart

Definition at line 378 of file checkBoxSingle.class.php.

chart_display_legend_doughnutChart ( )
private

displays the legend for doughnutChart

Definition at line 409 of file checkBoxSingle.class.php.

chart_display_legend_pieChart ( )
private

displays the legend for pieChart

Definition at line 384 of file checkBoxSingle.class.php.

chart_format_data ( )

formats data for charting

Returns
array of formatted data

Implements chartable_widget.

Definition at line 359 of file checkBoxSingle.class.php.

chart_format_data_barChart ( )
private

formats the count data to be displayed with a barChart

Returns
array formatted for input into barChart

Definition at line 329 of file checkBoxSingle.class.php.

chart_format_data_doughnutChart ( )

formats the count data to be displayed with a doughnutChart

Returns
array formatted for input into doughnutChart

Definition at line 354 of file checkBoxSingle.class.php.

chart_format_data_pieChart ( )
private

formats the count data to be displayed with a pieChart

Returns
array formatted for input into pieChart

Definition at line 343 of file checkBoxSingle.class.php.

chart_make ( )

makes the chartobject and loads count. Must be executed before any chart action

Implements chartable_widget.

Definition at line 303 of file checkBoxSingle.class.php.

check_max ( )

checks if the maximum for this widget is reached

Returns
bool true if ok, string with error message if "no space left"

if the value of the widget (answer) is already set to true then the test is passed (preserve values). So execute this BEFORE inserting data, otherwise the limit won't be taken in consideration.

Implements iWidget.

Definition at line 12 of file checkBoxSingle.class.php.

count (   $db)

counts results

Parameters
db$dbdatabase object

executes SQL through the database class individually for each widgettype a data "count" enty is created

Implements countable_widget.

Definition at line 268 of file checkBoxSingle.class.php.

display ( )

prints a widget on screen

Implements output_widget.

Definition at line 208 of file checkBoxSingle.class.php.

display_chartType_edit ( )

Definition at line 128 of file checkBoxSingle.class.php.

display_config_edit ( )

Definition at line 82 of file checkBoxSingle.class.php.

display_edit ( )

prints a widget on screen with edit buttons for the edit page

Reimplemented from checkBox.

Definition at line 191 of file checkBoxSingle.class.php.

display_max_edit ( )

Definition at line 165 of file checkBoxSingle.class.php.

display_option_edit (   $polltype)

Reimplemented from checkBox.

Definition at line 75 of file checkBoxSingle.class.php.

display_show_charts_edit ( )

Definition at line 140 of file checkBoxSingle.class.php.

get_data (   $name)

gets a data variable or it's default value

Parameters
string$namevariable name
Returns
mixed data

Reimplemented from checkBox.

Definition at line 42 of file checkBoxSingle.class.php.

handle_chartType_edit ( )

Definition at line 134 of file checkBoxSingle.class.php.

handle_config_edit ( )

Definition at line 99 of file checkBoxSingle.class.php.

handle_inpt ( )

handles the answer to a question on form submit. Sets the values and generates error messages

Returns
bool true on success, else error string

Reimplemented from checkBox.

Definition at line 244 of file checkBoxSingle.class.php.

handle_max_edit ( )

Definition at line 171 of file checkBoxSingle.class.php.

handle_option_edit ( )

Reimplemented from checkBox.

Definition at line 78 of file checkBoxSingle.class.php.

handle_show_charts_edit ( )

Definition at line 148 of file checkBoxSingle.class.php.

set_data (   $name,
  $val 
)

sets a data variable. Data is meant for non persistend data storage such as count

Parameters
string$namedata name to be set
mixed$valvalue to be set
Returns
true if success else error string

Reimplemented from checkBox.

Definition at line 60 of file checkBoxSingle.class.php.

set_default_values (   $db)

sets default values and childs. Used when creating a new widget

Reimplemented from checkBox.

Definition at line 38 of file checkBoxSingle.class.php.

Field Documentation

$direct_result = true

Definition at line 4 of file checkBoxSingle.class.php.

$typ = "checkBoxSingle"

Definition at line 3 of file checkBoxSingle.class.php.


The documentation for this class was generated from the following file: