| Línea 439... |
Línea 439... |
| 439 |
$this->page->blocks->save_block_data($this->block, $this->get_data());
|
439 |
$this->page->blocks->save_block_data($this->block, $this->get_data());
|
| 440 |
} else {
|
440 |
} else {
|
| 441 |
$blockregion = $this->optional_param('blockregion', null, PARAM_TEXT);
|
441 |
$blockregion = $this->optional_param('blockregion', null, PARAM_TEXT);
|
| 442 |
$newblock = $this->page->blocks->add_block_at_end_of_default_region($this->block->name(),
|
442 |
$newblock = $this->page->blocks->add_block_at_end_of_default_region($this->block->name(),
|
| 443 |
empty($blockregion) ? null : $blockregion);
|
443 |
empty($blockregion) ? null : $blockregion);
|
| - |
|
444 |
|
| - |
|
445 |
if (empty($newblock)) {
|
| - |
|
446 |
return;
|
| - |
|
447 |
}
|
| - |
|
448 |
|
| 444 |
$this->page->blocks->load_blocks();
|
449 |
$this->page->blocks->load_blocks();
|
| 445 |
$newblock = $this->page->blocks->find_instance($newblock->instance->id);
|
450 |
$newblock = $this->page->blocks->find_instance($newblock->instance->id);
|
| 446 |
$newdata = $this->prepare_defaults($newblock->instance);
|
451 |
$newdata = $this->prepare_defaults($newblock->instance);
|
| 447 |
foreach ($this->get_data() as $key => $value) {
|
452 |
foreach ($this->get_data() as $key => $value) {
|
| 448 |
$newdata->$key = $value;
|
453 |
$newdata->$key = $value;
|