Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
core_renderer Class Reference
Inheritance diagram for core_renderer:
renderer_base core_renderer_ajax core_renderer_cli core_renderer_maintenance

Public Member Functions

 __construct (moodle_page $page, $target)
 Constructor. More...
 
 action_icon ($url, pix_icon $pixicon, component_action $action=null, array $attributes=null, $linktext=false)
 Renders an action_icon. More...
 
 action_link ($url, $text, component_action $action=null, array $attributes=null, $icon=null)
 Renders a special html link with attached action. More...
 
 activity_navigation ()
 Returns standard navigation between activities in a course. More...
 
 add_action_handler (component_action $action, $id=null)
 Adds a JS action for the element with the provided id. More...
 
 block (block_contents $bc, $region)
 Prints a nice side block with an optional header. More...
 
 block_controls ($actions, $blockid=null)
 Output the row of editing icons for a block, as defined by the controls array. More...
 
 block_move_target ($target, $zones, $previous, $region)
 Output a place where the block that is currently being moved can be dropped. More...
 
 blocks ($region, $classes=array(), $tag='aside')
 Get the HTML for blocks in the given region. More...
 
 blocks_for_region ($region)
 Output all the blocks in a particular region. More...
 
 body_attributes ($additionalclasses=array())
 Returns HTML attributes to use within the body tag. More...
 
 body_css_classes (array $additionalclasses=array())
 Returns the CSS classes to apply to the body tag. More...
 
 body_id ()
 The ID attribute to apply to the body tag. More...
 
 box ($contents, $classes='generalbox', $id=null, $attributes=array())
 Outputs a box. More...
 
 box_end ()
 Outputs the closing section of a box. More...
 
 box_start ($classes='generalbox', $id=null, $attributes=array())
 Outputs the opening section of a box. More...
 
 check_result (core\check\result $result)
 Renders a Check API result. More...
 
 close_window_button ($text='')
 Returns HTML to display a simple button to close a window. More...
 
 confirm ($message, $continue, $cancel)
 Print a message along with button choices for Continue/Cancel. More...
 
 container ($contents, $classes=null, $id=null)
 Outputs a container. More...
 
 container_end ()
 Outputs the closing section of a container. More...
 
 container_end_all ($shouldbenone=false)
 Close all but the last open container. More...
 
 container_start ($classes=null, $id=null)
 Outputs the opening section of a container. More...
 
 context_header ($headerinfo=null, $headinglevel=1)
 
 context_header_settings_menu ()
 This is an optional menu that can be added to a layout by a theme. More...
 
 continue_button ($url)
 Returns HTML to display a continue button that goes to a particular URL. More...
 
 course_content_footer ($onlyifnotcalledbefore=false)
 Returns course-specific information to be output immediately below content on any course page (for the current course) More...
 
 course_content_header ($onlyifnotcalledbefore=false)
 Returns course-specific information to be output immediately above content on any course page (for the current course) More...
 
 course_footer ()
 Returns course-specific information to be output on any course page in the footer area (for the current course) More...
 
 course_header ()
 Returns course-specific information to be output on any course page in the header area (for the current course) More...
 
 custom_block_region ($regionname)
 Renders a custom block region. More...
 
 custom_menu ($custommenuitems='')
 Returns the custom menu if one has been set. More...
 
 custom_menu_flat ()
 We want to show the custom menus as a list of links in the footer on small screens. More...
 
 darrow ()
 Accessibility: Down arrow-like character. More...
 
 doc_link ($path, $text='', $forcepopup=false, array $attributes=[])
 Returns a string containing a link to the user documentation. More...
 
 doctype ()
 Get the DOCTYPE declaration that should be used with this page. More...
 
 download_dataformat_selector ($label, $base, $name='dataformat', $params=array())
 Returns a dataformat selection and download form. More...
 
 edit_button (moodle_url $url)
 Returns HTML to display a "Turn editing on/off" button in a form. More...
 
 error_text ($message)
 Output an error message. More...
 
 fatal_error ($message, $moreinfourl, $link, $backtrace, $debuginfo=null, $errorcode="")
 Do not call this function directly. More...
 
 favicon ()
 Returns the moodle_url for the favicon. More...
 
 file_picker ($options)
 Returns HTML to display the file picker. More...
 
 footer ()
 Outputs the page's footer. More...
 
 full_header ()
 Wrapper for header elements. More...
 
 get_compact_logo_url ($maxwidth=300, $maxheight=300)
 Return the site's compact logo URL, if any. More...
 
 get_generated_color_for_id ($id)
 Get the course color to show on a course card. More...
 
 get_generated_image_for_id ($id)
 Get the course pattern datauri to show on a course card. More...
 
 get_logo_url ($maxwidth=null, $maxheight=200)
 Return the site's logo URL, if any. More...
 
 has_started ()
 Returns true is output has already started, and false if not. More...
 
 header ()
 Start output by sending the HTTP headers, and printing the HTML <head> and the start of the <body>. More...
 
 heading ($text, $level=2, $classes=null, $id=null)
 Outputs a heading. More...
 
 heading_with_help ($text, $helpidentifier, $component='moodle', $icon='', $iconalt='', $level=2, $classnames=null)
 Centered heading with attached help button (same title text) and optional icon attached. More...
 
 help_icon ($identifier, $component='moodle', $linktext='')
 Returns HTML to display a help icon. More...
 
 help_icon_scale ($courseid, stdClass $scale)
 Returns HTML to display a scale help icon. More...
 
 home_link ()
 Return the 'back' link that normally appears in the footer. More...
 
 htmlattributes ()
 The attributes that should be added to the <html> tag. More...
 
 htmllize_file_tree ($dir)
 Internal implementation of file tree viewer items rendering. More...
 
 image_icon ($pix, $alt, $component='moodle', array $attributes=null)
 Return HTML for an image_icon. More...
 
 image_url ($imagename, $component='moodle')
 Return the moodle_url for an image. More...
 
 initials_bar ($current, $class, $title, $urlvar, $url, $alpha=null)
 Returns HTML to display initials bar to provide access to other pages (usually in a search) More...
 
 lang_menu ()
 Returns lang menu or '', this method also checks forcing of languages in courses. More...
 
 larrow ()
 Accessibility: Left arrow-like character is used in the breadcrumb trail, course navigation menu (previous/next activity), calendar, and search forum block. More...
 
 list_block_contents ($icons, $items)
 Render the contents of a block_list. More...
 
 login_info ($withlinks=null)
 Return the standard string that says whether you are logged in (and switched roles/logged in as another user). More...
 
 main_content ()
 Returns standard main content placeholder. More...
 
 maintenance_warning ()
 Scheduled maintenance warning message. More...
 
 mform_element ($element, $required, $advanced, $error, $ingroup)
 Renders an mform element from a template. More...
 
 navbar ()
 This renders the navbar. More...
 
 navbar_plugin_output ()
 Allow plugins to provide some content to be rendered in the navbar. More...
 
 notification ($message, $type=null)
 Output a notification (that is, a status message about something that has just happened). More...
 
 notify_message ()
 
 notify_problem ()
 
 notify_redirect ()
 
 notify_success ()
 
 old_help_icon ($helpidentifier, $title, $component='moodle', $linktext='')
 Returns HTML to display a help icon. More...
 
 page_doc_link ($text=null)
 Returns the Moodle docs link to use for this page. More...
 
 page_heading ($tag='h1')
 Gets HTML for the page heading. More...
 
 page_heading_button ()
 Gets the HTML for the page heading button. More...
 
 page_heading_menu ()
 Returns the page heading menu. More...
 
 page_title ()
 Returns the title to use on the page. More...
 
 paging_bar ($totalcount, $page, $perpage, $baseurl, $pagevar='page')
 Returns HTML to display a single paging bar to provide access to other pages (usually in a search) More...
 
 pix_icon ($pix, $alt, $component='moodle', array $attributes=null)
 Return HTML for a pix_icon. More...
 
 pix_url ($imagename, $component='moodle')
 Return the direct URL for an image from the pix folder. More...
 
 print_textarea ($name, $id, $value, $rows, $cols)
 Returns the HTML for a basic textarea field. More...
 
 rarrow ()
 Accessibility: Right arrow-like character is used in the breadcrumb trail, course navigation menu (previous/next activity), calendar, and search forum block. More...
 
 redirect_message ($encodedurl, $message, $delay, $debugdisableredirect, $messagetype=core\output\notification::NOTIFY_INFO)
 Redirects the user by any means possible given the current state. More...
 
 region_main_settings_menu ()
 This is an optional menu that can be added to a layout by a theme. More...
 
 render (renderable $widget)
 Returns rendered widget. More...
 
 render_action_menu (action_menu $menu)
 Renders an action menu component. More...
 
 render_chart (\core\chart_base $chart, $withtable=true)
 Renders a chart. More...
 
 render_chart_bar (\core\chart_bar $chart)
 Renders a bar chart. More...
 
 render_chart_line (\core\chart_line $chart)
 Renders a line chart. More...
 
 render_chart_pie (\core\chart_pie $chart)
 Renders a pie chart. More...
 
 render_checkbox_toggleall (\core\output\checkbox_toggleall $element)
 Renders element for a toggle-all checkbox. More...
 
 render_file_picker (file_picker $fp)
 Internal implementation of file picker rendering. More...
 
 render_from_template ($templatename, $context)
 Renders a template by name with the given context. More...
 
 render_inplace_editable (\core\output\inplace_editable $element)
 Renders element for inline editing of any value. More...
 
 render_login (\core_auth\output\login $form)
 Renders the login form. More...
 
 render_login_signup_form ($form)
 Render the login signup form into a nice template for the theme. More...
 
 render_preferences_group (preferences_group $renderable)
 Renders preferences group. More...
 
 render_preferences_groups (preferences_groups $renderable)
 Renders preferences groups. More...
 
 render_progress_bar (progress_bar $bar)
 Renders a progress bar. More...
 
 render_rating (rating $rating)
 Produces the html that represents this rating in the UI. More...
 
 render_skip_links ($links)
 Renders the skip links for the page. More...
 
 search_box ($id=false)
 Returns a search box. More...
 
 secure_layout_language_menu ()
 Returns the language menu in the secure layout. More...
 
 secure_layout_login_info ()
 Secure layout login info. More...
 
 should_display_main_logo ($headinglevel=1)
 Whether we should display the main logo. More...
 
 should_display_navbar_logo ()
 Whether we should display the logo in the navbar. More...
 
 single_button ($url, $label, $method='post', array $options=null)
 Returns a form with a single button. More...
 
 single_select ($url, $name, array $options, $selected='', $nothing=array(''=> 'choosedots'), $formid=null, $attributes=array())
 Returns a form with a single select widget. More...
 
 skip_link_target ($id=null)
 Output the place a skip link goes to. More...
 
 spacer (array $attributes=null, $br=false)
 Creates and returns a spacer image with optional line break. More...
 
 standard_after_main_region_html ()
 The standard HTML that should be output just before the <footer> tag. More...
 
 standard_end_of_body_html ()
 The standard tags (typically script tags that are not needed earlier) that should be output after everything else. More...
 
 standard_footer_html ()
 The standard tags (typically performance information and validation links, if we are in developer debug mode) that should be output in the footer area of the page. More...
 
 standard_head_html ()
 The standard tags (meta tags, links to stylesheets and JavaScript, etc.) that should be included in the <head> tag. More...
 
 standard_top_of_body_html ()
 The standard tags (typically skip links) that should be output just inside the start of the <body> tag. More...
 
 tabtree ($tabs, $selected=null, $inactive=null)
 Renders tabs. More...
 
 tag_list ($tags, $label=null, $classes='', $limit=10, $pagecontext=null, $accesshidelabel=false)
 Displays the list of tags associated with an entry. More...
 
 tree_block_contents ($items, $attrs=array())
 Make nested HTML lists out of the items. More...
 
 uarrow ()
 Accessibility: Up arrow-like character is used in the book heirarchical navigation. More...
 
 update_module_button ()
 
 url_select (array $urls, $selected, $nothing=array(''=> 'choosedots'), $formid=null)
 Returns a form with a url select widget. More...
 
 user_menu ($user=null, $withlinks=null)
 Construct a user menu, returning HTML that can be echoed out by a layout file. More...
 
 user_picture (stdClass $user, array $options=null)
 Returns HTML to display the specified user's avatar. More...
 

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. More...
 

