Browse Source

Désactivation formulaire de contact Le Chat des Noisettes

master
Guillaume Bourgeois 1 year ago
parent
commit
f9f2ca8afe
2 changed files with 7 additions and 0 deletions
  1. +5
    -0
      producer/controllers/SiteController.php
  2. +2
    -0
      producer/views/layouts/main.php

+ 5
- 0
producer/controllers/SiteController.php View File

$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)) {

+ 2
- 0
producer/views/layouts/main.php View File

'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
], ],
], ],
]); ]);

Loading…
Cancel
Save