Proyectos de Subversion Moodle

Rev

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

Rev 253 Rev 262
Línea 78... Línea 78...
78
        }
78
        }
79
    }
79
    }
Línea 80... Línea 80...
80
 
80
 
81
    public function addRegion()
81
    public function addRegion()
-
 
82
    {
-
 
83
        // Si $this->regionName es un array, recorremos cada región
-
 
84
        if (is_array($this->regionName)) {
-
 
85
            foreach ($this->regionName as $region) {
-
 
86
                // Verificamos si la región no existe antes de añadirla
-
 
87
                if (!in_array($region, $this->blockManager->get_regions())) {
-
 
88
                    $this->blockManager->add_region($region);
-
 
89
                }
-
 
90
            }
-
 
91
        } else {
82
    {
92
            // Si no es un array, lo manejamos como una sola región
83
        if (!in_array($this->regionName, $this->blockManager->get_regions())) {
93
            if (!in_array($this->regionName, $this->blockManager->get_regions())) {
-
 
94
                $this->blockManager->add_region($this->regionName);
84
            $this->blockManager->add_region($this->regionName);
95
            }
85
        }
96
        }
Línea 86... Línea 97...
86
    }
97
    }
87
 
98