A question bank column which gathers together all the actions into a menu.
More...
|
| claim_menuable_columns ($allcolumns) |
| Set up the list of actions that should be shown in the menu.
|
|
| display ($question, $rowclasses) |
| Output this column.
|
|
| display_header () |
| Output the column header cell.
|
|
| get_actions () |
| Get menuable actions.
|
|
| get_column_name () |
| Get the name of this column.
|
|
| get_extra_classes () |
| Any extra class names you would like applied to every cell in this column.
|
|
| get_extra_joins () |
| Return an array 'table_alias' => 'JOIN clause' to bring in any data that this column required.
|
|
| get_name () |
| Get the internal name for this column.
|
|
| get_preference () |
| Get if the preference of the row.
|
|
| get_preference_key () |
| Get if the preference key of the row.
|
|
| get_required_fields () |
| Use table alias 'q' for the question table, or one of the ones from get_extra_joins.
|
|
| get_required_statistics_fields () |
| If this column requires any aggregated statistics, it should declare that here.
|
|
| get_title () |
| Title for this column.
|
|
| get_title_tip () |
| Use this when get_title() returns something very short, and you want a longer version as a tool tip.
|
|
| has_preference () |
| Check if the row has an extra preference to view/hide.
|
|
| help_icon () |
| If you return a help icon here, it is shown in the column header after the title.
|
|
| is_extra_row () |
| Check if the column is an extra row of not.
|
|
| is_sortable () |
| Can this column be sorted on? You can return either:
|
|
| load_additional_data (array $questions) |
| If this column needs extra data (e.g.
|
|
| load_question_tags (array $questions) |
| Load the tags for each question.
|
|
| set_as_heading () |
| Set the column as heading.
|
|
| sort_expression ($reverse, $subsort) |
| Sorts the expressions.
|
|
|
| display_content ($question, $rowclasses) |
| Output the contents of this column.
|
|
| display_end ($question, $rowclasses) |
| Output the closing column tag.
|
|
| display_start ($question, $rowclasses) |
| Output the opening column tag.
|
|
| get_classes () |
| The CSS classes to apply to every cell in this column.
|
|
| get_sort_icon ($reverse) |
| Get an icon representing the corrent sort state.
|
|
| init () |
| A chance for subclasses to initialise themselves, for example to load lang strings, without having to override the constructor.
|
|
| make_sort_link ($sort, $title, $tip, $defaultreverse=false) |
| Get a link that changes the sort order, and indicates the current sort state.
|
|
| sortorder ($reverse) |
| Helper method for building sort clauses.
|
|
|
menuable_action[] | $actions |
|
bool | $isheading = false |
| determine whether the column is td or th.
|
|
view | $qbank |
| $qbank the question bank view we are helping to render.
|
|
A question bank column which gathers together all the actions into a menu.
This question bank column, if added to the question bank, will replace all of the other columns which implement the {
- See also
- menuable_action} interface and replace them with a single column containing an Edit menu.
- Copyright
- 2019 The Open University
- Author
- 2021 Safat Shahin safat.nosp@m.shah.nosp@m.in@ca.nosp@m.taly.nosp@m.st-au.nosp@m..net
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ claim_menuable_columns()
core_question\local\bank\edit_menu_column::claim_menuable_columns |
( |
| $allcolumns | ) |
|
Set up the list of actions that should be shown in the menu.
This takes a list of column object (the list from a question bank view). It extracts all the ones that should go in the menu and stores them for later use. Then it returns the remaining columns.
- Parameters
-
column_base[] | $allcolumns | a set of columns. |
- Return values
-
column_base[] | the non-action columns from the set. |
◆ display()
core_question\local\bank\column_base::display |
( |
| $question, |
|
|
| $rowclasses ) |
|
inherited |
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\local\bank\edit_menu_column::display_content |
( |
| $question, |
|
|
| $rowclasses ) |
|
protected |
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 from core_question\local\bank\column_base.
◆ display_end()
core_question\local\bank\column_base::display_end |
( |
| $question, |
|
|
| $rowclasses ) |
|
protectedinherited |
◆ display_start()
core_question\local\bank\column_base::display_start |
( |
| $question, |
|
|
| $rowclasses ) |
|
protectedinherited |
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\local\bank\row_base.
◆ get_actions()
core_question\local\bank\edit_menu_column::get_actions |
( |
| ) |
|
Get menuable actions.
- Return values
-
menuable_action | Menuable actions. |
◆ get_classes()
core_question\local\bank\column_base::get_classes |
( |
| ) |
|
|
protectedinherited |
The CSS classes to apply to every cell in this column.
- Return values
-
◆ get_column_name()
core_question\local\bank\column_base::get_column_name |
( |
| ) |
|
|
inherited |
Get the name of this column.
This must be unique. When using the inherited class to make many columns from one parent, ensure each instance returns a unique value.
- Return values
-
Reimplemented in qbank_customfields\custom_field_column.
◆ get_extra_classes()
core_question\local\bank\edit_menu_column::get_extra_classes |
( |
| ) |
|
◆ get_extra_joins()
core_question\local\bank\column_base::get_extra_joins |
( |
| ) |
|
|
inherited |
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\local\bank\action_column_base, qbank_viewcreator\creator_name_column, and qbank_viewcreator\modifier_name_column.
◆ get_name()
core_question\local\bank\edit_menu_column::get_name |
( |
| ) |
|
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 from core_question\local\bank\column_base.
◆ get_preference()
core_question\local\bank\column_base::get_preference |
( |
| ) |
|
|
inherited |
◆ get_preference_key()
core_question\local\bank\column_base::get_preference_key |
( |
| ) |
|
|
inherited |
◆ get_required_fields()
core_question\local\bank\edit_menu_column::get_required_fields |
( |
| ) |
|
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.
- Return values
-
Reimplemented from core_question\local\bank\column_base.
◆ get_required_statistics_fields()
core_question\local\bank\column_base::get_required_statistics_fields |
( |
| ) |
|
|
inherited |
◆ get_sort_icon()
core_question\local\bank\column_base::get_sort_icon |
( |
| $reverse | ) |
|
|
protectedinherited |
Get an icon representing the corrent sort state.
- Parameters
-
bool | $reverse | sort is descending, not ascending. |
- Return values
-
◆ get_title()
core_question\local\bank\edit_menu_column::get_title |
( |
| ) |
|
◆ get_title_tip()
core_question\local\bank\column_base::get_title_tip |
( |
| ) |
|
|
inherited |
◆ has_preference()
core_question\local\bank\column_base::has_preference |
( |
| ) |
|
|
inherited |
◆ help_icon()
core_question\local\bank\column_base::help_icon |
( |
| ) |
|
|
inherited |
◆ init()
core_question\local\bank\column_base::init |
( |
| ) |
|
|
protectedinherited |
A chance for subclasses to initialise themselves, for example to load lang strings, without having to override the constructor.
Reimplemented in mod_quiz\question\bank\add_action_column, qbank_deletequestion\delete_action_column, qbank_editquestion\copy_action_column, qbank_editquestion\edit_action_column, qbank_exporttoxml\export_xml_action_column, qbank_history\history_action_column, qbank_previewquestion\preview_action_column, qbank_tagquestion\tags_action_column, and qbank_viewquestiontext\question_text_row.
◆ is_extra_row()
core_question\local\bank\column_base::is_extra_row |
( |
| ) |
|
|
inherited |
◆ is_sortable()
core_question\local\bank\column_base::is_sortable |
( |
| ) |
|
|
inherited |
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 [ 'firstname' => ['field' => 'uc.firstname', 'title' => get_string('firstname')], 'lastname' => ['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 mod_quiz\question\bank\question_name_column, qbank_viewcreator\creator_name_column, qbank_viewcreator\modifier_name_column, qbank_viewquestionname\question_name_idnumber_tags_column, qbank_viewquestionname\viewquestionname_column_helper, and qbank_viewquestiontype\question_type_column.
◆ load_additional_data()
core_question\local\bank\column_base::load_additional_data |
( |
array | $questions | ) |
|
|
inherited |
◆ load_question_tags()
core_question\local\bank\column_base::load_question_tags |
( |
array | $questions | ) |
|
|
inherited |
Load the tags for each question.
Helper that can be used from {
- See also
- load_additional_data()};
- Parameters
-
◆ make_sort_link()
core_question\local\bank\column_base::make_sort_link |
( |
| $sort, |
|
|
| $title, |
|
|
| $tip, |
|
|
| $defaultreverse = false ) |
|
protectedinherited |
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\local\bank\column_base::sort_expression |
( |
| $reverse, |
|
|
| $subsort ) |
|
inherited |
Sorts the expressions.
- 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\local\bank\column_base::sortorder |
( |
| $reverse | ) |
|
|
protectedinherited |
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:
- question/classes/local/bank/edit_menu_column.php