Public Attributes

string const MAIN_CONTENT_TOKEN = '[MAIN CONTENT GOES HERE]'
 Do NOT use, please use <?php echo $OUTPUT->main_content() ?> in layout files instead. More...
 

Protected Member Functions

 build_action_menu_from_navigation (action_menu $menu, navigation_node $node, $indent=false, $onlytopleafnodes=false)
 Take a node in the nav tree and make an action menu out of it. More...
 
 get_mustache ()
 Return an instance of the mustache class. More...
 
 is_login_page ()
 Check whether the current page is a login page. More...
 
 render_action_link (action_link $link)
 Renders an action_link object. More...
 
 render_action_menu_filler (action_menu_filler $action)
 Renders a primary action_menu_filler item. More...
 
 render_action_menu_link (action_menu_link $action)
 Renders an action_menu_link item. More...
 
 render_action_menu_link_primary (action_menu_link_primary $action)
 Renders a primary action_menu_link item. More...
 
 render_action_menu_link_secondary (action_menu_link_secondary $action)
 Renders a secondary action_menu_link item. More...
 
 render_breadcrumb_navigation_node (breadcrumb_navigation_node $item)
 Renders a breadcrumb navigation node object. More...
 
 render_check_result (core\check\result $result)
 Renders a Check API result. More...
 
 render_context_header (context_header $contextheader)
 Renders the header bar. More...
 
 render_custom_menu (custom_menu $menu)
 Renders a custom menu object (located in outputcomponents.php) More...
 
 render_custom_menu_item (custom_menu_item $menunode)
 Renders a custom menu node as part of a submenu. More...
 
 render_digital_minor_page ($page)
 Render the digital minor contact information page into a nice template for the theme. More...
 
 render_help_icon (help_icon $helpicon)
 Implementation of user image rendering. More...
 
 render_image_icon (image_icon $icon)
 Renders a pix_icon widget and returns the HTML to display it. More...
 
 render_initials_bar (initials_bar $initialsbar)
 Internal implementation of initials bar rendering. More...
 
 render_navigation_node (navigation_node $item)
 Renders a navigation node object. More...
 
 render_notification (\core\output\notification $notification)
 Render a notification (that is, a status message about something that has just happened). More...
 
 render_page_layout ($layoutfile)
 Renders and outputs the page layout file. More...
 
 render_paging_bar (paging_bar $pagingbar)
 Returns HTML to display the paging bar. More...
 
 render_pix_emoticon (pix_emoticon $emoticon)
 Return HTML to display an emoticon icon. More...
 
 render_pix_icon (pix_icon $icon)
 Renders a pix_icon widget and returns the HTML to display it. More...
 
 render_single_button (single_button $button)
 Renders a single button widget. More...
 
 render_single_select (single_select $select)
 Internal implementation of single_select rendering. More...
 
 render_tabobject (tabobject $tabobject)
 Renders tabobject (part of tabtree) More...
 
 render_tabtree (tabtree $tabtree)
 Renders tabtree. More...
 
 render_url_select (url_select $select)
 Internal implementation of url_select rendering. More...
 
 render_user_picture (user_picture $userpicture)
 Internal implementation of user image rendering. More...
 
 render_verify_age_location_page ($page)
 Render the verify age and location page into a nice template for the theme. More...
 
 theme_switch_links ()
 Renders theme links for switching between default and other themes. More...
 

