mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-68636 core_contentbank: Changing get_icon function
This commit is contained in:
parent
f9830e456a
commit
6fc3477cc5
7 changed files with 81 additions and 16 deletions
|
@ -181,12 +181,12 @@ abstract class contenttype {
|
|||
/**
|
||||
* Returns the HTML code to render the icon for content bank contents.
|
||||
*
|
||||
* @param string $contentname The contentname to add as alt value to the icon.
|
||||
* @param content $content The content to be displayed.
|
||||
* @return string HTML code to render the icon
|
||||
*/
|
||||
public function get_icon(string $contentname): string {
|
||||
public function get_icon(content $content): string {
|
||||
global $OUTPUT;
|
||||
return $OUTPUT->pix_icon('f/unknown-64', $contentname, 'moodle', ['class' => 'iconsize-big']);
|
||||
return $OUTPUT->image_url('f/unknown-64', 'moodle')->out(false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -86,7 +86,7 @@ class bankcontent implements renderable, templatable {
|
|||
$contentdata[] = array(
|
||||
'name' => $name,
|
||||
'link' => $contenttype->get_view_url($content),
|
||||
'icon' => $contenttype->get_icon($name)
|
||||
'icon' => $contenttype->get_icon($content)
|
||||
);
|
||||
}
|
||||
$data->contents = $contentdata;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue