Conditions | 5 |
Paths | 9 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 4 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
23 | public function getDockedBlocks() { |
||
24 | $blocks = Block::get()->filter(array('showBlockbyClass' => true)); |
||
25 | $blocks_map = $blocks->map('ID', 'shownInClass'); |
||
26 | foreach ($blocks_map as $blockID => $Classes) { |
||
27 | $Classes = explode(',', $Classes); |
||
28 | if (!in_array($this->owner->ClassName, $Classes)) { |
||
29 | $blocks = $blocks->exclude('ID', $blockID); |
||
30 | } |
||
31 | } |
||
32 | $published_blocks = new ArrayList(); |
||
33 | foreach ($blocks as $block) { |
||
34 | if ($block->isPublished()) { |
||
35 | $published_blocks->push($block); |
||
36 | } |
||
37 | } |
||
38 | |||
39 | return $published_blocks->sort('SortOrder', 'ASC'); |
||
40 | } |
||
41 | } |