/[pub]/suikawiki/script/misc/plugins/calender.wp2
Suika

Contents of /suikawiki/script/misc/plugins/calender.wp2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Wed Feb 18 07:22:11 2004 UTC (22 years, 5 months ago) by wakaba
Branch: MAIN
Changes since 1.1: +2 -2 lines
WikiDB error reporting bug fixed

1 wakaba 1.1 #?SuikaWikiConfig/2.0
2    
3     Plugin:
4     @Name: Calender
5     @Description:
6     @@@: Calender
7     @@lang:en
8 wakaba 1.2 @License: %%Perl%%
9 wakaba 1.1 @Author:
10     @@Name:
11     @@@@: Wakaba
12     @@@lang:ja
13     @@@script:Latn
14     @@Mail[list]: [email protected]
15     @Date.RCS:
16 wakaba 1.2 $Date: 2004/02/14 10:50:07 $
17 wakaba 1.1 @RequiredPlugin[list]:
18     Phrase
19     WikiResource
20     WikiStructure
21     WikiLinking
22     @Use:
23     my $WIKILINKING;
24     my $WIKIRESOURCE;
25    
26     PluginConst:
27     @NS_XHTML1:
28     http://www.w3.org/1999/xhtml
29     @WIKILINKING:
30     {($WIKILINKING ||= SuikaWiki::Plugin->module_package ('WikiLinking'))}
31     @WIKIRESOURCE:
32     {($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))}
33    
34     FormattingRule:
35     @Category[list]:
36     view
37     view-resource
38     form-input
39     @Name: if-calender
40     @Description:
41     @@@: Test whether the WikiPage is part of calender or not
42     @@lang: en
43     @Parameter:
44     @@Name: day
45     @@Type: CDATA
46     @@Default: (none)
47     @@Description:
48     @@@@:
49     Template to be evaluated when it is part of calender and has
50     "day" information.
51     @@@lang: en
52     @Parameter:
53     @@Name: false
54     @@Type: CDATA
55     @@Default: (none)
56     @@Description:
57     @@@@:
58     Template to be evaluated when it is part of calender
59     @@@lang: en
60     @Parameter:
61     @@Name: month
62     @@Type: CDATA
63     @@Default: (none)
64     @@Description:
65     @@@@:
66     Template to be evaluated when it is part of calender and has
67     "month" part. This template will not be used if "day" template
68     is used.
69     @@@lang: en
70     @Parameter:
71     @@Name: page
72     @@Type: WikiName
73     @@Default: (auto)
74     @@Description:
75     @@@@:
76     WikiPage to be tested
77     @@lang: en
78     @Parameter:
79     @@Name: true
80     @@Type: CDATA
81     @@Default: (none)
82     @@Description:
83     @@@@:
84     Template to be evaluated when it is part of calender.
85     This template will not be used if "year", "month" or "day"
86     template is used.
87     @@@lang: en
88     @Parameter:
89     @@Name: year
90     @@Type: CDATA
91     @@Default: (none)
92     @@Description:
93     @@@@:
94     Template to be evaluated when it is part of calender.
95     This template will not be used if "month" or "day" template
96     is used.
97     @@lang: en
98     @Formatting:
99     my $page = $o->{wiki}->name ($p->{page} or $o->{wiki}->{var}->{page});
100     my $date = __FUNCPACK__->wikiname_to_date (name => $page, o => $o);
101     if ($date->{year}) {
102     if ($date->{day} and $p->{day}) {
103     __ATTRNODE:%day->{$p->{-parent}}__;
104     } elsif ($date->{month} and $p->{month}) {
105     __ATTRNODE:%month->{$p->{-parent}}__;
106     } elsif ($p->{year}) {
107     __ATTRNODE:%year->{$p->{-parent}}__;
108     } else {
109     __ATTRNODE:%true->{$p->{-parent}}__;
110     }
111     } else {
112     __ATTRNODE:%false->{$p->{-parent}}__;
113     }
114    
115     FormattingRule:
116     @Category[list]:
117     form-input
118     view
119     view-resource
120     @Name: calender
121     @Description:
122     @@@: List of months in the year
123     @@lang: en
124     @Parameter:
125     @@Name: label
126     @@Type: template
127     @@Default: (auto)
128     @@Description:
129     @@@@: Template to be used to construct day item