6 |
@@@: |
@@@: |
7 |
InterWiki - External WikiEngine URI Reference Support |
InterWiki - External WikiEngine URI Reference Support |
8 |
@@lang:en |
@@lang:en |
9 |
@License: %%GPL%% |
@License: %%Perl%% |
10 |
@Author: |
@Author: |
11 |
@@Name: |
@@Name: |
12 |
@@@@: Wakaba |
@@@@: Wakaba |
13 |
@@@lang:ja |
@@@lang:ja |
14 |
@@@script:Latn |
@@@script:Latn |
15 |
@@Mail[list]: w@suika.fam.cx |
@@Mail[list]: w@suika.fam.cx |
16 |
@Date.RCS: $Date$ |
@Date.RCS: |
17 |
|
$Date$ |
18 |
@RequiredModule[list]: |
@RequiredModule[list]: |
19 |
main |
main |
20 |
URI |
URI |
260 |
$c =~ s{$p->{wiki_namespace_delimiter}} |
$c =~ s{$p->{wiki_namespace_delimiter}} |
261 |
{$p->{filesystem_namespace_suffix}$p->{filesystem_namespace_delimiter}}g; |
{$p->{filesystem_namespace_suffix}$p->{filesystem_namespace_delimiter}}g; |
262 |
$p->{-result} .= $c . ($p->{filesystem_file_suffix} || '.txt'); |
$p->{-result} .= $c . ($p->{filesystem_file_suffix} || '.txt'); |
263 |
|
|
264 |
|
FormattingRule: |
265 |
|
@Category[list]: link-to-resource |
266 |
|
@Name: iwwe--wikiname |
267 |
|
@Description: |
268 |
|
@@@: Extracting WikiName from URI reference |
269 |
|
@@lang: en |
270 |
|
@Parameter: |
271 |
|
@@Name: charset |
272 |
|
@@Type: charset |
273 |
|
@@Default: (auto) |
274 |
|
@@Description: |
275 |
|
@@@: Charset in which WikiName written. |
276 |
|
@@lang: en |
277 |
|
@Formatting: |
278 |
|
if ($INTERWIKICORE->uri_has_feature |
279 |
|
(uri => $o->{link}->{dest}->{uri}, |
280 |
|
method => 'query')) { |
281 |
|
my $q = $o->{link}->{dest}->{uri}->query; |
282 |
|
my $page; |
283 |
|
my $charset; |
284 |
|
if ($q and index ($q, '=') > -1) { |
285 |
|
my %q = map {split /=/, $_, 2} split /[&;]/, $q; |
286 |
|
$page = $q{mypage}; |
287 |
|
$charset = lc ($q{_charset_} || $q{ie} || $p->{charset}) |
288 |
|
|| $o->{wiki}->{config}->{charset}->{uri_param}; |
289 |
|
} elsif (defined $q and length $q) { |
290 |
|
$page = $q; |
291 |
|
$charset = lc $p->{charset} |
292 |
|
|| $o->{wiki}->{config}->{charset}->{uri_query}; |
293 |
|
} |
294 |
|
if (defined $page) { |
295 |
|
$page =~ tr/+/ /; |
296 |
|
$page =~ s/%([0-9A-Fa-f][0-9A-Fa-f])/pack 'C', hex $1/ge; |
297 |
|
$page = &main::code_convert (\$page, $charset); |
298 |
|
$p->{-parent}->append_text ($page); |
299 |
|
} |
300 |
|
} |
301 |
|
|
302 |
|
|