[ Index ] |
PHP Cross Reference of Unnamed Project |
[Source view] [Print] [Project Stats]
Classes for rendering HTML output for Moodle. Please see {@link http://docs.moodle.org/en/Developement:How_Moodle_outputs_HTML} for an overview.
Copyright: | 2009 Tim Hunt |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 5012 lines (197 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
renderer_base:: (8 methods):
get_mustache()
__construct()
render_from_template()
render()
add_action_handler()
has_started()
prepare_classes()
pix_url()
plugin_renderer_base:: (3 methods):
__construct()
render()
__call()
core_renderer:: (125 methods):
__construct()
doctype()
htmlattributes()
standard_head_html()
standard_top_of_body_html()
maintenance_warning()
standard_footer_html()
main_content()
standard_end_of_body_html()
login_info()
is_login_page()
home_link()
redirect_message()
header()
render_page_layout()
footer()
container_end_all()
course_content_header()
course_content_footer()
course_header()
course_footer()
lang_menu()
block_controls()
render_action_menu()
render_action_menu_link()
render_action_menu_filler()
render_action_menu_link_primary()
render_action_menu_link_secondary()
block()
block_header()
block_content()
block_footer()
block_annotation()
init_block_hider_js()
list_block_contents()
blocks_for_region()
block_move_target()
action_link()
render_action_link()
action_icon()
confirm()
single_button()
render_single_button()
single_select()
download_dataformat_selector()
render_single_select()
url_select()
render_url_select()
doc_link()
pix_icon()
render_pix_icon()
render_pix_emoticon()
render_rating()
heading_with_help()
old_help_icon()
help_icon()
render_help_icon()
help_icon_scale()
spacer()
user_picture()
render_user_picture()
htmllize_file_tree()
file_picker()
render_file_picker()
update_module_button()
edit_button()
close_window_button()
error_text()
fatal_error()
notification()
notify_problem()
notify_success()
notify_message()
notify_redirect()
render_notification()
continue_button()
paging_bar()
render_paging_bar()
skip_link_target()
heading()
box()
box_start()
box_end()
container()
container_start()
container_end()
tree_block_contents()
search_box()
user_menu()
navbar()
render_breadcrumb_navigation_node()
render_navigation_node()
rarrow()
larrow()
uarrow()
darrow()
custom_menu()
render_custom_menu()
render_custom_menu_item()
theme_switch_links()
tabtree()
render_tabtree()
render_tabobject()
blocks()
custom_block_region()
body_css_classes()
body_id()
body_attributes()
page_heading()
page_heading_button()
page_doc_link()
page_heading_menu()
page_title()
favicon()
render_preferences_groups()
render_preferences_group()
context_header()
render_context_header()
full_header()
tag_list()
render_inplace_editable()
render_chart_bar()
render_chart_line()
render_chart_pie()
render_chart()
core_renderer_cli:: (6 methods):
header()
heading()
fatal_error()
notification()
footer()
render_notification()
core_renderer_ajax:: (6 methods):
fatal_error()
notification()
redirect_message()
header()
footer()
heading()
core_media_renderer:: (8 methods):
__construct()
get_players()
get_players_raw()
embed_url()
embed_alternatives()
can_embed_url()
can_embed_urls()
get_embeddable_markers()
core_renderer_maintenance:: (15 methods):
__construct()
block()
blocks()
blocks_for_region()
course_content_header()
course_content_footer()
course_header()
course_footer()
custom_menu()
file_picker()
htmllize_file_tree()
init_block_hider_js()
lang_menu()
login_info()
user_picture()
Class: renderer_base - X-Ref
Simple base class for Moodle renderers.get_mustache() X-Ref |
Return an instance of the mustache class. return: Mustache_Engine |
__construct(moodle_page $page, $target) X-Ref |
Constructor The constructor takes two arguments. The first is the page that the renderer has been created to assist with, and the second is the target. The target is an additional identifier that can be used to load different renderers for different options. param: moodle_page $page the page we are doing output for. param: string $target one of rendering target constants |
render_from_template($templatename, $context) X-Ref |
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 param: array|stdClass $context Context containing data for the template. return: string|boolean |
render(renderable $widget) X-Ref |
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. param: renderable $widget instance with renderable interface return: string |
add_action_handler(component_action $action, $id = null) X-Ref |
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 {@link html_writer::random_id()} param: component_action $action param: string $id return: string id of element, either original submitted or random new if not supplied |
has_started() X-Ref |
Returns true is output has already started, and false if not. return: boolean true if the header has been printed. |
prepare_classes($classes) X-Ref |
Given an array or space-separated list of classes, prepares and returns the HTML class attribute value param: mixed $classes Space-separated string or array of classes return: string HTML class attribute value |
pix_url($imagename, $component = 'moodle') X-Ref |
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: pix_url('comment', 'mod_glossary') param: string $imagename the pathname of the image param: string $component full plugin name (aka component) or 'theme' return: moodle_url |
Class: plugin_renderer_base - X-Ref
Basis for all plugin renderers.__construct(moodle_page $page, $target) X-Ref |
Constructor method, calls the parent constructor param: moodle_page $page param: string $target one of rendering target constants |
render(renderable $widget) X-Ref |
Renders the provided widget and returns the HTML to display it. param: renderable $widget instance with renderable interface return: string |
__call($method, $arguments) X-Ref |
Magic method used to pass calls otherwise meant for the standard renderer to it to ensure we don't go causing unnecessary grief. param: string $method param: array $arguments return: mixed |
Class: core_renderer - X-Ref
The standard implementation of the core_renderer interface.__construct(moodle_page $page, $target) X-Ref |
Constructor param: moodle_page $page the page we are doing output for. param: string $target one of rendering target constants |
doctype() X-Ref |
Get the DOCTYPE declaration that should be used with this page. Designed to be called in theme layout.php files. return: string the DOCTYPE declaration that should be used. |
htmlattributes() X-Ref |
The attributes that should be added to the <html> tag. Designed to be called in theme layout.php files. return: string HTML fragment. |
standard_head_html() X-Ref |
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: string HTML fragment. |
standard_top_of_body_html() X-Ref |
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: string HTML fragment. |
maintenance_warning() X-Ref |
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: string |
standard_footer_html() X-Ref |
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: string HTML fragment. |
main_content() X-Ref |
Returns standard main content placeholder. Designed to be called in theme layout.php files. return: string HTML fragment. |
standard_end_of_body_html() X-Ref |
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: string HTML fragment. |
login_info($withlinks = null) X-Ref |
Return the standard string that says whether you are logged in (and switched roles/logged in as another user). param: bool $withlinks if false, then don't include any links in the HTML produced. return: string HTML fragment. |
is_login_page() X-Ref |
Check whether the current page is a login page. return: bool |
home_link() X-Ref |
Return the 'back' link that normally appears in the footer. return: string HTML fragment. |
redirect_message($encodedurl, $message, $delay, $debugdisableredirect,$messagetype = \core\output\notification::NOTIFY_INFO) X-Ref |
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 param: string $encodedurl The URL to send to encoded if required param: string $message The message to display to the user if any param: int $delay The delay before redirecting a user, if $message has been param: boolean $debugdisableredirect this redirect has been disabled for param: string $messagetype The type of notification to show the message in. return: string The HTML to display to the user before dying, may contain |
header() X-Ref |
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. If you are familiar with the old {@link print_header()} function from Moodle 1.9 you will find that there are properties on $PAGE that correspond to most of the old parameters to could be passed to print_header. Not that, in due course, the remaining $navigation, $menu parameters here will be replaced by more properties of $PAGE, but that is still to do. return: string HTML that you must output this, preferably immediately. |
render_page_layout($layoutfile) X-Ref |
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. param: string $layoutfile The name of the layout file return: string HTML code |
footer() X-Ref |
Outputs the page's footer return: string HTML fragment |
container_end_all($shouldbenone = false) X-Ref |
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. param: bool $shouldbenone assert that the stack should be empty now - causes a return: string the HTML required to close any open containers inside <body>. |
course_content_header($onlyifnotcalledbefore = false) X-Ref |
Returns course-specific information to be output immediately above content on any course page (for the current course) param: bool $onlyifnotcalledbefore output content only if it has not been output before return: string |
course_content_footer($onlyifnotcalledbefore = false) X-Ref |
Returns course-specific information to be output immediately below content on any course page (for the current course) param: bool $onlyifnotcalledbefore output content only if it has not been output before return: string |
course_header() X-Ref |
Returns course-specific information to be output on any course page in the header area (for the current course) return: string |
course_footer() X-Ref |
Returns course-specific information to be output on any course page in the footer area (for the current course) return: string |
lang_menu() X-Ref |
Returns lang menu or '', this method also checks forcing of languages in courses. This function calls {@link core_renderer::render_single_select()} to actually display the language menu. return: string The lang menu HTML or empty string |
block_controls($actions, $blockid = null) X-Ref |
Output the row of editing icons for a block, as defined by the controls array. param: array $controls an array like {@link block_contents::$controls}. param: string $blockid The ID given to the block. return: string HTML fragment. |
render_action_menu(action_menu $menu) X-Ref |
Renders an action menu component. ARIA references: - http://www.w3.org/WAI/GL/wiki/Using_ARIA_menus - http://stackoverflow.com/questions/12279113/recommended-wai-aria-implementation-for-navigation-bar-menu param: action_menu $menu return: string HTML |
render_action_menu_link(action_menu_link $action) X-Ref |
Renders an action_menu_link item. param: action_menu_link $action return: string HTML fragment |
render_action_menu_filler(action_menu_filler $action) X-Ref |
Renders a primary action_menu_filler item. param: action_menu_link_filler $action return: string HTML fragment |
render_action_menu_link_primary(action_menu_link_primary $action) X-Ref |
Renders a primary action_menu_link item. param: action_menu_link_primary $action return: string HTML fragment |
render_action_menu_link_secondary(action_menu_link_secondary $action) X-Ref |
Renders a secondary action_menu_link item. param: action_menu_link_secondary $action return: string HTML fragment |
block(block_contents $bc, $region) X-Ref |
Prints a nice side block with an optional header. The content is described by a {@link core_renderer::block_contents} object. <div id="inst{$instanceid}" class="block_{$blockname} block"> <div class="header"></div> <div class="content"> ...CONTENT... <div class="footer"> </div> </div> <div class="annotation"> </div> </div> param: block_contents $bc HTML for the content param: string $region the region the block is appearing in. return: string the HTML to be output. |
block_header(block_contents $bc) X-Ref |
Produces a header for a block param: block_contents $bc return: string |
block_content(block_contents $bc) X-Ref |
Produces the content area for a block param: block_contents $bc return: string |
block_footer(block_contents $bc) X-Ref |
Produces the footer for a block param: block_contents $bc return: string |
block_annotation(block_contents $bc) X-Ref |
Produces the annotation for a block param: block_contents $bc return: string |
init_block_hider_js(block_contents $bc) X-Ref |
Calls the JS require function to hide a block. param: block_contents $bc A block_contents object |
list_block_contents($icons, $items) X-Ref |
Render the contents of a block_list. param: array $icons the icon for each item. param: array $items the content of each item. return: string HTML |
blocks_for_region($region) X-Ref |
Output all the blocks in a particular region. param: string $region the name of a region on this page. return: string the HTML to be output. |
block_move_target($target, $zones, $previous, $region) X-Ref |
Output a place where the block that is currently being moved can be dropped. param: block_move_target $target with the necessary details. param: array $zones array of areas where the block can be moved to param: string $previous the block located before the area currently being rendered. param: string $region the name of the region return: string the HTML to be output. |
action_link($url, $text, component_action $action = null, array $attributes = null, $icon = null) X-Ref |
Renders a special html link with attached action Theme developers: DO NOT OVERRIDE! Please override function {@link core_renderer::render_action_link()} instead. param: string|moodle_url $url param: string $text HTML fragment param: component_action $action param: array $attributes associative array of html link attributes + disabled param: pix_icon optional pix icon to render with the link return: string HTML fragment |
render_action_link(action_link $link) X-Ref |
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 {@link core_renderer::add_action_handler()} param: action_link $link return: string HTML fragment |
action_icon($url, pix_icon $pixicon, component_action $action = null, array $attributes = null, $linktext=false) X-Ref |
Renders an action_icon. This function uses the {@link 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 {@link core_renderer::render_action_link()} and {@link core_renderer::render_pix_icon()}. param: string|moodle_url $url A string URL or moodel_url param: pix_icon $pixicon param: component_action $action param: array $attributes associative array of html link attributes + disabled param: bool $linktext show title next to image in link return: string HTML fragment |
confirm($message, $continue, $cancel) X-Ref |
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. param: string $message The question to ask the user param: single_button|moodle_url|string $continue The single_button component representing the Continue answer. Can also be a moodle_url or string URL param: single_button|moodle_url|string $cancel The single_button component representing the Cancel answer. Can also be a moodle_url or string URL return: string HTML fragment |
single_button($url, $label, $method='post', array $options=null) X-Ref |
Returns a form with a single button. Theme developers: DO NOT OVERRIDE! Please override function {@link core_renderer::render_single_button()} instead. param: string|moodle_url $url param: string $label button text param: string $method get or post submit method param: array $options associative array {disabled, title, etc.} return: string HTML fragment |
render_single_button(single_button $button) X-Ref |
Renders a single button widget. This will return HTML to display a form containing a single button. param: single_button $button return: string HTML fragment |
single_select($url, $name, array $options, $selected = '',$nothing = array('' => 'choosedots') X-Ref |
Returns a form with a single select widget. Theme developers: DO NOT OVERRIDE! Please override function {@link core_renderer::render_single_select()} instead. param: moodle_url $url form action target, includes hidden fields param: string $name name of selection field - the changing parameter in url param: array $options list of options param: string $selected selected element param: array $nothing param: string $formid param: array $attributes other attributes for the single select return: string HTML fragment |
download_dataformat_selector($label, $base, $name = 'dataformat', $params = array() X-Ref |
Returns a dataformat selection and download form param: string $label A text label param: moodle_url|string $base The download page url param: string $name The query param which will hold the type of the download param: array $params Extra params sent to the download page return: string HTML fragment |
render_single_select(single_select $select) X-Ref |
Internal implementation of single_select rendering param: single_select $select return: string HTML fragment |
url_select(array $urls, $selected, $nothing = array('' => 'choosedots') X-Ref |
Returns a form with a url select widget. Theme developers: DO NOT OVERRIDE! Please override function {@link core_renderer::render_url_select()} instead. param: array $urls list of urls - array('/course/view.php?id=1'=>'Frontpage', ....) param: string $selected selected element param: array $nothing param: string $formid return: string HTML fragment |
render_url_select(url_select $select) X-Ref |
Internal implementation of url_select rendering param: url_select $select return: string HTML fragment |
doc_link($path, $text = '', $forcepopup = false) X-Ref |
Returns a string containing a link to the user documentation. Also contains an icon by default. Shown to teachers and admin only. param: string $path The page link after doc root and language, no leading slash. param: string $text The text to be displayed for the link param: boolean $forcepopup Whether to force a popup regardless of the value of $CFG->doctonewwindow return: string |
pix_icon($pix, $alt, $component='moodle', array $attributes = null) X-Ref |
Return HTML for a pix_icon. Theme developers: DO NOT OVERRIDE! Please override function {@link core_renderer::render_pix_icon()} instead. param: string $pix short pix name param: string $alt mandatory alt attribute param: string $component standard compoennt name like 'moodle', 'mod_forum', etc. param: array $attributes htm lattributes return: string HTML fragment |
render_pix_icon(pix_icon $icon) X-Ref |
Renders a pix_icon widget and returns the HTML to display it. param: pix_icon $icon return: string HTML fragment |
render_pix_emoticon(pix_emoticon $emoticon) X-Ref |
Return HTML to display an emoticon icon. param: pix_emoticon $emoticon return: string HTML fragment |
render_rating(rating $rating) X-Ref |
Produces the html that represents this rating in the UI param: rating $rating the page object on which this rating will appear return: string |
heading_with_help($text, $helpidentifier, $component = 'moodle', $icon = '', $iconalt = '', $level = 2, $classnames = null) X-Ref |
Centered heading with attached help button (same title text) and optional icon attached. param: string $text A heading text param: string $helpidentifier The keyword that defines a help page param: string $component component name param: string|moodle_url $icon param: string $iconalt icon alt text param: int $level The level of importance of the heading. Defaulting to 2 param: string $classnames A space-separated list of CSS classes. Defaulting to null return: string HTML fragment |
old_help_icon($helpidentifier, $title, $component = 'moodle', $linktext = '') X-Ref |
Returns HTML to display a help icon. |
help_icon($identifier, $component = 'moodle', $linktext = '') X-Ref |
Returns HTML to display a help icon. Theme developers: DO NOT OVERRIDE! Please override function {@link core_renderer::render_help_icon()} instead. param: string $identifier The keyword that defines a help page param: string $component component name param: string|bool $linktext true means use $title as link text, string means link text value return: string HTML fragment |
render_help_icon(help_icon $helpicon) X-Ref |
Implementation of user image rendering. param: help_icon $helpicon A help icon instance return: string HTML fragment |
help_icon_scale($courseid, stdClass $scale) X-Ref |
Returns HTML to display a scale help icon. param: int $courseid param: stdClass $scale instance return: string HTML fragment |
spacer(array $attributes = null, $br = false) X-Ref |
Creates and returns a spacer image with optional line break. param: array $attributes Any HTML attributes to add to the spaced. param: bool $br Include a BR after the spacer.... DON'T USE THIS. Don't be return: string HTML fragment |
user_picture(stdClass $user, array $options = null) X-Ref |
Returns HTML to display the specified user's avatar. User avatar may be obtained in two ways: <pre> // 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); </pre> Theme developers: DO NOT OVERRIDE! Please override function {@link core_renderer::render_user_picture()} instead. param: stdClass $user Object with at least fields id, picture, imagealt, firstname, lastname param: array $options associative array with user picture options, used only if not a user_picture object, return: string HTML fragment |
render_user_picture(user_picture $userpicture) X-Ref |
Internal implementation of user image rendering. param: user_picture $userpicture return: string |
htmllize_file_tree($dir) X-Ref |
Internal implementation of file tree viewer items rendering. param: array $dir return: string |
file_picker($options) X-Ref |
Returns HTML to display the file picker <pre> $OUTPUT->file_picker($options); </pre> Theme developers: DO NOT OVERRIDE! Please override function {@link core_renderer::render_file_picker()} instead. param: array $options associative array with file manager options return: string HTML fragment |
render_file_picker(file_picker $fp) X-Ref |
Internal implementation of file picker rendering. param: file_picker $fp return: string |
update_module_button($cmid, $modulename) X-Ref |
Returns HTML to display the 'Update this Modulename' button that appears on module pages. param: string $cmid the course_module id. param: string $modulename the module name, eg. "forum", "quiz" or "workshop" return: string the HTML for the button, if this user has permission to edit it, else an empty string. |
edit_button(moodle_url $url) X-Ref |
Returns HTML to display a "Turn editing on/off" button in a form. param: moodle_url $url The URL + params to send through when clicking the button return: string HTML the button |
close_window_button($text='') X-Ref |
Returns HTML to display a simple button to close a window param: string $text The lang string for the button's label (already output from get_string()) return: string html fragment |
error_text($message) X-Ref |
Output an error message. By default wraps the error message in <span class="error">. If the error message is blank, nothing is output. param: string $message the error message. return: string the HTML to output. |
fatal_error($message, $moreinfourl, $link, $backtrace, $debuginfo = null) X-Ref |
Do not call this function directly. To terminate the current script with a fatal error, call the {@link 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. param: string $message The message to output param: string $moreinfourl URL where more info can be found about the error param: string $link Link for the Continue button param: array $backtrace The execution backtrace param: string $debuginfo Debugging information return: string the HTML to output. |
notification($message, $type = null) X-Ref |
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. param: string $message The message to print out. param: string $type The type of notification. See constants on \core\output\notification. return: string the HTML to output. |
notify_problem($message) X-Ref |
Output a notification at a particular level - in this case, NOTIFY_PROBLEM. param: string $message the message to print out return: string HTML fragment. |
notify_success($message) X-Ref |
Output a notification at a particular level - in this case, NOTIFY_SUCCESS. param: string $message the message to print out return: string HTML fragment. |
notify_message($message) X-Ref |
Output a notification at a particular level - in this case, NOTIFY_MESSAGE. param: string $message the message to print out return: string HTML fragment. |
notify_redirect($message) X-Ref |
Output a notification at a particular level - in this case, NOTIFY_REDIRECT. param: string $message the message to print out return: string HTML fragment. |
render_notification(\core\output\notification $notification) X-Ref |
Render a notification (that is, a status message about something that has just happened). param: \core\output\notification $notification the notification to print out return: string the HTML to output. |
continue_button($url) X-Ref |
Returns HTML to display a continue button that goes to a particular URL. param: string|moodle_url $url The url the button goes to. return: string the HTML to output. |
paging_bar($totalcount, $page, $perpage, $baseurl, $pagevar = 'page') X-Ref |
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 {@link core_renderer::render_paging_bar()} instead. param: int $totalcount The total number of entries available to be paged through param: int $page The page you are currently viewing param: int $perpage The number of entries that should be shown per page param: string|moodle_url $baseurl url of the current page, the $pagevar parameter is added param: string $pagevar name of page parameter that holds the page number return: string the HTML to output. |
render_paging_bar(paging_bar $pagingbar) X-Ref |
Internal implementation of paging bar rendering. param: paging_bar $pagingbar return: string |
skip_link_target($id = null) X-Ref |
Output the place a skip link goes to. param: string $id The target name from the corresponding $PAGE->requires->skip_link_to($target) call. return: string the HTML to output. |
heading($text, $level = 2, $classes = null, $id = null) X-Ref |
Outputs a heading param: string $text The text of the heading param: int $level The level of importance of the heading. Defaulting to 2 param: string $classes A space-separated list of CSS classes. Defaulting to null param: string $id An optional ID return: string the HTML to output. |
box($contents, $classes = 'generalbox', $id = null, $attributes = array() X-Ref |
Outputs a box. param: string $contents The contents of the box param: string $classes A space-separated list of CSS classes param: string $id An optional ID param: array $attributes An array of other attributes to give the box. return: string the HTML to output. |
box_start($classes = 'generalbox', $id = null, $attributes = array() X-Ref |
Outputs the opening section of a box. param: string $classes A space-separated list of CSS classes param: string $id An optional ID param: array $attributes An array of other attributes to give the box. return: string the HTML to output. |
box_end() X-Ref |
Outputs the closing section of a box. return: string the HTML to output. |
container($contents, $classes = null, $id = null) X-Ref |
Outputs a container. param: string $contents The contents of the box param: string $classes A space-separated list of CSS classes param: string $id An optional ID return: string the HTML to output. |
container_start($classes = null, $id = null) X-Ref |
Outputs the opening section of a container. param: string $classes A space-separated list of CSS classes param: string $id An optional ID return: string the HTML to output. |
container_end() X-Ref |
Outputs the closing section of a container. return: string the HTML to output. |
tree_block_contents($items, $attrs = array() X-Ref |
Make nested HTML lists out of the items The resulting list will look something like this: <pre> <<ul>> <<li>><div class='tree_item parent'>(item contents)</div> <<ul> <<li>><div class='tree_item'>(item contents)</div><</li>> <</ul>> <</li>> <</ul>> </pre> param: array $items param: array $attrs html attributes passed to the top ofs the list return: string HTML |
search_box($id = false) X-Ref |
Returns a search box. param: string $id The search box wrapper div id, defaults to an autogenerated one. return: string HTML with the search form hidden by default. |
user_menu($user = null, $withlinks = null) X-Ref |
Construct a user menu, returning HTML that can be echoed out by a layout file. param: stdClass $user A user object, usually $USER. param: bool $withlinks true if a dropdown should be built. return: string HTML fragment. |
navbar() X-Ref |
Return the navbar content so that it can be echoed out by the layout return: string XHTML navbar |
render_breadcrumb_navigation_node(breadcrumb_navigation_node $item) X-Ref |
Renders a breadcrumb navigation node object. param: breadcrumb_navigation_node $item The navigation node to render. return: string HTML fragment |
render_navigation_node(navigation_node $item) X-Ref |
Renders a navigation node object. param: navigation_node $item The navigation node to render. return: string HTML fragment |
rarrow() X-Ref |
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: string |
larrow() X-Ref |
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: string |
uarrow() X-Ref |
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: string |
darrow() X-Ref |
Accessibility: Down arrow-like character. If the theme does not set characters, appropriate defaults are set automatically. return: string |
custom_menu($custommenuitems = '') X-Ref |
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 {@link core_renderer::render_custom_menu()} instead. param: string $custommenuitems - custom menuitems set by theme instead of global theme settings return: string |
render_custom_menu(custom_menu $menu) X-Ref |
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. param: custom_menu $menu return: string |
render_custom_menu_item(custom_menu_item $menunode) X-Ref |
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. param: custom_menu_item $menunode return: string |
theme_switch_links() X-Ref |
Renders theme links for switching between default and other themes. return: string |
tabtree($tabs, $selected = null, $inactive = null) X-Ref |
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 {@link core_renderer::render_tabtree()} and/or {@link core_renderer::render_tabobject()} param: array $tabs array of tabs, each of them may have it's own ->subtree param: string|null $selected which tab to mark as selected, all parent tabs will param: array|string|null $inactive list of ids of inactive tabs, regardless of return: string |
render_tabtree(tabtree $tabtree) X-Ref |
Renders tabtree param: tabtree $tabtree return: string |
render_tabobject(tabobject $tabobject) X-Ref |
Renders tabobject (part of tabtree) This function is called from {@link 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. param: tabobject $tabobject return: string HTML fragment |
blocks($region, $classes = array() X-Ref |
Get the HTML for blocks in the given region. param: string $region The region to get HTML for. return: string HTML. |
custom_block_region($regionname) X-Ref |
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). param: string $regionname The name of the custom region to add. return: string HTML for the block region. |
body_css_classes(array $additionalclasses = array() X-Ref |
Returns the CSS classes to apply to the body tag. param: array $additionalclasses Any additional classes to apply. return: string |
body_id() X-Ref |
The ID attribute to apply to the body tag. return: string |
body_attributes($additionalclasses = array() X-Ref |
Returns HTML attributes to use within the body tag. This includes an ID and classes. param: string|array $additionalclasses Any additional classes to give the body tag, return: string |
page_heading($tag = 'h1') X-Ref |
Gets HTML for the page heading. param: string $tag The tag to encase the heading in. h1 by default. return: string HTML. |
page_heading_button() X-Ref |
Gets the HTML for the page heading button. return: string HTML. |
page_doc_link($text = null) X-Ref |
Returns the Moodle docs link to use for this page. param: string $text return: string |
page_heading_menu() X-Ref |
Returns the page heading menu. return: string HTML. |
page_title() X-Ref |
Returns the title to use on the page. return: string |
favicon() X-Ref |
Returns the URL for the favicon. return: string The favicon URL |
render_preferences_groups(preferences_groups $renderable) X-Ref |
Renders preferences groups. param: preferences_groups $renderable The renderable return: string The output. |
render_preferences_group(preferences_group $renderable) X-Ref |
Renders preferences group. param: preferences_group $renderable The renderable return: string The output. |
context_header($headerinfo = null, $headinglevel = 1) X-Ref |
Returns the header bar. param: array $headerinfo An array of header information, dependant on what type of header is being displayed. The following param: int $headinglevel What level the 'h' tag will be. return: string HTML for the header bar. |
render_context_header(context_header $contextheader) X-Ref |
Renders the header bar. param: context_header $contextheader Header bar object. return: string HTML for the header bar. |
full_header() X-Ref |
Wrapper for header elements. return: string HTML to display the main header. |
tag_list($tags, $label = null, $classes = '', $limit = 10, $pagecontext = null) X-Ref |
Displays the list of tags associated with an entry param: array $tags list of instances of core_tag or stdClass param: string $label label to display in front, by default 'Tags' (get_string('tags')), set to null param: string $classes additional classes for the enclosing div element param: int $limit limit the number of tags to display, if size of $tags is more than this limit the "more" link param: context $pagecontext specify if needed to overwrite the current page context for the view tag link return: string |
render_inplace_editable(\core\output\inplace_editable $element) X-Ref |
Renders element for inline editing of any value param: \core\output\inplace_editable $element return: string |
render_chart_bar(\core\chart_bar $chart) X-Ref |
Renders a bar chart. param: \core\chart_bar $chart The chart. return: string. |
render_chart_line(\core\chart_line $chart) X-Ref |
Renders a line chart. param: \core\chart_line $chart The chart. return: string. |
render_chart_pie(\core\chart_pie $chart) X-Ref |
Renders a pie chart. param: \core\chart_pie $chart The chart. return: string. |
render_chart(\core\chart_base $chart, $withtable = true) X-Ref |
Renders a chart. param: \core\chart_base $chart The chart. param: bool $withtable Whether to include a data table with the chart. return: string. |
Class: core_renderer_cli - X-Ref
A renderer that generates output for command-line scripts.header() X-Ref |
Returns the page header. return: string HTML fragment |
heading($text, $level = 2, $classes = 'main', $id = null) X-Ref |
Returns a template fragment representing a Heading. param: string $text The text of the heading param: int $level The level of importance of the heading param: string $classes A space-separated list of CSS classes param: string $id An optional ID return: string A template fragment for a heading |
fatal_error($message, $moreinfourl, $link, $backtrace, $debuginfo = null) X-Ref |
Returns a template fragment representing a fatal error. param: string $message The message to output param: string $moreinfourl URL where more info can be found about the error param: string $link Link for the Continue button param: array $backtrace The execution backtrace param: string $debuginfo Debugging information return: string A template fragment for a fatal error |
notification($message, $type = null) X-Ref |
Returns a template fragment representing a notification. param: string $message The message to print out. param: string $type The type of notification. See constants on \core\output\notification. return: string A template fragment for a notification |
footer() X-Ref |
There is no footer for a cli request, however we must override the footer method to prevent the default footer. |
render_notification(\core\output\notification $notification) X-Ref |
Render a notification (that is, a status message about something that has just happened). param: \core\output\notification $notification the notification to print out return: string plain text output |
Class: core_renderer_ajax - X-Ref
A renderer that generates output for ajax scripts.fatal_error($message, $moreinfourl, $link, $backtrace, $debuginfo = null) X-Ref |
Returns a template fragment representing a fatal error. param: string $message The message to output param: string $moreinfourl URL where more info can be found about the error param: string $link Link for the Continue button param: array $backtrace The execution backtrace param: string $debuginfo Debugging information return: string A template fragment for a fatal error |
notification($message, $type = null) X-Ref |
Used to display a notification. For the AJAX notifications are discarded. param: string $message The message to print out. param: string $type The type of notification. See constants on \core\output\notification. |
redirect_message($encodedurl, $message, $delay, $debugdisableredirect,$messagetype = \core\output\notification::NOTIFY_INFO) X-Ref |
Used to display a redirection message. AJAX redirections should not occur and as such redirection messages are discarded. param: moodle_url|string $encodedurl param: string $message param: int $delay param: bool $debugdisableredirect param: string $messagetype The type of notification to show the message in. |
header() X-Ref |
Prepares the start of an AJAX output. |
footer() X-Ref |
There is no footer for an AJAX request, however we must override the footer method to prevent the default footer. |
heading($text, $level = 2, $classes = 'main', $id = null) X-Ref |
No need for headers in an AJAX request... this should never happen. param: string $text param: int $level param: string $classes param: string $id |
Class: core_media_renderer - X-Ref
Renderer for media files.__construct() X-Ref |
Constructor requires medialib.php. This is needed in the constructor (not later) so that you can use the constants and static functions that are defined in core_media class before you call renderer functions. |
get_players() X-Ref |
Obtains the list of core_media_player objects currently in use to render items. The list is in rank order (highest first) and does not include players which are disabled. return: array Array of core_media_player objects in rank order |
get_players_raw() X-Ref |
Obtains a raw list of player objects that includes objects regardless of whether they are disabled or not, and without sorting. You can override this in a subclass if you need to add additional players. The return array is be indexed by player name to make it easier to remove players in a subclass. return: array $players Array of core_media_player objects in any order |
embed_url(moodle_url $url, $name = '', $width = 0, $height = 0,$options = array() X-Ref |
Renders a media file (audio or video) using suitable embedded player. See embed_alternatives function for full description of parameters. This function calls through to that one. When using this function you can also specify width and height in the URL by including ?d=100x100 at the end. If specified in the URL, this will override the $width and $height parameters. param: moodle_url $url Full URL of media file param: string $name Optional user-readable name to display in download link param: int $width Width in pixels (optional) param: int $height Height in pixels (optional) param: array $options Array of key/value pairs return: string HTML content of embed |
embed_alternatives($alternatives, $name = '', $width = 0, $height = 0,$options = array() X-Ref |
Renders media files (audio or video) using suitable embedded player. The list of URLs should be alternative versions of the same content in multiple formats. If there is only one format it should have a single entry. If the media files are not in a supported format, this will give students a download link to each format. The download link uses the filename unless you supply the optional name parameter. Width and height are optional. If specified, these are suggested sizes and should be the exact values supplied by the user, if they come from user input. These will be treated as relating to the size of the video content, not including any player control bar. For audio files, height will be ignored. For video files, a few formats work if you specify only width, but in general if you specify width you must specify height as well. The $options array is passed through to the core_media_player classes that render the object tag. The keys can contain values from core_media::OPTION_xx. param: array $alternatives Array of moodle_url to media files param: string $name Optional user-readable name to display in download link param: int $width Width in pixels (optional) param: int $height Height in pixels (optional) param: array $options Array of key/value pairs return: string HTML content of embed |
can_embed_url(moodle_url $url, $options = array() X-Ref |
Checks whether a file can be embedded. If this returns true you will get an embedded player; if this returns false, you will just get a download link. This is a wrapper for can_embed_urls. param: moodle_url $url URL of media file param: array $options Options (same as when embedding) return: bool True if file can be embedded |
can_embed_urls(array $urls, $options = array() X-Ref |
Checks whether a file can be embedded. If this returns true you will get an embedded player; if this returns false, you will just get a download link. param: array $urls URL of media file and any alternatives (moodle_url) param: array $options Options (same as when embedding) return: bool True if file can be embedded |
get_embeddable_markers() X-Ref |
Obtains a list of markers that can be used in a regular expression when searching for URLs that can be embedded by any player type. This string is used to improve peformance of regex matching by ensuring that the (presumably C) regex code can do a quick keyword check on the URL part of a link to see if it matches one of these, rather than having to go into PHP code for every single link to see if it can be embedded. return: string String suitable for use in regex such as '(\.mp4|\.flv)' |
Class: core_renderer_maintenance - X-Ref
The maintenance renderer.__construct(moodle_page $page, $target) X-Ref |
Initialises the renderer instance. param: moodle_page $page param: string $target |
block(block_contents $bc, $region) X-Ref |
Does nothing. The maintenance renderer cannot produce blocks. param: block_contents $bc param: string $region return: string |
blocks($region, $classes = array() X-Ref |
Does nothing. The maintenance renderer cannot produce blocks. param: string $region param: array $classes param: string $tag return: string |
blocks_for_region($region) X-Ref |
Does nothing. The maintenance renderer cannot produce blocks. param: string $region return: string |
course_content_header($onlyifnotcalledbefore = false) X-Ref |
Does nothing. The maintenance renderer cannot produce a course content header. param: bool $onlyifnotcalledbefore return: string |
course_content_footer($onlyifnotcalledbefore = false) X-Ref |
Does nothing. The maintenance renderer cannot produce a course content footer. param: bool $onlyifnotcalledbefore return: string |
course_header() X-Ref |
Does nothing. The maintenance renderer cannot produce a course header. return: string |
course_footer() X-Ref |
Does nothing. The maintenance renderer cannot produce a course footer. return: string |
custom_menu($custommenuitems = '') X-Ref |
Does nothing. The maintenance renderer cannot produce a custom menu. param: string $custommenuitems return: string |
file_picker($options) X-Ref |
Does nothing. The maintenance renderer cannot produce a file picker. param: array $options return: string |
htmllize_file_tree($dir) X-Ref |
Does nothing. The maintenance renderer cannot produce and HTML file tree. param: array $dir return: string |
init_block_hider_js(block_contents $bc) X-Ref |
Does nothing. The maintenance renderer does not support JS. param: block_contents $bc |
lang_menu() X-Ref |
Does nothing. The maintenance renderer cannot produce language menus. return: string |
login_info($withlinks = null) X-Ref |
Does nothing. The maintenance renderer has no need for login information. param: null $withlinks return: string |
user_picture(stdClass $user, array $options = null) X-Ref |
Does nothing. The maintenance renderer cannot produce user pictures. param: stdClass $user param: array $options return: string |
Generated: Thu Aug 11 10:00:09 2016 | Cross-referenced by PHPXref 0.7.1 |