瀏覽代碼

[Espace producteur] Inscription / connexion : lien vers pages de connexion/inscription du producteur #1317

feature/souke
Guillaume Bourgeois 1 年之前
父節點
當前提交
5a921212f0
共有 1 個檔案被更改,包括 24 行新增15 行删除
  1. +24
    -15
      common/views/nav_user_top.php

+ 24
- 15
common/views/nav_user_top.php 查看文件

@@ -34,14 +34,13 @@ if ($userManager->isCurrentProducer()) {
$itemsProducersArray[] = [
'label' => 'Mes favoris',
];
foreach($producersArray as $producerItem) {
foreach ($producersArray as $producerItem) {
$itemsProducersArray[] = [
'label' => Html::encode($producerItem->name),
'url' => $this->getUrlManagerProducer()->createAbsoluteUrl(['site/index', 'slug_producer' => $producerItem->slug]),
];
}
}
else {
} else {
$itemsProducersArray[] = [
'label' => 'Aucun producteur dans vos favoris.',
];
@@ -64,7 +63,6 @@ if ($userManager->isCurrentProducer()) {
'linkOptions' => ['class' => 'btn btn-default navbar-btn']
];
$itemProducerSpace = [
//'label' => '<span class="glyphicon glyphicon-eye-open"></span> <span class="link-text">'.Html::encode($producer->name).'</span>',
'label' => '<span class="glyphicon glyphicon-eye-open"></span> <span class="link-text">Mon espace producteur</span>',
'url' => $this->getUrlManagerProducer()->createAbsoluteUrl(['site/index', 'slug_producer' => $producer ? $producer->slug : '']),
'visible' => $userManager->isCurrentProducer(),
@@ -79,7 +77,7 @@ if ($userManager->isCurrentProducer()) {
];

$itemsUserArray = [];
if($context == 'producer') {
if ($context == 'producer') {
$itemsUserArray = [
[
'label' => '<span class="glyphicon glyphicon-chevron-left"></span> Retour à l\'accueil',
@@ -89,9 +87,9 @@ if ($userManager->isCurrentProducer()) {
}

$itemsUserArray[] = [
'label' => '<span class="glyphicon glyphicon-user"></span> Mon profil',
'url' => $this->getUrlManagerFrontend()->createAbsoluteUrl(['user/update']),
];
'label' => '<span class="glyphicon glyphicon-user"></span> Mon profil',
'url' => $this->getUrlManagerFrontend()->createAbsoluteUrl(['user/update']),
];
$itemsUserArray[] = [
'label' => '<span class="glyphicon glyphicon-off"></span> Déconnexion',
'url' => $this->getUrlManagerFrontend()->createAbsoluteUrl(['site/logout']),
@@ -99,8 +97,7 @@ if ($userManager->isCurrentProducer()) {

$itemUser = [
'label' => '<span class="glyphicon glyphicon-user"></span> <span class="link-text">' .
((!Yii::$app->user->isGuest) ? Html::encode(Yii::$app->user->identity->name . ' ' . strtoupper(substr(Yii::$app->user->identity->lastname, 0, 1)).'.') : '') .
//($producer ? ' ('.Html::encode($producer->name).')' : '').
((!Yii::$app->user->isGuest) ? Html::encode(Yii::$app->user->identity->name . ' ' . strtoupper(substr(Yii::$app->user->identity->lastname, 0, 1)) . '.') : '') .
'</span>',
'options' => ['id' => 'label1'],
'url' => '#',
@@ -110,20 +107,33 @@ if ($userManager->isCurrentProducer()) {
];
$itemConnexion = [
'label' => '<span class="glyphicon glyphicon-log-in"></span> Connexion',
'url' => $this->getUrlManagerFrontend()->createAbsoluteUrl(['site/login']),
'url' => ($context == 'producer')
? $this->getUrlManagerFrontend()->createAbsoluteUrl([
'site/producer',
'id' => $this->context->getProducerCurrent()->id,
'return_url' => \Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index', 'slug_producer' => $this->context->getProducerCurrent()->slug])
])
: $this->getUrlManagerFrontend()->createAbsoluteUrl(['site/login']),
'linkOptions' => ['class' => 'btn btn-default navbar-btn'],
'visible' => \Yii::$app->user->isGuest,
'active' => $this->getControllerAction() == 'site/login'
];

$itemSignup = [
'label' => '<span class="glyphicon glyphicon-user"></span> Inscription',
'url' => $this->getUrlManagerFrontend()->createAbsoluteUrl(['site/signup']),
'url' => ($context == 'producer')
? $this->getUrlManagerFrontend()->createAbsoluteUrl([
'site/producer',
'id' => $this->context->getProducerCurrent()->id,
'return_url' => \Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index', 'slug_producer' => $this->context->getProducerCurrent()->slug])
])
: $this->getUrlManagerFrontend()->createAbsoluteUrl(['site/signup']),
'linkOptions' => ['class' => 'btn btn-default navbar-btn'],
'visible' => \Yii::$app->user->isGuest,
'active' => $this->getControllerAction() == 'site/signup'
];

if($context == 'frontend') {
if ($context == 'frontend') {
$itemsMenu = [
$itemAdministration,
$itemProducerSpace,
@@ -132,8 +142,7 @@ if ($userManager->isCurrentProducer()) {
$itemConnexion,
$itemSignup
];
}
elseif($context == 'producer') {
} elseif ($context == 'producer') {
$itemsMenu = [
$itemAdministration,
$itemProducers,

Loading…
取消
儲存