From 310ef22fd996a21642cc63b33829cc1f397269d7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 22 May 2008 07:29:54 -0400 Subject: abstract out RSS 1.0 generation to allow multiple streams darcs-hash:20080522112954-84dde-aa5087977298f5169148383e82e22241e613b1f2.gz --- lib/action.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index c346c7513..67eaf9ed7 100644 --- a/lib/action.php +++ b/lib/action.php @@ -46,4 +46,16 @@ class Action { // lawsuit $this->args[$k] = ($strip) ? stripslashes($v) : $v; } } + + function boolean($key, $def=false) { + $arg = $this->arg($key); + return (is_null($arg)) ? $def : + (strcasecmp($arg, 'true')) ? true : + (strcasecmp($arg, 'yes')) ? true : + (strcasecmp($arg, '1')) ? true : + (strcasecmp($arg, 'false')) ? false : + (strcasecmp($arg, 'no')) ? false : + (strcasecmp($arg, '0')) ? false : + $def; + } } -- cgit v1.2.3-54-g00ecf