Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 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
namespace core_table\output;
18
 
19
/**
20
 * Component representing a table row.
21
 *
22
 * @copyright 2009 Nicolas Connault
23
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24
 * @since Moodle 2.0
25
 * @package core_table
26
 * @category output
27
 */
28
class html_table_row {
29
    /**
30
     * @var string Value to use for the id attribute of the row.
31
     */
32
    public $id = null;
33
 
34
    /**
35
     * @var array Array of html_table_cell objects
36
     */
37
    public $cells = [];
38
 
39
    /**
40
     * @var string Value to use for the style attribute of the table row
41
     */
42
    public $style = null;
43
 
44
    /**
45
     * @var array Attributes of additional HTML attributes for the <tr> element
46
     */
47
    public $attributes = [];
48
 
49
    /**
50
     * Constructor
51
     *
52
     * @param null|array $cells
53
     */
54
    public function __construct(?array $cells = null) {
55
        $this->attributes['class'] = '';
56
        $cells = (array)$cells;
57
        foreach ($cells as $cell) {
58
            if ($cell instanceof html_table_cell) {
59
                $this->cells[] = $cell;
60
            } else {
61
                $this->cells[] = new html_table_cell($cell);
62
            }
63
        }
64
    }
65
}
66
 
67
// Alias this class to the old name.
68
// This file will be autoloaded by the legacyclasses autoload system.
69
// In future all uses of this class will be corrected and the legacy references will be removed.
70
class_alias(html_table_row::class, \html_table_row::class);