Changeset 336

Show
Ignore:
Timestamp:
03/26/04 17:25:47 (5 years ago)
Author:
earle
Message:

Added language code to questions in Build.PL and TT vars in scripts.

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/Build.PL

    r312 r336  
    4949  type     => "y_n" 
    5050  }, 
    51 { question => "What's the URL of the wiki's stylesheet?", 
     51{ question => "What's the URL of the site's stylesheet?", 
    5252  variable => "stylesheet_url" 
    5353}, 
    54 { question => "What's the wiki called? (should be unique)", 
     54{ question => "What's the site called? (should be unique)", 
    5555  variable => "site_name", 
    56   default  => "OpenGuides Wiki" 
     56  default  => "My OpenGuides Site" 
    5757  }, 
    5858{ question => "Do you want the navigation bar included on the home page?", 
     
    6565  default  => "Home" 
    6666  }, 
    67 { question => "How would you describe the wiki?", 
     67{ question => "How would you describe the site?", 
    6868  variable => "site_desc", 
    69   default  => "Development site for openguides.org's software" 
    70   }, 
    71 { question => "What city is the wiki based in?", 
     69  default  => "A guide to [my city]" 
     70  }, 
     71{ question => "What city is the site based in?", 
    7272  variable => "default_city", 
    7373  default  => "London" 
    7474  }, 
    75 { question => "What country is the wiki based in?", 
     75{ question => "What country is the site based in?", 
    7676  variable => "default_country", 
    7777  default  => "United Kingdom" 
    7878  }, 
    79 { question => "Contact email address for the wiki admin?", 
     79{ question => "What language will the site be in? (Please give an ISO language code.)", 
     80  variable => "default_language", 
     81  default  => "en" 
     82  }, 
     83{ question => "Contact email address for the site administrator?", 
    8084  variable => "contact_email" 
    8185  }, 
     
    111115my @answers; 
    112116 
    113 # Database type is speshull - can be one of three. 
     117# It is an ancient Configurer, and he chooseth one of three.  
    114118my $dbtype; 
    115119my $dbtype_qu = "what type of database do you want the site to run on?  postgres/mysql/sqlite"; 
  • trunk/newpage.cgi

    r320 r336  
    1 #!/usr/bin/perl -w 
     1#!/usr/local/bin/perl 
     2 
     3use warnings; 
    24use strict; 
    35 
  • trunk/preferences.cgi

    r290 r336  
    1 #!/usr/bin/perl -w 
     1#!/usr/local/bin/perl -w 
    22 
    33use strict; 
    44use CGI; 
    5  
     5use lib '/home/earle/lib'; 
    66use Config::Tiny; 
    77use OpenGuides::CGI; 
     
    1313my $cgi = CGI->new(); 
    1414my $action = $cgi->param('action') || ''; 
     15my $language = $config->{_}->{default_language}; 
    1516 
    1617if ( $action eq "set_preferences" ) { 
     
    4344        template => "preferences.tt", 
    4445        cookies  => $cookie, 
    45         vars     => { not_editable           => 1, 
     46        vars     => { 
     47                      language               => $language, 
     48                      not_editable           => 1, 
    4649                      username               => $username, 
    4750                      include_geocache_link  => $gc_link, 
     
    6366        template => "preferences.tt", 
    6467        vars     => { %prefs, 
     68                      language     => $language, 
    6569                      not_editable => 1, 
    6670                      show_form    => 1 
  • trunk/wiki.cgi

    r328 r336  
    1 #!/usr/local/bin/perl -w 
     1#!/usr/local/bin/perl 
    22 
    33use strict; 
     
    3030# Read in configuration values from config file. 
    3131my $script_name = $config->{_}->{script_name}; 
    32 my $script_url = $config->{_}->{script_url}; 
     32my $script_url  = $config->{_}->{script_url}; 
     33my $language    = $config->{_}->{default_language}; 
    3334 
    3435# Ensure that script_url ends in a '/' - this is done in Build.PL but 
     
    4748 
    4849    # Note $q->param('keywords') gives you the entire param string. 
    49     # We need this because usemod has URLs like foo.com/wiki.pl?This_Page 
     50    # We need this to do URLs like foo.com/wiki.cgi?This_Page 
    5051    my $node = $q->param('id') || $q->param('title') || $q->param('keywords') || ""; 
    5152    $node = $formatter->node_param_to_node_name( $node ); 
     
    230231                            metadata => $node_data{metadata} ); 
    231232 
    232     %tt_vars = ( %tt_vars, 
     233    %tt_vars = ( 
     234                 %tt_vars, 
    233235                 %metadata_vars, 
    234236                 content       => $content, 
     
    237239                 version       => $node_data{version}, 
    238240                 node_name     => $q->escapeHTML($node), 
    239                  node_param    => $q->escape($node) ); 
     241                 node_param    => $q->escape($node), 
     242                 language      => $language, ); 
     243 
    240244 
    241245    # We've undef'ed $version above if this is the current version.