Proyectos de Subversion Moodle

Rev

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

Rev 281 Rev 283
Línea 53... Línea 53...
53
        $PAGE->set_context(context_user::instance($this->userID));
53
        $PAGE->set_context(context_user::instance($this->userID));
54
        $PAGE->set_pagelayout('mydashboard');
54
        $PAGE->set_pagelayout('mydashboard');
55
        $PAGE->set_title("{$SITE->shortname}: " . $this->title);
55
        $PAGE->set_title("{$SITE->shortname}: " . $this->title);
56
    }
56
    }
Línea 57... Línea 57...
57
 
57
 
58
    public function addRegion($regionName)
58
    public function addRegion($region)
-
 
59
    {
59
    {
60
        // Validación alternativa: Verificamos si la región está en una lista predefinida de regiones.
-
 
61
        $existingRegions = $this->blockManager->get_regions();
-
 
62
 
-
 
63
        // Si la región no está presente en las regiones existentes, la añadimos.
60
        if (!in_array($this->regionName, $this->blockManager->get_regions())) {
64
        if (!in_array($region, $existingRegions)) {
61
            $this->blockManager->add_region($this->regionName);
65
            $this->blockManager->add_region($region);
62
        }
66
        }
Línea -... Línea 67...
-
 
67
    }
-
 
68
 
63
    }
69
}
64
 
70
 
65
    public function validateIfExistBlocks($regionName)
71
    public function validateIfExistBlocks($region)
66
    {
72
    {
67
        $this->blockExists = true;
73
        $this->blockExists = true;
68
        $this->blocks = $this->blockManager->get_blocks_for_region($this->regionName);
74
        $this->blocks = $this->blockManager->get_blocks_for_region($this->regionName);