Protected Attributes

string $contenttype
 Used to pass information from core_renderer::doctype() to core_renderer::standard_head_html().
 
custom_menu_item $language = null
 language The language menu if created
 
string $metarefreshtag = ''
 Used by core_renderer::redirect_message() method to communicate with core_renderer::header().
 
xhtml_container_stack $opencontainers
 The xhtml_container_stack to use.
 
moodle_page $page
 The Moodle page the renderer has been created to assist with.
 
string $target
 The requested rendering target.
 
string $unique_end_html_token
 Unique token for the closing HTML.
 
string $unique_main_content_token
 Unique token for the main content.
 
string $unique_performance_info_token
 Unique token for performance information.
 

Constructor & Destructor Documentation

◆ __construct()

core_renderer::__construct ( moodle_page  $page,
  $target 
)

Constructor.

Parameters
moodle_page$pagethe page we are doing output for.
string$targetone of rendering target constants

Reimplemented from renderer_base.

Reimplemented in core_renderer_maintenance.

Member Function Documentation

◆ action_icon()

core_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.

Theme developers: If you want to change how action links and/or icons are rendered, consider overriding function core_renderer::render_action_link() and core_renderer::render_pix_icon().

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

◆ action_link()

core_renderer::action_link (   $url,
  $text,
component_action  $action = null,
array  $attributes = null,
  $icon = null 
)

Renders a special html link with attached action.

Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_action_link() instead.

Parameters
string | moodle_url$url
string$textHTML fragment
component_action$action
array$attributesassociative array of html link attributes + disabled
pix_iconoptional pix icon to render with the link
Return values
stringHTML fragment

◆ activity_navigation()

core_renderer::activity_navigation ( )

Returns standard navigation between activities in a course.

Return values
stringthe navigation HTML.

◆ add_action_handler()

renderer_base::add_action_handler ( component_action  $action,
  $id = null 
)
inherited

Adds a JS action for the element with the provided id.

This method adds a JS event for the provided component action to the page and then returns the id that the event has been attached to. If no id has been provided then a new ID is generated by html_writer::random_id()

Parameters
component_action$action
string$id
Return values
stringid of element, either original submitted or random new if not supplied

◆ block()

core_renderer::block ( block_contents  $bc,
  $region 
)

Prints a nice side block with an optional header.

Parameters
block_contents$bcHTML for the content
string$regionthe region the block is appearing in.
Return values
stringthe HTML to be output.

Reimplemented in core_renderer_maintenance.

◆ block_controls()

core_renderer::block_controls (   $actions,
  $blockid = null 
)

Output the row of editing icons for a block, as defined by the controls array.

Parameters
array$controlsan array like block_contents::$controls.
string$blockidThe ID given to the block.
Return values
stringHTML fragment.

◆ block_move_target()

core_renderer::block_move_target (   $target,
  $zones,
  $previous,
  $region 
)

Output a place where the block that is currently being moved can be dropped.

Parameters
block_move_target$targetwith the necessary details.
array$zonesarray of areas where the block can be moved to
string$previousthe block located before the area currently being rendered.
string$regionthe name of the region
Return values
stringthe HTML to be output.

◆ blocks()

core_renderer::blocks (   $region,
  $classes = array(),
  $tag = 'aside' 
)

Get the HTML for blocks in the given region.

Since
Moodle 2.5.1 2.6
Parameters
string$regionThe region to get HTML for.
Return values
stringHTML.

Reimplemented in core_renderer_maintenance.

◆ blocks_for_region()

core_renderer::blocks_for_region (   $region)

Output all the blocks in a particular region.

Parameters
string$regionthe name of a region on this page.
Return values
stringthe HTML to be output.

Reimplemented in core_renderer_maintenance.

◆ body_attributes()

core_renderer::body_attributes (   $additionalclasses = array())

Returns HTML attributes to use within the body tag.

This includes an ID and classes.

Since
Moodle 2.5.1 2.6
Parameters
string | array$additionalclassesAny additional classes to give the body tag,
Return values
string

◆ body_css_classes()

core_renderer::body_css_classes ( array  $additionalclasses = array())

Returns the CSS classes to apply to the body tag.

Since
Moodle 2.5.1 2.6
Parameters
array$additionalclassesAny additional classes to apply.
Return values
string

◆ body_id()

core_renderer::body_id ( )

The ID attribute to apply to the body tag.

Since
Moodle 2.5.1 2.6
Return values
string

◆ box()

core_renderer::box (   $contents,
  $classes = 'generalbox',
  $id = null,
  $attributes = array() 
)

Outputs a box.

Parameters
string$contentsThe contents of the box
string$classesA space-separated list of CSS classes
string$idAn optional ID
array$attributesAn array of other attributes to give the box.
Return values
stringthe HTML to output.

◆ box_end()

core_renderer::box_end ( )

Outputs the closing section of a box.

Return values
stringthe HTML to output.

◆ box_start()

core_renderer::box_start (   $classes = 'generalbox',
  $id = null,
  $attributes = array() 
)

Outputs the opening section of a box.

Parameters
string$classesA space-separated list of CSS classes
string$idAn optional ID
array$attributesAn array of other attributes to give the box.
Return values
stringthe HTML to output.

◆ build_action_menu_from_navigation()

core_renderer::build_action_menu_from_navigation ( action_menu  $menu,
navigation_node  $node,
  $indent = false,
  $onlytopleafnodes = false 
)
protected

Take a node in the nav tree and make an action menu out of it.

The links are injected in the action menu.

Parameters
action_menu$menu
navigation_node$node
boolean$indent
boolean$onlytopleafnodes
Return values
booleannodesskipped - True if nodes were skipped in building the menu

◆ check_result()

core_renderer::check_result ( core\check\result  $result)

Renders a Check API result.

Parameters
result$result
Return values
stringHTML fragment

Reimplemented in core_renderer_cli.

◆ close_window_button()

core_renderer::close_window_button (   $text = '')

Returns HTML to display a simple button to close a window.

Parameters
string$textThe lang string for the button's label (already output from get_string())
Return values
stringhtml fragment

◆ confirm()

core_renderer::confirm (   $message,
  $continue,
  $cancel 
)

Print a message along with button choices for Continue/Cancel.

If a string or moodle_url is given instead of a single_button, method defaults to post.

Parameters
string$messageThe question to ask the user
single_button | moodle_url | string$continueThe single_button component representing the Continue answer. Can also be a moodle_url or string URL
single_button | moodle_url | string$cancelThe single_button component representing the Cancel answer. Can also be a moodle_url or string URL
Return values
stringHTML fragment

Reimplemented in core_renderer_maintenance.

◆ container()

core_renderer::container (   $contents,
  $classes = null,
  $id = null 
)

Outputs a container.

Parameters
string$contentsThe contents of the box
string$classesA space-separated list of CSS classes
string$idAn optional ID
Return values
stringthe HTML to output.

◆ container_end()

core_renderer::container_end ( )

Outputs the closing section of a container.

Return values
stringthe HTML to output.

◆ container_end_all()

core_renderer::container_end_all (   $shouldbenone = false)

Close all but the last open container.

This is useful in places like error handling, where you want to close all the open containers (apart from <body>) before outputting the error message.

Parameters
bool$shouldbenoneassert that the stack should be empty now - causes a developer debug warning if it isn't.
Return values
stringthe HTML required to close any open containers inside <body>.

◆ container_start()

