Umfragen
matrix Class Reference
Inheritance diagram for matrix:
container iWidget input_widget output_widget countable_widget chartable_widget widget

Public Member Functions

 set_default_values ($db)
 sets the widget and option list
 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.
 display_question_list_edit ($polltype)
 handle_question_list_edit ()
 display_chartType_edit ()
 handle_chartType_edit ()
 display_show_charts_edit ()
 handle_show_charts_edit ()
 display_dispName_edit ()
 handle_dispName_edit ()
 display_numberQuestion_edit ()
 handle_numberQuestion_edit ()
 display_edit ()
 prints a widget on screen with edit buttons for the edit page
 display ()
 handle_inpt ()
 count ($db)
 counts results
 chart_make ()
 makes the chartobject and loads count. Must be executed before any chart action
 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 container
 __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
 check_required ()
 checks for each child widget widget::check_required()
 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()
- 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
 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_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 ()
 set_config ($name, $val)
 get_config ($name)
 check_vital_vars ()
 check_required ()
 check_max ()
 set_dispName ($dispName)
 set_name ($name)
 display_edit_begin ()
 display_name_edit ()
 handle_name_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 = "matrix"
 $child_widgets_whitelist = array("matrixQuestion")
 defines a whitelist of widgettypes if the array is empty all types are allowed
 $child_options_whitelist = array("matrixOption")
 defines a whitelist of widgettypes if the array is empty all types are allowed
 $direct_result = false
 $question_list = array()
- Data Fields inherited from container
 $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
- 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

 get_best_display_cell_width ()
 display_question ($question, $option_len, $bold="")
 chart_format_data_barChart ()
 formats the count data to be displayed with a barChart
 chart_format_data_barChart2 ()
 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_barChart2 ()
 displays the legend for barChart
 chart_display_legend_pieChart ($widget)
 displays the legend for pieChart

Detailed Description

Definition at line 7 of file matrix.class.php.

Member Function Documentation

chart_display ( )

display legend and the chart

Implements chartable_widget.

Definition at line 691 of file matrix.class.php.

chart_display_chart ( )

display only the chart

Implements chartable_widget.

Definition at line 682 of file matrix.class.php.

chart_display_legend ( )

displays the legend for the chart

Implements chartable_widget.

Definition at line 666 of file matrix.class.php.

chart_display_legend_barChart ( )
private

displays the legend for barChart

Definition at line 576 of file matrix.class.php.

chart_display_legend_barChart2 ( )
private

displays the legend for barChart

Definition at line 612 of file matrix.class.php.

chart_display_legend_pieChart (   $widget)
private

displays the legend for pieChart

Parameters
widgetmatrixQuestion

Definition at line 650 of file matrix.class.php.

chart_format_data ( )

formats data for charting

Returns
array of formatted data

Implements chartable_widget.

Definition at line 555 of file matrix.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 500 of file matrix.class.php.

chart_format_data_barChart2 ( )
private

formats the count data to be displayed with a barChart

Returns
array formatted for input into barChart

Definition at line 520 of file matrix.class.php.

chart_format_data_pieChart ( )
private

formats the count data to be displayed with a pieChart

Returns
array 0=> array formatted for input into pieChart, 1 => widget list

Definition at line 540 of file matrix.class.php.

chart_make ( )

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

Implements chartable_widget.

Definition at line 466 of file matrix.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 426 of file matrix.class.php.

display ( )

Reimplemented from container.

Definition at line 332 of file matrix.class.php.

display_chartType_edit ( )

Definition at line 185 of file matrix.class.php.

display_dispName_edit ( )
See Also
widget::display_dispName_edit()

Implements iWidget.

Definition at line 220 of file matrix.class.php.

display_edit ( )

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

Implements iWidget.

Definition at line 285 of file matrix.class.php.

display_numberQuestion_edit ( )

Definition at line 245 of file matrix.class.php.

display_option_list_edit (   $polltype)

prints the edit form for the option list.

Parameters
int$polltypethe type of the poll (advanced or simple)

should be overriden when extending

Reimplemented from container.

Definition at line 70 of file matrix.class.php.

display_question (   $question,
  $option_len,
  $bold = "" 
)
private

Definition at line 264 of file matrix.class.php.

display_question_list_edit (   $polltype)

Definition at line 127 of file matrix.class.php.

display_show_charts_edit ( )

Definition at line 197 of file matrix.class.php.

get_best_display_cell_width ( )
private

Definition at line 44 of file matrix.class.php.

handle_chartType_edit ( )

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

handle_dispName_edit ( )
See Also
widget::handle_dispName_edit()

Implements iWidget.

Definition at line 230 of file matrix.class.php.

handle_inpt ( )

Reimplemented from container.

Definition at line 383 of file matrix.class.php.

handle_numberQuestion_edit ( )

Definition at line 255 of file matrix.class.php.

handle_option_list_edit ( )

handles the edit form for the option list.

See Also
container::display_option_list_edit()

should be overriden when extending

Reimplemented from container.

Definition at line 84 of file matrix.class.php.

handle_question_list_edit ( )

Definition at line 145 of file matrix.class.php.

handle_show_charts_edit ( )

Definition at line 205 of file matrix.class.php.

set_default_values (   $db)

sets the widget and option list

Parameters
db$dbdatabase objetc
See Also
iwidget::set_default_values()

should be overriden when extending

Reimplemented from container.

Definition at line 15 of file matrix.class.php.

Field Documentation

$child_options_whitelist = array("matrixOption")

defines a whitelist of widgettypes if the array is empty all types are allowed

Definition at line 10 of file matrix.class.php.

$child_widgets_whitelist = array("matrixQuestion")

defines a whitelist of widgettypes if the array is empty all types are allowed

Definition at line 9 of file matrix.class.php.

$direct_result = false

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

$question_list = array()

Definition at line 13 of file matrix.class.php.

$typ = "matrix"

Definition at line 8 of file matrix.class.php.


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