Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
|
Main renderer for the course management pages. More...
Public Member Functions | |
__call ($method, $arguments) | |
Magic method used to pass calls otherwise meant for the standard renderer to it to ensure we don't go causing unnecessary grief. | |
accessible_skipto_links ($displaycategorylisting, $displaycourselisting, $displaycoursedetail) | |
Creates access hidden skip to links for the displayed sections. | |
action_icon ($url, pix_icon $pixicon, component_action $action=null, array $attributes=null, $linktext=false) | |
Renders an action_icon. | |
add_action_handler (component_action $action, $id=null) | |
Adds a JS action for the element with the provided id. | |
category_bulk_actions (core_course_category $category=null) | |
Renders bulk actions for categories. | |
category_listing (core_course_category $category=null) | |
Presents a course category listing. | |
category_listing_actions (core_course_category $category=null) | |
Renderers the actions that are possible for the course category listing. | |
category_listitem (core_course_category $category, array $subcategories, $totalsubcategories, $selectedcategory=null, $selectedcategories=array()) | |
Renders a category list item. | |
category_listitem_actions (core_course_category $category, array $actions=null) | |
Renderers the actions for individual category list items. | |
course_bulk_actions (core_course_category $category) | |
Renderers bulk actions that can be performed on courses. | |
course_detail (core_course_list_element $course) | |
Renderers detailed course information. | |
course_detail_actions (core_course_list_element $course) | |
A collection of actions for a course. | |
course_listing (core_course_category $category=null, core_course_list_element $course=null, $page=0, $perpage=20, $viewmode='default') | |
Renders a course listing. | |
course_listing_actions (core_course_category $category, core_course_list_element $course=null, $perpage=20) | |
Renderers actions for the course listing. | |
course_listitem (core_course_category $category, core_course_list_element $course, $selectedcourse) | |
Renderers a course list item. | |
course_listitem_actions (core_course_category $category, core_course_list_element $course) | |
Renderers actions for individual course actions. | |
course_search_bulk_actions () | |
Renderers bulk actions that can be performed on courses in search returns. | |
replacement | course_search_form () |
enhance_management_interface () | |
Initialises the JS required to enhance the management interface. | |
get_compact_logo_url ($maxwidth=300, $maxheight=300) | |
Return the site's compact logo URL, if any. | |
get_logo_url ($maxwidth=null, $maxheight=200) | |
Return the site's logo URL, if any. | |
get_page () | |
Returns the moodle page object. | |
grid_column_end () | |
Closes a grid column. | |
grid_column_start ($size, $id=null, $class=null) | |
Opens a grid column. | |
grid_end () | |
Closes the grid. | |
grid_start ($id=null, $class=null) | |
Opens a grid. | |
has_started () | |
Returns true is output has already started, and false if not. | |
image_url ($imagename, $component='moodle') | |
Return the moodle_url for an image. | |
management_form_end () | |
Closes the course category bulk management form. | |
management_form_start () | |
Prepares the form element for the course category listing bulk actions. | |
replacement | management_heading () |
pix_url ($imagename, $component='moodle') | |
Return the direct URL for an image from the pix folder. | |
render (renderable $widget) | |
Renders the provided widget and returns the HTML to display it. | |
render_action_bar (\core_course\output\manage_categories_action_bar $actionbar) | |
Render the tertiary nav for the manage categories page. | |
render_action_menu ($menu) | |
render_from_template ($templatename, $context) | |
Renders a template by name with the given context. | |
search_listing (array $courses, $totalcourses, core_course_list_element $course=null, $page=0, $perpage=20, $search='') | |
Displays a search result listing. | |
search_listitem (core_course_list_element $course, $selectedcourse) | |
Renderers a search result course list item. | |
search_listitem_actions (core_course_list_element $course) | |
Renderers actions for individual course actions. | |
should_display_main_logo ($headinglevel=1) | |
Whether we should display the main logo. | |
should_display_navbar_logo () | |
Whether we should display the logo in the navbar. | |
view_mode_selector (array $modes, $currentmode, moodle_url $url=null, $param='view') | |
Displays a view mode selector. | |
Static Public Member Functions | |
static | prepare_classes ($classes) |
Given an array or space-separated list of classes, prepares and returns the HTML class attribute value. | |
Public Attributes | |
replacement | : 'manage_categories_action_bar' |
replacement | : 'manage_categories_action_bar' |
replacement | mdl: '<a class="el" href="https: final: true |
replacement | since: '4.0' |
Protected Member Functions | |
action_button (moodle_url $url, $text, $id=null, $class=null, $title=null, array $attributes=array()) | |
Creates an action button (styled link) | |
detail_pair ($key, $value, $class='') | |
Renderers a key value pair of information for display. | |
get_mustache () | |
Return an instance of the mustache class. | |
listing_pagination (core_course_category $category, $page, $perpage, $showtotals=false, $viewmode='default') | |
Renders pagination for a course listing. | |
search_pagination ($totalcourses, $page, $perpage, $showtotals=false, $search='') | |
Displays pagination for search results. | |
Protected Attributes | |
xhtml_container_stack | $opencontainers |
The xhtml_container_stack to use. | |
renderer_base core_renderer | $output |
A reference to the current renderer. | |
moodle_page | $page |
The Moodle page the renderer has been created to assist with. | |
string | $target |
The requested rendering target. | |
array | $templatecache = [] |
$templatecache The mustache template cache. | |
Main renderer for the course management pages.
core_course_management_renderer::accessible_skipto_links | ( | $displaycategorylisting, | |
$displaycourselisting, | |||
$displaycoursedetail ) |
Creates access hidden skip to links for the displayed sections.
bool | $displaycategorylisting | |
bool | $displaycourselisting | |
bool | $displaycoursedetail |
string |
|
protected |
Creates an action button (styled link)
moodle_url | $url | The URL to go to when clicked. |
string | $text | The text for the button. |
string | $id | An id to give the button. |
string | $class | A class to give the button. |
array | $attributes | Any additional attributes |
string |
core_course_management_renderer::action_icon | ( | $url, | |
pix_icon | $pixicon, | ||
component_action | $action = null, | ||
array | $attributes = null, | ||
$linktext = false ) |
Renders an action_icon.
This function uses the core_renderer::action_link() method for the most part. What it does different is prepare the icon as HTML and use it as the link text.
string | moodle_url | $url | A string URL or moodel_url |
pix_icon | $pixicon | |
component_action | $action | |
array | $attributes | associative array of html link attributes + disabled |
bool | $linktext | show title next to image in link |
string | HTML fragment |
core_course_management_renderer::category_bulk_actions | ( | core_course_category | $category = null | ) |
Renders bulk actions for categories.
core_course_category | $category | The currently selected category if there is one. |
string |
core_course_management_renderer::category_listing | ( | core_course_category | $category = null | ) |
Presents a course category listing.
core_course_category | $category | The currently selected category. Also the category to highlight in the listing. |
string |
core_course_management_renderer::category_listing_actions | ( | core_course_category | $category = null | ) |
Renderers the actions that are possible for the course category listing.
These are not the actions associated with an individual category listing. That happens through category_listitem_actions.
core_course_category | $category |
string |
core_course_management_renderer::category_listitem | ( | core_course_category | $category, |
array | $subcategories, | ||
$totalsubcategories, | |||
$selectedcategory = null, | |||
$selectedcategories = array() ) |
Renders a category list item.
This function gets called recursively to render sub categories.
core_course_category | $category | The category to render as listitem. |
core_course_category[] | $subcategories | The subcategories belonging to the category being rented. |
int | $totalsubcategories | The total number of sub categories. |
int | $selectedcategory | The currently selected category |
int[] | $selectedcategories | The path to the selected category and its ID. |
string |
core_course_management_renderer::category_listitem_actions | ( | core_course_category | $category, |
array | $actions = null ) |
Renderers the actions for individual category list items.
core_course_category | $category | |
array | $actions |
string |
core_course_management_renderer::course_bulk_actions | ( | core_course_category | $category | ) |
Renderers bulk actions that can be performed on courses.
core_course_category | $category | The currently selected category and the category in which courses that are selectable belong. |
string |
core_course_management_renderer::course_detail | ( | core_course_list_element | $course | ) |
Renderers detailed course information.
core_course_list_element | $course | The course to display details for. |
string |
core_course_management_renderer::course_detail_actions | ( | core_course_list_element | $course | ) |
A collection of actions for a course.
core_course_list_element | $course | The course to display actions for. |
string |
core_course_management_renderer::course_listing | ( | core_course_category | $category = null, |
core_course_list_element | $course = null, | ||
$page = 0, | |||
$perpage = 20, | |||
$viewmode = 'default' ) |
Renders a course listing.
core_course_category | $category | The currently selected category. This is what the listing is focused on. |
core_course_list_element | $course | The currently selected course. |
int | $page | The page being displayed. |
int | $perpage | The number of courses to display per page. |
string | null | $viewmode | The view mode the page is in, one out of 'default', 'combined', 'courses' or 'categories'. |
string |
core_course_management_renderer::course_listing_actions | ( | core_course_category | $category, |
core_course_list_element | $course = null, | ||
$perpage = 20 ) |
Renderers actions for the course listing.
Not to be confused with course_listitem_actions which renderers the actions for individual courses.
core_course_category | $category | |
core_course_list_element | $course | The currently selected course. |
int | $perpage |
string |
core_course_management_renderer::course_listitem | ( | core_course_category | $category, |
core_course_list_element | $course, | ||
$selectedcourse ) |
Renderers a course list item.
This function will be called for every course being displayed by course_listing.
core_course_category | $category | The currently selected category and the category the course belongs to. |
core_course_list_element | $course | The course to produce HTML for. |
int | $selectedcourse | The id of the currently selected course. |
string |
core_course_management_renderer::course_listitem_actions | ( | core_course_category | $category, |
core_course_list_element | $course ) |
Renderers actions for individual course actions.
core_course_category | $category | The currently selected category. |
core_course_list_element | $course | The course to renderer actions for. |
string |
core_course_management_renderer::course_search_bulk_actions | ( | ) |
Renderers bulk actions that can be performed on courses in search returns.
string |
|
protected |
Renderers a key value pair of information for display.
string | $key | |
string | $value | |
string | $class |
string |
core_course_management_renderer::enhance_management_interface | ( | ) |
Initialises the JS required to enhance the management interface.
Thunderbirds are go, this function kicks into gear the JS that makes the course management pages that much cooler.
core_course_management_renderer::grid_column_end | ( | ) |
Closes a grid column.
string |
core_course_management_renderer::grid_column_start | ( | $size, | |
$id = null, | |||
$class = null ) |
Opens a grid column.
int | $size | The number of segments this column should span. |
string | $id | An id to give the column. |
string | $class | A class to give the column. |
string |
core_course_management_renderer::grid_end | ( | ) |
Closes the grid.
string |
core_course_management_renderer::grid_start | ( | $id = null, | |
$class = null ) |
Opens a grid.
Call core_course_management_renderer::grid_column_start() to create columns.
string | $id | An id to give this grid. |
string | $class | A class to give this grid. |
string |
|
protected |
Renders pagination for a course listing.
core_course_category | $category | The category to produce pagination for. |
int | $page | The current page. |
int | $perpage | The number of courses to display per page. |
bool | $showtotals | Set to true to show the total number of courses and what is being displayed. |
string | null | $viewmode | The view mode the page is in, one out of 'default', 'combined', 'courses' or 'categories'. |
string |
core_course_management_renderer::management_form_end | ( | ) |
Closes the course category bulk management form.
string |
core_course_management_renderer::management_form_start | ( | ) |
Prepares the form element for the course category listing bulk actions.
string |
core_course_management_renderer::render_action_bar | ( | \core_course\output\manage_categories_action_bar | $actionbar | ) |
Render the tertiary nav for the manage categories page.
core_course\output\manage_categories_action_bar | $actionbar |
string | The renderered template |
core_course_management_renderer::search_listing | ( | array | $courses, |
$totalcourses, | |||
core_course_list_element | $course = null, | ||
$page = 0, | |||
$perpage = 20, | |||
$search = '' ) |
Displays a search result listing.
array | $courses | The courses to display. |
int | $totalcourses | The total number of courses to display. |
core_course_list_element | $course | The currently selected course if there is one. |
int | $page | The current page, starting at 0. |
int | $perpage | The number of courses to display per page. |
string | $search | The string we are searching for. |
string |
core_course_management_renderer::search_listitem | ( | core_course_list_element | $course, |
$selectedcourse ) |
Renderers a search result course list item.
This function will be called for every course being displayed by course_listing.
core_course_list_element | $course | The course to produce HTML for. |
int | $selectedcourse | The id of the currently selected course. |
string |
core_course_management_renderer::search_listitem_actions | ( | core_course_list_element | $course | ) |
Renderers actions for individual course actions.
core_course_list_element | $course | The course to renderer actions for. |
string |
|
protected |
Displays pagination for search results.
int | $totalcourses | The total number of courses to be displayed. |
int | $page | The current page. |
int | $perpage | The number of courses being displayed. |
bool | $showtotals | Whether or not to print total information. |
string | $search | The string we are searching for. |
string |
core_course_management_renderer::view_mode_selector | ( | array | $modes, |
$currentmode, | |||
moodle_url | $url = null, | ||
$param = 'view' ) |
Displays a view mode selector.
array | $modes | An array of view modes. |
string | $currentmode | The current view mode. |
moodle_url | $url | The URL to use when changing actions. Defaults to the page URL. |
string | $param | The param name. |
string |
replacement core_course_management_renderer::__pad0__ |
replacement core_course_management_renderer::__pad1__ |