<?php
$priorities = ["group.phantom", "group.god", "group.imperator", "group.general", "group.hermit", "group.soldier"];
$permissions = [
[
"permission" => "group.default"
],
[
"permission" => "group.phantom"
],
[
"permission" => "group.general"
]
];
$defaultPriority = 'group.default';
$defaultPriorityIndex = count($priorities);
$topPriorityIndex = $defaultPriorityIndex;
foreach ($permissions as $permission) {
$index = array_search($permission['permission'], $priorities);
if ($index !== false && $index < $topPriorityIndex) {
$topPriorityIndex = $index;
}
}
$topPriority = ($topPriorityIndex == $defaultPriorityIndex) ? $defaultPriority : $priorities[$topPriorityIndex];
public $js = [
// 'js/jquery.js',
// 'js/bootstrap.min.js',
'js/jquery.scrollUp.min.js',
'js/price-range.js',
'js/jquery.prettyPhoto.js',
'js/main.js',
'js/jquery.cookie.js',
'js/jquery.accordion.js',
];
$booking = Stub::make('Booking', [
'getBookingOptions' => function () { return [new BookingOption()]; }
]);
Countries::find()->findActiveAll($limit);
Towns::find()->findActiveAll($limit);
var scaleWidth = 480;
var width = window.innerWidth;
if (width < scaleWidth)
{
var scale = width / scaleWidth;
document.body.style.transform = "scale(" + scale + ")";
}
<?php
class BaseController extends \yii\web\Controller
{
private $_support;
public function beforeAction($action)
{
if (!parent::beforeAction($action)) {
return false;
}
$support = new ContactForm();
$this->_support = $support;
if ($support->load(Yii::$app->request->post())
&& $support->contact(Yii::$app->params['adminEmail'])) {
Yii::$app->session->setFlash('contactFormSubmitted');
return $this->refresh();
}
return true;
}
public function renderContent($content)
{
$layoutFile = $this->findLayoutFile($this->getView());
if ($layoutFile !== false) {
$layoutParams = [
'content' => $content,
'support' => $this->_support
];
return $this->getView()->renderFile($layoutFile, $layoutParams, $this);
} else {
return $content;
}
}
}