MDL-63058 core_favourites: add existence checks to the service layer
[moodle.git] / blocks / myoverview / classes / output / main.php
CommitLineData
9ac2e865
RW
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 * Class containing data for my overview block.
19 *
20 * @package block_myoverview
21 * @copyright 2017 Ryan Wyllie <ryan@moodle.com>
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 */
24namespace block_myoverview\output;
25defined('MOODLE_INTERNAL') || die();
26
27use renderable;
28use renderer_base;
29use templatable;
3f0c421b 30
c5515a34
SL
31require_once($CFG->libdir . '/completionlib.php');
32
9ac2e865
RW
33/**
34 * Class containing data for my overview block.
35 *
e4b4b9e7 36 * @copyright 2018 Bas Brands <bas@moodle.com>
9ac2e865
RW
37 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
38 */
39class main implements renderable, templatable {
9ac2e865
RW
40 /**
41 * Export this data so it can be used as the context for a mustache template.
42 *
43 * @param \renderer_base $output
44 * @return stdClass
45 */
46 public function export_for_template(renderer_base $output) {
4a995a1f 47
01a95b86 48 $nocoursesurl = $output->image_url('courses', 'block_myoverview')->out();
9ac2e865 49
e4b4b9e7
BB
50 return (object) [
51 'nocoursesimg' => $nocoursesurl
9ac2e865
RW
52 ];
53 }
54}