| Línea 19... |
Línea 19... |
| 19 |
* @package block_recentlyaccesseditems
|
19 |
* @package block_recentlyaccesseditems
|
| 20 |
* @copyright 2018 Victor Deniz <victor@moodle.com>
|
20 |
* @copyright 2018 Victor Deniz <victor@moodle.com>
|
| 21 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
21 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 22 |
*/
|
22 |
*/
|
| 23 |
namespace block_recentlyaccesseditems\external;
|
23 |
namespace block_recentlyaccesseditems\external;
|
| - |
|
24 |
defined('MOODLE_INTERNAL') || die();
|
| Línea 24... |
Línea -... |
| 24 |
|
- |
|
| 25 |
use core_course\output\activity_icon;
|
25 |
|
| 26 |
use renderer_base;
|
26 |
use renderer_base;
|
| Línea 27... |
Línea 27... |
| 27 |
use moodle_url;
|
27 |
use moodle_url;
|
| 28 |
|
28 |
|
| Línea 49... |
Línea 49... |
| 49 |
* @return array Additional properties with values
|
49 |
* @return array Additional properties with values
|
| 50 |
*/
|
50 |
*/
|
| 51 |
protected function get_other_values(renderer_base $output) {
|
51 |
protected function get_other_values(renderer_base $output) {
|
| 52 |
global $CFG;
|
52 |
global $CFG;
|
| 53 |
require_once($CFG->libdir.'/modinfolib.php');
|
53 |
require_once($CFG->libdir.'/modinfolib.php');
|
| - |
|
54 |
$iconurl = get_fast_modinfo($this->data->courseid)->cms[$this->data->cmid]->get_icon_url();
|
| - |
|
55 |
$iconclass = $iconurl->get_param('filtericon') ? '' : 'nofilter';
|
| Línea 54... |
Línea -... |
| 54 |
|
- |
|
| 55 |
$renderer = \core\di::get(\core\output\renderer_helper::class)->get_core_renderer();
|
56 |
|
| 56 |
$cminfo = get_fast_modinfo($this->data->courseid)->get_cm($this->data->cmid);
|
- |
|
| Línea 57... |
Línea 57... |
| 57 |
$icon = activity_icon::from_cm_info($cminfo);
|
57 |
$isbranded = component_callback('mod_' . $this->data->modname, 'is_branded') !== null ? : false;
|
| 58 |
|
58 |
|
| 59 |
return array(
|
59 |
return array(
|
| 60 |
'viewurl' => (new moodle_url('/mod/'.$this->data->modname.'/view.php',
|
60 |
'viewurl' => (new moodle_url('/mod/'.$this->data->modname.'/view.php',
|
| 61 |
array('id' => $this->data->cmid)))->out(false),
|
61 |
array('id' => $this->data->cmid)))->out(false),
|
| - |
|
62 |
'courseviewurl' => (new moodle_url('/course/view.php', array('id' => $this->data->courseid)))->out(false),
|
| - |
|
63 |
'icon' => \html_writer::img(
|
| - |
|
64 |
$iconurl,
|
| - |
|
65 |
get_string('pluginname', $this->data->modname),
|
| 62 |
'courseviewurl' => (new moodle_url('/course/view.php', array('id' => $this->data->courseid)))->out(false),
|
66 |
['title' => get_string('pluginname', $this->data->modname), 'class' => "icon $iconclass"]
|
| 63 |
'icon' => $renderer->render($icon),
|
67 |
),
|
| 64 |
'purpose' => plugin_supports('mod', $this->data->modname, FEATURE_MOD_PURPOSE, MOD_PURPOSE_OTHER),
|
68 |
'purpose' => plugin_supports('mod', $this->data->modname, FEATURE_MOD_PURPOSE, MOD_PURPOSE_OTHER),
|
| 65 |
'branded' => $icon->is_branded(),
|
69 |
'branded' => $isbranded,
|
| Línea 66... |
Línea 70... |
| 66 |
);
|
70 |
);
|
| 67 |
}
|
71 |
}
|