Proyectos de Subversion Moodle

Rev

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

Rev 285 Rev 286
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($region = $this->regionName)
58
    public function addRegion($regionName)
59
    {
-
 
60
        // Validación alternativa: Verificamos si la región está en una lista predefinida de regiones.
59
    {
61
        $existingRegions = $this->blockManager->get_regions();
-
 
62
 
-
 
63
        // Si la región no está presente en las regiones existentes, la añadimos.
-
 
64
        if (!in_array($region, $existingRegions)) {
60
        if (!in_array($this->regionName, $this->blockManager->get_regions())) {
65
            $this->blockManager->add_region($region);
61
            $this->blockManager->add_region($this->regionName);
66
        }
62
        }
Línea 67... Línea 63...
67
    }
63
    }
68
 
64
 
69
    public function validateIfExistBlocks($region)
65
    public function validateIfExistBlocks($regionName)
70
    {
66
    {
71
        $this->blockExists = true;
67
        $this->blockExists = true;
72
        $this->blocks = $this->blockManager->get_blocks_for_region($this->regionName);
68
        $this->blocks = $this->blockManager->get_blocks_for_region($this->regionName);