本文整理汇总了PHP中ThemeHelper::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP ThemeHelper::getAll方法的具体用法?PHP ThemeHelper::getAll怎么用?PHP ThemeHelper::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThemeHelper
的用法示例。
在下文中一共展示了ThemeHelper::getAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
public function view()
{
$c = Page::getCurrentPage();
parent::view();
$this->set('im', Loader::helper('image'));
$this->set('u', new User());
$this->set('rssUrl', $showRss ? $controller->getRssUrl($b) : '');
$this->set('show', $_REQUEST['show']);
/* Set the page lists which are walk related, as they have json we need */
switch ($this->block->getBlockFilename()) {
case 'walkcards':
$this->set('cards', $this->loadCards());
break;
case 'walk_filters':
Loader::helper('theme');
$cards = $this->loadCards();
// Build a separate walk card for each date
$walksByDate = [];
foreach ($cards as $walk) {
foreach ((array) $walk->time['slots'] as $slot) {
$dateWalk = clone $walk;
$dateWalk->time['slots'] = [$slot];
$walksByDate[] = $dateWalk;
}
}
usort($walksByDate, function ($a, $b) {
$ta = $a->time['slots'][0][0];
$tb = $b->time['slots'][0][0];
return $ta < $tb ? -1 : 1;
});
$this->set('cards', $walksByDate);
break;
}
// Set walk-filter specific filtering data
if ($this->block->getBlockFilename() === 'walk_filters') {
// Set up walk filters
// Wards
$wards = array();
$wardObjects = $c->getAttribute('city_wards');
if ($wardObjects !== false) {
foreach ($wardObjects->getOptions() as $ward) {
$val = $ward->value;
$wards[] = $val;
}
}
natcasesort($wards);
// Themes
$themes = ThemeHelper::getAll('themes');
asort($themes);
// Accessibility
$accessibilities = ThemeHelper::getAll('accessibilities');
asort($accessibilities);
// Initiatives
$initiatives = [];
if (strpos($c->getCollectionPath(), 'burlington') !== false) {
$initAttr = $c->getAttribute('walk_initiatives');
if ($initAttr) {
foreach ($c->getAttribute('walk_initiatives') as $initiative) {
$initiatives[$initiative->ID] = $initiative->value;
}
unset($initiative);
}
}
// Ward semantics
$wardName = 'Region';
if ($c->getCollectionName() === 'Toronto') {
$wardName = 'Ward';
}
/* Set variables needed for rendering show all walks */
$this->set('wardName', $wardName);
$this->set('initiatives', $initiatives);
$this->set('accessibilities', $accessibilities);
$this->set('themes', $themes);
$this->set('wards', $wards);
}
}