From 1ebe58d2cec1859adc13d64056741c8e9f180398 Mon Sep 17 00:00:00 2001
From: Antonio Ramirez
Date: Sun, 11 Dec 2016 00:56:05 +0100
Subject: [PATCH] fix views
---
lib/User/Controller/SecurityController.php | 3 +-
lib/User/Controller/SettingsController.php | 2 +-
lib/User/Module.php | 4 ++
lib/User/Widget/ConnectWidget.php | 55 +++++++++++++++++++
lib/User/Widget/LoginWidget.php | 21 +++++++
.../resources/views/mail/confirmation.php | 13 +----
.../resources/views/mail/layouts/html.php | 10 ----
.../resources/views/mail/layouts/text.php | 10 ----
.../resources/views/mail/reconfirmation.php | 12 +---
lib/User/resources/views/mail/recovery.php | 13 +----
.../views/mail/text/confirmation.php | 13 +----
.../views/mail/text/reconfirmation.php | 12 +---
.../resources/views/mail/text/recovery.php | 14 +----
.../resources/views/mail/text/welcome.php | 27 +++------
lib/User/resources/views/mail/welcome.php | 38 +++++--------
lib/User/resources/views/profile/show.php | 33 ++++++-----
lib/User/resources/views/recovery/request.php | 26 +++------
lib/User/resources/views/recovery/reset.php | 25 +++------
.../resources/views/registration/connect.php | 26 +++------
.../resources/views/registration/register.php | 21 ++++---
.../resources/views/registration/resend.php | 28 ++++------
lib/User/resources/views/security/login.php | 45 +++++++--------
lib/User/resources/views/settings/_menu.php | 50 ++++++++---------
lib/User/resources/views/settings/account.php | 19 ++-----
.../resources/views/settings/networks.php | 20 ++-----
25 files changed, 238 insertions(+), 302 deletions(-)
create mode 100644 lib/User/Widget/ConnectWidget.php
create mode 100644 lib/User/Widget/LoginWidget.php
diff --git a/lib/User/Controller/SecurityController.php b/lib/User/Controller/SecurityController.php
index 55b4eb2..589d4c5 100644
--- a/lib/User/Controller/SecurityController.php
+++ b/lib/User/Controller/SecurityController.php
@@ -135,7 +135,8 @@ class SecurityController extends Controller
$this->make(SocialNetworkAuthenticateService::class, [$this, $this->action, $client])->run();
}
- public function connect(AuthClientInterface $client) {
+ public function connect(AuthClientInterface $client)
+ {
if (Yii::$app->user->isGuest) {
Yii::$app->session->setFlash('danger', Yii::t('user', 'Something went wrong'));
diff --git a/lib/User/Controller/SettingsController.php b/lib/User/Controller/SettingsController.php
index e77cd5a..2eaba88 100644
--- a/lib/User/Controller/SettingsController.php
+++ b/lib/User/Controller/SettingsController.php
@@ -199,7 +199,7 @@ class SettingsController extends Controller
public function actionDelete()
{
- if (!$this->module->enableAccountDelete) {
+ if (!$this->module->allowAccountDelete) {
throw new NotFoundHttpException(\Yii::t('user', 'Not found'));
}
diff --git a/lib/User/Module.php b/lib/User/Module.php
index df7fc9a..da417b1 100644
--- a/lib/User/Module.php
+++ b/lib/User/Module.php
@@ -26,6 +26,10 @@ class Module extends \yii\base\Module
* @var bool whether to enable password recovery or not.
*/
public $allowPasswordRecovery = true;
+ /**
+ * @var bool Whether user can remove his account
+ */
+ public $allowAccountDelete = false;
/**
* @var string the class name of the strategy class to handle user's email change.
*/
diff --git a/lib/User/Widget/ConnectWidget.php b/lib/User/Widget/ConnectWidget.php
new file mode 100644
index 0000000..5514d79
--- /dev/null
+++ b/lib/User/Widget/ConnectWidget.php
@@ -0,0 +1,55 @@
+view);
+ if ($this->popupMode) {
+ Yii::$app->view->registerJs("\$('#" . $this->getId() . "').authchoice();");
+ }
+ $this->options['id'] = $this->getId();
+ echo Html::beginTag('div', $this->options);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function createClientUrl($provider)
+ {
+ if ($this->isConnected($provider)) {
+ return Url::to(['/user/settings/disconnect', 'id' => $this->accounts[$provider->getId()]->id]);
+ } else {
+ return parent::createClientUrl($provider);
+ }
+ }
+
+ /**
+ * Checks if provider already connected to user.
+ *
+ * @param ClientInterface $provider
+ *
+ * @return bool
+ */
+ public function isConnected(ClientInterface $provider)
+ {
+ return $this->accounts != null && isset($this->accounts[$provider->getId()]);
+ }
+}
diff --git a/lib/User/Widget/LoginWidget.php b/lib/User/Widget/LoginWidget.php
new file mode 100644
index 0000000..8bce6fe
--- /dev/null
+++ b/lib/User/Widget/LoginWidget.php
@@ -0,0 +1,21 @@
+render(
+ 'login',
+ [
+ 'model' => Yii::createObject(LoginForm::class)
+ ]
+ );
+ }
+}
diff --git a/lib/User/resources/views/mail/confirmation.php b/lib/User/resources/views/mail/confirmation.php
index 75ded1e..df27956 100644
--- a/lib/User/resources/views/mail/confirmation.php
+++ b/lib/User/resources/views/mail/confirmation.php
@@ -1,19 +1,10 @@
- *
- * For the full copyright and license information, please view the LICENSE.md
- * file that was distributed with this source code.
- */
-
use yii\helpers\Html;
/**
- * @var dektrium\user\models\User $user
- * @var dektrium\user\models\Token $token
+ * @var \Da\User\Model\User $user
+ * @var \Da\User\Model\Token $token
*/
?>
diff --git a/lib/User/resources/views/mail/layouts/html.php b/lib/User/resources/views/mail/layouts/html.php
index cd80b96..8981ab4 100644
--- a/lib/User/resources/views/mail/layouts/html.php
+++ b/lib/User/resources/views/mail/layouts/html.php
@@ -1,14 +1,4 @@
- *
- * For the full copyright and license information, please view the LICENSE.md
- * file that was distributed with this source code.
- */
-
/**
* @var \yii\web\View $this
* @var yii\mail\BaseMessage $content
diff --git a/lib/User/resources/views/mail/layouts/text.php b/lib/User/resources/views/mail/layouts/text.php
index 097eb30..43ce060 100644
--- a/lib/User/resources/views/mail/layouts/text.php
+++ b/lib/User/resources/views/mail/layouts/text.php
@@ -1,14 +1,4 @@
- *
- * For the full copyright and license information, please view the LICENSE.md
- * file that was distributed with this source code.
- */
-
/**
* @var string $content main view render result
*/
diff --git a/lib/User/resources/views/mail/reconfirmation.php b/lib/User/resources/views/mail/reconfirmation.php
index 312e166..02073c1 100644
--- a/lib/User/resources/views/mail/reconfirmation.php
+++ b/lib/User/resources/views/mail/reconfirmation.php
@@ -1,18 +1,8 @@
- *
- * For the full copyright and license information, please view the LICENSE.md
- * file that was distributed with this source code.
- */
-
use yii\helpers\Html;
/**
- * @var dektrium\user\models\Token $token
+ * @var \Da\User\Model\Token $token
*/
?>
diff --git a/lib/User/resources/views/mail/recovery.php b/lib/User/resources/views/mail/recovery.php
index a7aadb2..1a98f78 100644
--- a/lib/User/resources/views/mail/recovery.php
+++ b/lib/User/resources/views/mail/recovery.php
@@ -1,19 +1,10 @@
- *
- * For the full copyright and license information, please view the LICENSE.md
- * file that was distributed with this source code.
- */
-
use yii\helpers\Html;
/**
- * @var dektrium\user\models\User $user
- * @var dektrium\user\models\Token $token
+ * @var \Da\User\Model\User $user
+ * @var \Da\User\Model\Token $token
*/
?>
diff --git a/lib/User/resources/views/mail/text/confirmation.php b/lib/User/resources/views/mail/text/confirmation.php
index e2f7a38..e1d2daf 100644
--- a/lib/User/resources/views/mail/text/confirmation.php
+++ b/lib/User/resources/views/mail/text/confirmation.php
@@ -1,17 +1,8 @@
- *
- * For the full copyright and license information, please view the LICENSE.md
- * file that was distributed with this source code.
- */
-
/**
- * @var dektrium\user\models\User $user
- * @var dektrium\user\models\Token $token
+ * @var \Da\User\Model\User $user
+ * @var \Da\User\Model\Token $token
*/
?>
= Yii::t('user', 'Hello') ?>,
diff --git a/lib/User/resources/views/mail/text/reconfirmation.php b/lib/User/resources/views/mail/text/reconfirmation.php
index fdb6c64..6c5a388 100644
--- a/lib/User/resources/views/mail/text/reconfirmation.php
+++ b/lib/User/resources/views/mail/text/reconfirmation.php
@@ -1,16 +1,6 @@
- *
- * For the full copyright and license information, please view the LICENSE.md
- * file that was distributed with this source code.
- */
-
/**
- * @var dektrium\user\models\Token $token
+ * @var \Da\User\Model\Token $token
*/
?>
= Yii::t('user', 'Hello') ?>,
diff --git a/lib/User/resources/views/mail/text/recovery.php b/lib/User/resources/views/mail/text/recovery.php
index 3ffec17..9be9cad 100644
--- a/lib/User/resources/views/mail/text/recovery.php
+++ b/lib/User/resources/views/mail/text/recovery.php
@@ -1,17 +1,7 @@
- *
- * For the full copyright and license information, please view the LICENSE.md
- * file that was distributed with this source code.
- */
-
/**
- * @var dektrium\user\models\User $user
- * @var dektrium\user\models\Token $token
+ * @var \Da\User\Model\User $user
+ * @var \Da\User\Model\Token $token
*/
?>
= Yii::t('user', 'Hello') ?>,
diff --git a/lib/User/resources/views/mail/text/welcome.php b/lib/User/resources/views/mail/text/welcome.php
index a9f208c..8cff168 100644
--- a/lib/User/resources/views/mail/text/welcome.php
+++ b/lib/User/resources/views/mail/text/welcome.php
@@ -1,32 +1,23 @@
- *
- * For the full copyright and license information, please view the LICENSE.md
- * file that was distributed with this source code.
- */
-
/**
- * @var dektrium\user\models\User
+ * @var \Da\User\Model\User $user
+ * @var \Da\User\Model\Token $token
+ * @var \Da\User\Module $module
*/
?>
= Yii::t('user', 'Hello') ?>,
= Yii::t('user', 'Your account on {0} has been created', Yii::$app->name) ?>.
-enableGeneratingPassword): ?>
-= Yii::t('user', 'We have generated a password for you') ?>:
-= $user->password ?>
+generatePasswords): ?>
+ = Yii::t('user', 'We have generated a password for you') ?>:
+ = $user->password ?>
-= Yii::t('user', 'In order to complete your registration, please click the link below') ?>.
-
-= $token->url ?>
-
-= Yii::t('user', 'If you cannot click the link, please try pasting the text into your browser') ?>.
+ = Yii::t('user', 'In order to complete your registration, please click the link below') ?>.
+ = $token->url ?>
+ = Yii::t('user', 'If you cannot click the link, please try pasting the text into your browser') ?>.
= Yii::t('user', 'If you did not make this request you can ignore this email') ?>.
diff --git a/lib/User/resources/views/mail/welcome.php b/lib/User/resources/views/mail/welcome.php
index 79da04e..1e708ac 100644
--- a/lib/User/resources/views/mail/welcome.php
+++ b/lib/User/resources/views/mail/welcome.php
@@ -1,21 +1,11 @@
- *
- * For the full copyright and license information, please view the LICENSE.md
- * file that was distributed with this source code.
- */
-
use yii\helpers\Html;
/**
- * @var dektrium\user\Module $module
- * @var dektrium\user\models\User $user
- * @var dektrium\user\models\Token $token
- * @var bool $showPassword
+ * @var \Da\User\Module $module
+ * @var \Da\User\Model\User $user
+ * @var \Da\User\Model\Token $token
+ * @var bool $showPassword
*/
?>
@@ -25,22 +15,22 @@ use yii\helpers\Html;
= Yii::t('user', 'Your account on {0} has been created', Yii::$app->name) ?>.
- enableGeneratingPassword): ?>
+ generatePasswords): ?>
= Yii::t('user', 'We have generated a password for you') ?>: = $user->password ?>
-
- = Yii::t('user', 'In order to complete your registration, please click the link below') ?>.
-
-
- = Html::a(Html::encode($token->url), $token->url); ?>
-
-
- = Yii::t('user', 'If you cannot click the link, please try pasting the text into your browser') ?>.
-
+
+ = Yii::t('user', 'In order to complete your registration, please click the link below') ?>.
+
+
+ = Html::a(Html::encode($token->url), $token->url); ?>
+
+
+ = Yii::t('user', 'If you cannot click the link, please try pasting the text into your browser') ?>.
+
diff --git a/lib/User/resources/views/profile/show.php b/lib/User/resources/views/profile/show.php
index 076ff3e..bdabcae 100644
--- a/lib/User/resources/views/profile/show.php
+++ b/lib/User/resources/views/profile/show.php
@@ -1,19 +1,10 @@
- *
- * For the full copyright and license information, please view the LICENSE.md
- * file that was distributed with this source code.
- */
-
use yii\helpers\Html;
/**
* @var \yii\web\View $this
- * @var \dektrium\user\models\Profile $profile
+ * @var \Da\User\Model\Profile $profile
*/
$this->title = empty($profile->name) ? Html::encode($profile->user->username) : Html::encode($profile->name);
@@ -32,15 +23,29 @@ $this->params['breadcrumbs'][] = $this->title;
= $this->title ?>
location)): ?>
- - = Html::encode($profile->location) ?>
+ -
+
+ = Html::encode($profile->location) ?>
+
website)): ?>
- - = Html::a(Html::encode($profile->website), Html::encode($profile->website)) ?>
+ -
+
+ = Html::a(Html::encode($profile->website), Html::encode($profile->website)) ?>
+
public_email)): ?>
- - = Html::a(Html::encode($profile->public_email), 'mailto:' . Html::encode($profile->public_email)) ?>
+ -
+
+ = Html::a(Html::encode($profile->public_email), 'mailto:' .
+ Html::encode($profile->public_email))
+ ?>
+
- - = Yii::t('user', 'Joined on {0, date}', $profile->user->created_at) ?>
+ -
+
+ = Yii::t('user', 'Joined on {0, date}', $profile->user->created_at) ?>
+
bio)): ?>
= Html::encode($profile->bio) ?>
diff --git a/lib/User/resources/views/recovery/request.php b/lib/User/resources/views/recovery/request.php
index 7635380..fce2d37 100644
--- a/lib/User/resources/views/recovery/request.php
+++ b/lib/User/resources/views/recovery/request.php
@@ -1,21 +1,11 @@
- *
- * 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;
-/*
+/**
* @var yii\web\View $this
* @var yii\widgets\ActiveForm $form
- * @var dektrium\user\models\RecoveryForm $model
+ * @var \Da\User\Form\RecoveryForm $model
*/
$this->title = Yii::t('user', 'Recover your password');
@@ -28,11 +18,13 @@ $this->params['breadcrumbs'][] = $this->title;
= Html::encode($this->title) ?>
- 'password-recovery-form',
- 'enableAjaxValidation' => true,
- 'enableClientValidation' => false,
- ]); ?>
+ $model->formName(),
+ 'enableAjaxValidation' => true,
+ 'enableClientValidation' => false,
+ ]
+ ); ?>
= $form->field($model, 'email')->textInput(['autofocus' => true]) ?>
diff --git a/lib/User/resources/views/recovery/reset.php b/lib/User/resources/views/recovery/reset.php
index 6f29ea3..3ced36c 100644
--- a/lib/User/resources/views/recovery/reset.php
+++ b/lib/User/resources/views/recovery/reset.php
@@ -1,21 +1,12 @@
- *
- * 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;
-/*
+/**
* @var yii\web\View $this
* @var yii\widgets\ActiveForm $form
- * @var dektrium\user\models\RecoveryForm $model
+ * @var \Da\User\Form\RecoveryForm $model
*/
$this->title = Yii::t('user', 'Reset your password');
@@ -28,11 +19,13 @@ $this->params['breadcrumbs'][] = $this->title;
= Html::encode($this->title) ?>
- 'password-recovery-form',
- 'enableAjaxValidation' => true,
- 'enableClientValidation' => false,
- ]); ?>
+ $model->formName(),
+ 'enableAjaxValidation' => true,
+ 'enableClientValidation' => false,
+ ]
+ ); ?>
= $form->field($model, 'password')->passwordInput() ?>
diff --git a/lib/User/resources/views/registration/connect.php b/lib/User/resources/views/registration/connect.php
index 9ed4957..992b098 100644
--- a/lib/User/resources/views/registration/connect.php
+++ b/lib/User/resources/views/registration/connect.php
@@ -1,22 +1,12 @@
- *
- * 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;
/**
- * @var yii\web\View $this
- * @var yii\widgets\ActiveForm $form
- * @var dektrium\user\models\User $model
- * @var dektrium\user\models\Account $account
+ * @var yii\web\View $this
+ * @var yii\widgets\ActiveForm $form
+ * @var \Da\User\Model\User $model
+ * @var \Da\User\Model\SocialNetworkAccount $account
*/
$this->title = Yii::t('user', 'Sign in');
@@ -37,9 +27,11 @@ $this->params['breadcrumbs'][] = $this->title;
) ?>:
- 'connect-account-form',
- ]); ?>
+ $model->formName(),
+ ]
+ ); ?>
= $form->field($model, 'email') ?>
diff --git a/lib/User/resources/views/registration/register.php b/lib/User/resources/views/registration/register.php
index a5d774f..1cf07e9 100644
--- a/lib/User/resources/views/registration/register.php
+++ b/lib/User/resources/views/registration/register.php
@@ -13,9 +13,10 @@ use yii\helpers\Html;
use yii\widgets\ActiveForm;
/**
- * @var yii\web\View $this
- * @var dektrium\user\models\User $user
- * @var dektrium\user\Module $module
+ * @var yii\web\View $this
+ * @var \Da\User\Form\RegistrationForm $model
+ * @var \Da\User\Model\User $user
+ * @var \Da\User\Module $module
*/
$this->title = Yii::t('user', 'Sign up');
@@ -28,17 +29,19 @@ $this->params['breadcrumbs'][] = $this->title;
= Html::encode($this->title) ?>
- 'registration-form',
- 'enableAjaxValidation' => true,
- 'enableClientValidation' => false,
- ]); ?>
+ $model->formName(),
+ 'enableAjaxValidation' => true,
+ 'enableClientValidation' => false,
+ ]
+ ); ?>
= $form->field($model, 'email') ?>
= $form->field($model, 'username') ?>
- enableGeneratingPassword == false): ?>
+ generatePasswords == false): ?>
= $form->field($model, 'password')->passwordInput() ?>
diff --git a/lib/User/resources/views/registration/resend.php b/lib/User/resources/views/registration/resend.php
index d370aa5..98b925b 100644
--- a/lib/User/resources/views/registration/resend.php
+++ b/lib/User/resources/views/registration/resend.php
@@ -1,20 +1,10 @@
- *
- * 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;
-/*
- * @var yii\web\View $this
- * @var dektrium\user\models\ResendForm $model
+/**
+ * @var yii\web\View $this
+ * @var \Da\User\Form\ResendForm $model
*/
$this->title = Yii::t('user', 'Request new confirmation message');
@@ -27,11 +17,13 @@ $this->params['breadcrumbs'][] = $this->title;
= Html::encode($this->title) ?>
- 'resend-form',
- 'enableAjaxValidation' => true,
- 'enableClientValidation' => false,
- ]); ?>
+ $model->formName(),
+ 'enableAjaxValidation' => true,
+ 'enableClientValidation' => false,
+ ]
+ ); ?>
= $form->field($model, 'email')->textInput(['autofocus' => true]) ?>
diff --git a/lib/User/resources/views/security/login.php b/lib/User/resources/views/security/login.php
index 06f8280..70251f1 100644
--- a/lib/User/resources/views/security/login.php
+++ b/lib/User/resources/views/security/login.php
@@ -1,22 +1,13 @@
- *
- * For the full copyright and license information, please view the LICENSE.md
- * file that was distributed with this source code.
- */
-
use dektrium\user\widgets\Connect;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/**
- * @var yii\web\View $this
- * @var dektrium\user\models\LoginForm $model
- * @var dektrium\user\Module $module
+ * @var yii\web\View $this
+ * @var \Da\User\Form\LoginForm $model
+ * @var \Da\User\Module $module
*/
$this->title = Yii::t('user', 'Sign in');
@@ -32,14 +23,16 @@ $this->params['breadcrumbs'][] = $this->title;
= Html::encode($this->title) ?>
- 'login-form',
- 'enableAjaxValidation' => true,
- 'enableClientValidation' => false,
- 'validateOnBlur' => false,
- 'validateOnType' => false,
- 'validateOnChange' => false,
- ]) ?>
+ $model->formName(),
+ 'enableAjaxValidation' => true,
+ 'enableClientValidation' => false,
+ 'validateOnBlur' => false,
+ 'validateOnType' => false,
+ 'validateOnChange' => false,
+ ]
+ ) ?>
= $form->field(
$model,
@@ -56,7 +49,7 @@ $this->params['breadcrumbs'][] = $this->title;
->passwordInput()
->label(
Yii::t('user', 'Password')
- .($module->enablePasswordRecovery ?
+ . ($module->allowPasswordRecovery ?
' (' . Html::a(
Yii::t('user', 'Forgot password?'),
['/user/recovery/request'],
@@ -75,7 +68,7 @@ $this->params['breadcrumbs'][] = $this->title;
- enableConfirmation): ?>
+ enableEmailConfirmation): ?>
= Html::a(Yii::t('user', 'Didn\'t receive confirmation message?'), ['/user/registration/resend']) ?>
@@ -85,8 +78,10 @@ $this->params['breadcrumbs'][] = $this->title;
= Html::a(Yii::t('user', 'Don\'t have an account? Sign up!'), ['/user/registration/register']) ?>
- = Connect::widget([
- 'baseAuthUrl' => ['/user/security/auth'],
- ]) ?>
+ = Connect::widget(
+ [
+ 'baseAuthUrl' => ['/user/security/auth'],
+ ]
+ ) ?>
diff --git a/lib/User/resources/views/settings/_menu.php b/lib/User/resources/views/settings/_menu.php
index 71554ee..b0faa38 100644
--- a/lib/User/resources/views/settings/_menu.php
+++ b/lib/User/resources/views/settings/_menu.php
@@ -1,18 +1,9 @@
- *
- * 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\Menu;
-/** @var dektrium\user\models\User $user */
+/** @var \Da\User\Model\User $user */
$user = Yii::$app->user->identity;
$networksVisible = count(Yii::$app->authClientCollection->clients) > 0;
@@ -21,27 +12,32 @@ $networksVisible = count(Yii::$app->authClientCollection->clients) > 0;
- = Html::img($user->profile->getAvatarUrl(24), [
- 'class' => 'img-rounded',
- 'alt' => $user->username,
- ]) ?>
+ = Html::img(
+ $user->profile->getAvatarUrl(24),
+ [
+ 'class' => 'img-rounded',
+ 'alt' => $user->username,
+ ]
+ ) ?>
= $user->username ?>
- = Menu::widget([
- 'options' => [
- 'class' => 'nav nav-pills nav-stacked',
- ],
- 'items' => [
- ['label' => Yii::t('user', 'Profile'), 'url' => ['/user/settings/profile']],
- ['label' => Yii::t('user', 'Account'), 'url' => ['/user/settings/account']],
- [
- 'label' => Yii::t('user', 'Networks'),
- 'url' => ['/user/settings/networks'],
- 'visible' => $networksVisible
+ = Menu::widget(
+ [
+ 'options' => [
+ 'class' => 'nav nav-pills nav-stacked',
],
- ],
- ]) ?>
+ 'items' => [
+ ['label' => Yii::t('user', 'Profile'), 'url' => ['/user/settings/profile']],
+ ['label' => Yii::t('user', 'Account'), 'url' => ['/user/settings/account']],
+ [
+ 'label' => Yii::t('user', 'Networks'),
+ 'url' => ['/user/settings/networks'],
+ 'visible' => $networksVisible
+ ],
+ ],
+ ]
+ ) ?>
diff --git a/lib/User/resources/views/settings/account.php b/lib/User/resources/views/settings/account.php
index ca1ee4c..ad6d7b4 100644
--- a/lib/User/resources/views/settings/account.php
+++ b/lib/User/resources/views/settings/account.php
@@ -1,21 +1,12 @@
- *
- * 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;
/**
- * @var $this yii\web\View
- * @var $form yii\widgets\ActiveForm
- * @var $model dektrium\user\models\SettingsForm
+ * @var yii\web\View $this
+ * @var yii\widgets\ActiveForm $form
+ * @var \Da\User\Form\SettingsForm $model
*/
$this->title = Yii::t('user', 'Account settings');
@@ -35,7 +26,7 @@ $this->params['breadcrumbs'][] = $this->title;
'account-form',
+ 'id' => $model->formName(),
'options' => ['class' => 'form-horizontal'],
'fieldConfig' => [
'template' => "{label}\n
{input}
\n
{error}\n{hint}
",
@@ -65,7 +56,7 @@ $this->params['breadcrumbs'][] = $this->title;
- module->enableAccountDelete): ?>
+ module->allowAccountDelete): ?>
= Yii::t('user', 'Delete account') ?>
diff --git a/lib/User/resources/views/settings/networks.php b/lib/User/resources/views/settings/networks.php
index 1ee1c7d..ad810af 100644
--- a/lib/User/resources/views/settings/networks.php
+++ b/lib/User/resources/views/settings/networks.php
@@ -1,20 +1,12 @@
- *
- * For the full copyright and license information, please view the LICENSE.md
- * file that was distributed with this source code.
- */
-
-use dektrium\user\widgets\Connect;
+use Da\User\Widget\ConnectWidget;
use yii\helpers\Html;
-/*
+/**
* @var yii\web\View $this
* @var yii\widgets\ActiveForm $form
+ * @var \Da\User\Model\User $user
*/
$this->title = Yii::t('user', 'Networks');
@@ -36,9 +28,9 @@ $this->params['breadcrumbs'][] = $this->title;
= Yii::t('user', 'You can connect multiple accounts to be able to log in using them') ?>.
- ['/user/security/auth'],
- 'accounts' => $user->accounts,
+ 'accounts' => $user->socialNetworkAccounts,
'autoRender' => false,
'popupMode' => false,
]) ?>
@@ -65,7 +57,7 @@ $this->params['breadcrumbs'][] = $this->title;
-
+