1.20.x layout.class.inc Layout::removeBlock($block_uuid)

Remove a block from a layout.

Parameters

string $block_uuid: The UUID of the block being removed.

File

modules/layout/includes/layout.class.inc, line 550
Class for loading, modifying, and executing a layout.

Class

Layout
@file Class for loading, modifying, and executing a layout.

Code

function removeBlock($block_uuid) {
  // Keep track of removed blocks so that block modules can react to their
  // removal (if layout edits are saved).
  $this->removed_blocks[$block_uuid] = $this->content[$block_uuid];

  unset($this->content[$block_uuid]);
  foreach ($this->positions as $region => $positions) {
    $key = array_search($block_uuid, $positions);
    if ($key !== FALSE) {
      unset($this->positions[$region][$key]);
      unset($this->content[$block_uuid]);
    }
  }

}