Skip to content

Commit

Permalink
MDL-39871 output: improved block manipulation inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Sep 23, 2013
1 parent 0fd451b commit eeb0820
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/outputlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class theme_config {
* This is used when displaying blocks for regions only.
* @var array
*/
public $blockrtlmanipulations = array();
public $blockrtlmanipulations = null;

/**
* @var renderer_factory Instance of the renderer_factory implementation
Expand Down Expand Up @@ -488,8 +488,15 @@ private function __construct($config) {
}

// Use parent theme's "blockrtlmanipulations" if it was defined and if it was not defined on current theme.
if (empty($this->blockrtlmanipulations) and !empty($parent_config->blockrtlmanipulations)) {
$this->blockrtlmanipulations = $parent_config->blockrtlmanipulations;
if (!is_array($this->blockrtlmanipulations)) {
$blockrtlmanipulations = array();
foreach ($this->parent_configs as $parentconfig) {
if (isset($parentconfig->blockrtlmanipulations)) {
$blockrtlmanipulations = $parentconfig->blockrtlmanipulations;
break;
}
}
$this->blockrtlmanipulations = $blockrtlmanipulations;
}

//fix arrows if needed
Expand Down

0 comments on commit eeb0820

Please sign in to comment.