Show
Ignore:
Timestamp:
05/11/08 17:04:41 (4 years ago)
Author:
dom
Message:

fix much tab/whitespace damage; no functional changes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • wiki-toolkit/trunk/lib/Wiki/Toolkit.pm

    r424 r431  
    1515my $CAN_USE_ENCODE; 
    1616BEGIN { 
    17   eval " use Encode "; 
    18   $CAN_USE_ENCODE = $@ ? 0 : 1; 
    19 } 
    20  
     17    eval " use Encode "; 
     18    $CAN_USE_ENCODE = $@ ? 0 : 1; 
     19} 
    2120 
    2221=head1 NAME 
     
    4544 
    4645  my $wiki      = Wiki::Toolkit->new( store     => $store, 
    47                                   search    => $search ); 
     46                                      search    => $search ); 
    4847 
    4948  # Do all the CGI stuff. 
     
    5655      my $cooked = $wiki->format($raw); 
    5756      print_page(node    => $node, 
    58                 content => $cooked); 
     57                content => $cooked); 
    5958  } elsif ($action eq 'preview') { 
    6059      my $submitted_content = $q->param("content"); 
    6160      my $preview_html      = $wiki->format($submitted_content); 
    6261      print_editform(node    => $node, 
    63                      content => $submitted_content, 
    64                      preview => $preview_html); 
     62                     content => $submitted_content, 
     63                     preview => $preview_html); 
    6564  } elsif ($action eq 'commit') { 
    6665      my $submitted_content = $q->param("content"); 
     
    142141           . "of Wiki::Toolkit - the $obsolete_param parameter is no longer used. " 
    143142           . "Please read the documentation with 'perldoc Wiki::Toolkit'" 
    144           if $args{$obsolete_param}; 
     143            if $args{$obsolete_param}; 
    145144    } 
    146145 
     
    158157        my %config; 
    159158        foreach ( qw( extended_links implicit_links allowed_tags 
    160                     macros node_prefix ) ) { 
     159            macros node_prefix ) ) { 
    161160            $config{$_} = $args{$_} if defined $args{$_}; 
    162         } 
     161    } 
    163162        $self->{_formatter} = Wiki::Toolkit::Formatter::Default->new( %config ); 
    164163    } 
     
    219218    my ($self, @rawargs) = @_; 
    220219 
    221         my %args = scalar @rawargs == 1 ? ( name => $rawargs[0] ) : @rawargs; 
     220    my %args = scalar @rawargs == 1 ? ( name => $rawargs[0] ) : @rawargs; 
    222221 
    223222    my @plugins = $self->get_registered_plugins; 
     
    243242 
    244243    my $ret = $self->store->moderate_node( %args ); 
    245         if($ret == -1) { return $ret; } 
    246         return 1; 
     244    if($ret == -1) { return $ret; } 
     245    return 1; 
    247246} 
    248247 
     
    278277sub rename_node { 
    279278    my ($self, @argsarray) = @_; 
    280         my %args = @argsarray; 
    281         if((scalar @argsarray) == 2 || (scalar @argsarray) == 3) { 
    282                 # Missing keys 
    283                 %args = ( 
    284                         old_name => $argsarray[0], 
    285                         new_name => $argsarray[1], 
    286                         create_new_versions => $argsarray[2] 
    287                 ); 
    288         } 
     279    my %args = @argsarray; 
     280    if ((scalar @argsarray) == 2 || (scalar @argsarray) == 3) { 
     281        # Missing keys 
     282        %args = ( 
     283            old_name => $argsarray[0], 
     284            new_name => $argsarray[1], 
     285            create_new_versions => $argsarray[2] 
     286        ); 
     287    } 
    289288 
    290289    my @plugins = $self->get_registered_plugins; 
    291290    $args{plugins} = \@plugins if scalar @plugins; 
    292         $args{wiki} = $self; 
     291    $args{wiki} = $self; 
    293292 
    294293    my $ret = $self->store->rename_node( %args ); 
    295294 
    296         if($ret && $ret == -1) { return $ret; } 
    297         return 1; 
     295    if ($ret && $ret == -1) { 
     296        return $ret; 
     297    } 
     298    return 1; 
    298299} 
    299300 
     
    450451  my @nodes = $wiki->list_unmoderated_nodes(); 
    451452  my @nodes = $wiki->list_unmoderated_nodes( 
    452                                                                                                 only_where_latest => 1 
    453                                                                                         ); 
     453                                                only_where_latest => 1 
     454                                            ); 
    454455 
    455456  $nodes[0]->{'name'}              # The name of the node 
     
    502503 
    503504=item B<list_last_version_before> 
    504         List the last version of every node before a given date. 
    505         If no version existed before that date, will return undef for version. 
    506         Returns a hash of id, name, version and date 
    507  
    508         my @nv = $wiki->list_last_version_before('2007-01-02 10:34:11') 
    509         foreach my $data (@nv) { 
    510                  
    511         } 
     505    List the last version of every node before a given date. 
     506    If no version existed before that date, will return undef for version. 
     507    Returns a hash of id, name, version and date 
     508 
     509    my @nv = $wiki->list_last_version_before('2007-01-02 10:34:11') 
     510    foreach my $data (@nv) { 
     511         
     512    } 
    512513 
    513514=cut 
     
    515516sub list_last_version_before { 
    516517    my ($self,@argsarray) = @_; 
    517  
    518518    return $self->store->list_last_version_before(@argsarray); 
    519519} 
     
    557557 
    558558    # Return false if it doesn't exist 
    559     unless(%node) { return 0; } 
    560     unless($node{node_requires_moderation}) { return 0; } 
     559    unless(%node) { 
     560        return 0; 
     561    } 
     562    unless($node{node_requires_moderation}) { 
     563        return 0; 
     564    } 
    561565 
    562566    # Otherwise return the state of the flag 
     
    587591 
    588592    my @plugins = $self->get_registered_plugins; 
    589         my $plugins_ref = \@plugins if scalar @plugins; 
     593    my $plugins_ref = \@plugins if scalar @plugins; 
    590594 
    591595    return 1 unless $self->node_exists( $args{name} ); 
     
    604608        if ( $new_current_content ) { 
    605609            $search->index_node( $args{name}, $new_current_content ); 
    606         } 
     610        } 
    607611    } 
    608612 
     
    831835 
    832836    my %data = ( node     => $node, 
    833                 content  => $content, 
    834                 checksum => $checksum, 
    835                 metadata => $metadata, 
    836                 requires_moderation => $requires_moderation ); 
     837        content  => $content, 
     838        checksum => $checksum, 
     839        metadata => $metadata, 
     840        requires_moderation => $requires_moderation ); 
    837841    $data{links_to} = \@links_to if scalar @links_to; 
    838842    my @plugins = $self->get_registered_plugins; 
     
    841845    my $store = $self->store; 
    842846    my $ret = $store->check_and_write_node( %data ) or return 0; 
    843         if($ret == -1) { return -1; } 
     847    if($ret == -1) { 
     848        return -1; 
     849    } 
    844850 
    845851    my $search = $self->{_search}; 
     
    871877    # see http://rt.cpan.org/NoAuth/Bug.html?id=7014 
    872878    if ($CAN_USE_ENCODE) { 
    873       if (Encode::is_utf8($raw)) { 
    874         Encode::_utf8_on( $result ); 
    875       } 
     879        if (Encode::is_utf8($raw)) { 
     880            Encode::_utf8_on( $result ); 
     881        } 
    876882    } 
    877883