X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=www%2Fplugins%2Fsaisies%2Fsaisies_options.php;fp=www%2Fplugins%2Fsaisies%2Fsaisies_options.php;h=c35bebe51f243345a3d350b1dcf882c8b13a7896;hb=c0f18416f529232b5555c6410a8765a5125ebcd3;hp=a64d7dcea7d6a48e3a3d5b826306cf96f4ada6b4;hpb=50522c53acc9e61a4a7de3a1890c4ba93e2f61b4;p=lhc%2Fweb%2Fwww.git diff --git a/www/plugins/saisies/saisies_options.php b/www/plugins/saisies/saisies_options.php index a64d7dce..c35bebe5 100644 --- a/www/plugins/saisies/saisies_options.php +++ b/www/plugins/saisies/saisies_options.php @@ -7,10 +7,11 @@ **/ // Sécurité -if (!defined('_ECRIRE_INC_VERSION')) return; - +if (!defined('_ECRIRE_INC_VERSION')) { + return; +} -if (!function_exists('_T_ou_typo')){ +if (!function_exists('_T_ou_typo')) { /** * une fonction qui regarde si $texte est une chaine de langue * de la forme <:qqch:> @@ -24,26 +25,26 @@ if (!function_exists('_T_ou_typo')){ * @return mixed * Retourne la valeur éventuellement modifiée. */ - function _T_ou_typo($valeur, $mode_typo='toujours') { + function _T_ou_typo($valeur, $mode_typo = 'toujours') { // Si la valeur est bien une chaine (et pas non plus un entier déguisé) - if (is_string($valeur) and !intval($valeur)){ + if (is_string($valeur) and !intval($valeur)) { // Si la chaine est du type <:truc:> on passe à _T() - if (preg_match('/^\<:(.*?):\>$/', $valeur, $match)) + if (preg_match('/^\<:(.*?):\>$/', $valeur, $match)) { $valeur = _T($match[1]); - // Sinon on la passe a typo() - else { - if (!in_array($mode_typo, array('toujours', 'multi', 'jamais'))) + } else { + // Sinon on la passe a typo() + if (!in_array($mode_typo, array('toujours', 'multi', 'jamais'))) { $mode_typo = 'toujours'; - - if ($mode_typo == 'toujours' or ($mode_typo == 'multi' and strpos($valeur, '') !== false)){ + } + + if ($mode_typo == 'toujours' or ($mode_typo == 'multi' and strpos($valeur, '') !== false)) { include_spip('inc/texte'); $valeur = typo($valeur); } } - } - // Si c'est un tableau, on reapplique la fonction récursivement - elseif (is_array($valeur)){ - foreach ($valeur as $cle => $valeur2){ + } elseif (is_array($valeur)) { + // Si c'est un tableau, on reapplique la fonction récursivement + foreach ($valeur as $cle => $valeur2) { $valeur[$cle] = _T_ou_typo($valeur2, $mode_typo); } } @@ -51,4 +52,3 @@ if (!function_exists('_T_ou_typo')){ return $valeur; } } -