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
 * UI Element for an excluded grade_grade.
19
 *
20
 * @package   gradereport_singleview
21
 * @copyright 2014 Moodle Pty Ltd (http://moodle.com)
22
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23
 */
24
 
25
namespace gradereport_singleview\local\ui;
26
 
27
defined('MOODLE_INTERNAL') || die;
28
 
29
/**
30
 * UI Element for an excluded grade_grade.
31
 *
32
 * @package   gradereport_singleview
33
 * @copyright 2014 Moodle Pty Ltd (http://moodle.com)
34
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35
 */
36
abstract class element {
37
 
38
    /**
39
     * The first bit of the name for this input.
40
     * @var string $name
41
     */
42
    public $name;
43
 
44
    /**
45
     * The value for this input.
46
     * @var string $value
47
     */
48
    public $value;
49
 
50
    /**
51
     * The form label for this input.
52
     * @var string $label
53
     */
54
    public $label;
55
 
56
    /**
57
     * Constructor
58
     *
59
     * @param string $name The first bit of the name for this input
60
     * @param string $value The value for this input
61
     * @param string $label The label for this form field
62
     */
63
    public function __construct(string $name, string $value, string $label) {
64
        $this->name = $name;
65
        $this->value = $value;
66
        $this->label = $label;
67
    }
68
 
69
    /**
70
     * Nasty function used for spreading checkbox logic all around
71
     * @return bool
72
     */
73
    public function is_checkbox(): bool {
74
        return false;
75
    }
76
 
77
    /**
78
     * Nasty function used for spreading textbox logic all around
79
     * @return bool
80
     */
81
    public function is_textbox(): bool {
82
        return false;
83
    }
84
 
85
    /**
86
     * Nasty function used for spreading dropdown logic all around
87
     * @return bool
88
     */
89
    public function is_dropdown(): bool {
90
        return false;
91
    }
92
 
93
    /**
94
     * Return the HTML
95
     * @return string
96
     */
97
    abstract public function html(): string;
98
}