You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
813 B
43 lines
813 B
7 years ago
|
<?php
|
||
|
|
||
7 years ago
|
namespace Aldine;
|
||
7 years ago
|
|
||
|
use Sober\Controller\Controller;
|
||
|
|
||
|
class Home extends Controller
|
||
|
{
|
||
7 years ago
|
public function blockCount()
|
||
|
{
|
||
7 years ago
|
$c = 0;
|
||
7 years ago
|
foreach ([
|
||
7 years ago
|
'home-block-1',
|
||
|
'home-block-2',
|
||
|
'home-block-3',
|
||
|
'home-block-4',
|
||
|
'home-block-5'
|
||
7 years ago
|
] as $block) {
|
||
|
if (is_active_sidebar($block)) {
|
||
|
$c++;
|
||
|
}
|
||
|
}
|
||
|
return $c;
|
||
|
}
|
||
|
|
||
7 years ago
|
public function homeBlocks()
|
||
7 years ago
|
{
|
||
|
$blocks = [];
|
||
|
for ($i = 0; $i < 5; $i++) {
|
||
7 years ago
|
if (is_active_sidebar("home-block-$i")) {
|
||
|
$blocks[] = "home-block-$i";
|
||
7 years ago
|
}
|
||
|
}
|
||
|
|
||
|
return $blocks;
|
||
|
}
|
||
7 years ago
|
|
||
|
public function latestBooksBlock()
|
||
|
{
|
||
|
return is_active_widget(false, false, 'latestbooks');
|
||
|
}
|
||
7 years ago
|
}
|