Proyectos de Subversion Moodle

Rev

Rev 181 | Rev 186 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 181 Rev 183
Línea 1... Línea 1...
1
<?php
1
<?php
2
require_once(__DIR__ . '/cesa.php');
2
require_once(__DIR__ . '/cesa.php');
-
 
3
 
3
class StaticsBlocks extends Cesa
4
class StaticsBlocks extends Cesa
4
{
5
{
5
 
-
 
6
    public function __construct()
6
    public function __construct()
7
    {
7
    {
-
 
8
        // Ahora pasamos un array de varios bloques en lugar de un solo bloque
8
        parent::__construct('statics_blocks', 'comments', 'side-pre');
9
        parent::__construct('statics_blocks', ['comments', 'messageteacher'], 'side-pre');
9
    }
10
    }
Línea 10... Línea 11...
10
 
11
 
11
    public function render()
12
    public function render()
12
    {
13
    {
Línea -... Línea 14...
-
 
14
        global $PAGE, $CFG, $OUTPUT;
13
        global $PAGE, $CFG, $OUTPUT;
15
 
14
 
-
 
Línea -... Línea 16...
-
 
16
        // Establecemos la URL del bloque estático
-
 
17
        $PAGE->set_url('/cesa/statics_blocks.php', array('userid' => $this->userID));
Línea -... Línea 18...
-
 
18
 
15
        $PAGE->set_url('/cesa/statics_blocks.php', array('userid' => $this->userID));
19
        // Añadimos la región si no existe
Línea -... Línea 20...
-
 
20
        $this->addRegion();
16
        $this->addRegion();
21
 
17
 
22
        // Cargamos los bloques existentes
Línea -... Línea 23...
-
 
23
        $this->blockManager->load_blocks(true);
18
 
24
 
19
        $this->blockManager->load_blocks(true);
25
        // Validamos si los bloques existen y los agregamos si es necesario
20
 
26
        $this->validateIfExistBlocks();
Línea 21... Línea 27...
21
        $this->validateIfExistBlock();
27
        $this->addBlocksIfNotExist('statics_blocks');
22
        $this->redirectIfNotExistBlock('statics_blocks');
28
 
23
 
29
        // Renderizamos la página con los bloques
Línea -... Línea 30...
-
 
30
        $view = $OUTPUT->header();
24
        $view = $OUTPUT->header();
31
        //$view .= $OUTPUT->blocks_for_region($this->regionName);
25
        //$view .= $OUTPUT->blocks_for_region($this->regionName);
32
        $view .= $OUTPUT->footer();