core_renderer::container_start (   $classes = null,
  $id = null 
)

Outputs the opening section of a container.

Parameters
string$classesA space-separated list of CSS classes
string$idAn optional ID
Return values
stringthe HTML to output.

◆ context_header_settings_menu()

core_renderer::context_header_settings_menu ( )

This is an optional menu that can be added to a layout by a theme.

It contains the menu for the course administration, only on the course main page.

Return values
string

◆ continue_button()

core_renderer::continue_button (   $url)

Returns HTML to display a continue button that goes to a particular URL.

Parameters
string | moodle_url$urlThe url the button goes to.
Return values
stringthe HTML to output.

◆ course_content_footer()

core_renderer::course_content_footer (   $onlyifnotcalledbefore = false)

Returns course-specific information to be output immediately below content on any course page (for the current course)

Parameters
bool$onlyifnotcalledbeforeoutput content only if it has not been output before
Return values
string

Reimplemented in core_renderer_maintenance.

◆ course_content_header()

core_renderer::course_content_header (   $onlyifnotcalledbefore = false)

Returns course-specific information to be output immediately above content on any course page (for the current course)

Parameters
bool$onlyifnotcalledbeforeoutput content only if it has not been output before
Return values
string

Reimplemented in core_renderer_maintenance.

◆ course_footer()

core_renderer::course_footer ( )

Returns course-specific information to be output on any course page in the footer area (for the current course)

Return values
string

Reimplemented in core_renderer_maintenance.

◆ course_header()

core_renderer::course_header ( )

Returns course-specific information to be output on any course page in the header area (for the current course)

Return values
string

Reimplemented in core_renderer_maintenance.

◆ custom_block_region()

core_renderer::custom_block_region (   $regionname)

Renders a custom block region.

Use this method if you want to add an additional block region to the content of the page. Please note this should only be used in special situations. We want to leave the theme is control where ever possible!

This method must use the same method that the theme uses within its layout file. As such it asks the theme what method it is using. It can be one of two values, blocks or blocks_for_region (deprecated).

Parameters
string$regionnameThe name of the custom region to add.
Return values
stringHTML for the block region.

◆ custom_menu()

core_renderer::custom_menu (   $custommenuitems = '')

Returns the custom menu if one has been set.

A custom menu can be configured by browsing to Settings: Administration > Appearance > Themes > Theme settings and then configuring the custommenu config setting as described.

Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_custom_menu() instead.

Parameters
string$custommenuitems- custom menuitems set by theme instead of global theme settings
Return values
string

Reimplemented in core_renderer_maintenance.

◆ custom_menu_flat()

core_renderer::custom_menu_flat ( )

We want to show the custom menus as a list of links in the footer on small screens.

Just return the menu object exported so we can render it differently.

◆ darrow()

core_renderer::darrow ( )

Accessibility: Down arrow-like character.

If the theme does not set characters, appropriate defaults are set automatically.

Return values
string

◆ doc_link()

core_renderer::doc_link (   $path,
  $text = '',
  $forcepopup = false,
array  $attributes = [] 
)

Returns a string containing a link to the user documentation.

Also contains an icon by default. Shown to teachers and admin only.

Parameters
string$pathThe page link after doc root and language, no leading slash.
string$textThe text to be displayed for the link
boolean$forcepopupWhether to force a popup regardless of the value of $CFG->doctonewwindow
array$attributeshtm attributes
Return values
string

◆ doctype()

core_renderer::doctype ( )

Get the DOCTYPE declaration that should be used with this page.

Designed to be called in theme layout.php files.

Return values
stringthe DOCTYPE declaration that should be used.

◆ download_dataformat_selector()

core_renderer::download_dataformat_selector (   $label,
  $base,
  $name = 'dataformat',
  $params = array() 
)

Returns a dataformat selection and download form.

Parameters
string$labelA text label
moodle_url | string$baseThe download page url
string$nameThe query param which will hold the type of the download
array$paramsExtra params sent to the download page
Return values
stringHTML fragment

◆ edit_button()

core_renderer::edit_button ( moodle_url  $url)

Returns HTML to display a "Turn editing on/off" button in a form.

Parameters
moodle_url$urlThe URL + params to send through when clicking the button
Return values
stringHTML the button

◆ error_text()

core_renderer::error_text (   $message)

Output an error message.

By default wraps the error message in . If the error message is blank, nothing is output.

Parameters
string$messagethe error message.
Return values
stringthe HTML to output.

◆ fatal_error()

core_renderer::fatal_error (   $message,
  $moreinfourl,
  $link,
  $backtrace,
  $debuginfo = null,
  $errorcode = "" 
)

Do not call this function directly.

To terminate the current script with a fatal error, call the print_error function, or throw an exception. Doing either of those things will then call this function to display the error, before terminating the execution.

Parameters
string$messageThe message to output
string$moreinfourlURL where more info can be found about the error
string$linkLink for the Continue button
array$backtraceThe execution backtrace
string$debuginfoDebugging information
Return values
stringthe HTML to output.

Reimplemented in core_renderer_cli, and core_renderer_ajax.

◆ favicon()

core_renderer::favicon ( )

Returns the moodle_url for the favicon.

Since
Moodle 2.5.1 2.6
Return values
moodle_urlThe moodle_url for the favicon

◆ file_picker()

core_renderer::file_picker (   $options)

Returns HTML to display the file picker.

$OUTPUT->file_picker($options);

Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_file_picker() instead.

Parameters
array$optionsassociative array with file manager options options are: maxbytes=>-1, itemid=>0, client_id=>uniqid(), acepted_types=>'*', return_types=>FILE_INTERNAL, context=>current page context
Return values
stringHTML fragment

Reimplemented in core_renderer_maintenance.

◆ footer()

core_renderer::footer ( )

Outputs the page's footer.

Return values
stringHTML fragment

Reimplemented in core_renderer_cli, and core_renderer_ajax.

◆ full_header()

core_renderer::full_header ( )

Wrapper for header elements.

Return values
stringHTML to display the main header.

◆ get_compact_logo_url()

renderer_base::get_compact_logo_url (   $maxwidth = 300,
  $maxheight = 300 
)
inherited

Return the site's compact logo URL, if any.

Parameters
int$maxwidthThe maximum width, or null when the maximum width does not matter.
int$maxheightThe maximum height, or null when the maximum height does not matter.
Return values
moodle_url|false

◆ get_generated_color_for_id()

core_renderer::get_generated_color_for_id (   $id)

Get the course color to show on a course card.

Parameters
int$idId to use when generating the color.
Return values
stringhex color code.

◆ get_generated_image_for_id()

core_renderer::get_generated_image_for_id (   $id)

Get the course pattern datauri to show on a course card.

The datauri is an encoded svg that can be passed as a url.

Parameters
int$idId to use when generating the pattern
Return values
stringdatauri

◆ get_logo_url()

renderer_base::get_logo_url (   $maxwidth = null,
  $maxheight = 200 
)
inherited

Return the site's logo URL, if any.

Parameters
int$maxwidthThe maximum width, or null when the maximum width does not matter.
int$maxheightThe maximum height, or null when the maximum height does not matter.
Return values
moodle_url|false

◆ get_mustache()

renderer_base::get_mustache ( )
protectedinherited

Return an instance of the mustache class.

Since
2.9
Return values
Mustache_Engine

◆ has_started()

renderer_base::has_started ( )
inherited

Returns true is output has already started, and false if not.

Return values
booleantrue if the header has been printed.

◆ header()

core_renderer::header ( )

Start output by sending the HTTP headers, and printing the HTML <head> and the start of the <body>.

To control what is printed, you should set properties on $PAGE.

Return values
stringHTML that you must output this, preferably immediately.

Reimplemented in core_renderer_cli, and core_renderer_ajax.

