Repository URL to install this package:
|
Version:
3.4.2 ▾
|
<?php
namespace Evsmash\Banners\Exts;
use Evsmash\Core\Dec\Dec;
use Evsmash\Core\Simpy\Element;
use Evsmash\Core\System\Lang;
use Evsmash\Banners\BannersGroup;
class Bar {
// banners
static public function banners($elements) {
// basic
$bar = [
'search' => true,
'params' => [
['Group', 'group', Element::flat(new BannersGroup)],
['Published', 'published', ['true' => 'Yes', 'false' => 'No']],
['External', 'external', ['true' => 'Yes', 'false' => 'No']]
],
'summary' => $elements
];
// langs
if(Lang::multi()) {
$bar['params'][] = ['Lang', 'language', ['' => '---'] + cfg('i18n-langs')];
}
// output
return $bar;
}
// banner
static public function banner($element) {
// basic
$bar = [
'shared' => [
'banners/index' => Dec::a('/banners', Dec::i('tasks').' '.t('All'), false)->class('btn btn-info'),
'banners/stats-reset' => Dec::a('/banners/stats-reset/'.$element->id, Dec::i('area-chart').' '.t('Reset'), false)->class('btn btn-warning'),
]
];
// output
return $bar;
}
}