Changeset 841


Ignore:
Timestamp:
Aug 24, 2006, 4:45:37 PM (15 years ago)
Author:
nick
Message:

Fix a typo, and support the node image for editing (but not yet display)

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Changes

    r840 r841  
    66        Moderation support (based on Wiki::Toolkit moderation)
    77        Four new config file options: moderation_requires_password,
    8           enabled_node_image, enable_common_categories, enable_common_locales
     8          enable_node_image, enable_common_categories, enable_common_locales
    99        Search::InvertedIndex support is deprecated as of this release.
    1010          Please upgrade to Plucene if you are still using it.
  • trunk/lib/OpenGuides.pm

    r836 r841  
    974974        wiki    => $wiki,
    975975        config  => $config,
    976     cgi_obj => $q
     976        cgi_obj => $q
    977977    );
    978978
  • trunk/lib/OpenGuides/Config.pm

    r840 r841  
    1414   centre_lat default_gmaps_zoom default_gmaps_search_zoom force_wgs84
    1515   licence_name licence_url licence_info_url moderation_requires_password
    16    enabled_node_image enable_common_categories enable_common_locales
     16   enable_node_image enable_common_categories enable_common_locales
    1717);
    1818my @questions = map { $_ . "__qu" } @variables;
     
    7070                     moderation_requires_password => 1,
    7171                     admin_pass => "Change This!",
    72                      enabled_node_image => 1,
     72                     enable_node_image => 1,
    7373                     enable_common_categories => 1,
    7474                     enable_common_locales => 1,
     
    139139        admin_pass => "Please specify a password for the site admin.",
    140140        stylesheet_url => "What's the URL of the site's stylesheet?",
    141         enabled_node_image => "Should nodes be allowed to have an externally hosted image?",
     141        enable_node_image => "Should nodes be allowed to have an externally hosted image?",
    142142        enable_common_categories => "Do you want a common list of categories shown on all node pages?",
    143143        enable_common_locales => "Do you want a common list of locales shown on all node pages?",
  • trunk/lib/OpenGuides/Template.pm

    r785 r841  
    320320        summary                => $summary,
    321321    );
     322
     323    my $node_image = $args{metadata} ? $metadata{node_image}[0]
     324                                     : $q->param("node_image");
     325    if ($config->enable_node_image && $node_image) {
     326        $vars{node_image} = $node_image;
     327    }
    322328
    323329    if (exists $metadata{source}) {
  • trunk/t/17_commit_node.t

    r797 r841  
    6868$q->param( -name => "username", -value => "bob" );
    6969$q->param( -name => "comment", -value => "foo" );
     70$q->param( -name => "node_image", -value => "image" );
    7071$q->param( -name => "edit_type", -value => "Minor tidying" );
    7172$ENV{REMOTE_ADDR} = "127.0.0.1";
  • trunk/templates/edit_form.tt

    r838 r841  
    5959          <legend>Metadata (optional)</legend>
    6060          <table summary="Form for entering metadata about the subject of this node">
     61[% IF config.enable_node_image %]
     62            <tr>
     63              <td class="label"><label for="node_image">Node Image:</label></td>
     64              <td><input type="text" size="50" id="node_image" name="node_image" value="[% node_image %]" /></td>
     65            </tr>
     66[% END %]
    6167            <tr>
    6268              <td class="label"><label for="phone">Phone:</label></td>
  • trunk/wiki.cgi

    r834 r841  
    265265        my %tt_vars = (
    266266            %tt_metadata_vars,
     267            config                 => $config,
    267268            content                => $q->escapeHTML($content),
    268269            preview_html           => $wiki->format($content),
    269270            preview_above_edit_box => get_cookie( "preview_above_edit_box" ),
    270271            checksum               => $q->escapeHTML($checksum)
    271     );
     272        );
    272273        process_template("edit_form.tt", $node, \%tt_vars);
    273274    } else {
    274275        my %node_data = $wiki->retrieve_node($node);
    275276        my %tt_vars = ( checksum       => $node_data{checksum},
     277                        config         => $config,
    276278                        new_content    => $content,
    277279                        stored_content => $node_data{content} );
     
    313315                    checksum        => $q->escapeHTML($checksum),
    314316                    %metadata_vars,
    315             username        => $username,
     317                    config          => $config,
     318                    username        => $username,
    316319                    edit_type       => $edit_type,
    317320                    deter_robots    => 1,
Note: See TracChangeset for help on using the changeset viewer.