mirror of
https://framagit.org/framasoft/framadate/framadate
synced 2026-07-26 19:23:51 +00:00
Refactor on choix_autre.php
* Utils::issetAndNoEmpty is now removed * Use Form object to store value from page to page
This commit is contained in:
parent
de04d47434
commit
46ea697cb6
5 changed files with 94 additions and 72 deletions
|
|
@ -13,7 +13,7 @@ class Choice
|
|||
*/
|
||||
private $slots;
|
||||
|
||||
public function __construct($name)
|
||||
public function __construct($name='')
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->slots = array();
|
||||
|
|
|
|||
|
|
@ -185,18 +185,19 @@ class Utils
|
|||
|
||||
/**
|
||||
* Fonction vérifiant l'existance et la valeur non vide d'une clé d'un tableau
|
||||
* @deprecated
|
||||
* @param string $name La clé à tester
|
||||
* @param array $tableau Le tableau où rechercher la clé ($_POST par défaut)
|
||||
* @return bool Vrai si la clé existe et renvoie une valeur non vide
|
||||
*/
|
||||
public static function issetAndNoEmpty($name, $tableau = null)
|
||||
/*public static function issetAndNoEmpty($name, $tableau = null)
|
||||
{
|
||||
if (is_null($tableau)) {
|
||||
$tableau = $_POST;
|
||||
}
|
||||
|
||||
return isset($tableau[$name]) && ! empty($tableau[$name]);
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Fonction permettant de générer les URL pour les sondage
|
||||
|
|
@ -258,4 +259,11 @@ class Utils
|
|||
}
|
||||
$connect->commit();
|
||||
}
|
||||
|
||||
public static function debug($object)
|
||||
{
|
||||
echo '<pre>';
|
||||
print_r($object);
|
||||
echo '</pre>';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue