|
|
@@ -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, |