◆ heading()

core_renderer::heading (   $text,
  $level = 2,
  $classes = null,
  $id = null 
)

Outputs a heading.

Parameters
string$textThe text of the heading
int$levelThe level of importance of the heading. Defaulting to 2
string$classesA space-separated list of CSS classes. Defaulting to null
string$idAn optional ID
Return values
stringthe HTML to output.

Reimplemented in core_renderer_cli, and core_renderer_ajax.

◆ heading_with_help()

core_renderer::heading_with_help (   $text,
  $helpidentifier,
  $component = 'moodle',
  $icon = '',
  $iconalt = '',
  $level = 2,
  $classnames = null 
)

Centered heading with attached help button (same title text) and optional icon attached.

Parameters
string$textA heading text
string$helpidentifierThe keyword that defines a help page
string$componentcomponent name
string | moodle_url$icon
string$iconalticon alt text
int$levelThe level of importance of the heading. Defaulting to 2
string$classnamesA space-separated list of CSS classes. Defaulting to null
Return values
stringHTML fragment

◆ help_icon()

core_renderer::help_icon (   $identifier,
  $component = 'moodle',
  $linktext = '' 
)

Returns HTML to display a help icon.

Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_help_icon() instead.

Parameters
string$identifierThe keyword that defines a help page
string$componentcomponent name
string | bool$linktexttrue means use $title as link text, string means link text value
Return values
stringHTML fragment

◆ help_icon_scale()

core_renderer::help_icon_scale (   $courseid,
stdClass  $scale 
)

Returns HTML to display a scale help icon.

Parameters
int$courseid
stdClass$scaleinstance
Return values
stringHTML fragment

◆ home_link()

core_renderer::home_link ( )

Return the 'back' link that normally appears in the footer.

Return values
stringHTML fragment.

◆ htmlattributes()

core_renderer::htmlattributes ( )

The attributes that should be added to the <html> tag.

Designed to be called in theme layout.php files.

Return values
stringHTML fragment.

◆ htmllize_file_tree()

core_renderer::htmllize_file_tree (   $dir)

Internal implementation of file tree viewer items rendering.

Parameters
array$dir
Return values
string

Reimplemented in core_renderer_maintenance.

◆ image_icon()

core_renderer::image_icon (   $pix,
  $alt,
  $component = 'moodle',
array  $attributes = null 
)

Return HTML for an image_icon.

Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_image_icon() instead.

Parameters
string$pixshort pix name
string$altmandatory alt attribute
string$componentstandard compoennt name like 'moodle', 'mod_forum', etc.
array$attributeshtm attributes
Return values
stringHTML fragment

◆ image_url()

renderer_base::image_url (   $imagename,
  $component = 'moodle' 
)
inherited

Return the moodle_url for an image.

The exact image location and extension is determined automatically by searching for gif|png|jpg|jpeg, please note there can not be diferent images with the different extension. The imagename is for historical reasons a relative path name, it may be changed later for core images. It is recommended to not use subdirectories in plugin and theme pix directories.

There are three types of images: 1/ theme images - stored in theme/mytheme/pix/, use component 'theme' 2/ core images - stored in /pix/, overridden via theme/mytheme/pix_core/ 3/ plugin images - stored in mod/mymodule/pix, overridden via theme/mytheme/pix_plugins/mod/mymodule/, example: image_url('comment', 'mod_glossary')

Parameters
string$imagenamethe pathname of the image
string$componentfull plugin name (aka component) or 'theme'
Return values
moodle_url

◆ initials_bar()

core_renderer::initials_bar (   $current,
  $class,
  $title,
  $urlvar,
  $url,
  $alpha = null 
)

Returns HTML to display initials bar to provide access to other pages (usually in a search)

Parameters
string$currentthe currently selected letter.
string$classclass name to add to this initial bar.
string$titlethe name to put in front of this initial bar.
string$urlvarURL parameter name for this initial.
string$urlURL object.
array$alphaof letters in the alphabet.
Return values
stringthe HTML to output.

◆ is_login_page()

core_renderer::is_login_page ( )
protected

Check whether the current page is a login page.

Since
Moodle 2.9
Return values
bool

◆ lang_menu()

core_renderer::lang_menu ( )

Returns lang menu or '', this method also checks forcing of languages in courses.

This function calls core_renderer::render_single_select() to actually display the language menu.

Return values
stringThe lang menu HTML or empty string

Reimplemented in core_renderer_maintenance.

◆ larrow()

core_renderer::larrow ( )

Accessibility: Left arrow-like character is used in the breadcrumb trail, course navigation menu (previous/next activity), calendar, and search forum block.

If the theme does not set characters, appropriate defaults are set automatically. Please DO NOT use < > » - these are confusing for blind users.

Return values
string

◆ list_block_contents()

core_renderer::list_block_contents (   $icons,
  $items 
)

Render the contents of a block_list.

Parameters
array$iconsthe icon for each item.
array$itemsthe content of each item.
Return values
stringHTML

◆ login_info()

core_renderer::login_info (   $withlinks = null)

Return the standard string that says whether you are logged in (and switched roles/logged in as another user).

Parameters
bool$withlinksif false, then don't include any links in the HTML produced. If not set, the default is the nologinlinks option from the theme config.php file, and if that is not set, then links are included.
Return values
stringHTML fragment.

Reimplemented in core_renderer_maintenance.

◆ main_content()

core_renderer::main_content ( )

Returns standard main content placeholder.

Designed to be called in theme layout.php files.

Return values
stringHTML fragment.

◆ maintenance_warning()

core_renderer::maintenance_warning ( )

Scheduled maintenance warning message.

Note: This is a nasty hack to display maintenance notice, this should be moved to some general notification area once we have it.

Return values
string

◆ mform_element()

core_renderer::mform_element (   $element,
  $required,
  $advanced,
  $error,
  $ingroup 
)

Renders an mform element from a template.

Parameters
HTML_QuickForm_element$elementelement
bool$requiredif input is required field
bool$advancedif input is an advanced field
string$errorerror message to display
bool$ingroupTrue if this element is rendered as part of a group
Return values
mixedstring|bool

◆ navbar()

core_renderer::navbar ( )

This renders the navbar.

Uses bootstrap compatible html.

◆ navbar_plugin_output()

core_renderer::navbar_plugin_output ( )

Allow plugins to provide some content to be rendered in the navbar.

The plugin must define a PLUGIN_render_navbar_output function that returns the HTML they wish to add to the navbar.

Return values
stringHTML for the navbar

◆ notification()

core_renderer::notification (   $message,
  $type = null 
)

Output a notification (that is, a status message about something that has just happened).

Note: core::notification::add() may be more suitable for your usage.

Parameters
string$messageThe message to print out.
string$typeThe type of notification. See constants on core::output::notification.
Return values
stringthe HTML to output.

Reimplemented in core_renderer_cli, and core_renderer_ajax.

◆ notify_message()

core_renderer::notify_message ( )
Deprecated:
since Moodle 3.1 MDL-30811 - please do not use this function any more.

◆ notify_problem()

core_renderer::notify_problem ( )
Deprecated:
since Moodle 3.1 MDL-30811 - please do not use this function any more.

◆ notify_redirect()

core_renderer::notify_redirect ( )
Deprecated:
since Moodle 3.1 MDL-30811 - please do not use this function any more.

◆ notify_success()

core_renderer::notify_success ( )
Deprecated:
since Moodle 3.1 MDL-30811 - please do not use this function any more.

◆ old_help_icon()

core_renderer::old_help_icon (   $helpidentifier,
  $title,
  $component = 'moodle',
  $linktext = '' 
)

Returns HTML to display a help icon.

Deprecated:
since Moodle 2.0

◆ page_doc_link()

