MDL-68819 core_contentbank: "Upload" button is not localized.
[moodle.git] / contentbank / tests / fixtures / testable_contenttype.php
CommitLineData
70819075
AA
1<?php
2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
17/**
18 * Testable contenttype plugin class.
19 *
20 * @package core_contentbank
21 * @category test
22 * @copyright 2020 Sara Arjona <sara@moodle.com>
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24 */
25
26namespace contenttype_testable;
27
28/**
29 * Testable contenttype plugin class.
30 *
31 * @package core_contentbank
32 * @copyright 2020 Sara Arjona <sara@moodle.com>
33 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
34 */
35class contenttype extends \core_contentbank\contenttype {
36
37 /** Feature for testing */
38 const CAN_TEST = 'test';
39
70819075
AA
40 /**
41 * Returns the HTML code to render the icon for content bank contents.
42 *
6fc3477c 43 * @param content $content The content to delete.
70819075
AA
44 * @return string HTML code to render the icon
45 */
6fc3477c 46 public function get_icon(\core_contentbank\content $content): string {
70819075
AA
47 global $OUTPUT;
48
6fc3477c 49 return $OUTPUT->image_url('f/archive-64', 'moodle')->out(false);
70819075
AA
50 }
51
52 /**
53 * Return an array of implemented features by this plugin.
54 *
55 * @return array
56 */
57 protected function get_implemented_features(): array {
58 return [self::CAN_TEST];
59 }
60
61 /**
62 * Return an array of extensions this plugin could manage.
63 *
64 * @return array
65 */
66 public function get_manageable_extensions(): array {
67 return ['.txt', '.png', '.h5p'];
68 }
69}