Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
|
Extends table_sql to provide a table of assignment submissions. More...
Public Member Functions | |
__construct (assign $assignment, $perpage, $filter, $rowoffset, $quickgrading, $downloadfilename=null) | |
overridden constructor keeps a reference to the assignment class that is displaying this table | |
add_data ($row, $classname='') | |
This method actually directly echoes the row passed to it now or adds it to the download. | |
add_data_keyed ($rowwithkeys, $classname='') | |
Add a row of data to the table. | |
add_separator () | |
Add a seperator line to table. | |
build_table () | |
Build the table from the fetched data. | |
can_view_all_grades () | |
Return things to the renderer. | |
close_recordset () | |
Closes recordset (for use after building the table). | |
col_allocatedmarker (stdClass $row) | |
list current marker | |
col_allowsubmissionsfromdate (stdClass $row) | |
Format a column of data for display. | |
col_cutoffdate (stdClass $row) | |
Format a column of data for display. | |
col_duedate (stdClass $row) | |
Format a column of data for display. | |
col_finalgrade (stdClass $row) | |
Format a column of data for display. | |
col_fullname ($row) | |
Format a user record for display (link to profile). | |
col_grade (stdClass $row) | |
Format a column of data for display. | |
col_gradecanbechanged (stdClass $row) | |
Format a column of data for display. | |
col_grademax (stdClass $row) | |
Format a column of data for display. | |
col_outcomes (stdClass $row) | |
Format a list of outcomes. | |
col_picture (stdClass $row) | |
Format a user picture for display. | |
col_recordid (stdClass $row) | |
Add a column with an ID that uniquely identifies this user in this assignment. | |
col_scale ($row) | |
For download only - list all the valid options for this custom scale. | |
col_select (stdClass $row) | |
Insert a checkbox for selecting the current row for batch operations. | |
col_status (stdClass $row) | |
Format a column of data for display. | |
col_team (stdClass $row) | |
Get the team info for this user. | |
col_timemarked (stdClass $row) | |
Format a column of data for display. | |
col_timesubmitted (stdClass $row) | |
Format a column of data for display. | |
col_userid (stdClass $row) | |
Format a column of data for display. | |
col_workflowstate ($row) | |
For download only - list current marking workflow state. | |
col_workflowstatus (stdClass $row) | |
list current marking workflow state | |
collapsible ($bool) | |
Sets the is_collapsible variable to the given boolean. | |
column_class ($column, $classname) | |
Sets the given $column index to the given $classname in $this->column_class. | |
column_sticky (string $column, bool $sticky=true) | |
Sets a sticky attribute to a column. | |
column_style ($column, $property, $value) | |
Sets the given $column index and $property index to the given $value in $this->column_style. | |
column_style_all ($property, $value) | |
Sets all columns' $propertys to the given $value in $this->column_style. | |
column_suppress ($column) | |
What this method does is set the column so that if the same data appears in consecutive rows, then it is not repeated. | |
define_baseurl ($url) | |
Sets $this->baseurl. | |
define_columns ($columns) | |
define_header_column (string $column) | |
Mark a specific column as being a table header using the column name defined in define_columns. | |
define_headers ($headers) | |
define_help_for_headers ($helpicons) | |
Defines a help icon for the header. | |
display_grade ($grade, $editable, $userid, $modified) | |
Display a grade with scales etc. | |
download_buttons () | |
Get the html for the download buttons. | |
export_class_instance ($exportclass=null) | |
Get, and optionally set, the export class. | |
finish_html () | |
This function is not part of the public api. | |
finish_output ($closeexportclassdoc=true) | |
You should call this to finish outputting the table data after adding data to the table with add_data or add_data_keyed. | |
format_and_add_array_of_rows ($rowstoadd, $finish=true) | |
Add a number of rows to the table at once. | |
format_row ($row) | |
Before adding each row to the table make sure rownum is incremented. | |
format_text ($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL) | |
Used from col_* functions when text is to be displayed. | |
get_assignment_name () | |
Return things to the renderer. | |
get_column_data ($columnname) | |
Using the current filtering and sorting - load all rows and return a single column from them. | |
get_context () | |
Get the context for the table. | |
get_course_context () | |
Return things to the renderer. | |
get_course_id () | |
Return things to the renderer. | |
get_course_module_id () | |
Return things to the renderer. | |
get_default_per_page () | |
Get the default per page. | |
get_filterset () | |
Get the currently defined filterset. | |
get_initial_first () | |
This function is not part of the public api. | |
get_initial_last () | |
This function is not part of the public api. | |
get_page_size () | |
get_page_start () | |
get_row_cells_html (string $rowid, array $row, ?array $suppresslastrow) | |
Generate html code for the row cells. | |
get_row_class ($row) | |
Add the userid to the row class so it can be updated via ajax. | |
get_row_from_keyed ($rowwithkeys) | |
This function is not part of the public api. | |
get_row_html ($row, $classname='') | |
Generate html code for the passed row. | |
get_rows_per_page () | |
Return the number of rows to display on a single page. | |
get_sort_columns () | |
Always return a valid sort - even if the userid column is missing. | |
get_sql_sort () | |
get_sql_where () | |
guess_base_url () | |
Attempt to guess the base URL. | |
initialbars ($bool) | |
Sets the use_initials variable to the given boolean. | |
is_downloadable ($downloadable=null) | |
Probably don't need to call this directly. | |
is_downloading ($download=null, $filename='', $sheettitle='') | |
Call this to pass the download type. | |
is_persistent ($persistent=null) | |
Call with boolean true to store table layout changes in the user_preferences table. | |
is_sortable ($column=null) | |
Is the column sortable? | |
make_styles_string ($styles) | |
This function is not part of the public api. | |
mark_table_to_reset () | |
Mark the table preferences to be reset. | |
no_sorting ($column) | |
Do not sort using this column. | |
other_cols ($colname, $row) | |
Format the submission and feedback columns. | |
out ($pagesize, $useinitialsbar, $downloadhelpbutton='') | |
Convenience method to call a number of methods for you to display the table. | |
pageable ($bool) | |
Sets the use_pages variable to the given boolean. | |
pagesize ($perpage, $total) | |
Sets the pagesize variable to the given integer, the totalrows variable to the given integer, and the use_pages variable to true. | |
print_headers () | |
This function is not part of the public api. | |
print_html () | |
This method is deprecated although the old api is still supported. | |
print_initials_bar () | |
This function is not part of the public api. | |
print_nothing_to_display () | |
This function is not part of the public api. | |
print_row ($row, $classname='') | |
This function is not part of the public api. | |
query_db ($pagesize, $useinitialsbar=true) | |
Query the db. | |
render_caption () | |
This function renders a table caption. | |
set_attribute ($attribute, $value) | |
Gives the given $value to the $attribute index of $this->attributes. | |
set_caption (string $caption, ?array $captionattributes) | |
This function set caption for table. | |
set_columnsattributes (array $attributes) | |
Sets the given $attributes to $this->columnsattributes. | |
set_control_variables ($variables) | |
Assigns each given variable in the array to the corresponding index in the request class variable. | |
set_count_sql ($sql, array $params=NULL) | |
This is only needed if you want to use different sql to count rows. | |
set_default_per_page (int $defaultperpage) | |
Set the default per page. | |
set_filterset (filterset $filterset) | |
Set the filterset in the table class. | |
set_first_initial (string $initial) | |
Set the preferred first name initial in an initials bar. | |
set_hidden_columns (array $columns) | |
Set the list of hidden columns. | |
set_last_initial (string $initial) | |
Set the preferred last name initial in an initials bar. | |
set_page_number (int $pagenumber) | |
Set the page number. | |
set_sortdata (array $sortdata) | |
Set the preferred table sorting attributes. | |
set_sql ($fields, $from, $where, array $params=array()) | |
Set the sql to query the db. | |
setup () | |
Overides setup to ensure it will only run a single time. | |
show_download_buttons_at ($showat) | |
Where to show download buttons. | |
sortable ($bool, $defaultcolumn=NULL, $defaultorder=SORT_ASC) | |
Sets the is_sortable variable to the given boolean, sort_default_column to the given string, and the sort_default_order to the given integer. | |
start_html () | |
This function is not part of the public api. | |
start_output () | |
This function is not part of the public api. | |
submissions_enabled () | |
Return things to the renderer. | |
text_sorting ($column) | |
Use text sorting functions for this column (required for text columns with Oracle). | |
wrap_html_finish () | |
Hook that can be overridden in child classes to wrap a table in a form for example. | |
wrap_html_start () | |
Hook that can be overridden in child classes to wrap a table in a form for example. | |
Static Public Member Functions | |
static | construct_order_by ($cols, $textsortcols=array()) |
Prepare an an order by clause from the list of columns to be sorted. | |
static | get_filterset_class () |
Get the class used as a filterset. | |
static | get_sort_for_table ($uniqueid) |
Get the order by clause from the session or user preferences, for the table with id $uniqueid. | |
Public Attributes | |
$attributes = array() | |
$baseurl = NULL | |
string | $caption |
$caption The caption of table | |
array | $captionattributes |
$captionattributes The caption attributes of table | |
$column_class = array() | |
$column_nosort = array('userpic') | |
$column_style = array() | |
$column_suppress = array() | |
$columns = array() | |
$countparams = NULL | |
$countsql = NULL | |
$currentrow = 0 | |
$currpage = 0 | |
string | $download = '' |
which download plugin to use. | |
bool | $downloadable = false |
whether data is downloadable from table. | |
table_dataformat_export_format | $exportclass = null |
$headers = array() | |
bool | $is_collapsible = true |
Overriding default for this. | |
bool | $is_sortable = true |
Overriding default for this. | |
$maxsortkeys = 2 | |
$pagesize = 30 | |
string | $plugingradingbatchoperations = array() |
$plugingradingbatchoperations - List of plugin supported batch operations | |
array Traversable | $rawdata = NULL |
Data fetched from the db. | |
$request = array() | |
boolean | $setup = false |
Stores if setup has already been called on this flixible table. | |
$showdownloadbuttonsat = array(TABLE_P_TOP) | |
Array of positions in which to display download controls. | |
$sort_default_column = NULL | |
$sort_default_order = SORT_ASC | |
object | $sql = NULL |
sql for querying db. | |
bool | $started_output = false |
Has start output been called yet? | |
$totalrows = 0 | |
$uniqueid = NULL | |
$use_initials = false | |
$use_pages = false | |
string | $useridfield = 'id' |
Key of field returned by db query that is the id field of the user table or equivalent. | |
Protected Member Functions | |
can_be_reset () | |
Are there some table preferences that can be reset? | |
get_component () | |
Get dynamic class component. | |
get_dynamic_table_html_end () | |
Get the dynamic table end wrapper. | |
get_dynamic_table_html_start () | |
Get the dynamic table start wrapper. | |
get_group_and_submission ($userid, &$group, &$submission, $attemptnumber) | |
Use a static cache to try and reduce DB calls. | |
get_handler () | |
Get dynamic class handler. | |
get_primary_sort_order () | |
Return primary sorting column/order, either the first preferred "sortby" value or defaults defined for the table. | |
get_sort_order () | |
Return sorting attributes values. | |
initialise_table_preferences () | |
Initialise table preferences. | |
is_resetting_preferences () | |
Is the table marked for reset preferences? | |
print_one_initials_bar ($alpha, $current, $class, $title, $urlvar) | |
Helper function, used by print_initials_bar() to output one initial bar. | |
render_reset_button () | |
Generate the HTML for the table preferences reset button. | |
save_preferences ($oldprefs) | |
Save preferences. | |
set_hide_show_preferences () | |
Set hide and show preferences. | |
set_initials_preferences () | |
Fill in the preferences for the initials bar. | |
set_sorting_preferences () | |
Calculate the preferences for sort order based on user-supplied values and get params. | |
show_hide_link ($column, $index) | |
Override the table show_hide_link to not show for select column. | |
sort_icon ($isprimary, $order) | |
Generate the HTML for the sort icon. | |
sort_link ($text, $column, $isprimary, $order) | |
Generate the HTML for the sort link. | |
sort_order_name ($isprimary, $order) | |
Generate the correct tool tip for changing the sort order. | |
Protected Attributes | |
array | $columnsticky = [] |
The sticky attribute of each table column. | |
string | $filename |
$filename | |
filterset | $filterset = null |
The currently applied filerset This is required for dynamic tables, but can be used by other tables too if desired. | |
string | $headercolumn = null |
A column which should be considered as a header column. | |
array | $hiddencolumns |
$hiddencolumns List of hidden columns. | |
string | $ifirst |
The manually set first name initial preference. | |
string | $ilast |
The manually set last name initial preference. | |
bool | $resetting |
$resetting Whether the table preferences is resetting. | |
string | $sheettitle |
$sheettitle | |
array | $sortdata |
The fields to sort. | |
string[] | $userfullnamecolumns = ['fullname'] |
Columns that are expected to contain a users fullname. | |
Extends table_sql to provide a table of assignment submissions.
assign_grading_table::__construct | ( | assign | $assignment, |
$perpage, | |||
$filter, | |||
$rowoffset, | |||
$quickgrading, | |||
$downloadfilename = null ) |
overridden constructor keeps a reference to the assignment class that is displaying this table
assign | $assignment | The assignment class |
int | $perpage | how many per page |
string | $filter | The current filter |
int | $rowoffset | For showing a subsequent page of results |
bool | $quickgrading | Is this table wrapped in a quickgrading form? |
string | $downloadfilename |
|
inherited |
This method actually directly echoes the row passed to it now or adds it to the download.
If this is the first row and start_output has not already been called this method also calls start_output to open the table or send headers for the downloaded. Can be used as before. print_html now calls finish_html to close table.
array | $row | a numerically keyed row of data to add to the table. |
string | $classname | CSS class name to add to this row's tr tag. |
bool | success. |
|
inherited |
Add a row of data to the table.
This function takes an array or object with column names as keys or property names.
It ignores any elements with keys that are not defined as columns. It puts in empty strings into the row when there is no element in the passed array corresponding to a column in the table. It puts the row elements in the proper order (internally row table data is stored by in arrays with a numerical index corresponding to the column number).
object | array | $rowwithkeys | array keys or object property names are column names, as defined in call to define_columns. |
string | $classname | CSS class name to add to this row's tr tag. |
|
inherited |
Build the table from the fetched data.
Take the data returned from the db_query and go through all the rows processing each col using either col_{columnname} method or other_cols method or if other_cols returns NULL then put the data straight into the table.
After calling this function, don't forget to call close_recordset.
Reimplemented in mod_feedback_responses_table, quiz_last_responses_table, and quiz_overview_table.
|
protectedinherited |
Are there some table preferences that can be reset?
If true, then the "reset table preferences" widget should be displayed.
bool |
assign_grading_table::can_view_all_grades | ( | ) |
Return things to the renderer.
bool | Can this user view all grades (the gradebook) |
assign_grading_table::col_allocatedmarker | ( | stdClass | $row | ) |
list current marker
stdClass | $row | - The row of data |
id | the user->id of the marker. |
assign_grading_table::col_allowsubmissionsfromdate | ( | stdClass | $row | ) |
Format a column of data for display.
stdClass | $row |
string |
assign_grading_table::col_cutoffdate | ( | stdClass | $row | ) |
Format a column of data for display.
stdClass | $row |
string |
assign_grading_table::col_duedate | ( | stdClass | $row | ) |
Format a column of data for display.
stdClass | $row |
string |
assign_grading_table::col_finalgrade | ( | stdClass | $row | ) |
Format a column of data for display.
stdClass | $row |
string |
assign_grading_table::col_fullname | ( | $row | ) |
Format a user record for display (link to profile).
stdClass | $row |
string |
Reimplemented from flexible_table.
assign_grading_table::col_grade | ( | stdClass | $row | ) |
Format a column of data for display.
stdClass | $row |
string |
assign_grading_table::col_gradecanbechanged | ( | stdClass | $row | ) |
Format a column of data for display.
stdClass | $row |
string |
assign_grading_table::col_grademax | ( | stdClass | $row | ) |
Format a column of data for display.
stdClass | $row |
string |
assign_grading_table::col_outcomes | ( | stdClass | $row | ) |
Format a list of outcomes.
stdClass | $row |
string |
assign_grading_table::col_picture | ( | stdClass | $row | ) |
Format a user picture for display.
stdClass | $row |
string |
assign_grading_table::col_recordid | ( | stdClass | $row | ) |
Add a column with an ID that uniquely identifies this user in this assignment.
stdClass | $row |
string |
assign_grading_table::col_scale | ( | $row | ) |
For download only - list all the valid options for this custom scale.
stdClass | $row | - The row of data |
string | A list of valid options for the current scale |
assign_grading_table::col_select | ( | stdClass | $row | ) |
Insert a checkbox for selecting the current row for batch operations.
stdClass | $row |
string |
assign_grading_table::col_status | ( | stdClass | $row | ) |
Format a column of data for display.
stdClass | $row |
string |
assign_grading_table::col_team | ( | stdClass | $row | ) |
Get the team info for this user.
stdClass | $row |
string | The team name |
assign_grading_table::col_timemarked | ( | stdClass | $row | ) |
Format a column of data for display.
stdClass | $row |
string |
assign_grading_table::col_timesubmitted | ( | stdClass | $row | ) |
Format a column of data for display.
stdClass | $row |
string |
assign_grading_table::col_userid | ( | stdClass | $row | ) |
Format a column of data for display.
stdClass | $row |
string |
assign_grading_table::col_workflowstate | ( | $row | ) |
For download only - list current marking workflow state.
stdClass | $row | - The row of data |
string | The current marking workflow state |
assign_grading_table::col_workflowstatus | ( | stdClass | $row | ) |
list current marking workflow state
stdClass | $row |
string |
|
inherited |
Sets the is_collapsible variable to the given boolean.
bool | $bool |
void |
|
inherited |
Sets the given $column index to the given $classname in $this->column_class.
int | $column | |
string | $classname |
void |
|
inherited |
Sets a sticky attribute to a column.
string | $column | Column name |
bool | $sticky |
|
inherited |
Sets the given $column index and $property index to the given $value in $this->column_style.
int | $column | |
string | $property | |
mixed | $value |
void |
|
inherited |
Sets all columns' $propertys to the given $value in $this->column_style.
int | $property | |
string | $value |
void |
|
inherited |
What this method does is set the column so that if the same data appears in consecutive rows, then it is not repeated.
For example, in the quiz overview report, the fullname column is set to be suppressed, so that when one student has made multiple attempts, their name is only printed in the row for their first attempt.
int | $column | the index of a column. |
|
staticinherited |
Prepare an an order by clause from the list of columns to be sorted.
array | $cols | column name => SORT_ASC or SORT_DESC |
string | SQL fragment that can be used in an ORDER BY clause. |
|
inherited |
Sets $this->baseurl.
moodle_url | string | $url | the url with params needed to call up this page |
|
inherited |
array | $columns | an array of identifying names for columns. If columns are sorted then column names must correspond to a field in sql. |
Reimplemented in mod_feedback_responses_table.
|
inherited |
Mark a specific column as being a table header using the column name defined in define_columns.
Note: Only one column can be a header, and it will be rendered using a th tag.
string | $column |
|
inherited |
array | $headers | numerical keyed array of displayed string titles for each column. |
|
inherited |
Defines a help icon for the header.
Always use this function if you need to create header with sorting and help icon.
renderable[] | $helpicons | An array of renderable objects to be used as help icons |
assign_grading_table::display_grade | ( | $grade, | |
$editable, | |||
$userid, | |||
$modified ) |
Display a grade with scales etc.
string | $grade | |
boolean | $editable | |
int | $userid | The user id of the user this grade belongs to |
int | $modified | Timestamp showing when the grade was last modified |
string | The formatted grade |
|
inherited |
Get the html for the download buttons.
Usually only use internally
Reimplemented in core_reportbuilder\table\custom_report_table, core_reportbuilder\table\custom_report_table_view, core_reportbuilder\table\system_report_table, and mod_feedback_responses_table.
|
inherited |
Get, and optionally set, the export class.
table_dataformat_export_format | $exportclass | (optional) if passed, set the table to use this export class. |
table_dataformat_export_format | the export class in use (after any set). |
|
inherited |
Add a number of rows to the table at once.
And optionally finish output after they have been added.
(object|array|null)[] | $rowstoadd Array of rows to add to table, a null value in array adds a separator row. Or a object or array is added to table. We expect properties for the row array as would be passed to add_data_keyed. | |
bool | $finish |
assign_grading_table::format_row | ( | $row | ) |
Before adding each row to the table make sure rownum is incremented.
array | $row | row of data from db used to make one row of the table. |
array | one row for the table |
Reimplemented from flexible_table.
|
inherited |
Used from col_* functions when text is to be displayed.
Does the right thing - either converts text to html or strips any html tags depending on if we are downloading and what is the download type. Params are the same as format_text function in weblib.php but some default options are changed.
assign_grading_table::get_assignment_name | ( | ) |
Return things to the renderer.
string | the assignment name |
assign_grading_table::get_column_data | ( | $columnname | ) |
Using the current filtering and sorting - load all rows and return a single column from them.
string | $columnname | The name of the raw column data |
array | of data |
|
protectedinherited |
Get dynamic class component.
string |
|
inherited |
Get the context for the table.
Note: This function must be overridden by dynamic tables to ensure that the context is correctly determined from the filterset parameters.
context |
Reimplemented in core_admin\table\plugin_management_table, core_reportbuilder\table\base_report_table, core_user\table\participants, and mod_feedback_responses_table.
assign_grading_table::get_course_context | ( | ) |
Return things to the renderer.
stdClass | The course context |
assign_grading_table::get_course_id | ( | ) |
Return things to the renderer.
int | the course id |
assign_grading_table::get_course_module_id | ( | ) |
Return things to the renderer.
int | the course module id |
|
inherited |
Get the default per page.
int |
Reimplemented in core_reportbuilder\table\custom_report_table_view.
|
protectedinherited |
Get the dynamic table end wrapper.
If this is not a dynamic table, then an empty string is returned making this safe to blindly call.
string |
Reimplemented in core_admin\table\plugin_management_table.
|
protectedinherited |
Get the dynamic table start wrapper.
If this is not a dynamic table, then an empty string is returned making this safe to blindly call.
string |
|
inherited |
Get the currently defined filterset.
filterset |
|
staticinherited |
Get the class used as a filterset.
string |
Reimplemented in core_admin\table\plugin_management_table.
|
protected |
Use a static cache to try and reduce DB calls.
int | $userid | The user id for this submission |
int | $group | The groupid (returned) |
stdClass | false | $submission | The stdClass submission or false (returned) |
int | $attemptnumber | Return a specific attempt number (-1 for latest) |
|
protectedinherited |
Get dynamic class handler.
string |
|
inherited |
This function is not part of the public api.
string | initial of first name we are currently filtering by |
|
inherited |
This function is not part of the public api.
string | initial of last name we are currently filtering by |
|
inherited |
int | the pagesize for LIMIT clause of SQL |
|
inherited |
int | the offset for LIMIT clause of SQL |
|
protectedinherited |
Return primary sorting column/order, either the first preferred "sortby" value or defaults defined for the table.
array |
|
inherited |
Generate html code for the row cells.
string | $rowid | |
array | $row | |
array | null | $suppresslastrow |
string |
Reimplemented in core_reportbuilder\table\custom_report_table.
assign_grading_table::get_row_class | ( | $row | ) |
Add the userid to the row class so it can be updated via ajax.
stdClass | $row | The row of data |
string | The row class |
Reimplemented from table_sql.
|
inherited |
Generate html code for the passed row.
array | $row | Row data. |
string | $classname | classes to add. |
string\$html | html code for the row passed. |
assign_grading_table::get_rows_per_page | ( | ) |
Return the number of rows to display on a single page.
int | The number of rows per page |
assign_grading_table::get_sort_columns | ( | ) |
Always return a valid sort - even if the userid column is missing.
array | column name => SORT_... constant. |
Reimplemented from flexible_table.
|
staticinherited |
Get the order by clause from the session or user preferences, for the table with id $uniqueid.
string | $uniqueid | the identifier for a table. |
string | SQL fragment that can be used in an ORDER BY clause. |
|
protectedinherited |
Return sorting attributes values.
array |
|
inherited |
string | SQL fragment that can be used in an ORDER BY clause. |
Reimplemented in core_reportbuilder\table\base_report_table, and gradereport_history\output\tablelog.
|
inherited |
string | sql to add to where statement. |
Reimplemented in core_tag_manage_table, and tool_policy\acceptances_table.
|
inherited |
Attempt to guess the base URL.
Reimplemented in core_admin\table\activity_management_table, core_admin\table\block_management_table, core_admin\table\editor_management_table, core_admin\table\plugin_management_table, core_reportbuilder\table\base_report_table, core_user\table\participants, and editor_tiny\table\plugin_management_table.
|
inherited |
Sets the use_initials variable to the given boolean.
bool | $bool |
void |
|
inherited |
Probably don't need to call this directly.
Calling is_downloading with a param automatically sets table as downloadable.
bool | $downloadable | optional param to set whether data from table is downloadable. If ommitted this function can be used to get current state of table. |
bool | whether table data is set to be downloadable. |
Reimplemented in core_admin\table\plugin_management_table.
|
inherited |
Call this to pass the download type.
Use : $download = optional_param('download', '', PARAM_ALPHA); To get the download type. We assume that if you call this function with params that this table's data is downloadable, so we call is_downloadable for you (even if the param is '', which means no download this time. Also you can call this method with no params to get the current set download type.
string | null | $download | type of dataformat for export. |
string | $filename | filename for downloads without file extension. |
string | $sheettitle | title for downloaded data. |
string | download dataformat type. |
|
inherited |
Call with boolean true to store table layout changes in the user_preferences table.
Note: user_preferences.value has a maximum length of 1333 characters. Call with no parameter to get current state of table persistence.
bool | $persistent | Optional parameter to set table layout persistence. |
bool | Whether or not the table layout preferences will persist. |
|
protectedinherited |
Is the table marked for reset preferences?
bool | True if the table is marked to reset, false otherwise. |
|
inherited |
Is the column sortable?
string | column name, null means table |
bool |
|
inherited |
This function is not part of the public api.
array | $styles | CSS-property => value |
string | values suitably to go in a style="" attribute in HTML. |
|
inherited |
Do not sort using this column.
string | column name |
assign_grading_table::other_cols | ( | $colname, | |
$row ) |
Format the submission and feedback columns.
string | $colname | The column name |
stdClass | $row | The submission row |
mixed | string or NULL |
Reimplemented from flexible_table.
|
inherited |
Convenience method to call a number of methods for you to display the table.
Reimplemented in core_reportbuilder\table\custom_report_table, core_user\table\participants, forumreport_summary\summary_table, mod_feedback_responses_table, and report_loglive_table_log_ajax.
|
inherited |
Sets the use_pages variable to the given boolean.
bool | $bool |
void |
|
inherited |
Sets the pagesize variable to the given integer, the totalrows variable to the given integer, and the use_pages variable to true.
int | $perpage | |
int | $total |
void |
|
inherited |
This function is not part of the public api.
Reimplemented in core_reportbuilder\table\custom_report_table, and core_reportbuilder\table\custom_report_table_view.
|
inherited |
This method is deprecated although the old api is still supported.
|
inherited |
This function is not part of the public api.
Reimplemented in core\moodlenet\share_progress_table, core_reportbuilder\table\base_report_table, core_reportbuilder\table\custom_report_table, forumreport_summary\summary_table, mod_h5pactivity\local\report\participants, tool_cohortroles\output\cohort_role_assignments_table, tool_dataprivacy\output\data_requests_table, tool_dataprivacy\output\expired_contexts_table, tool_lp\output\template_cohorts_table, and tool_lp\output\template_plans_table.
|
protectedinherited |
Helper function, used by print_initials_bar() to output one initial bar.
array | $alpha | of letters in the alphabet. |
string | $current | the currently selected letter. |
string | $class | class name to add to this initial bar. |
string | $title | the name to put in front of this initial bar. |
string | $urlvar | URL parameter name for this initial. |
|
inherited |
Query the db.
Store results in the table object for use by build_table.
int | $pagesize | size of page for paginated displayed table. |
bool | $useinitialsbar | do you want to use the initials bar. Bar will only be used if there is a fullname column defined for the table. |
Reimplemented in core\moodlenet\share_progress_table, core_reportbuilder\table\base_report_table, core_tag_manage_table, core_user\table\participants, core_webservice\token_table, enrol_lti\local\ltiadvantage\table\published_resources_table, enrol_lti\manage_table, forumreport_summary\summary_table, gradereport_history\output\tablelog, mod_feedback_responses_table, mod_quiz\local\reports\attempts_report_table, qbank_usage\tables\question_usage_table, quiz_overview_table, report_infectedfiles\table\infectedfiles_table, report_log_table_log, report_loglive_table_log, tool_analytics\output\model_logs, tool_cohortroles\output\cohort_role_assignments_table, tool_dataprivacy\output\data_requests_table, tool_dataprivacy\output\expired_contexts_table, tool_lp\output\template_cohorts_table, tool_lp\output\template_plans_table, tool_monitor\output\managerules\renderable, tool_monitor\output\managesubs\rules, tool_monitor\output\managesubs\subs, and tool_task\running_tasks_table.
|
inherited |
This function renders a table caption.
string\$output | Caption of table. |
|
protectedinherited |
Generate the HTML for the table preferences reset button.
string | HTML fragment, empty string if no need to reset |
|
protectedinherited |
Save preferences.
array | $oldprefs | Old preferences to compare against. |
|
inherited |
Gives the given $value to the $attribute index of $this->attributes.
string | $attribute | |
mixed | $value |
void |
|
inherited |
|
inherited |
Sets the given $attributes to $this->columnsattributes.
Column attributes will be added to every cell in the column.
array[] | $attributes | e.g. ['c0_firstname' => ['data-foo' => 'bar']] |
|
inherited |
Assigns each given variable in the array to the corresponding index in the request class variable.
array | $variables |
void |
|
inherited |
This is only needed if you want to use different sql to count rows.
Used for example when perhaps all db JOINS are not needed when counting records. You don't need to call this function the count_sql will be generated automatically.
We need to count rows returned by the db seperately to the query itself as we need to know how many pages of data we have to display.
|
inherited |
Set the default per page.
int | $defaultperpage |
|
inherited |
Set the filterset in the table class.
The use of filtersets is a requirement for dynamic tables, but can be used by other tables too if desired.
filterset | $filterset | The filterset object to get filters and table parameters from |
Reimplemented in core_reportbuilder\table\system_report_table, and core_user\table\participants.
|
inherited |
Set the preferred first name initial in an initials bar.
string | $initial | The character to set |
|
inherited |
Set the list of hidden columns.
array | $columns | The list of hidden columns. |
|
inherited |
Set the preferred last name initial in an initials bar.
string | $initial | The character to set |
|
inherited |
Set the page number.
int | $pagenumber | The page number. |
|
inherited |
Set the preferred table sorting attributes.
string | $sortby | The field to sort by. |
int | $sortorder | The sort order. |
|
inherited |
Set the sql to query the db.
Query will be : SELECT $fields FROM $from WHERE $where Of course you can use sub-queries, JOINS etc. by putting them in the appropriate clause of the query.
Reimplemented in forumreport_summary\summary_table.
assign_grading_table::setup | ( | ) |
Overides setup to ensure it will only run a single time.
Reimplemented from flexible_table.
|
inherited |
Where to show download buttons.
array | $showat | array of postions in which to show download buttons. Containing TABLE_P_TOP and/or TABLE_P_BOTTOM |
|
protected |
Override the table show_hide_link to not show for select column.
string | $column | the column name, index into various names. |
int | $index | numerical index of the column. |
string | HTML fragment. |
Reimplemented from flexible_table.
|
protectedinherited |
Generate the HTML for the sort icon.
This is a helper method used by sort_link().
bool | $isprimary | whether an icon is needed (it is only needed for the primary sort column.) |
int | $order | SORT_ASC or SORT_DESC |
string | HTML fragment. |
|
protectedinherited |
Generate the HTML for the sort link.
This is a helper method used by print_headers().
string | $text | the text for the link. |
string | $column | the column name, may be a fake column like 'firstname' or a real one. |
bool | $isprimary | whether the is column is the current primary sort column. |
int | $order | SORT_ASC or SORT_DESC |
string | HTML fragment. |
|
protectedinherited |
Generate the correct tool tip for changing the sort order.
This is a helper method used by sort_link().
bool | $isprimary | whether the is column is the current primary sort column. |
int | $order | SORT_ASC or SORT_DESC |
string | the correct title. |
|
inherited |
Sets the is_sortable variable to the given boolean, sort_default_column to the given string, and the sort_default_order to the given integer.
bool | $bool | |
string | $defaultcolumn | |
int | $defaultorder |
void |
|
inherited |
This function is not part of the public api.
Reimplemented in core_reportbuilder\table\base_report_table.
|
inherited |
This function is not part of the public api.
You don't normally need to call this. It is called automatically when needed when you start adding data to the table.
assign_grading_table::submissions_enabled | ( | ) |
Return things to the renderer.
bool | Does this assignment accept submissions |
|
inherited |
Use text sorting functions for this column (required for text columns with Oracle).
Be warned that you cannot use this with column aliases. You can only do this with real columns. See MDL-40481 for an example.
string | column name |
|
inherited |
Hook that can be overridden in child classes to wrap a table in a form for example.
Called only when there is data to display and not downloading.
Reimplemented in core_reportbuilder\table\custom_report_table, forumreport_summary\summary_table, mod_quiz\local\reports\attempts_report_table, quiz_statistics_table, tool_dataprivacy\output\data_requests_table, and tool_policy\acceptances_table.
|
inherited |
Hook that can be overridden in child classes to wrap a table in a form for example.
Called only when there is data to display and not downloading.
Reimplemented in mod_quiz\local\reports\attempts_report_table, quiz_statistics_table, and tool_policy\acceptances_table.
|
inherited |
which download plugin to use.
Default '' means none - print html table with paging. Property set by is_downloading which typically passes in cleaned data from $
|
inherited |
whether data is downloadable from table.
Determines whether to display download buttons. Set by method downloadable().
|
inherited |
sql for querying db.
Has fields 'fields', 'from', 'where', 'params'.
|
protectedinherited |
Columns that are expected to contain a users fullname.