core_renderer::page_doc_link (   $text = null)

Returns the Moodle docs link to use for this page.

Since
Moodle 2.5.1 2.6
Parameters
string$text
Return values
string

◆ page_heading()

core_renderer::page_heading (   $tag = 'h1')

Gets HTML for the page heading.

Since
Moodle 2.5.1 2.6
Parameters
string$tagThe tag to encase the heading in. h1 by default.
Return values
stringHTML.

◆ page_heading_button()

core_renderer::page_heading_button ( )

Gets the HTML for the page heading button.

Since
Moodle 2.5.1 2.6
Return values
stringHTML.

◆ page_heading_menu()

core_renderer::page_heading_menu ( )

Returns the page heading menu.

Since
Moodle 2.5.1 2.6
Return values
stringHTML.

◆ page_title()

core_renderer::page_title ( )

Returns the title to use on the page.

Since
Moodle 2.5.1 2.6
Return values
string

◆ paging_bar()

core_renderer::paging_bar (   $totalcount,
  $page,
  $perpage,
  $baseurl,
  $pagevar = 'page' 
)

Returns HTML to display a single paging bar to provide access to other pages (usually in a search)

Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_paging_bar() instead.

Parameters
int$totalcountThe total number of entries available to be paged through
int$pageThe page you are currently viewing
int$perpageThe number of entries that should be shown per page
string | moodle_url$baseurlurl of the current page, the $pagevar parameter is added
string$pagevarname of page parameter that holds the page number
Return values
stringthe HTML to output.

◆ pix_icon()

core_renderer::pix_icon (   $pix,
  $alt,
  $component = 'moodle',
array  $attributes = null 
)

Return HTML for a pix_icon.

Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_pix_icon() instead.

Parameters
string$pixshort pix name
string$altmandatory alt attribute
string$componentstandard compoennt name like 'moodle', 'mod_forum', etc.
array$attributeshtm lattributes
Return values
stringHTML fragment

◆ pix_url()

renderer_base::pix_url (   $imagename,
  $component = 'moodle' 
)
inherited

Return the direct URL for an image from the pix folder.

Use this function sparingly and never for icons. For icons use pix_icon or the pix helper in a mustache template.

Deprecated:
since Moodle 3.3
Parameters
string$imagenamethe name of the icon.
string$componentspecification of one plugin like in get_string()
Return values
moodle_url

◆ prepare_classes()

static renderer_base::prepare_classes (   $classes)
staticinherited

Given an array or space-separated list of classes, prepares and returns the HTML class attribute value.

Parameters
mixed$classesSpace-separated string or array of classes
Return values
stringHTML class attribute value

◆ print_textarea()

core_renderer::print_textarea (   $name,
  $id,
  $value,
  $rows,
  $cols 
)

Returns the HTML for a basic textarea field.

Parameters
string$nameName to use for the textarea element
string$idThe id to use fort he textarea element
string$valueInitial content to display in the textarea
int$rowsNumber of rows to display
int$colsNumber of columns to display
Return values
stringthe HTML to display

◆ rarrow()

core_renderer::rarrow ( )

Accessibility: Right arrow-like character is used in the breadcrumb trail, course navigation menu (previous/next activity), calendar, and search forum block.

If the theme does not set characters, appropriate defaults are set automatically. Please DO NOT use < > » - these are confusing for blind users.

Return values
string

◆ redirect_message()

core_renderer::redirect_message (   $encodedurl,
  $message,
  $delay,
  $debugdisableredirect,
  $messagetype = core\output\notification::NOTIFY_INFO 
)

Redirects the user by any means possible given the current state.

This function should not be called directly, it should always be called using the redirect function in lib/weblib.php

The redirect function should really only be called before page output has started however it will allow itself to be called during the state STATE_IN_BODY

Parameters
string$encodedurlThe URL to send to encoded if required
string$messageThe message to display to the user if any
int$delayThe delay before redirecting a user, if $message has been set this is a requirement and defaults to 3, set to 0 no delay
boolean$debugdisableredirectthis redirect has been disabled for debugging purposes. Display a message that explains, and don't trigger the redirect.
string$messagetypeThe type of notification to show the message in. See constants on core::output::notification.
Return values
stringThe HTML to display to the user before dying, may contain meta refresh, javascript refresh, and may have set header redirects

Reimplemented in core_renderer_ajax.

◆ region_main_settings_menu()

core_renderer::region_main_settings_menu ( )

This is an optional menu that can be added to a layout by a theme.

It contains the menu for the most specific thing from the settings block. E.g. Module administration.

Return values
string

◆ render()

renderer_base::render ( renderable  $widget)
inherited

Returns rendered widget.

The provided widget needs to be an object that extends the renderable interface. If will then be rendered by a method based upon the classname for the widget. For instance a widget of class crazywidget will be rendered by a protected render_crazywidget method of this renderer. If no render_crazywidget method exists and crazywidget implements templatable, look for the 'crazywidget' template in the same component and render that.

Parameters
renderable$widgetinstance with renderable interface
Return values
string

Reimplemented in tool_policy\output\renderer, and plugin_renderer_base.

◆ render_action_link()

core_renderer::render_action_link ( action_link  $link)
protected

Renders an action_link object.

The provided link is renderer and the HTML returned. At the same time the associated actions are setup in JS by core_renderer::add_action_handler()

Parameters
action_link$link
Return values
stringHTML fragment

◆ render_action_menu()

core_renderer::render_action_menu ( action_menu  $menu)

Renders an action menu component.

Parameters
action_menu$menu
Return values
stringHTML

◆ render_action_menu_filler()

core_renderer::render_action_menu_filler ( action_menu_filler  $action)
protected

Renders a primary action_menu_filler item.

Parameters
action_menu_link_filler$action
Return values
stringHTML fragment

◆ render_action_menu_link()

core_renderer::render_action_menu_link ( action_menu_link  $action)
protected

Renders an action_menu_link item.

Parameters
action_menu_link$action
Return values
stringHTML fragment

◆ render_action_menu_link_primary()

core_renderer::render_action_menu_link_primary ( action_menu_link_primary  $action)
protected

Renders a primary action_menu_link item.

Parameters
action_menu_link_primary$action
Return values
stringHTML fragment

◆ render_action_menu_link_secondary()

core_renderer::render_action_menu_link_secondary ( action_menu_link_secondary  $action)
protected

Renders a secondary action_menu_link item.

Parameters
action_menu_link_secondary$action
Return values
stringHTML fragment

◆ render_breadcrumb_navigation_node()

core_renderer::render_breadcrumb_navigation_node ( breadcrumb_navigation_node  $item)
protected

Renders a breadcrumb navigation node object.

Parameters
breadcrumb_navigation_node$itemThe navigation node to render.
Return values
stringHTML fragment

◆ render_chart()

core_renderer::render_chart ( \core\chart_base  $chart,
  $withtable = true 
)

Renders a chart.

Parameters
core::chart_base$chartThe chart.
bool$withtableWhether to include a data table with the chart.
Return values
string.

◆ render_chart_bar()

core_renderer::render_chart_bar ( \core\chart_bar  $chart)

Renders a bar chart.

Parameters
core::chart_bar$chartThe chart.
Return values
string.

◆ render_chart_line()

core_renderer::render_chart_line ( \core\chart_line  $chart)

Renders a line chart.

Parameters
core::chart_line$chartThe chart.
Return values
string.

◆ render_chart_pie()

core_renderer::render_chart_pie ( \core\chart_pie  $chart)

Renders a pie chart.

Parameters
core::chart_pie$chartThe chart.
Return values
string.

◆ render_check_result()

core_renderer::render_check_result ( core\check\result  $result)
protected

Renders a Check API result.

Parameters
result$result
Return values
stringHTML fragment

