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
 * A widget contains information on how to display data.
19
 *
20
 * @package    block_dash
21
 * @copyright  2022 bdecent gmbh <https://bdecent.de>
22
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23
 */
24
 
25
namespace block_dash\local\widget;
26
 
27
/**
28
 * A widget contains information on how to display data.
29
 *
30
 * @package block_dash
31
 */
32
interface widget_interface {
33
 
34
    /**
35
     * Confirm the loaded data source is widget.
36
     *
37
     * @return boolean
38
     */
39
    public function is_widget();
40
 
41
    /**
42
     * Define the widget will supports the default query builder method.
43
     *
44
     * @return bool
45
     */
46
    public function supports_query();
47
 
48
    /**
49
     * Is the widget needs to load the js when it the content updated using JS.
50
     *
51
     * @return bool
52
     */
53
    public function supports_currentscript();
54
 
55
    /**
56
     * Get tables if the widget uses query method
57
     *
58
     * @return void
59
     */
60
    public function get_tables();
61
 
62
    /**
63
     * Layout class that the widget will used.
64
     *
65
     * @return void
66
     */
67
    public function layout();
68
 
69
    /**
70
     * List of widget preferences loadded by default.
71
     *
72
     * @return \stdclass
73
     */
74
    public function widget_preferences();
75
 
76
    /**
77
     * Build the widget data to render the widget.
78
     *
79
     * @return array
80
     */
81
    public function build_widget();
82
 
83
    /**
84
     * Fetch the data used to generate the widget.
85
     *
86
     * @return array
87
     */
88
    public function get_widget_data();
89
}
90