1
# See bottom of file for license and copyright information
3
package Foswiki::Configure::Types::BOOLEAN;
7
use Foswiki::Configure::Type;
9
use base 'Foswiki::Configure::Type';
12
my ( $this, $id, $opts, $value ) = @_;
15
-checked => ( $value ? 1 : 0 ),
22
my ( $this, $val ) = @_;
23
return ( $val ? 1 : 0 );
27
my ( $this, $val, $def ) = @_;
29
return ( ( $val && $def ) || ( !$val && !$def ) );
35
# Foswiki - The Free and Open Source Wiki, http://foswiki.org/
37
# Copyright (C) 2008 Foswiki Contributors. All Rights Reserved.
38
# Foswiki Contributors are listed in the AUTHORS file in the root
39
# of this distribution. NOTE: Please extend that file, not this notice.
41
# Additional copyrights apply to some or all of the code in this
44
# Copyright (C) 2000-2006 TWiki Contributors. All Rights Reserved.
45
# TWiki Contributors are listed in the AUTHORS file in the root
46
# of this distribution. NOTE: Please extend that file, not this notice.
48
# This program is free software; you can redistribute it and/or
49
# modify it under the terms of the GNU General Public License
50
# as published by the Free Software Foundation; either version 2
51
# of the License, or (at your option) any later version. For
52
# more details read LICENSE in the root of this distribution.
54
# This program is distributed in the hope that it will be useful,
55
# but WITHOUT ANY WARRANTY; without even the implied warranty of
56
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
58
# As per the GPL, removal of this notice is prohibited.