Reimplemented in core_renderer_cli.

◆ render_checkbox_toggleall()

core_renderer::render_checkbox_toggleall ( \core\output\checkbox_toggleall  $element)

Renders element for a toggle-all checkbox.

Parameters
core::output::checkbox_toggleall$element
Return values
string

◆ render_context_header()

core_renderer::render_context_header ( context_header  $contextheader)
protected

Renders the header bar.

Parameters
context_header$contextheaderHeader bar object.
Return values
stringHTML for the header bar.

◆ render_custom_menu()

core_renderer::render_custom_menu ( custom_menu  $menu)
protected

Renders a custom menu object (located in outputcomponents.php)

The custom menu this method produces makes use of the YUI3 menunav widget and requires very specific html elements and classes.

@staticvar int $menucount

Parameters
custom_menu$menu
Return values
string

◆ render_custom_menu_item()

core_renderer::render_custom_menu_item ( custom_menu_item  $menunode)
protected

Renders a custom menu node as part of a submenu.

The custom menu this method produces makes use of the YUI3 menunav widget and requires very specific html elements and classes.

See also
core:renderer::render_custom_menu()

@staticvar int $submenucount

Parameters
custom_menu_item$menunode
Return values
string

◆ render_digital_minor_page()

core_renderer::render_digital_minor_page (   $page)
protected

Render the digital minor contact information page into a nice template for the theme.

Parameters
core_auth::output::digital_minor_page$pageThe renderable
Return values
string

◆ render_file_picker()

core_renderer::render_file_picker ( file_picker  $fp)

Internal implementation of file picker rendering.

Parameters
file_picker$fp
Return values
string

◆ render_from_template()

renderer_base::render_from_template (   $templatename,
  $context 
)
inherited

Renders a template by name with the given context.

The provided data needs to be array/stdClass made up of only simple types. Simple types are array,stdClass,bool,int,float,string

Since
2.9
Parameters
array | stdClass$contextContext containing data for the template.
Return values
string|boolean

◆ render_help_icon()

core_renderer::render_help_icon ( help_icon  $helpicon)
protected

Implementation of user image rendering.

Parameters
help_icon$helpiconA help icon instance
Return values
stringHTML fragment

◆ render_image_icon()

core_renderer::render_image_icon ( image_icon  $icon)
protected

Renders a pix_icon widget and returns the HTML to display it.

Parameters
image_icon$icon
Return values
stringHTML fragment

◆ render_initials_bar()

core_renderer::render_initials_bar ( initials_bar  $initialsbar)
protected

Internal implementation of initials bar rendering.

Parameters
initials_bar$initialsbar
Return values
string

◆ render_inplace_editable()

core_renderer::render_inplace_editable ( \core\output\inplace_editable  $element)

Renders element for inline editing of any value.

Parameters
core::output::inplace_editable$element
Return values
string

◆ render_login()

core_renderer::render_login ( \core_auth\output\login  $form)

Renders the login form.

Parameters
core_auth::output::login$formThe renderable.
Return values
string

◆ render_login_signup_form()

core_renderer::render_login_signup_form (   $form)

Render the login signup form into a nice template for the theme.

Parameters
mform$form
Return values
string

◆ render_navigation_node()

core_renderer::render_navigation_node ( navigation_node  $item)
protected

Renders a navigation node object.

Parameters
navigation_node$itemThe navigation node to render.
Return values
stringHTML fragment

◆ render_notification()

core_renderer::render_notification ( \core\output\notification  $notification)
protected

Render a notification (that is, a status message about something that has just happened).

Parameters
core::output::notification$notificationthe notification to print out
Return values
stringthe HTML to output.

Reimplemented in core_renderer_cli.

◆ render_page_layout()

core_renderer::render_page_layout (   $layoutfile)
protected

Renders and outputs the page layout file.

This is done by preparing the normal globals available to a script, and then including the layout file provided by the current theme for the requested layout.

Parameters
string$layoutfileThe name of the layout file
Return values
stringHTML code

◆ render_paging_bar()

core_renderer::render_paging_bar ( paging_bar  $pagingbar)
protected

Returns HTML to display the paging bar.

Parameters
paging_bar$pagingbar
Return values
stringthe HTML to output.

◆ render_pix_emoticon()

core_renderer::render_pix_emoticon ( pix_emoticon  $emoticon)
protected

Return HTML to display an emoticon icon.

Parameters
pix_emoticon$emoticon
Return values
stringHTML fragment

◆ render_pix_icon()

core_renderer::render_pix_icon ( pix_icon  $icon)
protected

Renders a pix_icon widget and returns the HTML to display it.

Parameters
pix_icon$icon
Return values
stringHTML fragment

◆ render_preferences_group()

core_renderer::render_preferences_group ( preferences_group  $renderable)

Renders preferences group.

Parameters
preferences_group$renderableThe renderable
Return values
stringThe output.

◆ render_preferences_groups()

core_renderer::render_preferences_groups ( preferences_groups  $renderable)

Renders preferences groups.

Parameters
preferences_groups$renderableThe renderable
Return values
stringThe output.

◆ render_progress_bar()

core_renderer::render_progress_bar ( progress_bar  $bar)

Renders a progress bar.

Do not use $OUTPUT->render($bar), instead use progress_bar::create().

Parameters
progress_bar$barThe bar.
Return values
stringHTML fragment

◆ render_rating()

core_renderer::render_rating ( rating  $rating)

Produces the html that represents this rating in the UI.

Parameters
rating$ratingthe page object on which this rating will appear
Return values
string

◆ render_single_button()

core_renderer::render_single_button ( single_button  $button)
protected

Renders a single button widget.

This will return HTML to display a form containing a single button.

Parameters
single_button$button
Return values
stringHTML fragment

◆ render_single_select()

core_renderer::render_single_select ( single_select  $select)
protected

Internal implementation of single_select rendering.

Parameters
single_select$select
Return values
stringHTML fragment

◆ render_skip_links()

core_renderer::render_skip_links (   $links)

Renders the skip links for the page.

Parameters
array$linksList of skip links.
Return values
stringHTML for the skip links.

◆ render_tabobject()

core_renderer::render_tabobject ( tabobject  $tabobject)
protected

Renders tabobject (part of tabtree)

This function is called from core_renderer::render_tabtree() and also it calls itself when printing the $tabobject subtree recursively.

Property $tabobject->level indicates the number of row of tabs.

Parameters
tabobject$tabobject
Return values
stringHTML fragment

◆ render_tabtree()

core_renderer::render_tabtree ( tabtree  $tabtree)
protected

Renders tabtree.

Parameters
tabtree$tabtree
Return values
string

◆ render_url_select()

core_renderer::render_url_select ( url_select  $select)
protected

Internal implementation of url_select rendering.

Parameters
url_select$select
Return values
stringHTML fragment

◆ render_user_picture()

core_renderer::render_user_picture ( user_picture  $userpicture)
protected

Internal implementation of user image rendering.

Parameters
user_picture$userpicture
Return values
string

◆ render_verify_age_location_page()

core_renderer::render_verify_age_location_page (   $page)
protected

Render the verify age and location page into a nice template for the theme.

Parameters
core_auth::output::verify_age_location_page$pageThe renderable
Return values
string

◆ search_box()

core_renderer::search_box (   $id = false)

Returns a search box.

Parameters
string$idThe search box wrapper div id, defaults to an autogenerated one.
Return values
stringHTML with the search form hidden by default.

◆ secure_layout_language_menu()

core_renderer::secure_layout_language_menu ( )

Returns the language menu in the secure layout.

No custom menu items are passed though, such that it will render only the language selection.

Return values
string

◆ secure_layout_login_info()

core_renderer::secure_layout_login_info ( )

Secure layout login info.

