Base class for representing a column in a question_bank_view.
More...
|
bool | $isheading = false |
| determine whether the column is td or th.
|
|
view | $qbank |
| $qbank the question bank view we are helping to render.
|
|
Base class for representing a column in a question_bank_view.
- Copyright
- 2009 Tim Hunt
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core_question\bank\column_base::__construct |
( |
view |
$qbank | ) |
|
Constructor.
- Parameters
-
view | $qbank | the question bank view we are helping to render. |
◆ display()
core_question\bank\column_base::display |
( |
|
$question, |
|
|
|
$rowclasses |
|
) |
| |
Output this column.
- Parameters
-
object | $question | the row from the $question table, augmented with extra information. |
string | $rowclasses | CSS class names that should be applied to this row of output. |
◆ display_content()
core_question\bank\column_base::display_content |
( |
|
$question, |
|
|
|
$rowclasses |
|
) |
| |
|
abstractprotected |
Output the contents of this column.
- Parameters
-
object | $question | the row from the $question table, augmented with extra information. |
string | $rowclasses | CSS class names that should be applied to this row of output. |
Reimplemented in mod_quiz\question\bank\add_action_column, mod_quiz\question\bank\question_name_text_column, core_question\bank\checkbox_column, core_question\bank\creator_name_column, core_question\bank\edit_menu_column, core_question\bank\menu_action_column_base, core_question\bank\modifier_name_column, core_question\bank\preview_action_column, core_question\bank\question_name_column, core_question\bank\question_name_idnumber_tags_column, core_question\bank\question_text_row, core_question\bank\question_type_column, and core_question\bank\tags_action_column.
◆ display_end()
core_question\bank\column_base::display_end |
( |
|
$question, |
|
|
|
$rowclasses |
|
) |
| |
|
protected |
◆ display_start()
core_question\bank\column_base::display_start |
( |
|
$question, |
|
|
|
$rowclasses |
|
) |
| |
|
protected |
Output the opening column tag.
If it is set as heading, it will use
tag instead of
- Parameters
-
stdClass | $question | |
string | $rowclasses | |
Reimplemented in core_question\bank\row_base.
◆ get_classes()
core_question\bank\column_base::get_classes |
( |
| ) |
|
|
protected |
- Return values
-
string | the CSS classes to apply to every cell in this column. |
◆ get_extra_classes()
core_question\bank\column_base::get_extra_classes |
( |
| ) |
|
◆ get_extra_joins()
core_question\bank\column_base::get_extra_joins |
( |
| ) |
|
Return an array 'table_alias' => 'JOIN clause' to bring in any data that this column required.
The return values for all the columns will be checked. It is OK if two columns join in the same table with the same alias and identical JOIN clauses. If to columns try to use the same alias with different joins, you get an error. The only table included by default is the question table, which is aliased to 'q'.
It is importnat that your join simply adds additional data (or NULLs) to the existing rows of the query. It must not cause additional rows.
- Return values
-
array | 'table_alias' => 'JOIN clause' |
Reimplemented in core_question\bank\action_column_base, core_question\bank\creator_name_column, core_question\bank\modifier_name_column, and core_question\bank\question_text_row.
◆ get_name()
core_question\bank\column_base::get_name |
( |
| ) |
|
|
abstract |
Get the internal name for this column.
Used as a CSS class name, and to store information about the current sort. Must match PARAM_ALPHA.
- Return values
-
Reimplemented in mod_quiz\question\bank\add_action_column, mod_quiz\question\bank\question_name_text_column, core_question\bank\checkbox_column, core_question\bank\copy_action_column, core_question\bank\creator_name_column, core_question\bank\delete_action_column, core_question\bank\edit_action_column, core_question\bank\edit_menu_column, core_question\bank\export_xml_action_column, core_question\bank\modifier_name_column, core_question\bank\preview_action_column, core_question\bank\question_name_column, core_question\bank\question_name_idnumber_tags_column, core_question\bank\question_text_row, core_question\bank\question_type_column, and core_question\bank\tags_action_column.
◆ get_required_fields()
core_question\bank\column_base::get_required_fields |
( |
| ) |
|
- Return values
-
array | fields required. use table alias 'q' for the question table, or one of the ones from get_extra_joins. Every field requested must specify a table prefix. |
Reimplemented in mod_quiz\question\bank\question_name_text_column, core_question\bank\action_column_base, core_question\bank\checkbox_column, core_question\bank\creator_name_column, core_question\bank\delete_action_column, core_question\bank\edit_menu_column, core_question\bank\modifier_name_column, core_question\bank\question_name_column, core_question\bank\question_name_idnumber_tags_column, core_question\bank\question_text_row, and core_question\bank\question_type_column.
◆ get_sort_icon()
core_question\bank\column_base::get_sort_icon |
( |
|
$reverse | ) |
|
|
protected |
Get an icon representing the corrent sort state.
- Parameters
-
bool | $reverse | sort is descending, not ascending. |
- Return values
-
◆ get_title()
core_question\bank\column_base::get_title |
( |
| ) |
|
|
abstractprotected |
◆ get_title_tip()
core_question\bank\column_base::get_title_tip |
( |
| ) |
|
|
protected |
◆ init()
core_question\bank\column_base::init |
( |
| ) |
|
|
protected |
◆ is_sortable()
core_question\bank\column_base::is_sortable |
( |
| ) |
|
Can this column be sorted on? You can return either:
- false for no (the default),
- a field name, if sorting this column corresponds to sorting on that datbase field.
- an array of subnames to sort on as follows return array( 'firstname' => array('field' => 'uc.firstname', 'title' => get_string('firstname')), 'lastname' => array('field' => 'uc.lastname', 'title' => get_string('lastname')), ); As well as field, and field, you can also add 'revers' => 1 if you want the default sort order to be DESC.
- Return values
-
Reimplemented in core_question\bank\creator_name_column, core_question\bank\modifier_name_column, core_question\bank\question_name_column, core_question\bank\question_name_idnumber_tags_column, and core_question\bank\question_type_column.
◆ load_additional_data()
core_question\bank\column_base::load_additional_data |
( |
array |
$questions | ) |
|
◆ load_question_tags()
core_question\bank\column_base::load_question_tags |
( |
array |
$questions | ) |
|
◆ make_sort_link()
core_question\bank\column_base::make_sort_link |
( |
|
$sort, |
|
|
|
$title, |
|
|
|
$tip, |
|
|
|
$defaultreverse = false |
|
) |
| |
|
protected |
Get a link that changes the sort order, and indicates the current sort state.
- Parameters
-
string | $sort | the column to sort on. |
string | $title | the link text. |
string | $tip | the link tool-tip text. If empty, defaults to title. |
bool | $defaultreverse | whether the default sort order for this column is descending, rather than ascending. |
- Return values
-
◆ sort_expression()
core_question\bank\column_base::sort_expression |
( |
|
$reverse, |
|
|
|
$subsort |
|
) |
| |
- Parameters
-
bool | $reverse | Whether to sort in the reverse of the default sort order. |
string | $subsort | if is_sortable returns an array of subnames, then this will be one of those. Otherwise will be empty. |
- Return values
-
string | some SQL to go in the order by clause. |
◆ sortorder()
core_question\bank\column_base::sortorder |
( |
|
$reverse | ) |
|
|
protected |
Helper method for building sort clauses.
- Parameters
-
bool | $reverse | whether the normal direction should be reversed. |
- Return values
-
The documentation for this class was generated from the following file: