Beispiel #1
0
 /**
  * MODULE : Configuration de la redirection
  */
 public function index()
 {
     if ($this->getPost('submit')) {
         $this->setData($this->getUrl(1), 'url', $this->getPost('url', helpers::URL));
         $this->saveData();
         $this->setNotification('Configuration du module enregistrée avec succès !');
         helpers::redirect($this->getUrl());
     }
     self::$content = template::openForm() . template::openRow() . template::text('url', ['label' => 'URL de redirection', 'value' => $this->getData($this->getUrl(1), 'url')]) . template::newRow() . template::button('back', ['value' => 'Retour', 'href' => '?edit/' . $this->getUrl(1), 'col' => 2]) . template::submit('submit', ['col' => 2, 'offset' => 8]) . template::closeRow() . template::closeForm();
 }
Beispiel #2
0
 /** MODULE : Configuration de la redirection*/
 public function index()
 {
     // Traitement du formulaire
     if ($this->getPost('submit')) {
         // Modifie l'URL de redirection
         $this->setData([$this->getUrl(0), 'url', $this->getPost('url', helper::URL)]);
         // Enregistre les données
         $this->saveData();
         // Notification de succès
         $this->setNotification('URL de redirection enregistrée avec succès !');
         // Redirige vers l'URL courante
         helper::redirect($this->getUrl());
     }
     // Contenu de la page
     self::$content = template::openForm() . template::openRow() . template::text('url', ['label' => 'URL de redirection', 'value' => $this->getData([$this->getUrl(0), 'url'])]) . template::newRow() . template::button('back', ['value' => 'Retour', 'href' => helper::baseUrl() . 'edit/' . $this->getUrl(0), 'col' => 2]) . template::submit('submit', ['col' => 2, 'offset' => 8]) . template::closeRow() . template::closeForm();
 }