Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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
 * mod_unilabel Activity picker button.
19
 *
20
 * @package     mod_unilabel
21
 * @author      Andreas Grabs <info@grabs-edv.de>
22
 * @copyright   2018 onwards Grabs EDV {@link https://www.grabs-edv.de}
23
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24
 */
25
 
26
namespace mod_unilabel\output\component;
27
 
28
/**
29
 * Activity picker to choose a internal url to an activity.
30
 * @package     mod_unilabel
31
 * @author      Andreas Grabs <info@grabs-edv.de>
32
 * @copyright   2018 onwards Grabs EDV {@link https://www.grabs-edv.de}
33
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
34
 */
35
class activity_picker_button implements \renderable, \templatable {
36
    /** @var array */
37
    public $data;
38
 
39
    /**
40
     * Constructor.
41
     *
42
     * @param string $formid
43
     * @param string $inputidbase
44
     */
45
    public function __construct($formid, $inputidbase) {
46
        $this->data                = [];
47
        $this->data['formid']      = $formid;
48
        $this->data['inputidbase'] = $inputidbase;
49
        $this->data['buttontitle'] = get_string('chooseurlfromactivity', 'mod_unilabel');
50
    }
51
 
52
    /**
53
     * Export the data for usage in mustache.
54
     *
55
     * @param  \renderer_base $output
56
     * @return array
57
     */
58
    public function export_for_template(\renderer_base $output) {
59
        return $this->data;
60
    }
61
}