lib/TWiki/Form/Label.pm
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
permissions -rw-r--r--
RELEASE 4.2.0 freetown
     1 # See bottom of file for license and copyright details
     2 package TWiki::Form::Label;
     3 use base 'TWiki::Form::FieldDefinition';
     4 
     5 use strict;
     6 
     7 sub isEditable {
     8     return 0;
     9 }
    10 
    11 sub renderForEdit {
    12     my( $this, $web, $topic, $value ) = @_;
    13 
    14     # Changing labels through the URL is a feature for TWiki applications,
    15     # even though it's not accessible for standard edits. Some contribs
    16     # may want to override this to make labels editable.
    17     my $session = $this->{session};
    18     my $renderedValue = $session->renderer->getRenderedVersion
    19       ( $session->handleCommonTags( $value, $web, $topic ));
    20     return ( '',
    21              CGI::hidden( -name => $this->{name},
    22                           -value => $value )
    23                  . CGI::div( { class => 'twikiEditFormLabelField' },
    24                              $renderedValue ));
    25 }
    26 
    27 1;
    28 __DATA__
    29 
    30 Module of TWiki Enterprise Collaboration Platform, http://TWiki.org/
    31 
    32 Copyright (C) 2001-2007 TWiki Contributors. All Rights Reserved.
    33 TWiki Contributors are listed in the AUTHORS file in the root of
    34 this distribution. NOTE: Please extend that file, not this notice.
    35 
    36 This program is free software; you can redistribute it and/or
    37 modify it under the terms of the GNU General Public License
    38 as published by the Free Software Foundation; either version 2
    39 of the License, or (at your option) any later version. For
    40 more details read LICENSE in the root of this distribution.
    41 
    42 This program is distributed in the hope that it will be useful,
    43 but WITHOUT ANY WARRANTY; without even the implied warranty of
    44 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    45 
    46 As per the GPL, removal of this notice is prohibited.
    47