Proyectos de Subversion Moodle

Rev

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

Rev 262 Rev 263
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 {
-
 
92
            // Si no es un array, lo manejamos como una sola región
82
    {
93
            if (!in_array($this->regionName, $this->blockManager->get_regions())) {
83
        if (!in_array($this->regionName, $this->blockManager->get_regions())) {
94
                $this->blockManager->add_region($this->regionName);
-
 
95
            }
84
            $this->blockManager->add_region($this->regionName);
96
        }
85
        }
Línea 97... Línea 86...
97
    }
86
    }
98
 
87