Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core_course_management_renderer Class Reference

Main renderer for the course management pages. More...

Inheritance diagram for core_course_management_renderer:
plugin_renderer_base renderer_base

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 ()
 
 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.
 

Detailed Description

Main renderer for the course management pages.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ accessible_skipto_links()

core_course_management_renderer::accessible_skipto_links ( $displaycategorylisting,
$displaycourselisting,
$displaycoursedetail )

Creates access hidden skip to links for the displayed sections.

Parameters
bool$displaycategorylisting
bool$displaycourselisting
bool$displaycoursedetail
Return values
string

◆ action_button()

core_course_management_renderer::action_button ( moodle_url $url,
$text,
$id = null,
$class = null,
$title = null,
array $attributes = array() )
protected

Creates an action button (styled link)

Parameters
moodle_url$urlThe URL to go to when clicked.
string$textThe text for the button.
string$idAn id to give the button.
string$classA class to give the button.
array$attributesAny additional attributes
Return values
string

◆ action_icon()

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.

Parameters
string | moodle_url$urlA string URL or moodel_url
pix_icon$pixicon
component_action$action
array$attributesassociative array of html link attributes + disabled
bool$linktextshow title next to image in link
Return values
stringHTML fragment

◆ category_bulk_actions()

core_course_management_renderer::category_bulk_actions ( core_course_category $category = null)

Renders bulk actions for categories.

Parameters
core_course_category$categoryThe currently selected category if there is one.
Return values
string

◆ category_listing()

core_course_management_renderer::category_listing ( core_course_category $category = null)

Presents a course category listing.

Parameters
core_course_category$categoryThe currently selected category. Also the category to highlight in the listing.
Return values
string

◆ category_listing_actions()

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.

Parameters
core_course_category$category
Return values
string

◆ category_listitem()

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.

Parameters
core_course_category$categoryThe category to render as listitem.
core_course_category[]$subcategoriesThe subcategories belonging to the category being rented.
int$totalsubcategoriesThe total number of sub categories.
int$selectedcategoryThe currently selected category
int[]$selectedcategoriesThe path to the selected category and its ID.
Return values
string

◆ category_listitem_actions()

core_course_management_renderer::category_listitem_actions ( core_course_category $category,
array $actions = null )

Renderers the actions for individual category list items.

Parameters
core_course_category$category
array$actions
Return values
string

◆ course_bulk_actions()

core_course_management_renderer::course_bulk_actions ( core_course_category $category)

Renderers bulk actions that can be performed on courses.

Parameters
core_course_category$categoryThe currently selected category and the category in which courses that are selectable belong.
Return values
string

◆ course_detail()

core_course_management_renderer::course_detail ( core_course_list_element $course)

Renderers detailed course information.

Parameters
core_course_list_element$courseThe course to display details for.
Return values
string

◆ course_detail_actions()

core_course_management_renderer::course_detail_actions ( core_course_list_element $course)

A collection of actions for a course.

Parameters
core_course_list_element$courseThe course to display actions for.
Return values
string

◆ course_listing()

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.

Parameters
core_course_category$categoryThe currently selected category. This is what the listing is focused on.
core_course_list_element$courseThe currently selected course.
int$pageThe page being displayed.
int$perpageThe number of courses to display per page.
string | null$viewmodeThe view mode the page is in, one out of 'default', 'combined', 'courses' or 'categories'.
Return values
string

◆ course_listing_actions()

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.

Parameters
core_course_category$category
core_course_list_element$courseThe currently selected course.
int$perpage
Return values
string

◆ course_listitem()

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.

Parameters
core_course_category$categoryThe currently selected category and the category the course belongs to.
core_course_list_element$courseThe course to produce HTML for.
int$selectedcourseThe id of the currently selected course.
Return values
string

◆ course_listitem_actions()

core_course_management_renderer::course_listitem_actions ( core_course_category $category,
core_course_list_element $course )

Renderers actions for individual course actions.

Parameters
core_course_category$categoryThe currently selected category.
core_course_list_element$courseThe course to renderer actions for.
Return values
string

◆ course_search_bulk_actions()

