Overview
Comment:Cohérence du retour des fonctions des filtres de squelettes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 302a336a7c654477fc0e6ec65f8742a3cc15a2aa
User & Date: bohwaz on 2019-10-09 11:30:46
Other Links: manifest | tags
Context
2019-10-10
17:33
Correction procédure mise à jour pour tenir compte des versions récentes de SQLite qui changent le comportement lors de la mise à jour d'une table liée à des clés étrangères check-in: 23a0bc4602 user: bohwaz tags: trunk, stable, 0.9.4
2019-10-09
11:30
Cohérence du retour des fonctions des filtres de squelettes check-in: 302a336a7c user: bohwaz tags: trunk
2019-10-06
21:40
Correctif: édition de squelette vide check-in: 22c5cdcd73 user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Squelette_Filtres.php from [a2925f4fde] to [719077c361].

209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
    }

    // Compatibilité SPIP

    static public function egal_a($value, $test)
    {
        if ($value == $test)
            return true;
        else
            return false;
    }

    static public function different_de($value, $test)
    {
        if ($value != $test)
            return true;
        else
            return false;
    }

    // disponible aussi avec : | ?{sioui, sinon}
    static public function choixsivide($value, $un, $deux = '')
    {







|







|







209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
    }

    // Compatibilité SPIP

    static public function egal_a($value, $test)
    {
        if ($value == $test)
            return $value;
        else
            return false;
    }

    static public function different_de($value, $test)
    {
        if ($value != $test)
            return $value;
        else
            return false;
    }

    // disponible aussi avec : | ?{sioui, sinon}
    static public function choixsivide($value, $un, $deux = '')
    {
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
    static public function date_w3c($date)
    {
        return date(DATE_W3C, $date);
    }

    static public function et($value, $test)
    {
        return ($value && $test);
    }

    static public function ou($value, $test)
    {
        return ($value || $test);
    }

    static public function xou($value, $test)
    {
        return ($value XOR $test);
    }

    static public function oui($value)
    {
        return $value ? true : false;
    }

    static public function non($value)
    {
        return !$value ? true : false;
    }

    static public function superieur_a($value, $test)
    {
        return ($value > $test) ? true : false;
    }

    static public function superieur_ou_egal_a($value, $test)
    {
        return ($value >= $test) ? true : false;
    }

    static public function inferieur_a($value, $test)
    {
        return ($value < $test) ? true : false;
    }

    static public function inferieur_ou_egal_a($value, $test)
    {
        return ($value <= $test) ? true : false;
    }

    static public function euros($value)
    {
        return str_replace(' ', '&nbsp;', number_format($value, (round($value) == round($value, 2) ? 0 : 2), ',', ' ')) . '&nbsp;€';
    }

    static public function taille_en_octets($value)
    {
        return Utils::format_bytes($value);
    }
}







|




|




|




|




|




|




|




|




|












327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
    static public function date_w3c($date)
    {
        return date(DATE_W3C, $date);
    }

    static public function et($value, $test)
    {
        return ($value && $test) ? $value : false;
    }

    static public function ou($value, $test)
    {
        return ($value || $test) ? $value : false;
    }

    static public function xou($value, $test)
    {
        return ($value XOR $test) ? $value : false;
    }

    static public function oui($value)
    {
        return $value ? ' ' : false;
    }

    static public function non($value)
    {
        return !$value ? ' ' : false;
    }

    static public function superieur_a($value, $test)
    {
        return ($value > $test) ? $value : false;
    }

    static public function superieur_ou_egal_a($value, $test)
    {
        return ($value >= $test) ? $value : false;
    }

    static public function inferieur_a($value, $test)
    {
        return ($value < $test) ? $value : false;
    }

    static public function inferieur_ou_egal_a($value, $test)
    {
        return ($value <= $test) ? $value : false;
    }

    static public function euros($value)
    {
        return str_replace(' ', '&nbsp;', number_format($value, (round($value) == round($value, 2) ? 0 : 2), ',', ' ')) . '&nbsp;€';
    }

    static public function taille_en_octets($value)
    {
        return Utils::format_bytes($value);
    }
}