~kosova/+junk/tuxfamily-twiki

« back to all changes in this revision

Viewing changes to foswiki/lib/Foswiki/Configure/Pluggable.pm

  • Committer: James Michael DuPont
  • Date: 2009-07-18 19:58:49 UTC
  • Revision ID: jamesmikedupont@gmail.com-20090718195849-vgbmaht2ys791uo2
added foswiki

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# See bottom of file for license and copyright information
 
2
 
 
3
#
 
4
# A placeholder in a configuration representing a pluggable UI block.
 
5
# A pluggable block has special semantics, may have a special UI which
 
6
# may override the behaviors of a standard item. Normally pluggables
 
7
# are sections, containing values and other sections. If this isn't
 
8
# appropriate, you will have to implement a new visit() function for
 
9
# saving configuration data.
 
10
package Foswiki::Configure::Pluggable;
 
11
 
 
12
use strict;
 
13
 
 
14
use Foswiki::Configure::Section;
 
15
 
 
16
use base 'Foswiki::Configure::Section';
 
17
 
 
18
sub load {
 
19
    my ($name) = @_;
 
20
 
 
21
    my $modelName = 'Foswiki::Configure::' . $name;
 
22
    eval "use $modelName";
 
23
    Carp::confess $@ if $@;
 
24
 
 
25
    no strict 'refs';
 
26
    my $model = $modelName->new();
 
27
    use strict 'refs';
 
28
 
 
29
    return $model;
 
30
}
 
31
 
 
32
1;
 
33
__DATA__
 
34
#
 
35
# Foswiki - The Free and Open Source Wiki, http://foswiki.org/
 
36
#
 
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.
 
40
#
 
41
# Additional copyrights apply to some or all of the code in this
 
42
# file as follows:
 
43
#
 
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.
 
47
#
 
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.
 
53
#
 
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.
 
57
#
 
58
# As per the GPL, removal of this notice is prohibited.