Ticket #18: rt15051.patch
| File rt15051.patch, 13.1 kB (added by IVORW@…, 3 years ago) |
|---|
-
Build.PL
old new 75 75 install_directory template_path custom_template_path script_url 76 76 custom_lib_path use_plucene indexing_directory enable_page_deletion 77 77 admin_pass stylesheet_url site_name navbar_on_home_page home_name 78 site_desc default_city default_country contact_email default_language 78 site_desc default_town default_city default_county default_state 79 default_country contact_email default_language 79 80 formatting_rules_node backlinks_in_title 80 81 ) ) { 81 82 my $q_method = $var . "__qu"; -
lib/OpenGuides/Config.pm
old new 8 8 dbtype dbname dbuser dbpass dbhost script_name install_directory script_url 9 9 custom_lib_path use_plucene indexing_directory enable_page_deletion 10 10 admin_pass stylesheet_url site_name navbar_on_home_page home_name 11 site_desc default_ city default_country contact_email default_language12 formatting_rules_node formatting_rules_link backlinks_in_title template_path custom_template_path13 geo_handler ellipsoid11 site_desc default_town default_city default_county default_state default_country 12 contact_email default_language formatting_rules_node formatting_rules_link 13 backlinks_in_title template_path custom_template_path geo_handler ellipsoid 14 14 ); 15 15 my @questions = map { $_ . "__qu" } @variables; 16 16 OpenGuides::Config->mk_accessors( @variables ); … … 69 69 navbar_on_home_page => 1, 70 70 home_name => "Home", 71 71 site_desc => "A default configuration of OpenGuides", 72 default_town => "", 72 73 default_city => "", 74 default_county => "", 75 default_state => "", 73 76 default_country => "", 74 77 default_language => "en", 75 78 formatting_rules_node => "Text Formatting Examples", … … 126 129 navbar_on_home_page => "Do you want the navigation bar included on the home page?", 127 130 home_name => "What should the home page of the wiki be called?", 128 131 site_desc => "How would you describe the site?", 129 default_city => "What city is the site based in?", 130 default_country => "What country is the site based in?", 132 default_town => "The following 5 questions about the location of your guide will take the responses: NONE - not applicable for this guide, blank - users can enter metadata for individual pages, A value e.g. London to force the same value for the whole guide. Town: ", 133 default_city => "City: ", 134 default_county => "County: ", 135 default_state => "State: ", 136 default_country => "Country: ", 131 137 contact_email => "Contact email address for the site administrator?", 132 138 default_language => "What language will the site be in? (Please give an ISO language code.)", 133 139 formatting_rules_node => "What's the name of the node or page to use for the text formatting rules link (this is by default an external document, but if you make formatting_rules_link empty, it will be a wiki node instead", -
lib/OpenGuides/RDF.pm
old new 47 47 $node_url; 48 48 }; 49 49 $self->{site_name} = $config->site_name; 50 $self->{default_town} = $config->default_town || ""; 50 51 $self->{default_city} = $config->default_city || ""; 52 $self->{default_county} = $config->default_county || ""; 53 $self->{default_state} = $config->default_state || ""; 51 54 $self->{default_country} = $config->default_country || ""; 52 55 $self->{site_description} = $config->site_desc || ""; 53 56 $self->{site_version} = OpenGuides->VERSION; 54 57 $self; 55 58 } 56 59 … … 67 70 my $opening_hours_text = $node_data{metadata}{opening_hours_text}[0] || ''; 68 71 my $address = $node_data{metadata}{address}[0] || ''; 69 72 my $postcode = $node_data{metadata}{postcode}[0] || ''; 73 my $town = $node_data{metadata}{town}[0] || $self->{default_town}; 70 74 my $city = $node_data{metadata}{city}[0] || $self->{default_city}; 75 my $county = $node_data{metadata}{county}[0] || $self->{default_county}; 76 my $state = $node_data{metadata}{state}[0] || $self->{default_state}; 71 77 my $country = $node_data{metadata}{country}[0] || $self->{default_country}; 72 78 my $latitude = $node_data{metadata}{latitude}[0] || ''; 73 79 my $longitude = $node_data{metadata}{longitude}[0] || ''; 74 80 my $version = $node_data{version}; 81 my $site_version = $self->{site_version}; 75 82 my $username = $node_data{metadata}{username}[0] || ''; 76 83 my $os_x = $node_data{metadata}{os_x}[0] || ''; 77 84 my $os_y = $node_data{metadata}{os_y}[0] || ''; … … 81 88 82 89 # replace any errant characters in data to prevent illegal XML 83 90 foreach ($phone, $fax, $website, $opening_hours_text, $address, $postcode, 84 $ city, $country, $latitude, $longitude, $version, $os_x, $os_y,85 @categories, @locales, $summary)91 $town, $city, $county, $state, $country, $latitude, $longitude, 92 $version, $os_x, $os_y, @categories, @locales, $summary) 86 93 { 87 94 if ($_) 88 95 { … … 150 157 { 151 158 $rdf .= "\n <!-- address and geospatial data -->\n\n"; 152 159 $rdf .= " <address>$address</address>\n" if $address; 160 $rdf .= " <town>$town</town>\n" if $town; 153 161 $rdf .= " <city>$city</city>\n" if $city; 162 $rdf .= " <county>$county</county>\n" if $county; 163 $rdf .= " <state>$state</state>\n" if $state; 154 164 $rdf .= " <postalCode>$postcode</postalCode>\n" if $postcode; 155 165 $rdf .= " <country>$country</country>\n" if $country; 156 166 -
lib/OpenGuides/Template.pm
old new 113 113 114 114 my $script_name = $config->script_name; 115 115 my $script_url = $config->script_url; 116 my $default_town = $config->default_town; 116 117 my $default_city = $config->default_city; 118 my $default_county = $config->default_county; 119 my $default_state = $config->default_state; 120 my $default_country = $config->default_country; 117 121 118 122 # Check cookie to see if we need to set the formatting_rules_link. 119 123 my ($formatting_rules_link, $omit_help_links); … … 152 156 openguides_version => $OpenGuides::VERSION, 153 157 enable_page_deletion => $enable_page_deletion, 154 158 language => $config->default_language, 159 default_town => $default_town, 155 160 default_city => $default_city, 161 default_county => $default_county, 162 default_state => $default_state, 163 default_country => $default_country, 156 164 }; 157 165 158 166 if ($args{node}) { -
templates/display_metadata.tt
old new 19 19 [% IF address %] 20 20 <li class="address"> 21 21 <span class="metadata_label">Address:</span> 22 [% CGI.escapeHTML(address) %]<!--, [% default_city %] --> [%# uncomment at left to show city %] 22 [% CGI.escapeHTML(address) %], 23 [% IF town %] 24 [% CGI.escapeHTML(town) %], 25 [% END %] 26 [% IF city %] 27 [% CGI.escapeHTML(city) %], 28 [% END %] 29 [% IF county %] 30 [% CGI.escapeHTML(county) %], 31 [% END %] 32 [% IF state %] 33 [% CGI.escapeHTML(state) %], 34 [% END %] 35 [% IF country %] 36 [% CGI.escapeHTML(country) %], 37 [% END %] 23 38 [% IF map_link %] 24 39 <a href="[% map_link %]">(map of this place)</a> 25 40 [% END %] -
templates/edit_conflict.tt
old new 67 67 <td>[% CGI.escapeHTML(new_hours_text) %]</td> 68 68 </tr> 69 69 <tr> 70 <td class="label"><label for="address"> Address:</label></td>70 <td class="label"><label for="address">Street:</label></td> 71 71 <td><input type="text" size="50" id="address" name="address" value="[% stored_address %]"></td> 72 72 <td>[% CGI.escapeHTML(new_address) %]</td> 73 73 </tr> 74 74 <tr> 75 <td class="label"><label for="town">Town:</label></td> 76 <td><input type="text" size="50" name="town" value="[% stored_town %]"></td> 77 <td>[% CGI.escapeHTML(new_town) %]</td> 78 </tr> 79 <tr> 80 <td class="label"><label for="city">City:</label></td> 81 <td><input type="text" size="50" name="city" value="[% stored_city %]"></td> 82 <td>[% CGI.escapeHTML(new_city) %]</td> 83 </tr> 84 <tr> 85 <td class="label"><label for="county">County:</label></td> 86 <td><input type="text" size="50" name="county" value="[% stored_county %]"></td> 87 <td>[% CGI.escapeHTML(new_county) %]</td> 88 </tr> 89 <tr> 90 <td class="label"><label for="state">State:</label></td> 91 <td><input type="text" size="50" name="state" value="[% stored_state %]"></td> 92 <td>[% CGI.escapeHTML(new_state) %]</td> 93 </tr> 94 <tr> 95 <td class="label"><label for="country">Country:</label></td> 96 <td><input type="text" size="50" name="country" value="[% stored_country %]"></td> 97 <td>[% CGI.escapeHTML(new_country) %]</td> 98 </tr> 99 <tr> 75 100 <td class="label"><label for="postcode">Postcode:</label></td> 76 101 <td><input type="text" size="50" id="postcode" name="postcode" value="[% stored_postcode %]"></td> 77 102 <td>[% CGI.escapeHTML(new_postcode) %]</td> -
templates/edit_form.tt
old new 1 [% USE CGI %] 1 2 [% INCLUDE header.tt page_title = "Edit $node_name - $site_name" %] 2 3 <div id="content"> 3 4 … … 81 82 <td><input type="text" size="50" id="hours" name="hours_text" value="[% hours_text %]" /></td> 82 83 </tr> 83 84 <tr> 84 <td class="label"><label for="address"> Address:</label></td>85 <td class="label"><label for="address">Street:</label></td> 85 86 <td><input type="text" size="50" id="address" name="address" value="[% address %]" /></td> 86 87 </tr> 88 [% IF default_town != "NONE" %] 89 <tr> 90 <td class="label"><label for="town">Town:</label></td> 91 [% IF default_town %] 92 <td><input type="checkbox" name="town" value="[% default_town %]" checked /> 93 [% CGI.escapeHTML(default_town) %]</td> 94 [% ELSE %] 95 <td><input type="text" size="50" name="town" value="[% town %]" /></td> 96 [% END %] 97 </tr> 98 [% END %] 99 [% IF default_city != "NONE" %] 100 <tr> 101 <td class="label"><label for="city">City:</label></td> 102 [% IF default_city %] 103 <td><input type="checkbox" name="city" value="[% default_city %]" checked /> 104 [% CGI.escapeHTML(default_city) %]</td> 105 [% ELSE %] 106 <td><input type="text" size="50" name="city" value="[% city %]" /></td> 107 [% END %] 108 </tr> 109 [% END %] 110 [% IF default_county != "NONE" %] 111 <tr> 112 <td class="label"><label for="county">County:</label></td> 113 [% IF default_county %] 114 <td><input type="checkbox" name="county" value="[% default_county %]" checked /> 115 [% CGI.escapeHTML(default_county) %]</td> 116 [% ELSE %] 117 <td><input type="text" size="50" name="county" value="[% county %]" /></td> 118 [% END %] 119 </tr> 120 [% END %] 121 [% IF default_state != "NONE" %] 122 <tr> 123 <td class="label"><label for="state">State:</label></td> 124 [% IF default_state %] 125 <td><input type="checkbox" name="state" value="[% default_state %]" checked /> 126 [% CGI.escapeHTML(default_state) %]</td> 127 [% ELSE %] 128 <td><input type="text" size="50" name="state" value="[% state %]" /></td> 129 [% END %] 130 </tr> 131 [% END %] 132 [% IF default_country != "NONE" %] 133 <tr> 134 <td class="label"><label for="country">Country:</label></td> 135 [% IF default_country %] 136 <td><input type="checkbox" name="country" value="[% default_country %]" checked /> 137 [% CGI.escapeHTML(default_country) %]</td> 138 [% ELSE %] 139 <td><input type="text" size="50" name="country" value="[% country %]" /></td> 140 [% END %] 141 </tr> 142 [% END %] 87 143 <tr> 88 144 <td class="label"><label for="postcode">Postcode:</label></td> 89 145 <td><input type="text" size="50" id="postcode" name="postcode" value="[% postcode %]" /></td>
