Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Public Member Functions | |
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="") | |
Returns a template fragment representing a fatal error. More... | |
favicon () | |
Returns the moodle_url for the favicon. More... | |
file_picker ($options) | |
Returns HTML to display the file picker. More... | |
footer () | |
There is no footer for a cli request, however we must override the footer method to prevent the default 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 () | |
Returns the page header. More... | |
heading ($text, $level=2, $classes='main', $id=null) | |
Returns a template fragment representing 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) | |
Returns a template fragment representing a notification. 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_notification (\core\output\notification $notification) | |
Render a notification (that is, a status message about something that has just happened). 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_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. | |
|
inherited |
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().
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 |
|
inherited |
Renders a special html link with attached action.
Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_action_link() instead.
string | moodle_url | $url | |
string | $text | HTML fragment |
component_action | $action | |
array | $attributes | associative array of html link attributes + disabled |
pix_icon | optional pix icon to render with the link |
string | HTML fragment |
|
inherited |
Returns standard navigation between activities in a course.
string | the navigation HTML. |
|
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()
component_action | $action | |
string | $id |
string | id of element, either original submitted or random new if not supplied |
|
inherited |
Prints a nice side block with an optional header.
block_contents | $bc | HTML for the content |
string | $region | the region the block is appearing in. |
string | the HTML to be output. |
Reimplemented in core_renderer_maintenance.
|
inherited |
Output the row of editing icons for a block, as defined by the controls array.
array | $controls | an array like block_contents::$controls. |
string | $blockid | The ID given to the block. |
string | HTML fragment. |
|
inherited |
Output a place where the block that is currently being moved can be dropped.
block_move_target | $target | with the necessary details. |
array | $zones | array of areas where the block can be moved to |
string | $previous | the block located before the area currently being rendered. |
string | $region | the name of the region |
string | the HTML to be output. |
|
inherited |
Get the HTML for blocks in the given region.
string | $region | The region to get HTML for. |
string | HTML. |
Reimplemented in core_renderer_maintenance.
|
inherited |
Output all the blocks in a particular region.
string | $region | the name of a region on this page. |
string | the HTML to be output. |
Reimplemented in core_renderer_maintenance.
|
inherited |
Returns HTML attributes to use within the body tag.
This includes an ID and classes.
string | array | $additionalclasses | Any additional classes to give the body tag, |
string |
|
inherited |
Returns the CSS classes to apply to the body tag.
array | $additionalclasses | Any additional classes to apply. |
string |
|
inherited |
The ID attribute to apply to the body tag.
string |
|
inherited |
Outputs a box.
string | $contents | The contents of the box |
string | $classes | A space-separated list of CSS classes |
string | $id | An optional ID |
array | $attributes | An array of other attributes to give the box. |
string | the HTML to output. |
|
inherited |
Outputs the closing section of a box.
string | the HTML to output. |
|
inherited |
Outputs the opening section of a box.
string | $classes | A space-separated list of CSS classes |
string | $id | An optional ID |
array | $attributes | An array of other attributes to give the box. |
string | the HTML to output. |
|
protectedinherited |
Take a node in the nav tree and make an action menu out of it.
The links are injected in the action menu.
action_menu | $menu | |
navigation_node | $node | |
boolean | $indent | |
boolean | $onlytopleafnodes |
boolean | nodesskipped - True if nodes were skipped in building the menu |
core_renderer_cli::check_result | ( | core\check\result | $result | ) |
Renders a Check API result.
result | $result |
string | fragment |
Reimplemented from core_renderer.
|
inherited |
Returns HTML to display a simple button to close a window.
string | $text | The lang string for the button's label (already output from get_string()) |
string | html fragment |
|
inherited |
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.
string | $message | The question to ask the user |
single_button | moodle_url | string | $continue | The single_button component representing the Continue answer. Can also be a moodle_url or string URL |
single_button | moodle_url | string | $cancel | The single_button component representing the Cancel answer. Can also be a moodle_url or string URL |
string | HTML fragment |
Reimplemented in core_renderer_maintenance.
|
inherited |
Outputs a container.
string | $contents | The contents of the box |
string | $classes | A space-separated list of CSS classes |
string | $id | An optional ID |
string | the HTML to output. |
|
inherited |
Outputs the closing section of a container.
string | the HTML to output. |
|
inherited |
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.
bool | $shouldbenone | assert that the stack should be empty now - causes a developer debug warning if it isn't. |
string | the HTML required to close any open containers inside <body>. |
|
inherited |
Outputs the opening section of a container.
string | $classes | A space-separated list of CSS classes |
string | $id | An optional ID |
string | the HTML to output. |
|
inherited |
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.
string |
|
inherited |
Returns HTML to display a continue button that goes to a particular URL.
string | moodle_url | $url | The url the button goes to. |
string | the HTML to output. |
|
inherited |
Returns course-specific information to be output immediately below content on any course page (for the current course)
bool | $onlyifnotcalledbefore | output content only if it has not been output before |
string |
Reimplemented in core_renderer_maintenance.
|
inherited |
Returns course-specific information to be output immediately above content on any course page (for the current course)
bool | $onlyifnotcalledbefore | output content only if it has not been output before |
string |
Reimplemented in core_renderer_maintenance.
|
inherited |
Returns course-specific information to be output on any course page in the footer area (for the current course)
string |
Reimplemented in core_renderer_maintenance.
|
inherited |
Returns course-specific information to be output on any course page in the header area (for the current course)
string |
Reimplemented in core_renderer_maintenance.
|
inherited |
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).
string | $regionname | The name of the custom region to add. |
string | HTML for the block region. |
|
inherited |
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.
string | $custommenuitems | - custom menuitems set by theme instead of global theme settings |
string |
Reimplemented in core_renderer_maintenance.
|
inherited |
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.
|
inherited |
Accessibility: Down arrow-like character.
If the theme does not set characters, appropriate defaults are set automatically.
string |
|
inherited |
Returns a string containing a link to the user documentation.
Also contains an icon by default. Shown to teachers and admin only.
string | $path | The page link after doc root and language, no leading slash. |
string | $text | The text to be displayed for the link |
boolean | $forcepopup | Whether to force a popup regardless of the value of $CFG->doctonewwindow |
array | $attributes | htm attributes |
string |
|
inherited |
Get the DOCTYPE declaration that should be used with this page.
Designed to be called in theme layout.php files.
string | the DOCTYPE declaration that should be used. |
|
inherited |
Returns a dataformat selection and download form.
string | $label | A text label |
moodle_url | string | $base | The download page url |
string | $name | The query param which will hold the type of the download |
array | $params | Extra params sent to the download page |
string | HTML fragment |
|
inherited |
Returns HTML to display a "Turn editing on/off" button in a form.
moodle_url | $url | The URL + params to send through when clicking the button |
string | HTML the button |
|
inherited |
Output an error message.
By default wraps the error message in . If the error message is blank, nothing is output.
string | $message | the error message. |
string | the HTML to output. |
core_renderer_cli::fatal_error | ( | $message, | |
$moreinfourl, | |||
$link, | |||
$backtrace, | |||
$debuginfo = null , |
|||
$errorcode = "" |
|||
) |
Returns a template fragment representing a fatal error.
string | $message | The message to output |
string | $moreinfourl | URL where more info can be found about the error |
string | $link | Link for the Continue button |
array | $backtrace | The execution backtrace |
string | $debuginfo | Debugging information |
string | A template fragment for a fatal error |
Reimplemented from core_renderer.
|
inherited |
Returns the moodle_url for the favicon.
moodle_url | The moodle_url for the favicon |
|
inherited |
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.
array | $options | associative array with file manager options options are: maxbytes=>-1, itemid=>0, client_id=>uniqid(), acepted_types=>'*', return_types=>FILE_INTERNAL, context=>current page context |
string | HTML fragment |
Reimplemented in core_renderer_maintenance.
core_renderer_cli::footer | ( | ) |
There is no footer for a cli request, however we must override the footer method to prevent the default footer.
Reimplemented from core_renderer.
|
inherited |
Wrapper for header elements.
string | HTML to display the main header. |
|
inherited |
Return the site's compact logo URL, if any.
int | $maxwidth | The maximum width, or null when the maximum width does not matter. |
int | $maxheight | The maximum height, or null when the maximum height does not matter. |
moodle_url|false |
|
inherited |
Get the course color to show on a course card.
int | $id | Id to use when generating the color. |
string | hex color code. |
|
inherited |
Get the course pattern datauri to show on a course card.
The datauri is an encoded svg that can be passed as a url.
int | $id | Id to use when generating the pattern |
string | datauri |
|
inherited |
Return the site's logo URL, if any.
int | $maxwidth | The maximum width, or null when the maximum width does not matter. |
int | $maxheight | The maximum height, or null when the maximum height does not matter. |
moodle_url|false |
|
protectedinherited |
Return an instance of the mustache class.
Mustache_Engine |
|
inherited |
Returns true is output has already started, and false if not.
boolean | true if the header has been printed. |
core_renderer_cli::header | ( | ) |
core_renderer_cli::heading | ( | $text, | |
$level = 2 , |
|||
$classes = 'main' , |
|||
$id = null |
|||
) |
Returns a template fragment representing a Heading.
string | $text | The text of the heading |
int | $level | The level of importance of the heading |
string | $classes | A space-separated list of CSS classes |
string | $id | An optional ID |
string | A template fragment for a heading |
Reimplemented from core_renderer.
|
inherited |
Centered heading with attached help button (same title text) and optional icon attached.
string | $text | A heading text |
string | $helpidentifier | The keyword that defines a help page |
string | $component | component name |
string | moodle_url | $icon | |
string | $iconalt | icon alt text |
int | $level | The level of importance of the heading. Defaulting to 2 |
string | $classnames | A space-separated list of CSS classes. Defaulting to null |
string | HTML fragment |
|
inherited |
Returns HTML to display a help icon.
Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_help_icon() instead.
string | $identifier | The keyword that defines a help page |
string | $component | component name |
string | bool | $linktext | true means use $title as link text, string means link text value |
string | HTML fragment |
|
inherited |
Returns HTML to display a scale help icon.
int | $courseid | |
stdClass | $scale | instance |
string | HTML fragment |
|
inherited |
Return the 'back' link that normally appears in the footer.
string | HTML fragment. |
|
inherited |
The attributes that should be added to the <html> tag.
Designed to be called in theme layout.php files.
string | HTML fragment. |
|
inherited |
Internal implementation of file tree viewer items rendering.
array | $dir |
string |
Reimplemented in core_renderer_maintenance.
|
inherited |
Return HTML for an image_icon.
Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_image_icon() instead.
string | $pix | short pix name |
string | $alt | mandatory alt attribute |
string | $component | standard compoennt name like 'moodle', 'mod_forum', etc. |
array | $attributes | htm attributes |
string | HTML fragment |
|
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')
string | $imagename | the pathname of the image |
string | $component | full plugin name (aka component) or 'theme' |
moodle_url |
|
inherited |
Returns HTML to display initials bar to provide access to other pages (usually in a search)
string | $current | the currently selected letter. |
string | $class | class name to add to this initial bar. |
string | $title | the name to put in front of this initial bar. |
string | $urlvar | URL parameter name for this initial. |
string | $url | URL object. |
array | $alpha | of letters in the alphabet. |
string | the HTML to output. |
|
protectedinherited |
Check whether the current page is a login page.
bool |
|
inherited |
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.
string | The lang menu HTML or empty string |
Reimplemented in core_renderer_maintenance.
|
inherited |
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.
string |
|
inherited |
Render the contents of a block_list.
array | $icons | the icon for each item. |
array | $items | the content of each item. |
string | HTML |
|
inherited |
Return the standard string that says whether you are logged in (and switched roles/logged in as another user).
bool | $withlinks | if 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. |
string | HTML fragment. |
Reimplemented in core_renderer_maintenance.
|
inherited |
Returns standard main content placeholder.
Designed to be called in theme layout.php files.
string | HTML fragment. |
|
inherited |
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.
string |
|
inherited |
Renders an mform element from a template.
HTML_QuickForm_element | $element | element |
bool | $required | if input is required field |
bool | $advanced | if input is an advanced field |
string | $error | error message to display |
bool | $ingroup | True if this element is rendered as part of a group |
mixed | string|bool |
|
inherited |
This renders the navbar.
Uses bootstrap compatible html.
|
inherited |
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.
string | HTML for the navbar |
core_renderer_cli::notification | ( | $message, | |
$type = null |
|||
) |
Returns a template fragment representing a notification.
string | $message | The message to print out. |
string | $type | The type of notification. See constants on core::output::notification. |
string | A template fragment for a notification |
Reimplemented from core_renderer.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Returns HTML to display a help icon.
|
inherited |
Returns the Moodle docs link to use for this page.
string | $text |
string |
|
inherited |
Gets HTML for the page heading.
string | $tag | The tag to encase the heading in. h1 by default. |
string | HTML. |
|
inherited |
Gets the HTML for the page heading button.
string | HTML. |
|
inherited |
Returns the page heading menu.
string | HTML. |
|
inherited |
Returns the title to use on the page.
string |
|
inherited |
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.
int | $totalcount | The total number of entries available to be paged through |
int | $page | The page you are currently viewing |
int | $perpage | The number of entries that should be shown per page |
string | moodle_url | $baseurl | url of the current page, the $pagevar parameter is added |
string | $pagevar | name of page parameter that holds the page number |
string | the HTML to output. |
|
inherited |
Return HTML for a pix_icon.
Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_pix_icon() instead.
string | $pix | short pix name |
string | $alt | mandatory alt attribute |
string | $component | standard compoennt name like 'moodle', 'mod_forum', etc. |
array | $attributes | htm lattributes |
string | HTML fragment |
|
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.
string | $imagename | the name of the icon. |
string | $component | specification of one plugin like in get_string() |
moodle_url |
|
staticinherited |
Given an array or space-separated list of classes, prepares and returns the HTML class attribute value.
mixed | $classes | Space-separated string or array of classes |
string | HTML class attribute value |
|
inherited |
Returns the HTML for a basic textarea field.
string | $name | Name to use for the textarea element |
string | $id | The id to use fort he textarea element |
string | $value | Initial content to display in the textarea |
int | $rows | Number of rows to display |
int | $cols | Number of columns to display |
string | the HTML to display |
|
inherited |
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.
string |
|
inherited |
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
string | $encodedurl | The URL to send to encoded if required |
string | $message | The message to display to the user if any |
int | $delay | The delay before redirecting a user, if $message has been set this is a requirement and defaults to 3, set to 0 no delay |
boolean | $debugdisableredirect | this redirect has been disabled for debugging purposes. Display a message that explains, and don't trigger the redirect. |
string | $messagetype | The type of notification to show the message in. See constants on core::output::notification. |
string | The 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.
|
inherited |
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.
string |
|
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.
renderable | $widget | instance with renderable interface |
string |
Reimplemented in tool_policy\output\renderer, and plugin_renderer_base.
|
protectedinherited |
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()
action_link | $link |
string | HTML fragment |
|
inherited |
|
protectedinherited |
Renders a primary action_menu_filler item.
action_menu_link_filler | $action |
string | HTML fragment |
|
protectedinherited |
Renders an action_menu_link item.
action_menu_link | $action |
string | HTML fragment |
|
protectedinherited |
Renders a primary action_menu_link item.
action_menu_link_primary | $action |
string | HTML fragment |
|
protectedinherited |
Renders a secondary action_menu_link item.
action_menu_link_secondary | $action |
string | HTML fragment |
|
protectedinherited |
Renders a breadcrumb navigation node object.
breadcrumb_navigation_node | $item | The navigation node to render. |
string | HTML fragment |
|
inherited |
Renders a chart.
core::chart_base | $chart | The chart. |
bool | $withtable | Whether to include a data table with the chart. |
string. |
|
inherited |
|
inherited |
|
inherited |
|
protected |
Renders a Check API result.
To aid in CLI consistency this status is NOT translated and the visual width is always exactly 10 chars.
result | $result |
string | HTML fragment |
Reimplemented from core_renderer.
|
inherited |
Renders element for a toggle-all checkbox.
core::output::checkbox_toggleall | $element |
string |
|
protectedinherited |
Renders the header bar.
context_header | $contextheader | Header bar object. |
string | HTML for the header bar. |
|
protectedinherited |
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
custom_menu | $menu |
string |
|
protectedinherited |
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.
@staticvar int $submenucount
custom_menu_item | $menunode |
string |
|
protectedinherited |
Render the digital minor contact information page into a nice template for the theme.
core_auth::output::digital_minor_page | $page | The renderable |
string |
|
inherited |
|
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
array | stdClass | $context | Context containing data for the template. |
string|boolean |
|
protectedinherited |
Implementation of user image rendering.
help_icon | $helpicon | A help icon instance |
string | HTML fragment |
|
protectedinherited |
Renders a pix_icon widget and returns the HTML to display it.
image_icon | $icon |
string | HTML fragment |
|
protectedinherited |
Internal implementation of initials bar rendering.
initials_bar | $initialsbar |
string |
|
inherited |
Renders element for inline editing of any value.
core::output::inplace_editable | $element |
string |
|
inherited |
Renders the login form.
core_auth::output::login | $form | The renderable. |
string |
|
inherited |
Render the login signup form into a nice template for the theme.
mform | $form |
string |
|
protectedinherited |
Renders a navigation node object.
navigation_node | $item | The navigation node to render. |
string | HTML fragment |
core_renderer_cli::render_notification | ( | \core\output\notification | $notification | ) |
Render a notification (that is, a status message about something that has just happened).
core::output::notification | $notification | the notification to print out |
string | plain text output |
Reimplemented from core_renderer.
|
protectedinherited |
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.
string | $layoutfile | The name of the layout file |
string | HTML code |
|
protectedinherited |
Returns HTML to display the paging bar.
paging_bar | $pagingbar |
string | the HTML to output. |
|
protectedinherited |
Return HTML to display an emoticon icon.
pix_emoticon | $emoticon |
string | HTML fragment |
|
protectedinherited |
|
inherited |
Renders preferences group.
preferences_group | $renderable | The renderable |
string | The output. |
|
inherited |
Renders preferences groups.
preferences_groups | $renderable | The renderable |
string | The output. |
|
inherited |
Renders a progress bar.
Do not use $OUTPUT->render($bar), instead use progress_bar::create().
progress_bar | $bar | The bar. |
string | HTML fragment |
|
inherited |
Produces the html that represents this rating in the UI.
rating | $rating | the page object on which this rating will appear |
string |
|
protectedinherited |
Renders a single button widget.
This will return HTML to display a form containing a single button.
single_button | $button |
string | HTML fragment |
|
protectedinherited |
Internal implementation of single_select rendering.
single_select | $select |
string | HTML fragment |
|
inherited |
Renders the skip links for the page.
array | $links | List of skip links. |
string | HTML for the skip links. |
|
protectedinherited |
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.
tabobject | $tabobject |
string | HTML fragment |
|
protectedinherited |
Renders tabtree.
tabtree | $tabtree |
string |
|
protectedinherited |
Internal implementation of url_select rendering.
url_select | $select |
string | HTML fragment |
|
protectedinherited |
Internal implementation of user image rendering.
user_picture | $userpicture |
string |
|
protectedinherited |
Render the verify age and location page into a nice template for the theme.
core_auth::output::verify_age_location_page | $page | The renderable |
string |
|
inherited |
Returns a search box.
string | $id | The search box wrapper div id, defaults to an autogenerated one. |
string | HTML with the search form hidden by default. |
|
inherited |
Returns the language menu in the secure layout.
No custom menu items are passed though, such that it will render only the language selection.
string |
|
inherited |
Secure layout login info.
string |
|
inherited |
Whether we should display the main logo.
int | $headinglevel | The heading level we want to check against. |
bool |
|
inherited |
Whether we should display the logo in the navbar.
We will when there are no main logos, and we have compact logo.
bool |
|
inherited |
Returns a form with a single button.
Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_single_button() instead.
string | moodle_url | $url | |
string | $label | button text |
string | $method | get or post submit method |
array | $options | associative array {disabled, title, etc.} |
string | HTML fragment |
|
inherited |
Returns a form with a single select widget.
Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_single_select() instead.
moodle_url | $url | form action target, includes hidden fields |
string | $name | name of selection field - the changing parameter in url |
array | $options | list of options |
string | $selected | selected element |
array | $nothing | |
string | $formid | |
array | $attributes | other attributes for the single select |
string | HTML fragment |
|
inherited |
Output the place a skip link goes to.
string | $id | The target name from the corresponding $PAGE->requires->skip_link_to($target) call. |
string | the HTML to output. |
|
inherited |
Creates and returns a spacer image with optional line break.
array | $attributes | Any HTML attributes to add to the spaced. |
bool | $br | Include a BR after the spacer.... DON'T USE THIS. Don't be laxy do it with CSS which is a much better solution. |
string | HTML fragment |
|
inherited |
The standard HTML that should be output just before the <footer> tag.
Designed to be called in theme layout.php files.
string | HTML fragment. |
|
inherited |
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.
string | HTML fragment. |
|
inherited |
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.
string | HTML fragment. |
|
inherited |
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.
string | HTML fragment. |
|
inherited |
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.
string | HTML fragment. |
|
finalinherited |
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()
array | $tabs | array of tabs, each of them may have it's own ->subtree |
string | null | $selected | which tab to mark as selected, all parent tabs will automatically be marked as activated |
array | string | null | $inactive | list of ids of inactive tabs, regardless of their level. Note that you can as weel specify tabobject::$inactive for separate instances |
string |
|
inherited |
Displays the list of tags associated with an entry.
array | $tags | list of instances of core_tag or stdClass |
string | $label | label 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 | $classes | additional classes for the enclosing div element |
int | $limit | limit 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 | $pagecontext | specify if needed to overwrite the current page context for the view tag link |
bool | $accesshidelabel | if true, the label should have class="accesshide" added. |
string |
|
protectedinherited |
Renders theme links for switching between default and other themes.
string |
|
inherited |
Make nested HTML lists out of the items.
The resulting list will look something like this:
<
array | $items | |
array | $attrs | html attributes passed to the top ofs the list |
string | HTML |
|
inherited |
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.
string |
|
inherited |
|
inherited |
Returns a form with a url select widget.
Theme developers: DO NOT OVERRIDE! Please override function core_renderer::render_url_select() instead.
array | $urls | list of urls - array('/course/view.php?id=1'=>'Frontpage', ....) |
string | $selected | selected element |
array | $nothing | |
string | $formid |
string | HTML fragment |
|
inherited |
Construct a user menu, returning HTML that can be echoed out by a layout file.
stdClass | $user | A user object, usually $USER. |
bool | $withlinks | true if a dropdown should be built. |
string | HTML fragment. |
|
inherited |
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.
stdClass | $user | Object 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 | $options | associative array with user picture options, used only if not a user_picture object, options are:
|
string | HTML fragment |
Reimplemented in core_renderer_maintenance.
|
inherited |
Do NOT use, please use <?php echo $OUTPUT->main_content() ?> in layout files instead.