Proyectos de Subversion Moodle

Rev

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

Rev 268 Rev 269
Línea 35... Línea 35...
35
            $this->validateIfExistBlocks(); // Validar si los bloques existen
35
            $this->validateIfExistBlocks(); // Validar si los bloques existen
36
            $this->addBlocksIfNotExist(); // Añadir bloques si no existen
36
            $this->addBlocksIfNotExist(); // Añadir bloques si no existen
37
        }
37
        }
38
    }
38
    }
Línea 39... Línea -...
39
 
-
 
40
    public function renderBlocks()
-
 
41
    {
-
 
42
        global $OUTPUT;
-
 
43
 
-
 
44
        $blocksView = '';
-
 
45
        // Renderizar bloques para cada región
-
 
46
        foreach ($this->regions as $region) {
-
 
47
            $this->regionName = $region;
-
 
48
            $this->blockManager->load_blocks(true); // Cargar bloques en la región
-
 
49
            $blocksView .= $OUTPUT->blocks_for_region($this->regionName); // Renderizar bloques
-
 
50
        }
-
 
51
 
-
 
52
        return $blocksView; // Devolver bloques renderizados
-
 
53
    }
-
 
54
 
39
 
55
    public function addRegion()
40
    public function addRegion()
56
    {
41
    {
57
        // Añadir la región si no existe en blockManager
42
        // Añadir la región si no existe en blockManager
58
        if (!in_array($this->regionName, $this->blockManager->get_regions())) {
43
        if (!in_array($this->regionName, $this->blockManager->get_regions())) {
Línea 88... Línea 73...
88
            foreach ($this->blockNames as $blockName) {
73
            foreach ($this->blockNames as $blockName) {
89
                $this->blockManager->add_block($blockName, $this->regionName, 1, true);
74
                $this->blockManager->add_block($blockName, $this->regionName, 1, true);
90
            }
75
            }
91
        }
76
        }
92
    }
77
    }
-
 
78
 
-
 
79
    public function renderBlocks()
-
 
80
    {
-
 
81
        global $OUTPUT;
-
 
82
 
-
 
83
        $blocksView = '';
-
 
84
        // Renderizar bloques para cada región
-
 
85
        foreach ($this->regions as $region) {
-
 
86
            $this->regionName = $region;
-
 
87
            $this->blockManager->load_blocks(true); // Cargar bloques en la región
-
 
88
            $blocksView .= $OUTPUT->blocks_for_region($this->regionName); // Renderizar bloques
-
 
89
        }
-
 
90
 
-
 
91
        return $blocksView; // Devolver bloques renderizados
-
 
92
    }
93
}
93
}
Línea -... Línea 94...
-
 
94
 
-
 
95
 
94
 
96
 
95
/* // Instanciamos y renderizamos la página con los bloques estáticos
97
/* // Instanciamos y renderizamos la página con los bloques estáticos
96
$statics_blocks = new StaticsBlocks();
98
$statics_blocks = new StaticsBlocks();