core_course_management_renderer::course_search_bulk_actions ( )

Renderers bulk actions that can be performed on courses in search returns.

Return values
string

◆ detail_pair()

core_course_management_renderer::detail_pair ( $key,
$value,
$class = '' )
protected

Renderers a key value pair of information for display.

Parameters
string$key
string$value
string$class
Return values
string

◆ enhance_management_interface()

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.

◆ grid_column_end()

core_course_management_renderer::grid_column_end ( )

Closes a grid column.

Return values
string

◆ grid_column_start()

core_course_management_renderer::grid_column_start ( $size,
$id = null,
$class = null )

Opens a grid column.

Parameters
int$sizeThe number of segments this column should span.
string$idAn id to give the column.
string$classA class to give the column.
Return values
string

◆ grid_end()

core_course_management_renderer::grid_end ( )

Closes the grid.

Return values
string

◆ grid_start()

core_course_management_renderer::grid_start ( $id = null,
$class = null )

Opens a grid.

Call core_course_management_renderer::grid_column_start() to create columns.

Parameters
string$idAn id to give this grid.
string$classA class to give this grid.
Return values
string

◆ listing_pagination()

core_course_management_renderer::listing_pagination ( core_course_category $category,
$page,
$perpage,
$showtotals = false,
$viewmode = 'default' )
protected

Renders pagination for a course listing.

Parameters
core_course_category$categoryThe category to produce pagination for.
int$pageThe current page.
int$perpageThe number of courses to display per page.
bool$showtotalsSet to true to show the total number of courses and what is being displayed.
string | null$viewmodeThe view mode the page is in, one out of 'default', 'combined', 'courses' or 'categories'.
Return values
string

◆ management_form_end()

core_course_management_renderer::management_form_end ( )

Closes the course category bulk management form.

Return values
string

◆ management_form_start()

core_course_management_renderer::management_form_start ( )

Prepares the form element for the course category listing bulk actions.

Return values
string

◆ render_action_bar()

core_course_management_renderer::render_action_bar ( \core_course\output\manage_categories_action_bar $actionbar)

Render the tertiary nav for the manage categories page.

Parameters
core_course\output\manage_categories_action_bar$actionbar
Return values
stringThe renderered template

◆ search_listing()

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.

Parameters
array$coursesThe courses to display.
int$totalcoursesThe total number of courses to display.
core_course_list_element$courseThe currently selected course if there is one.
int$pageThe current page, starting at 0.
int$perpageThe number of courses to display per page.
string$searchThe string we are searching for.
Return values
string

◆ search_listitem()

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.

Parameters
core_course_list_element$courseThe course to produce HTML for.
int$selectedcourseThe id of the currently selected course.
Return values
string

◆ search_listitem_actions()

core_course_management_renderer::search_listitem_actions ( core_course_list_element $course)

Renderers actions for individual course actions.

Parameters
core_course_list_element$courseThe course to renderer actions for.
Return values
string

◆ search_pagination()

core_course_management_renderer::search_pagination ( $totalcourses,
$page,
$perpage,
$showtotals = false,
$search = '' )
protected

Displays pagination for search results.

Parameters
int$totalcoursesThe total number of courses to be displayed.
int$pageThe current page.
int$perpageThe number of courses being displayed.
bool$showtotalsWhether or not to print total information.
string$searchThe string we are searching for.
Return values
string

◆ view_mode_selector()

core_course_management_renderer::view_mode_selector ( array $modes,
$currentmode,
moodle_url $url = null,
$param = 'view' )

Displays a view mode selector.

Parameters
array$modesAn array of view modes.
string$currentmodeThe current view mode.
moodle_url$urlThe URL to use when changing actions. Defaults to the page URL.
string$paramThe param name.
Return values
string

Member Data Documentation

◆ __pad0__

replacement core_course_management_renderer::__pad0__
Deprecated
since Moodle 4.0. This is now handled/replaced with the tertiary navigation

◆ __pad1__

replacement core_course_management_renderer::__pad1__
Deprecated
since Moodle 4.0. This is now handled within manage_categories_action_bar

The documentation for this class was generated from the following file: