add backend theme AdminLte, bind reception/transaction to a permission
This commit is contained in:
79
backend/views/layouts-orig/main.php
Normal file
79
backend/views/layouts-orig/main.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $content string */
|
||||
|
||||
use backend\assets\AppAsset;
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\Nav;
|
||||
use yii\bootstrap\NavBar;
|
||||
use yii\widgets\Breadcrumbs;
|
||||
use common\widgets\Alert;
|
||||
use backend\components\AdminMenuStructure;
|
||||
use kartik\widgets\AlertBlock;
|
||||
|
||||
AppAsset::register($this);
|
||||
|
||||
$adminMenu = new AdminMenuStructure();
|
||||
$items = $adminMenu->run();
|
||||
?>
|
||||
<?php $this->beginPage() ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= Yii::$app->language ?>">
|
||||
<head>
|
||||
<meta charset="<?= Yii::$app->charset ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?= Html::csrfMetaTags() ?>
|
||||
<title><?= Html::encode($this->title) ?></title>
|
||||
|
||||
|
||||
<?php $this->head() ?>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<?php $this->beginBody() ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php
|
||||
NavBar::begin([
|
||||
'brandLabel' => 'Botond Fitness WebAdmin',
|
||||
'brandUrl' => Yii::$app->homeUrl,
|
||||
'options' => [
|
||||
'class' => 'navbar-inverse navbar-fixed-top',
|
||||
],
|
||||
]);
|
||||
echo Nav::widget([
|
||||
'options' => ['class' => 'navbar-nav navbar-right'],
|
||||
'items' => $items,
|
||||
]);
|
||||
NavBar::end();
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<?= Breadcrumbs::widget([
|
||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
|
||||
]) ?>
|
||||
<?php //echo Alert::widget() ?>
|
||||
<?php
|
||||
echo AlertBlock::widget([
|
||||
'useSessionFlash' => true,
|
||||
'type' => AlertBlock::TYPE_GROWL,
|
||||
'delay' => '1'
|
||||
]);
|
||||
?>
|
||||
<?= $content ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<p class="pull-left">© <?= Yii::$app->name ?> <?= Yii::$app->params['version'] ?> Fitness - WebAdmin <?= date('Y') ?></p>
|
||||
|
||||
<p class="pull-right"><?= Yii::powered() ?></p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<?php $this->endBody() ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php $this->endPage() ?>
|
||||
26
backend/views/layouts/content.php
Normal file
26
backend/views/layouts/content.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
use yii\widgets\Breadcrumbs;
|
||||
use dmstr\widgets\Alert;
|
||||
|
||||
?>
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header clearfix">
|
||||
|
||||
<?=
|
||||
Breadcrumbs::widget(
|
||||
[
|
||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
|
||||
]
|
||||
) ?>
|
||||
</section>
|
||||
|
||||
<section class="content">
|
||||
<?= Alert::widget() ?>
|
||||
<?= $content ?>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<footer class="main-footer">
|
||||
© <?= Yii::$app->name ?> <?= Yii::$app->params['version'] ?> Fitness - WebAdmin <?= date('Y') ?>
|
||||
</footer>
|
||||
|
||||
69
backend/views/layouts/header.php
Normal file
69
backend/views/layouts/header.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $content string */
|
||||
?>
|
||||
|
||||
<header class="main-header">
|
||||
|
||||
<?= Html::a('<span class="logo-mini">A</span><span class="logo-lg">Fitness Admin</span>', Yii::$app->homeUrl, ['class' => 'logo']) ?>
|
||||
|
||||
<nav class="navbar navbar-static-top" role="navigation">
|
||||
|
||||
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</a>
|
||||
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="#">Web Recepció</a>
|
||||
</div>
|
||||
|
||||
<div class="navbar-custom-menu">
|
||||
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<!-- User Account: style can be found in dropdown.less -->
|
||||
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<span class='glyphicon glyphicon-user'></span>
|
||||
<span class="hidden-xs"><?php echo Yii::$app->user->identity->username?></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<!-- User image -->
|
||||
<li class="user-header">
|
||||
|
||||
<p>
|
||||
<?php echo Yii::$app->user->identity->username?>
|
||||
<small>Felhasználó</small>
|
||||
</p>
|
||||
</li>
|
||||
<!-- Menu Footer-->
|
||||
<li class="user-footer">
|
||||
<div class="pull-left">
|
||||
<!--
|
||||
<a href="#" class="btn btn-default btn-flat">Profile</a>
|
||||
-->
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<?= Html::a(
|
||||
Yii::t('common/site','Logout'),
|
||||
['/site/logout'],
|
||||
['data-method' => 'post', 'class' => 'btn btn-default btn-flat']
|
||||
) ?>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<!-- User Account: style can be found in dropdown.less -->
|
||||
<!--
|
||||
<li>
|
||||
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
20
backend/views/layouts/left.php
Normal file
20
backend/views/layouts/left.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
use backend\components\AdminMenuStructure;
|
||||
?>
|
||||
|
||||
<?php
|
||||
$menu = new AdminMenuStructure();
|
||||
$menu = $menu->run();
|
||||
$items = $menu;
|
||||
|
||||
?>
|
||||
<aside class="main-sidebar">
|
||||
<section class="sidebar">
|
||||
<?= \backend\components\LTEAdminMenu::widget(
|
||||
[
|
||||
'options' => ['class' => 'sidebar-menu'],
|
||||
'items' => $items
|
||||
]
|
||||
) ?>
|
||||
</section>
|
||||
</aside>
|
||||
29
backend/views/layouts/main-login.php
Normal file
29
backend/views/layouts/main-login.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
use backend\assets\AppAsset;
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $content string */
|
||||
|
||||
dmstr\web\AdminLteAsset::register($this);
|
||||
?>
|
||||
<?php $this->beginPage() ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= Yii::$app->language ?>">
|
||||
<head>
|
||||
<meta charset="<?= Yii::$app->charset ?>"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?= Html::csrfMetaTags() ?>
|
||||
<title><?= Html::encode($this->title) ?></title>
|
||||
<?php $this->head() ?>
|
||||
</head>
|
||||
<body class="login-page">
|
||||
|
||||
<?php $this->beginBody() ?>
|
||||
|
||||
<?= $content ?>
|
||||
|
||||
<?php $this->endBody() ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php $this->endPage() ?>
|
||||
@@ -1,76 +1,74 @@
|
||||
<?php
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $content string */
|
||||
|
||||
use backend\assets\AppAsset;
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\Nav;
|
||||
use yii\bootstrap\NavBar;
|
||||
use yii\widgets\Breadcrumbs;
|
||||
use common\widgets\Alert;
|
||||
use backend\components\AdminMenuStructure;
|
||||
use kartik\widgets\AlertBlock;
|
||||
|
||||
AppAsset::register($this);
|
||||
if (Yii::$app->controller->action->id === 'login') {
|
||||
/**
|
||||
* Do not use this code in your template. Remove it.
|
||||
* Instead, use the code $this->layout = '//main-login'; in your controller.
|
||||
*/
|
||||
echo $this->render(
|
||||
'main-login',
|
||||
['content' => $content]
|
||||
);
|
||||
} else {
|
||||
|
||||
$adminMenu = new AdminMenuStructure();
|
||||
$items = $adminMenu->run();
|
||||
?>
|
||||
<?php $this->beginPage() ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= Yii::$app->language ?>">
|
||||
<head>
|
||||
<meta charset="<?= Yii::$app->charset ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?= Html::csrfMetaTags() ?>
|
||||
<title><?= Html::encode($this->title) ?></title>
|
||||
<?php $this->head() ?>
|
||||
</head>
|
||||
<body>
|
||||
<?php $this->beginBody() ?>
|
||||
if (class_exists('backend\assets\AppAsset')) {
|
||||
backend\assets\AppAsset::register($this);
|
||||
} else {
|
||||
app\assets\AppAsset::register($this);
|
||||
}
|
||||
|
||||
<div class="wrap">
|
||||
<?php
|
||||
NavBar::begin([
|
||||
'brandLabel' => 'Botond Fitness WebAdmin',
|
||||
'brandUrl' => Yii::$app->homeUrl,
|
||||
'options' => [
|
||||
'class' => 'navbar-inverse navbar-fixed-top',
|
||||
],
|
||||
]);
|
||||
echo Nav::widget([
|
||||
'options' => ['class' => 'navbar-nav navbar-right'],
|
||||
'items' => $items,
|
||||
]);
|
||||
NavBar::end();
|
||||
dmstr\web\AdminLteAsset::register($this);
|
||||
|
||||
$directoryAsset = Yii::$app->assetManager->getPublishedUrl('@vendor/almasaeed2010/adminlte/dist');
|
||||
?>
|
||||
<?php $this->beginPage() ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= Yii::$app->language ?>">
|
||||
<head>
|
||||
<meta charset="<?= Yii::$app->charset ?>"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?= Html::csrfMetaTags() ?>
|
||||
<title><?= Html::encode($this->title) ?></title>
|
||||
<?php $this->head() ?>
|
||||
<style type="text/css">
|
||||
.content-header > .breadcrumb{
|
||||
position: static;
|
||||
top: auto;
|
||||
left: auto;
|
||||
right: auto;
|
||||
float: left;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="hold-transition skin-red sidebar-mini">
|
||||
<?php $this->beginBody() ?>
|
||||
<div class="wrapper">
|
||||
|
||||
<div class="container">
|
||||
<?= Breadcrumbs::widget([
|
||||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
|
||||
]) ?>
|
||||
<?php //echo Alert::widget() ?>
|
||||
<?php
|
||||
echo AlertBlock::widget([
|
||||
'useSessionFlash' => true,
|
||||
'type' => AlertBlock::TYPE_GROWL,
|
||||
'delay' => '1'
|
||||
]);
|
||||
<?= $this->render(
|
||||
'header.php',
|
||||
['directoryAsset' => $directoryAsset]
|
||||
) ?>
|
||||
|
||||
<?= $this->render(
|
||||
'left.php',
|
||||
['directoryAsset' => $directoryAsset]
|
||||
)
|
||||
?>
|
||||
<?= $content ?>
|
||||
|
||||
<?= $this->render(
|
||||
'content.php',
|
||||
['content' => $content, 'directoryAsset' => $directoryAsset]
|
||||
) ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<p class="pull-left">© <?= Yii::$app->name ?> <?= Yii::$app->params['version'] ?> Fitness - WebAdmin <?= date('Y') ?></p>
|
||||
|
||||
<p class="pull-right"><?= Yii::powered() ?></p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<?php $this->endBody() ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php $this->endPage() ?>
|
||||
<?php $this->endBody() ?>
|
||||
</body>
|
||||
</html>
|
||||
<?php $this->endPage() ?>
|
||||
<?php } ?>
|
||||
|
||||
@@ -1,27 +1,45 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $name string */
|
||||
/* @var $message string */
|
||||
/* @var $exception Exception */
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
$this->title = $name;
|
||||
?>
|
||||
<div class="site-error">
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<div class="error-page">
|
||||
<h2 class="headline text-info"><i class="fa fa-warning text-yellow"></i></h2>
|
||||
|
||||
<div class="alert alert-danger">
|
||||
<?= nl2br(Html::encode($message)) ?>
|
||||
<div class="error-content">
|
||||
<h3><?= $name ?></h3>
|
||||
|
||||
<p>
|
||||
<?= nl2br(Html::encode($message)) ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The above error occurred while the Web server was processing your request.
|
||||
Please contact us if you think this is a server error. Thank you.
|
||||
Meanwhile, you may <a href='<?= Yii::$app->homeUrl ?>'>return to dashboard</a> or try using the search
|
||||
form.
|
||||
</p>
|
||||
|
||||
<form class='search-form'>
|
||||
<div class='input-group'>
|
||||
<input type="text" name="search" class='form-control' placeholder="Search"/>
|
||||
|
||||
<div class="input-group-btn">
|
||||
<button type="submit" name="submit" class="btn btn-primary"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
The above error occurred while the Web server was processing your request.
|
||||
</p>
|
||||
<p>
|
||||
Please contact us if you think this is a server error. Thank you.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -2,16 +2,11 @@
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
|
||||
$this->title = 'My Yii Application';
|
||||
$this->title = Yii::$app->name;
|
||||
?>
|
||||
<div class="site-index">
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>Web Admin</h1>
|
||||
|
||||
<p class="lead">Üdvözöljük adminisztrációs felületünkön</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,35 +1,59 @@
|
||||
<?php
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $form yii\bootstrap\ActiveForm */
|
||||
/* @var $model \common\models\LoginForm */
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
$this->title = 'Bejelentkezés';
|
||||
|
||||
$this->title = Yii::t('common/site' , 'Login');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
$fieldOptions1 = [
|
||||
'options' => ['class' => 'form-group has-feedback'],
|
||||
'inputTemplate' => "{input}<span class='glyphicon glyphicon-envelope form-control-feedback'></span>"
|
||||
];
|
||||
|
||||
$fieldOptions2 = [
|
||||
'options' => ['class' => 'form-group has-feedback'],
|
||||
'inputTemplate' => "{input}<span class='glyphicon glyphicon-lock form-control-feedback'></span>"
|
||||
];
|
||||
?>
|
||||
<div class="site-login">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p><?php echo Yii::t('common/site' , 'Please fill out the following fields to login:') ?> </p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-5">
|
||||
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
|
||||
|
||||
<?= $form->field($model, 'username') ?>
|
||||
|
||||
<?= $form->field($model, 'password')->passwordInput() ?>
|
||||
|
||||
<?= $form->field($model, 'rememberMe')->checkbox() ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton( Yii::t('common/site' ,'Login'), ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
<div class="login-box">
|
||||
<div class="login-logo">
|
||||
<a href="#"><b>Fitness</b>Adminisztráció</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.login-logo -->
|
||||
<div class="login-box-body">
|
||||
<p class="login-box-msg">Kérem jelentkezzen be</p>
|
||||
|
||||
<?php $form = ActiveForm::begin(['id' => 'login-form', 'enableClientValidation' => false]); ?>
|
||||
|
||||
<?= $form
|
||||
->field($model, 'username', $fieldOptions1)
|
||||
->label(false)
|
||||
->textInput(['placeholder' => $model->getAttributeLabel('username')]) ?>
|
||||
|
||||
<?= $form
|
||||
->field($model, 'password', $fieldOptions2)
|
||||
->label(false)
|
||||
->passwordInput(['placeholder' => $model->getAttributeLabel('password')]) ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<?= $form->field($model, 'rememberMe')->checkbox() ?>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
<div class="col-xs-6">
|
||||
<?= Html::submitButton('Bejelentkezés', ['class' => 'btn btn-primary btn-block btn-flat', 'name' => 'login-button']) ?>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- /.login-box-body -->
|
||||
</div><!-- /.login-box -->
|
||||
|
||||
27
backend/views/site_orig/error.php
Normal file
27
backend/views/site_orig/error.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $name string */
|
||||
/* @var $message string */
|
||||
/* @var $exception Exception */
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
$this->title = $name;
|
||||
?>
|
||||
<div class="site-error">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<div class="alert alert-danger">
|
||||
<?= nl2br(Html::encode($message)) ?>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
The above error occurred while the Web server was processing your request.
|
||||
</p>
|
||||
<p>
|
||||
Please contact us if you think this is a server error. Thank you.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
17
backend/views/site_orig/index.php
Normal file
17
backend/views/site_orig/index.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
|
||||
$this->title = Yii::$app->name;
|
||||
?>
|
||||
<div class="site-index">
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>Web Admin</h1>
|
||||
|
||||
<p class="lead">Üdvözöljük adminisztrációs felületünkön</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
35
backend/views/site_orig/login.php
Normal file
35
backend/views/site_orig/login.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $form yii\bootstrap\ActiveForm */
|
||||
/* @var $model \common\models\LoginForm */
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
|
||||
$this->title = Yii::t('common/site' , 'Login');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="site-login">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p><?php echo Yii::t('common/site' , 'Please fill out the following fields to login:') ?> </p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-5">
|
||||
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
|
||||
|
||||
<?= $form->field($model, 'username') ?>
|
||||
|
||||
<?= $form->field($model, 'password')->passwordInput() ?>
|
||||
|
||||
<?= $form->field($model, 'rememberMe')->checkbox() ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton( Yii::t('common/site' ,'Login'), ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
72
backend/views/user/role.php
Normal file
72
backend/views/user/role.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use yii\grid\GridView;
|
||||
use yii\data\ArrayDataProvider;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\User */
|
||||
|
||||
$this->title = Yii::t('app', 'Jogosultság szerkesztő');
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Felhasználók'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
$availablePermissions = $model->availablePermissions ;
|
||||
|
||||
$permissions = $model->permissions;
|
||||
|
||||
?>
|
||||
<div class="user-create">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
|
||||
<div class="user-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
|
||||
|
||||
<h3>Engedélyezett jogosultságok</h3>
|
||||
<?php echo GridView::widget([
|
||||
'dataProvider' => new ArrayDataProvider( [
|
||||
'allModels' => $availablePermissions,
|
||||
'sort' => false,
|
||||
'pagination' => false,
|
||||
]),
|
||||
'columns' => [
|
||||
[
|
||||
'class' => 'yii\grid\CheckboxColumn',
|
||||
'name' => (new ReflectionClass( $model->classname() ))->getShortName() . '[permissions]',
|
||||
'checkboxOptions' => function ($model, $key, $index, $column) use ($permissions){
|
||||
$result = [];
|
||||
$result['value'] = $model['name'] ;
|
||||
|
||||
if ( isset($permissions) ){
|
||||
if ( is_array($permissions) ){
|
||||
if ( array_search($model['name'] , $permissions ) !== false){
|
||||
$result['checked'] = 'checked' ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
],
|
||||
[ 'attribute' => 'description' ],
|
||||
],
|
||||
])?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton( Yii::t('app', 'Mentés'), ['class' => 'btn btn-primary' ,'name' => 'RoleForm[save]']) ?>
|
||||
</div>
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user