MDL-57447 block_myoverview: add context for courses view
[moodle.git] / blocks / myoverview / classes / output / courses_view.php
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/>.
17 /**
18  * Class containing data for courses view in the myoverview 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  */
24 namespace block_myoverview\output;
25 defined('MOODLE_INTERNAL') || die();
27 use renderable;
28 use renderer_base;
29 use templatable;
30 /**
31  * Class containing data for courses view in the myoverview block.
32  *
33  * @copyright  2017 Simey Lameze <simey@moodle.com>
34  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35  */
36 class courses_view implements renderable, templatable {
38     /**
39      * Export this data so it can be used as the context for a mustache template.
40      *
41      * @param \renderer_base $output
42      * @return stdClass
43      */
44     public function export_for_template(renderer_base $output) {
45         return [
46             'past' => [
47                 'pagingbar' => [
48                     'first' => [
49                         'number' => 1,
50                         'page' => '&laquo;',
51                         'url' => '#',
52                     ],
53                     'last' => [
54                         'number' => 3,
55                         'page' => '&raquo;',
56                         'url' => '#',
57                     ],
58                     'pages' => [
59                         [
60                             'number' => 1,
61                             'page' => 1,
62                             'url' => '#',
63                             'active' => true,
64                         ],
65                         [
66                             'number' => 2,
67                             'page' => 2,
68                             'url' => '#',
69                         ],
70                         [
71                             'number' => 3,
72                             'page' => 3,
73                             'url' => '#',
74                         ],
75                     ]
76                 ],
77             ],
78             'inprogress' => [
79                 'pagingbar' => [
80                     'first' => [
81                         'number' => 1,
82                         'page' => '&laquo;',
83                         'url' => '#',
84                     ],
85                     'last' => [
86                         'number' => 3,
87                         'page' => '&raquo;',
88                         'url' => '#',
89                     ],
90                     'pages' => [
91                         [
92                             'number' => 1,
93                             'page' => 1,
94                             'url' => '#',
95                             'active' => true,
96                         ],
97                         [
98                             'number' => 2,
99                             'page' => 2,
100                             'url' => '#',
101                         ],
102                         [
103                             'number' => 3,
104                             'page' => 3,
105                             'url' => '#',
106                         ],
107                     ]
108                 ],
109             ],
110             'future' => [
111                 'pagingbar' => [
112                     'first' => [
113                         'number' => 1,
114                         'page' => '&laquo;',
115                         'url' => '#',
116                     ],
117                     'last' => [
118                         'number' => 3,
119                         'page' => '&raquo;',
120                         'url' => '#',
121                     ],
122                     'pages' => [
123                         [
124                             'number' => 1,
125                             'page' => 1,
126                             'url' => '#',
127                             'active' => true,
128                         ],
129                         [
130                             'number' => 2,
131                             'page' => 2,
132                             'url' => '#',
133                         ],
134                         [
135                             'number' => 3,
136                             'page' => 3,
137                             'url' => '#',
138                         ],
139                     ]
140                 ],
141             ],
142         ];
143     }