Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 21... Línea 21...
21
 * @copyright  2016 Frédéric Massart - FMCorz.net
21
 * @copyright  2016 Frédéric Massart - FMCorz.net
22
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23
 */
23
 */
Línea 24... Línea 24...
24
 
24
 
25
namespace core\output;
-
 
Línea 26... Línea 25...
26
defined('MOODLE_INTERNAL') || die();
25
namespace core\output;
27
 
-
 
28
use lang_string;
-
 
29
use renderer_base;
26
 
30
use renderable;
-
 
Línea 31... Línea 27...
31
use stdClass;
27
use lang_string;
32
use templatable;
28
use stdClass;
33
 
29
 
34
/**
30
/**
35
 * The chooser_section renderable class.
31
 * The chooser_section renderable class.
36
 *
32
 *
37
 * @package    core
33
 * @package    core
38
 * @copyright  2016 Frédéric Massart - FMCorz.net
34
 * @copyright  2016 Frédéric Massart - FMCorz.net
39
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
40
 */
35
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
41
class chooser_section implements renderable, templatable {
36
 */
42
 
37
class chooser_section implements renderable, templatable {
43
    /** @var string $id An identifier for the section. */
38
    /** @var string $id An identifier for the section. */
44
    public $id;
39
    public $id;
Línea 68... Línea 63...
68
     */
63
     */
69
    public function export_for_template(renderer_base $output) {
64
    public function export_for_template(renderer_base $output) {
70
        $data = new stdClass();
65
        $data = new stdClass();
71
        $data->id = $this->id;
66
        $data->id = $this->id;
72
        $data->label = (string) $this->label;
67
        $data->label = (string) $this->label;
73
        $data->items = array_map(function($item) use ($output) {
68
        $data->items = array_map(function ($item) use ($output) {
74
            return $item->export_for_template($output);
69
            return $item->export_for_template($output);
75
        }, array_values($this->items));
70
        }, array_values($this->items));
76
        return $data;
71
        return $data;
77
    }
72
    }
78
 
-
 
79
}
73
}