Moodle  2.2.1
http://www.collinsharper.com
question_bank_column_base Class Reference
Inheritance diagram for question_bank_column_base:

Public Member Functions

 __construct (question_bank_view $qbank)
 is_extra_row ()
 display_header ()
 display ($question, $rowclasses)
 get_name ()
 get_extra_classes ()
 get_extra_joins ()
 get_required_fields ()
 is_sortable ()
 sort_expression ($reverse, $subsort)

Protected Member Functions

 init ()
 get_title ()
 get_title_tip ()
 make_sort_link ($sort, $title, $tip, $defaultreverse=false)
 get_sort_icon ($reverse)
 display_start ($question, $rowclasses)
 get_classes ()
 display_content ($question, $rowclasses)
 display_end ($question, $rowclasses)
 sortorder ($reverse)

Protected Attributes

 $qbank

Detailed Description

Base class for representing a column in a question_bank_view.

Definition at line 130 of file editlib.php.


Constructor & Destructor Documentation

Constructor.

Parameters:
$qbankthe question_bank_view we are helping to render.

Definition at line 140 of file editlib.php.

Here is the call graph for this function:


Member Function Documentation

display ( question,
rowclasses 
)

Output this column.

Parameters:
object$questionthe row from the $question table, augmented with extra information.
string$rowclassesCSS class names that should be applied to this row of output.

Definition at line 254 of file editlib.php.

Here is the call graph for this function:

display_content ( question,
rowclasses 
) [abstract, protected]

Output the contents of this column.

Parameters:
object$questionthe row from the $question table, augmented with extra information.
string$rowclassesCSS class names that should be applied to this row of output.

Reimplemented in question_bank_question_name_text_column, question_bank_add_to_quiz_action_column, question_bank_question_text_row, question_bank_delete_action_column, question_bank_move_action_column, question_bank_preview_action_column, question_bank_edit_action_column, question_bank_modifier_name_column, question_bank_creator_name_column, question_bank_question_name_column, question_bank_question_type_column, and question_bank_checkbox_column.

Here is the caller graph for this function:

display_end ( question,
rowclasses 
) [protected]

Reimplemented in question_bank_row_base.

Definition at line 294 of file editlib.php.

Here is the caller graph for this function:

Output the column header cell.

Definition at line 159 of file editlib.php.

Here is the call graph for this function:

display_start ( question,
rowclasses 
) [protected]

Reimplemented in question_bank_row_base.

Definition at line 260 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_classes ( ) [protected]
Returns:
string the CSS classes to apply to every cell in this column.

Definition at line 267 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
array any extra class names you would like applied to every cell in this column.

Reimplemented in question_bank_action_column_base.

Definition at line 283 of file editlib.php.

Here is the caller graph for this function:

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.

Returns:
array 'table_alias' => 'JOIN clause'

Reimplemented in question_bank_question_text_row, question_bank_modifier_name_column, and question_bank_creator_name_column.

Definition at line 312 of file editlib.php.

get_name ( ) [abstract]
Parameters:
object$questionthe row from the $question table, augmented with extra information.
Returns:
string internal name for this column. Used as a CSS class name, and to store information about the current sort. Must match PARAM_ALPHA.

Reimplemented in question_bank_question_name_text_column, question_bank_add_to_quiz_action_column, question_bank_question_text_row, question_bank_delete_action_column, question_bank_move_action_column, question_bank_preview_action_column, question_bank_edit_action_column, question_bank_modifier_name_column, question_bank_creator_name_column, question_bank_question_name_column, question_bank_question_type_column, and question_bank_checkbox_column.

Here is the caller graph for this function:

get_sort_icon ( reverse) [protected]

Get an icon representing the corrent sort state.

Parameters:
$reversesort is descending, not ascending.
Returns:
string HTML image tag.

Definition at line 240 of file editlib.php.

Here is the caller graph for this function:

get_title ( ) [abstract, protected]

Title for this column. Not used if is_sortable returns an array.

Parameters:
object$questionthe row from the $question table, augmented with extra information.
string$rowclassesCSS class names that should be applied to this row of output.

Reimplemented in question_bank_question_text_row, question_bank_action_column_base, question_bank_modifier_name_column, question_bank_creator_name_column, question_bank_question_name_column, question_bank_question_type_column, and question_bank_checkbox_column.

Here is the caller graph for this function:

get_title_tip ( ) [protected]
Returns:
string a fuller version of the name. Use this when get_title() returns something very short, and you want a longer version as a tool tip.

Reimplemented in question_bank_question_type_column, and question_bank_checkbox_column.

Definition at line 200 of file editlib.php.

Here is the caller graph for this function:

init ( ) [protected]

A chance for subclasses to initialise themselves, for example to load lang strings, without having to override the constructor.

Reimplemented in question_bank_add_to_quiz_action_column, question_bank_question_text_row, question_bank_delete_action_column, question_bank_move_action_column, question_bank_preview_action_column, question_bank_edit_action_column, and question_bank_checkbox_column.

Definition at line 149 of file editlib.php.

Here is the caller graph for this function:

Reimplemented in question_bank_row_base.

Definition at line 152 of file editlib.php.

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', 'field' => 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.

Returns:
mixed as above.

Reimplemented in question_bank_modifier_name_column, question_bank_creator_name_column, question_bank_question_name_column, and question_bank_question_type_column.

Definition at line 337 of file editlib.php.

Here is the caller graph for this function:

make_sort_link ( sort,
title,
tip,
defaultreverse = false 
) [protected]

Get a link that changes the sort order, and indicates the current sort state.

Parameters:
$nameinternal name used for this type of sorting.
$currentsortthe current sort order -1, 0, 1 for descending, none, ascending.
$titlethe link text.
$defaultreversewhether the default sort order for this column is descending, rather than ascending.
Returns:
string HTML fragment.

Definition at line 212 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

sort_expression ( reverse,
subsort 
)
Parameters:
$reverseWhether to sort in the reverse of the default sort order.
$subsortif is_sortable returns an array of subnames, then this will be one of those. Otherwise will be empty.
Returns:
string some SQL to go in the order by clause.

Definition at line 361 of file editlib.php.

Here is the call graph for this function:

sortorder ( reverse) [protected]

Helper method for building sort clauses.

Parameters:
bool$reversewhether the normal direction should be reversed.
string$normaldir'ASC' or 'DESC'
Returns:
string 'ASC' or 'DESC'

Definition at line 347 of file editlib.php.

Here is the caller graph for this function:


Field Documentation

$qbank [protected]

Definition at line 134 of file editlib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations