Changeset 821 for trunk/wiki.cgi

Show
Ignore:
Timestamp:
07/27/06 17:27:54 (2 years ago)
Author:
nick
Message:

Add the page to list nodes needing moderation

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wiki.cgi

    r810 r821  
    6666    } elsif ($action eq 'show_wanted_pages') { 
    6767        show_wanted_pages(); 
     68    } elsif ($action eq 'show_needing_moderation') { 
     69        show_needing_moderation(); 
    6870    } elsif ($action eq 'index') { 
    6971        $guide->show_index( 
     
    8183                                      metres => $q->param("distance_in_metres") 
    8284                                    ); 
     85    } elsif ( $action eq 'admin' ) { 
     86        $guide->display_admin_interface(); 
     87    } elsif ( $action eq 'set_moderation' ) { 
     88        $guide->set_node_moderation( 
     89                             id       => $node, 
     90                             password => $q->param("password") || "", 
     91                             moderation_flag => $q->param("moderation_flat") || "", 
     92                           ); 
     93    } elsif ( $action eq 'moderate' ) { 
     94        $guide->moderate_node( 
     95                             id       => $node, 
     96                             version  => $q->param("version") || "", 
     97                             password => $q->param("password") || "", 
     98                           ); 
    8399    } elsif ( $action eq 'delete' 
    84100              and ( lc($config->enable_page_deletion) eq "y" 
     
    367383} 
    368384 
     385sub show_needing_moderation { 
     386    my @nodes = $wiki->list_unmoderated_nodes; 
     387 
     388    # Build the moderate link 
     389    foreach my $node (@nodes) { 
     390        my $node_param = 
     391            uri_escape($formatter->node_name_to_node_param($node->{'name'})); 
     392        $node->{'moderate_url'} = $script_url . "?action=moderate&id=".$node_param."&version=".$node->{'version'}; 
     393        $node->{'diff_url'} = $script_url . "?id=".$node_param."&version=".$node->{'moderated_version'}."&diffversion=".$node->{'version'}; 
     394    } 
     395 
     396    process_template( "needing_moderation.tt", 
     397                      "", 
     398                      { not_editable  => 1, 
     399                        not_deletable => 1, 
     400                        deter_robots  => 1, 
     401                        nodes        => \@nodes } ); 
     402}