implement module viewPath in all views instead of static file reference
This commit is contained in:
@ -74,6 +74,7 @@ abstract class AbstractAuthItemController extends Controller
|
||||
[
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $searchModel->search(Yii::$app->request->get()),
|
||||
'module' => $this->module
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -101,6 +102,7 @@ abstract class AbstractAuthItemController extends Controller
|
||||
[
|
||||
'model' => $model,
|
||||
'unassignedItems' => $this->authHelper->getUnassignedItems($model),
|
||||
'module' => $this->module
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -130,6 +132,7 @@ abstract class AbstractAuthItemController extends Controller
|
||||
[
|
||||
'model' => $model,
|
||||
'unassignedItems' => $this->authHelper->getUnassignedItems($model),
|
||||
'module' => $this->module
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@ -178,7 +178,10 @@ class AdminController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('_account', ['user' => $user]);
|
||||
return $this->render('_account', [
|
||||
'user' => $user,
|
||||
'module' => $this->module
|
||||
]);
|
||||
}
|
||||
|
||||
public function actionUpdateProfile($id)
|
||||
@ -211,6 +214,7 @@ class AdminController extends Controller
|
||||
[
|
||||
'user' => $user,
|
||||
'profile' => $profile,
|
||||
'module' => $this->module
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -224,6 +228,7 @@ class AdminController extends Controller
|
||||
'_info',
|
||||
[
|
||||
'user' => $user,
|
||||
'module' => $this->module
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -238,6 +243,7 @@ class AdminController extends Controller
|
||||
[
|
||||
'user' => $user,
|
||||
'params' => Yii::$app->request->post(),
|
||||
'module' => $this->module
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -372,6 +378,7 @@ class AdminController extends Controller
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
'user' => $user,
|
||||
'module' => $this->module
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@ -67,6 +67,7 @@ class RuleController extends Controller
|
||||
[
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
'module' => $this->module
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -89,7 +90,8 @@ class RuleController extends Controller
|
||||
return $this->render(
|
||||
'create',
|
||||
[
|
||||
'model' => $model
|
||||
'model' => $model,
|
||||
'module' => $this->module
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -104,7 +106,7 @@ class RuleController extends Controller
|
||||
[
|
||||
'previousName' => $name,
|
||||
'name' => $rule->name,
|
||||
'className' => get_class($rule)
|
||||
'className' => get_class($rule),
|
||||
]
|
||||
);
|
||||
|
||||
@ -123,6 +125,7 @@ class RuleController extends Controller
|
||||
'update',
|
||||
[
|
||||
'model' => $model,
|
||||
'module' => $this->module
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@ -12,13 +12,16 @@
|
||||
namespace Da\User\Service;
|
||||
|
||||
use Da\User\Contracts\ServiceInterface;
|
||||
use Da\User\Traits\ModuleAwareTrait;
|
||||
use Yii;
|
||||
use yii\mail\BaseMailer;
|
||||
use yii\mail\MailerInterface;
|
||||
|
||||
class MailService implements ServiceInterface
|
||||
{
|
||||
protected $viewPath = '@Da/User/resources/views/mail';
|
||||
use ModuleAwareTrait;
|
||||
|
||||
protected $viewPath = '';
|
||||
|
||||
protected $type;
|
||||
protected $from;
|
||||
@ -48,6 +51,7 @@ class MailService implements ServiceInterface
|
||||
$this->view = $view;
|
||||
$this->params = $params;
|
||||
$this->mailer = $mailer;
|
||||
$this->viewPath = $this->getModule()->viewPath . '/mail';
|
||||
$this->mailer->setViewPath($this->viewPath);
|
||||
$this->mailer->getView()->theme = Yii::$app->view->theme;
|
||||
}
|
||||
|
||||
@ -12,17 +12,22 @@
|
||||
namespace Da\User\Widget;
|
||||
|
||||
use Da\User\Form\LoginForm;
|
||||
use Da\User\Traits\ModuleAwareTrait;
|
||||
use Yii;
|
||||
use yii\base\Widget;
|
||||
|
||||
/**
|
||||
* @deprecated this seems to be unused by this module. To be deleted in future!
|
||||
*/
|
||||
class LoginWidget extends Widget
|
||||
{
|
||||
use ModuleAwareTrait;
|
||||
public $validate = true;
|
||||
|
||||
public function run()
|
||||
{
|
||||
return $this->render(
|
||||
'@Da/User/resources/views/widgets/login/form',
|
||||
$this->getModule()->$this->viewPath .'/widgets/login/form',
|
||||
[
|
||||
'model' => Yii::createObject(LoginForm::class),
|
||||
]
|
||||
|
||||
@ -14,10 +14,11 @@ use yii\helpers\Html;
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var Da\User\Model\User $user */
|
||||
/** @var \Da\User\Module $module */
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/admin/update.php', ['user' => $user]) ?>
|
||||
<?php $this->beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?>
|
||||
|
||||
<?php $form = ActiveForm::begin(
|
||||
[
|
||||
|
||||
@ -14,10 +14,11 @@ use Da\User\Widget\AssignmentsWidget;
|
||||
/** @var yii\web\View $this */
|
||||
/** @var Da\User\Model\User $user */
|
||||
/** @var string[] $params */
|
||||
/** @var \Da\User\Module $module */
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/admin/update.php', ['user' => $user]) ?>
|
||||
<?php $this->beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?>
|
||||
|
||||
<?= yii\bootstrap\Alert::widget(
|
||||
[
|
||||
|
||||
@ -11,10 +11,11 @@
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var Da\User\Model\User $user */
|
||||
/** @var \Da\User\Module $module */
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/admin/update.php', ['user' => $user]) ?>
|
||||
<?php $this->beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?>
|
||||
|
||||
<table class="table">
|
||||
<tr>
|
||||
|
||||
@ -16,11 +16,12 @@ use yii\helpers\Html;
|
||||
* @var yii\web\View $this
|
||||
* @var \Da\User\Model\User $user
|
||||
* @var \Da\User\Model\Profile $profile
|
||||
* @var \Da\User\Module $module
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/admin/update.php', ['user' => $user]) ?>
|
||||
<?php $this->beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?>
|
||||
|
||||
<?php $form = ActiveForm::begin(
|
||||
[
|
||||
|
||||
@ -23,10 +23,11 @@ use yii\data\ActiveDataProvider;
|
||||
* @var SessionHistorySearch $searchModel
|
||||
* @var ActiveDataProvider $dataProvider
|
||||
* @var \Da\User\Model\User $user
|
||||
* @var \Da\User\Module $module
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/admin/update.php', ['user' => $user]) ?>
|
||||
<?php $this->beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<?= Html::a(
|
||||
|
||||
@ -27,7 +27,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
$module = Yii::$app->getModule('user');
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
|
||||
<?php $this->beginContent($module->viewPath . '/shared/admin_layout.php') ?>
|
||||
|
||||
<?php Pjax::begin() ?>
|
||||
<div class="table-responsive">
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
* @var yii\web\View $this
|
||||
* @var Da\User\Model\Permission $model
|
||||
* @var string[] $unassignedItems
|
||||
* @var \Da\User\Module $module
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('usuario', 'Create new permission');
|
||||
@ -20,7 +21,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
|
||||
<?php $this->beginContent($module->viewPath . '/shared/admin_layout.php') ?>
|
||||
|
||||
<?= $this->render(
|
||||
'/permission/_form',
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
* @var \yii\data\ActiveDataProvider $dataProvider
|
||||
* @var yii\web\View $this
|
||||
* @var \Da\User\Search\PermissionSearch $searchModel
|
||||
* @var \Da\User\Module $module
|
||||
*/
|
||||
use yii\grid\ActionColumn;
|
||||
use yii\grid\GridView;
|
||||
@ -23,7 +24,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
|
||||
<?php $this->beginContent($module->viewPath . '/shared/admin_layout.php') ?>
|
||||
<div class="table-responsive">
|
||||
<?= GridView::widget(
|
||||
[
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
* @var yii\web\View $this
|
||||
* @var Da\User\Model\Permission $model
|
||||
* @var string[] $unassignedItems
|
||||
* @var \Da\User\Module $module
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('usuario', 'Update permission');
|
||||
@ -20,7 +21,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
|
||||
<?php $this->beginContent($module->viewPath . '/shared/admin_layout.php') ?>
|
||||
|
||||
<?= $this->render(
|
||||
'/permission/_form',
|
||||
|
||||
@ -13,13 +13,14 @@
|
||||
* @var yii\web\View $this
|
||||
* @var \Da\User\Model\Role $model
|
||||
* @var string[] $unassignedItems
|
||||
* @var \Da\User\Module $module
|
||||
*/
|
||||
$this->title = Yii::t('usuario', 'Create new role');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
|
||||
<?php $this->beginContent($module->viewPath . '/shared/admin_layout.php') ?>
|
||||
|
||||
<?= $this->render(
|
||||
'/role/_form',
|
||||
|
||||
@ -17,6 +17,7 @@ use yii\helpers\Url;
|
||||
* @var \yii\data\DataProviderInterface $dataProvider
|
||||
* @var \Da\User\Search\RoleSearch $searchModel
|
||||
* @var yii\web\View $this
|
||||
* @var \Da\User\Module $module
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('usuario', 'Roles');
|
||||
@ -24,7 +25,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
|
||||
<?php $this->beginContent($module->viewPath . '/shared/admin_layout.php') ?>
|
||||
<div class="table-responsive">
|
||||
<?= GridView::widget(
|
||||
[
|
||||
|
||||
@ -13,13 +13,14 @@
|
||||
* @var yii\web\View $this
|
||||
* @var \Da\User\Model\Role $model
|
||||
* @var string[] $unassignedItems
|
||||
* @var \Da\User\Module $module
|
||||
*/
|
||||
$this->title = Yii::t('usuario', 'Update role');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
|
||||
<?php $this->beginContent($module->viewPath . '/shared/admin_layout.php') ?>
|
||||
|
||||
<?= $this->render(
|
||||
'/role/_form',
|
||||
|
||||
@ -13,13 +13,14 @@
|
||||
* @var yii\web\View $this
|
||||
* @var \Da\User\Model\Rule $model
|
||||
* @var string[] $unassignedItems
|
||||
* @var \Da\User\Module $module
|
||||
*/
|
||||
$this->title = Yii::t('usuario', 'Create new rule');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
|
||||
<?php $this->beginContent($module->viewPath . '/shared/admin_layout.php') ?>
|
||||
|
||||
<?= $this->render(
|
||||
'/rule/_form',
|
||||
|
||||
@ -9,6 +9,7 @@ use yii\rbac\Rule;
|
||||
* @var \yii\data\ActiveDataProvider $dataProvider
|
||||
* @var \Da\User\Search\RuleSearch $searchModel
|
||||
* @var yii\web\View $this
|
||||
* @var \Da\User\Module $module
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('usuario', 'Rules');
|
||||
@ -16,7 +17,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
|
||||
<?php $this->beginContent($module->viewPath . '/shared/admin_layout.php') ?>
|
||||
<div class="table-responsive">
|
||||
<?= GridView::widget(
|
||||
[
|
||||
|
||||
@ -13,14 +13,16 @@
|
||||
* @var yii\web\View $this
|
||||
* @var \Da\User\Model\Rule $model
|
||||
* @var string[] $unassignedItems
|
||||
* @var \Da\User\Module $module
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('usuario', 'Update rule');
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('usuario', 'Rules'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
|
||||
<?php $this->beginContent($module->viewPath . '/shared/admin_layout.php') ?>
|
||||
|
||||
<?= $this->render(
|
||||
'/rule/_form',
|
||||
|
||||
Reference in New Issue
Block a user