Return values
string

◆ should_display_main_logo()

renderer_base::should_display_main_logo (   $headinglevel = 1)
inherited

Whether we should display the main logo.

Parameters
int$headinglevelThe heading level we want to check against.
Return values
bool

◆ should_display_navbar_logo()

renderer_base::should_display_navbar_logo ( )
inherited

Whether we should display the logo in the navbar.

We will when there are no main logos, and we have compact logo.

Return values
bool

◆ single_button()

core_renderer::single_button (   $url,
  $label,
  $method = 'post',
array  $options = null 
)

Returns a form with a single button.

Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_single_button() instead.

Parameters
string | moodle_url$url
string$labelbutton text
string$methodget or post submit method
array$optionsassociative array {disabled, title, etc.}
Return values
stringHTML fragment

◆ single_select()

core_renderer::single_select (   $url,
  $name,
array  $options,
  $selected = '',
  $nothing = array('' => 'choosedots'),
  $formid = null,
  $attributes = array() 
)

Returns a form with a single select widget.

Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_single_select() instead.

Parameters
moodle_url$urlform action target, includes hidden fields
string$namename of selection field - the changing parameter in url
array$optionslist of options
string$selectedselected element
array$nothing
string$formid
array$attributesother attributes for the single select
Return values
stringHTML fragment

◆ skip_link_target()

core_renderer::skip_link_target (   $id = null)

Output the place a skip link goes to.

Parameters
string$idThe target name from the corresponding $PAGE->requires->skip_link_to($target) call.
Return values
stringthe HTML to output.

◆ spacer()

core_renderer::spacer ( array  $attributes = null,
  $br = false 
)

Creates and returns a spacer image with optional line break.

Parameters
array$attributesAny HTML attributes to add to the spaced.
bool$brInclude a BR after the spacer.... DON'T USE THIS. Don't be laxy do it with CSS which is a much better solution.
Return values
stringHTML fragment

◆ standard_after_main_region_html()

core_renderer::standard_after_main_region_html ( )

The standard HTML that should be output just before the <footer> tag.

Designed to be called in theme layout.php files.

Return values
stringHTML fragment.

◆ standard_end_of_body_html()

core_renderer::standard_end_of_body_html ( )

The standard tags (typically script tags that are not needed earlier) that should be output after everything else.

Designed to be called in theme layout.php files.

Return values
stringHTML fragment.

◆ standard_footer_html()

core_renderer::standard_footer_html ( )

The standard tags (typically performance information and validation links, if we are in developer debug mode) that should be output in the footer area of the page.

Designed to be called in theme layout.php files.

Return values
stringHTML fragment.

◆ standard_head_html()

core_renderer::standard_head_html ( )

The standard tags (meta tags, links to stylesheets and JavaScript, etc.) that should be included in the <head> tag.

Designed to be called in theme layout.php files.

Return values
stringHTML fragment.

◆ standard_top_of_body_html()

core_renderer::standard_top_of_body_html ( )

The standard tags (typically skip links) that should be output just inside the start of the <body> tag.

Designed to be called in theme layout.php files.

Return values
stringHTML fragment.

◆ tabtree()

core_renderer::tabtree (   $tabs,
  $selected = null,
  $inactive = null 
)
final

Renders tabs.

This function replaces print_tabs() used before Moodle 2.5 but with slightly different arguments

Theme developers: In order to change how tabs are displayed please override functions core_renderer::render_tabtree() and/or core_renderer::render_tabobject()

Parameters
array$tabsarray of tabs, each of them may have it's own ->subtree
string | null$selectedwhich tab to mark as selected, all parent tabs will automatically be marked as activated
array | string | null$inactivelist of ids of inactive tabs, regardless of their level. Note that you can as weel specify tabobject::$inactive for separate instances
Return values
string

◆ tag_list()

core_renderer::tag_list (   $tags,
  $label = null,
  $classes = '',
  $limit = 10,
  $pagecontext = null,
  $accesshidelabel = false 
)

Displays the list of tags associated with an entry.

Parameters
array$tagslist of instances of core_tag or stdClass
string$labellabel to display in front, by default 'Tags' (get_string('tags')), set to null to use default, set to '' (empty string) to omit the label completely
string$classesadditional classes for the enclosing div element
int$limitlimit the number of tags to display, if size of $tags is more than this limit the "more" link will be appended to the end, JS will toggle the rest of the tags
context$pagecontextspecify if needed to overwrite the current page context for the view tag link
bool$accesshidelabelif true, the label should have class="accesshide" added.
Return values
string

◆ theme_switch_links()

core_renderer::theme_switch_links ( )
protected

Renders theme links for switching between default and other themes.

Return values
string

◆ tree_block_contents()

core_renderer::tree_block_contents (   $items,
  $attrs = array() 
)

Make nested HTML lists out of the items.

The resulting list will look something like this:

<
<>
(item contents)
<
>
(item contents)
<> <> <> <>
Parameters
array$items
array$attrshtml attributes passed to the top ofs the list
Return values
stringHTML

◆ uarrow()

core_renderer::uarrow ( )

Accessibility: Up arrow-like character is used in the book heirarchical navigation.

If the theme does not set characters, appropriate defaults are set automatically. Please DO NOT use ^ - this is confusing for blind users.

Return values
string

◆ update_module_button()

core_renderer::update_module_button ( )
Deprecated:
since Moodle 3.2

◆ url_select()

core_renderer::url_select ( array  $urls,
  $selected,
  $nothing = array('' => 'choosedots'),
  $formid = null 
)

Returns a form with a url select widget.

Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_url_select() instead.

Parameters
array$urlslist of urls - array('/course/view.php?id=1'=>'Frontpage', ....)
string$selectedselected element
array$nothing
string$formid
Return values
stringHTML fragment

◆ user_menu()

core_renderer::user_menu (   $user = null,
  $withlinks = null 
)

Construct a user menu, returning HTML that can be echoed out by a layout file.

Parameters
stdClass$userA user object, usually $USER.
bool$withlinkstrue if a dropdown should be built.
Return values
stringHTML fragment.

◆ user_picture()

core_renderer::user_picture ( stdClass  $user,
array  $options = null 
)

Returns HTML to display the specified user's avatar.

User avatar may be obtained in two ways:

// Option 1: (shortcut for simple cases, preferred way)
// $user has come from the DB and has fields id, picture, imagealt, firstname and lastname
$OUTPUT->user_picture($user, array('popup'=>true));

// Option 2:
$userpic = new user_picture($user);
// Set properties of $userpic
$userpic->popup = true;
$OUTPUT->render($userpic);

Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_user_picture() instead.

Parameters
stdClass$userObject with at least fields id, picture, imagealt, firstname, lastname If any of these are missing, the database is queried. Avoid this if at all possible, particularly for reports. It is very bad for performance.
array$optionsassociative array with user picture options, used only if not a user_picture object, options are:
  • courseid=$this->page->course->id (course id of user profile in link)
  • size=35 (size of image)
  • link=true (make image clickable - the link leads to user profile)
  • popup=false (open in popup)
  • alttext=true (add image alt attribute)
  • class = image class attribute (default 'userpicture')
  • visibletoscreenreaders=true (whether to be visible to screen readers)
  • includefullname=false (whether to include the user's full name together with the user picture)
  • includetoken = false (whether to use a token for authentication. True for current user, int value for other user id)
Return values
stringHTML fragment

Reimplemented in core_renderer_maintenance.

Member Data Documentation

◆ MAIN_CONTENT_TOKEN

string const core_renderer::MAIN_CONTENT_TOKEN = '[MAIN CONTENT GOES HERE]'

Do NOT use, please use <?php echo $OUTPUT->main_content() ?> in layout files instead.

Deprecated:
used in core_renderer::header().

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