Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
core_webservice_renderer Class Reference
Inheritance diagram for core_webservice_renderer:
plugin_renderer_base renderer_base

Public Member Functions

 __call ($method, $arguments)
 Magic method used to pass calls otherwise meant for the standard renderer to it to ensure we don't go causing unnecessary grief.
 
 add_action_handler (component_action $action, $id=null)
 Adds a JS action for the element with the provided id.
 
 admin_authorised_user_list ($users, $serviceid)
 Display list of authorised users for the given external service.
 
 admin_authorised_user_selector (&$options)
 Display the authorised user selector.
 
 admin_remove_service_confirmation ($service)
 Display a confirmation page to remove a service.
 
 admin_remove_service_function_confirmation ($function, $service)
 Display a confirmation page to remove a function from a service.
 
 admin_service_function_list ($functions, $service)
 Display a list of functions for a given service If the service is built-in, do not display remove/add operation (read-only)
 
 colored_box_with_pre_tag ($title, $content, $rgb='FEEBE5')
 Return the html of a coloured box with content.
 
 description_in_indented_xml_format ($returndescription, $indentation="")
 Return a description object in indented xml format (for REST response) It is indented to be output within.
 
 detailed_description_html ($params)
 Return documentation for a ws description object ws description object can be 'external_multiple_structure', 'external_single_structure' or 'external_value'.
 
 documentation_html ($functions, $printableformat, $activatedprotocol, $authparams, $parenturl='/webservice/wsdoc.php')
 Displays all the documentation.
 
 get_compact_logo_url ($maxwidth=300, $maxheight=300)
 Return the site's compact logo URL, if any.
 
 get_logo_url ($maxwidth=null, $maxheight=200)
 Return the site's logo URL, if any.
 
 get_page ()
 Returns the moodle page object.
 
 has_started ()
 Returns true is output has already started, and false if not.
 
 image_url ($imagename, $component='moodle')
 Return the moodle_url for an image.
 
 pix_url ($imagename, $component='moodle')
 Return the direct URL for an image from the pix folder.
 
 render (renderable $widget)
 Renders the provided widget and returns the HTML to display it.
 
 render_from_template ($templatename, $context)
 Renders a template by name with the given context.
 
 rest_param_description_html ($paramdescription, $paramstring)
 Return indented REST param description.
 
 should_display_main_logo ($headinglevel=1)
 Whether we should display the main logo.
 
 should_display_navbar_logo ()
 Whether we should display the logo in the navbar.
 
 user_reset_token_confirmation ($token)
 Display Reset token confirmation box.
 
 user_webservice_tokens_box ($tokens, $userid, $documentation=false)
 Display user tokens with buttons to reset them.
 
 xmlrpc_param_description_html ($paramdescription, $indentation="")
 Create indented XML-RPC param description.
 

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.
 

Protected Member Functions

 get_mustache ()
 Return an instance of the mustache class.
 

Protected Attributes

xhtml_container_stack $opencontainers
 The xhtml_container_stack to use.
 
renderer_base core_renderer $output
 A reference to the current renderer.
 
moodle_page $page
 The Moodle page the renderer has been created to assist with.
 
string $target
 The requested rendering target.
 
array $templatecache = []
 $templatecache The mustache template cache.
 

Detailed Description

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

Member Function Documentation

◆ admin_authorised_user_list()

core_webservice_renderer::admin_authorised_user_list ( $users,
$serviceid )

Display list of authorised users for the given external service.

Parameters
array$usersauthorised users
int$serviceidservice id
Return values
string\$html

◆ admin_authorised_user_selector()

core_webservice_renderer::admin_authorised_user_selector ( & $options)

Display the authorised user selector.

Parameters
stdClass$optionsIt contains alloweduserselector, potentialuserselector and serviceid
Return values
stringhtml

◆ admin_remove_service_confirmation()

core_webservice_renderer::admin_remove_service_confirmation ( $service)

Display a confirmation page to remove a service.

