| 1 |
wakaba |
1.1 |
#?SuikaWikiConfig/2.0 |
| 2 |
|
|
|
| 3 |
|
|
Plugin: |
| 4 |
|
|
@Name: WikiFormCommentInput |
| 5 |
|
|
@FullName: |
| 6 |
|
|
WikiForm: Annotation |
| 7 |
|
|
@Description: |
| 8 |
|
|
@@@: |
| 9 |
|
|
WikiFormCommentInput plugin module provides some WikiForm input |
| 10 |
|
|
forms and processing rules to provide WikiPage annotation form. |
| 11 |
|
|
@@lang: en |
| 12 |
wakaba |
1.2 |
@License: %%Perl%% |
| 13 |
wakaba |
1.1 |
@Author[list]: |
| 14 |
|
|
Wakaba <[email protected]> |
| 15 |
wakaba |
1.2 |
@Date.RCS: |
| 16 |
|
|
$Date: 2004/02/01 12:08:07 $ |
| 17 |
wakaba |
1.1 |
@RequiredModule[list]: |
| 18 |
|
|
WikiFormCore |
| 19 |
|
|
@Use: |
| 20 |
|
|
my $WIKIRESOURCE; |
| 21 |
|
|
|
| 22 |
|
|
PluginConst: |
| 23 |
|
|
@NS_XHTML1: |
| 24 |
|
|
http://www.w3.org/1999/xhtml |
| 25 |
|
|
@WIKIRESOURCE: |
| 26 |
|
|
{($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))} |
| 27 |
|
|
|
| 28 |
|
|
|
| 29 |
|
|
FormattingRule: |
| 30 |
|
|
@Category[list]: form-template |
| 31 |
|
|
@Name: name |
| 32 |
|
|
@Description: |
| 33 |
|
|
@@@: |
| 34 |
|
|
Inserting inputer "name" with SuikaWiki/0.9 emphasis and link. |
| 35 |
|
|
\ |
| 36 |
|
|
Note: This rule is provided for compatibility with SuikaWiki 2. |
| 37 |
|
|
@@lang: en |
| 38 |
|
|
@Parameter: |
| 39 |
|
|
@@Name: source |
| 40 |
|
|
@@Type: ID |
| 41 |
|
|
@@Default: "name" |
| 42 |
|
|
@@Description: |
| 43 |
|
|
@@@@: Input field name |
| 44 |
|
|
@@@lang: en |
| 45 |
|
|
@After: |
| 46 |
|
|
my $name = $o->{wiki}->{input}->parameter |
| 47 |
|
|
('wikiform__'.($p->{source} || 'name')); |
| 48 |
|
|
unless (length $name) { |
| 49 |
|
|
WHOLETREE: |
| 50 |
|
|
for (@{$o->{var}->{sw09__document_tree}->child_nodes}) { |
| 51 |
|
|
if ($_->node_type eq '#element' and $_->local_name eq 'head') { |
| 52 |
|
|
for (@{$_->child_nodes}) { |
| 53 |
|
|
if ($_->node_type eq '#element' and $_->local_name eq 'parameter') { |
| 54 |
|
|
if ($_->get_attribute_value ('name', default => '') eq |
| 55 |
|
|
'default-name') { |
| 56 |
|
|
for (@{$_->child_nodes}) { |
| 57 |
|
|
if ($_->node_type eq '#element' and |
| 58 |
|
|
$_->local_name eq 'value') { |
| 59 |
|
|
$name = $_->inner_text; |
| 60 |
|
|
last WHOLETREE; |
| 61 |
|
|
} |
| 62 |
|
|
} |
| 63 |
|
|
last WHOLETREE; |
| 64 |
|
|
} |
| 65 |
|
|
} |
| 66 |
|
|
} |
| 67 |
|
|
} |
| 68 |
|
|
} |
| 69 |
|
|
} |
| 70 |
|
|
unless (length $name) { |
| 71 |
|
|
$name = $WIKIRESOURCE->get (name => 'WikiForm:WikiComment:DefaultName', |
| 72 |
|
|
o => $o, wiki => $o->{wiki}); |
| 73 |
|
|
} |
| 74 |
|
|
|
| 75 |
|
|
if ($name =~ />>\d/ or $name =~ /^\d+$/) { |
| 76 |
|
|
$p->{-result} .= $name; |
| 77 |
|
|
} else { |
| 78 |
|
|
$p->{-result} .= "[[$name]]"; |
| 79 |
|
|
} |
| 80 |
|
|
|
| 81 |
|
|
FormattingRule: |
| 82 |
|
|
@Category[list]: form-template |
| 83 |
|
|
@Name: date |
| 84 |
|
|
@Description: |
| 85 |
|
|
@@@: |
| 86 |
|
|
Current date and time. |
| 87 |
|
|
\ |
| 88 |
|
|
Note that this rule is provided for compatibility with SuikaWiki 2. |
| 89 |
|
|
This rule should be reimplemented. |
| 90 |
|
|
@@lang: en |
| 91 |
|
|
@After: |
| 92 |
|
|
my @time = gmtime (time); |
| 93 |
|
|
$p->{-result} .= sprintf '%04d-%02d-%02d %02d:%02d:%02d +00:00', |
| 94 |
|
|
$time[5]+1900,$time[4]+1,@time[3,2,1,0]; |
| 95 |
|
|
|
| 96 |
|
|
Resource: |
| 97 |
|
|
@WikiForm:WikiComment:DefaultName: |
| 98 |
|
|
@@@: AnonymousCoward |
| 99 |
|
|
@@lang: en |
| 100 |
|
|
|
| 101 |
|
|
|