| 1 |
wakaba |
1.1 |
use strict; |
| 2 |
|
|
package SuikaWiki::Plugin::Registry; |
| 3 |
|
|
|
| 4 |
|
|
|
| 5 |
|
|
our %Info; |
| 6 |
|
|
$Info{q#WikiFormCommentInput#}->{Name} = q#WikiFormCommentInput#; |
| 7 |
|
|
$Info{q#WikiFormCommentInput#}->{q#Version#} = q#2004.0831.0328#; |
| 8 |
|
|
$Info{q#WikiFormCommentInput#}->{q#InterfaceVersion#} = q#2.9.1#; |
| 9 |
|
|
$Info{q#WikiFormCommentInput#}->{q#mkpluginVersion#} = q#2.1.19#; |
| 10 |
|
|
$Info{q#WikiFormCommentInput#}->{q#module_name#} = q#SuikaWiki::Plugin::plugin::WikiFormCommentInput10407310328074O6o#; |
| 11 |
|
|
$Info{q#WikiFormCommentInput#}->{q#Date.RCS#} = q#$Date: 2004/03/29 03:00:52 $#; |
| 12 |
|
|
$Info{q#WikiFormCommentInput#}->{RequiredModule} = [q#WikiFormCore#]; |
| 13 |
|
|
$Info{q#WikiFormCommentInput#}->{Description} = [[q#WikiFormCommentInput plugin module provides some WikiForm input |
| 14 |
|
|
forms and processing rules to provide WikiPage annotation form.#, q#en#, q##]]; |
| 15 |
|
|
$Info{q#WikiFormCommentInput#}->{License} = [[q#%%Perl%%#, q##, q##]]; |
| 16 |
|
|
$Info{q#WikiFormCommentInput#}->{Author} = [[[], [q##], [q##]]]; |
| 17 |
|
|
package SuikaWiki::Plugin::plugin::WikiFormCommentInput10407310328074O6o; |
| 18 |
|
|
|
| 19 |
|
|
|
| 20 |
|
|
#line 1 "(WikiPlugin module source comment.wp2, block Plugin/Use)" |
| 21 |
|
|
my $WIKIRESOURCE; |
| 22 |
|
|
#line 1 "(WikiPlugin module WikiFormCommentInput, chunk 1)" |
| 23 |
|
|
|
| 24 |
|
|
$SuikaWiki::Plugin::Rule{form_template}->{name} = {q#after#, sub {my ($f, $rule_name, $p, $o, %opt) = @_; |
| 25 |
|
|
|
| 26 |
|
|
#line 1 "(WikiPlugin module source comment.wp2, block FormattingRule[name()='[q#form-template#]/name']/After)" |
| 27 |
|
|
my $name = $o->{wiki}->{input}->parameter |
| 28 |
|
|
('wikiform__'.($p->{source} || 'name')); |
| 29 |
|
|
unless (length $name) { |
| 30 |
|
|
WHOLETREE: |
| 31 |
|
|
for (@{$o->{var}->{sw09__document_tree}->child_nodes}) { |
| 32 |
|
|
if ($_->node_type eq '#element' and $_->local_name eq 'head') { |
| 33 |
|
|
for (@{$_->child_nodes}) { |
| 34 |
|
|
if ($_->node_type eq '#element' and $_->local_name eq 'parameter') { |
| 35 |
|
|
if ($_->get_attribute_value ('name', default => '') eq |
| 36 |
|
|
'default-name') { |
| 37 |
|
|
for (@{$_->child_nodes}) { |
| 38 |
|
|
if ($_->node_type eq '#element' and |
| 39 |
|
|
$_->local_name eq 'value') { |
| 40 |
|
|
$name = $_->inner_text; |
| 41 |
|
|
last WHOLETREE; |
| 42 |
|
|
} |
| 43 |
|
|
} |
| 44 |
|
|
last WHOLETREE; |
| 45 |
|
|
} |
| 46 |
|
|
} |
| 47 |
|
|
} |
| 48 |
|
|
} |
| 49 |
|
|
} |
| 50 |
|
|
} |
| 51 |
|
|
unless (length $name) { |
| 52 |
|
|
$name = ($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))->get (name => 'WikiForm:WikiComment:DefaultName', |
| 53 |
|
|
o => $o, wiki => $o->{wiki}); |
| 54 |
|
|
} |
| 55 |
|
|
if ($name =~ />>\d/ or $name =~ /^\d+$/) { |
| 56 |
|
|
$p->{-result} .= $name; |
| 57 |
|
|
} else { |
| 58 |
|
|
$p->{-result} .= "[[$name]]"; |
| 59 |
|
|
}}, q#Parameter#, {q#source#, {q#Type#, q#ID#, q#Default#, q#"name"#, q#Description#, [[q#Input field name#, q#en#, q##]]}}, q#Description#, [[q#Inserting inputer "name" with SuikaWiki/0.9 emphasis and link. |
| 60 |
|
|
|
| 61 |
|
|
Note: This rule is provided for compatibility with SuikaWiki 2.#, q#en#, q##]]} |
| 62 |
|
|
#line 1 "(WikiPlugin module WikiFormCommentInput, chunk 2)" |
| 63 |
|
|
; |
| 64 |
|
|
|
| 65 |
|
|
$SuikaWiki::Plugin::Rule{form_template}->{date} = {q#after#, sub {my ($f, $rule_name, $p, $o, %opt) = @_; |
| 66 |
|
|
|
| 67 |
|
|
#line 1 "(WikiPlugin module source comment.wp2, block FormattingRule[name()='[q#form-template#]/date']/After)" |
| 68 |
|
|
my @time = gmtime (time); |
| 69 |
|
|
$p->{-result} .= sprintf '%04d-%02d-%02d %02d:%02d:%02d +00:00', |
| 70 |
|
|
$time[5]+1900,$time[4]+1,@time[3,2,1,0];}, q#Parameter#, {}, q#Description#, [[q#Current date and time. |
| 71 |
|
|
|
| 72 |
|
|
Note that this rule is provided for compatibility with SuikaWiki 2. |
| 73 |
|
|
This rule should be reimplemented.#, q#en#, q##]]} |
| 74 |
|
|
#line 1 "(WikiPlugin module WikiFormCommentInput, chunk 4)" |
| 75 |
|
|
; |
| 76 |
|
|
|
| 77 |
|
|
package SuikaWiki::Plugin::Resource; |
| 78 |
|
|
|
| 79 |
|
|
our $BaseResource; |
| 80 |
|
|
$BaseResource->{q#en#}->{q##}->{q#WikiForm:WikiComment:DefaultName#} = q#AnonymousCoward#; |
| 81 |
|
|
package SuikaWiki::Plugin::Registry; |
| 82 |
|
|
|
| 83 |
|
|
$Info{q#WikiFormCommentInput#}->{provide} = {q#rule#, {q#form_template#, [q#name#, q#date#]}}; |
| 84 |
|
|
|
| 85 |
|
|
1; |