$model = new ContactForm(); | $model = new ContactForm(); | ||||
$producer = $this->getProducerCurrent(); | $producer = $this->getProducerCurrent(); | ||||
// @TODO : à gérer avec les feature flag | |||||
if($producer->id == 1) { | |||||
return $this->redirect(['site/index']); | |||||
} | |||||
if ($model->load(\Yii::$app->request->post()) && $model->validate()) { | if ($model->load(\Yii::$app->request->post()) && $model->validate()) { | ||||
$isSent = false; | $isSent = false; | ||||
if ($producer->contact_email && strlen($producer->contact_email) > 0 && $model->sendEmail($producer)) { | if ($producer->contact_email && strlen($producer->contact_email) > 0 && $model->sendEmail($producer)) { |
'label' => '<span class="glyphicon glyphicon-envelope"></span> Contact', | 'label' => '<span class="glyphicon glyphicon-envelope"></span> Contact', | ||||
'url' => $this->getUrlManagerProducer()->createUrl(['site/contact']), | 'url' => $this->getUrlManagerProducer()->createUrl(['site/contact']), | ||||
'active' => $this->getControllerAction() == 'site/contact', | 'active' => $this->getControllerAction() == 'site/contact', | ||||
// @TODO : à gérer avec les feature flag | |||||
'visible' => $producer->id != 1 | |||||
], | ], | ||||
], | ], | ||||
]); | ]); |