Browse Source

Si producteur : lien vers son espace et l'administration

refactoring
Guillaume Bourgeois 5 years ago
parent
commit
ba61d366ba
2 changed files with 22 additions and 2 deletions
  1. +21
    -1
      frontend/views/layouts/main.php
  2. +1
    -1
      frontend/views/site/producers.php

+ 21
- 1
frontend/views/layouts/main.php View File

\common\assets\CommonAsset::register($this); \common\assets\CommonAsset::register($this);
\frontend\assets\AppAsset::register($this); \frontend\assets\AppAsset::register($this);


$producer = null ;
if(!Yii::$app->user->isGuest && Yii::$app->user->identity->id_producer > 0) {
$producer = Producer::searchOne(['id' => Yii::$app->user->identity->id_producer]) ;
}

?> ?>
<?php $this->beginPage() ?> <?php $this->beginPage() ?>
<!DOCTYPE html> <!DOCTYPE html>
'active' => $this->getControllerAction() == 'site/producers', 'active' => $this->getControllerAction() == 'site/producers',
'options' => ['id' => 'li-producteurs'] 'options' => ['id' => 'li-producteurs']
], ],
[
'label' => '<span class="glyphicon glyphicon-flag"></span> Le Chat des Noisettes',
'url' => '#',
'items' => [
[
'label' => '<span class="glyphicon glyphicon-th-large"></span> Mon espace',
'url' => Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index', 'slug_producer' => $producer ? $producer->slug : '']),
],
[
'label' => '<span class="glyphicon glyphicon-cog"></span> Administration',
'url' => Yii::$app->urlManagerBackend->createAbsoluteUrl(['site/index']),
]
],
'visible' => !Yii::$app->user->isGuest && $producer
],
[ [
'label' => '<span class="glyphicon glyphicon-log-in"></span> Connexion', 'label' => '<span class="glyphicon glyphicon-log-in"></span> Connexion',
'url' => Yii::$app->urlManager->createUrl(['site/login']), 'url' => Yii::$app->urlManager->createUrl(['site/login']),
'url' => '#', 'url' => '#',
'items' => [ 'items' => [
[ [
'label' => 'Profil',
'label' => '<span class="glyphicon glyphicon-user"></span> Profil',
'url' => Yii::$app->urlManager->createUrl(['user/update']), 'url' => Yii::$app->urlManager->createUrl(['user/update']),
], ],
[ [

+ 1
- 1
frontend/views/site/producers.php View File



?> ?>


<h1 class="title-system-order"><span class="glyphicon glyphicon-grain"></span>&nbsp;&nbsp;<?= Html::encode($this->title) ?></h1>
<h1 class="title-system-order"><span class="glyphicon glyphicon-search"></span>&nbsp;&nbsp;<?= Html::encode($this->title) ?></h1>


<?= <?=



Loading…
Cancel
Save