added RBAC

This commit is contained in:
Antonio Ramirez
2016-12-14 02:26:02 +01:00
parent 9409da4c89
commit 9f1a60b542
43 changed files with 1625 additions and 245 deletions

View File

@ -1,26 +1,24 @@
<?php
/*
* This file is part of the Dektrium project.
*
* (c) Dektrium project <http://github.com/dektrium>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use Da\User\Helper\TimezoneHelper;
/**
* @var yii\web\View $this
* @var yii\widgets\ActiveForm $form
* @var dektrium\user\models\Profile $profile
* @var \Da\User\Model\Profile $model
* @var TimezoneHelper $timezoneHelper
*/
$this->title = Yii::t('user', 'Profile settings');
$this->params['breadcrumbs'][] = $this->title;
$timezoneHelper = $model->make(TimezoneHelper::class);
?>
<div class="clearfix"></div>
<?= $this->render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?>
<div class="row">
@ -33,17 +31,19 @@ $this->params['breadcrumbs'][] = $this->title;
<?= Html::encode($this->title) ?>
</div>
<div class="panel-body">
<?php $form = \yii\widgets\ActiveForm::begin([
'id' => 'profile-form',
'options' => ['class' => 'form-horizontal'],
'fieldConfig' => [
'template' => "{label}\n<div class=\"col-lg-9\">{input}</div>\n<div class=\"col-sm-offset-3 col-lg-9\">{error}\n{hint}</div>",
'labelOptions' => ['class' => 'col-lg-3 control-label'],
],
'enableAjaxValidation' => true,
'enableClientValidation' => false,
'validateOnBlur' => false,
]); ?>
<?php $form = ActiveForm::begin(
[
'id' => $model->formName(),
'options' => ['class' => 'form-horizontal'],
'fieldConfig' => [
'template' => "{label}\n<div class=\"col-lg-9\">{input}</div>\n<div class=\"col-sm-offset-3 col-lg-9\">{error}\n{hint}</div>",
'labelOptions' => ['class' => 'col-lg-3 control-label'],
],
'enableAjaxValidation' => true,
'enableClientValidation' => false,
'validateOnBlur' => false,
]
); ?>
<?= $form->field($model, 'name') ?>
@ -55,18 +55,12 @@ $this->params['breadcrumbs'][] = $this->title;
<?= $form
->field($model, 'timezone')
->dropDownList(
\yii\helpers\ArrayHelper::map(
\dektrium\user\helpers\Timezone::getAll(),
'timezone',
'name'
)
); ?>
->dropDownList(ArrayHelper::map($timezoneHelper->getAll(),'timezone','name'));
?>
<?= $form
->field($model, 'gravatar_email')
->hint(
\yii\helpers\Html::a(
Html::a(
Yii::t('user', 'Change your avatar at Gravatar.com'),
'http://gravatar.com'
)
@ -76,14 +70,12 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="form-group">
<div class="col-lg-offset-3 col-lg-9">
<?= \yii\helpers\Html::submitButton(
Yii::t('user', 'Save'),
['class' => 'btn btn-block btn-success']
) ?><br>
<?= Html::submitButton(Yii::t('user', 'Save'), ['class' => 'btn btn-block btn-success']) ?>
<br>
</div>
</div>
<?php \yii\widgets\ActiveForm::end(); ?>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>