Parameters
stdClass$serviceIt needs service id + service name properties.
Return values
stringhtml

◆ admin_remove_service_function_confirmation()

core_webservice_renderer::admin_remove_service_function_confirmation ( $function,
$service )

Display a confirmation page to remove a function from a service.

Parameters
stdClass$functionIt needs function id + function name properties.
stdClass$serviceIt needs service id + service name properties.
Return values
stringhtml

◆ admin_service_function_list()

core_webservice_renderer::admin_service_function_list ( $functions,
$service )

Display a list of functions for a given service If the service is built-in, do not display remove/add operation (read-only)

Parameters
array$functionslist of functions
stdClass$servicethe given service
Return values
stringthe table html + add operation html

◆ colored_box_with_pre_tag()

core_webservice_renderer::colored_box_with_pre_tag ( $title,
$content,
$rgb = 'FEEBE5' )

Return the html of a coloured box with content.

Parameters
string$title- the title of the box
string$content- the content to displayed
string$rgb- the background color of the box
Return values
stringHTML code

◆ description_in_indented_xml_format()

core_webservice_renderer::description_in_indented_xml_format ( $returndescription,
$indentation = "" )

Return a description object in indented xml format (for REST response) It is indented to be output within.

 tags

Parameters
external_description$returndescriptionthe description structure of the web service function returned value
string$indentationIndentation in the generated HTML code; should contain only spaces.
Return values
stringthe html to diplay

◆ detailed_description_html()

core_webservice_renderer::detailed_description_html ( $params)

Return documentation for a ws description object ws description object can be 'external_multiple_structure', 'external_single_structure' or 'external_value'.

Example of documentation for core_group_create_groups function: list of ( object { courseid int //id of course name string //multilang compatible name, course unique description string //group description text enrolmentkey string //group enrol secret phrase } )

Parameters
stdClass$paramsa part of parameter/return description
Return values
stringthe html to display

◆ documentation_html()

core_webservice_renderer::documentation_html ( $functions,
$printableformat,
$activatedprotocol,
$authparams,
$parenturl = '/webservice/wsdoc.php' )

Displays all the documentation.

Todo
MDL-76078 - Incorrect inter-communication, core cannot have plugin dependencies like this.
Parameters
array$functionsexternal_description of all the web service functions
boolean$printableformattrue if we want to display the documentation in a printable format
array$activatedprotocolthe currently enabled protocol
array$authparamsurl parameters (it contains 'tokenid' and sometimes 'print')
string$parenturlurl of the calling page - needed for the print button url: '/admin/documentation.php' or '/webservice/wsdoc.php' (default)
Return values
stringthe html to diplay

◆ rest_param_description_html()

core_webservice_renderer::rest_param_description_html ( $paramdescription,
$paramstring )

Return indented REST param description.

Todo
MDL-76078 - Incorrect inter-communication, core cannot have plugin dependencies like this.
Parameters
external_description$paramdescriptionthe description structure of the web service function parameters
string$paramstringparameter
Return values
stringthe html to diplay

◆ user_reset_token_confirmation()

core_webservice_renderer::user_reset_token_confirmation ( $token)

Display Reset token confirmation box.

Parameters
stdClass$tokentoken to reset
Return values
stringhtml

◆ user_webservice_tokens_box()

core_webservice_renderer::user_webservice_tokens_box ( $tokens,
$userid,
$documentation = false )

Display user tokens with buttons to reset them.

Parameters
stdClass$tokensuser tokens
int$useriduser id
bool$documentationif true display a link to the API documentation
Return values
stringhtml code

◆ xmlrpc_param_description_html()

core_webservice_renderer::xmlrpc_param_description_html ( $paramdescription,
$indentation = "" )

Create indented XML-RPC param description.

Todo
MDL-76078 - Incorrect inter-communication, core cannot have plugin dependencies like this.
Parameters
external_description$paramdescriptionthe description structure of the web service function parameters
string$indentationIndentation in the generated HTML code; should contain only spaces.
Return values
stringthe html to diplay

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