76 |
__ATTRTEXT:%mode__; |
__ATTRTEXT:%mode__; |
77 |
for (sort {$b->[1] <=> $a->[1]} |
for (sort {$b->[1] <=> $a->[1]} |
78 |
map { try { [$_, $o->{wiki}->{db}->get (lastmodified => $_)] } |
map { try { [$_, $o->{wiki}->{db}->get (lastmodified => $_)] } |
79 |
catch SuikaWiki::DB::Util::Error with {[$_, undef]} } |
catch SuikaWiki::DB::Util::Error with { |
80 |
|
my $err = shift; |
81 |
|
$err->throw if $err->{-type} eq 'ERROR_REPORTED'; |
82 |
|
[$_, undef]} } |
83 |
$o->{wiki}->{db}->keys ('content', |
$o->{wiki}->{db}->keys ('content', |
84 |
-ns => $ns, |
-ns => $ns, |
85 |
-type => 'key', |
-type => 'key', |
87 |
next unless $_->[0]; |
next unless $_->[0]; |
88 |
last if $i++ == $p->{n}; |
last if $i++ == $p->{n}; |
89 |
|
|
|
my $li = $list->append_new_node |
|
|
(type => '#element', |
|
|
namespace_uri => $NS_XHTML1, |
|
|
local_name => 'li'); |
|
90 |
$WIKILINKING->to_wikipage_in_html ({ |
$WIKILINKING->to_wikipage_in_html ({ |
91 |
label => $p->{template}, |
label => $p->{template}, |
92 |
} => { |
} => { |
97 |
page_lastmodified => $_->[1], |
page_lastmodified => $_->[1], |
98 |
}, { |
}, { |
99 |
o => $o, |
o => $o, |
100 |
parent => $li, |
parent => $list->append_new_node |
101 |
|
(type => '#element', |
102 |
|
namespace_uri => $NS_XHTML1, |
103 |
|
local_name => 'li'), |
104 |
}); |
}); |
105 |
} |
} |
106 |
|
|
151 |
-recursive => $p->{recursive})) { |
-recursive => $p->{recursive})) { |
152 |
last if $i++ == $p->{n}; |
last if $i++ == $p->{n}; |
153 |
|
|
|
my $li = $list->append_new_node |
|
|
(type => '#element', |
|
|
namespace_uri => $NS_XHTML1, |
|
|
local_name => 'li'); |
|
154 |
$WIKILINKING->to_wikipage_in_html ({ |
$WIKILINKING->to_wikipage_in_html ({ |
155 |
label => $p->{template}, |
label => $p->{template}, |
156 |
} => { |
} => { |
159 |
wiki_mode => $p->{mode}, |
wiki_mode => $p->{mode}, |
160 |
}, { |
}, { |
161 |
o => $o, |
o => $o, |
162 |
parent => $li, |
parent => $list->append_new_node |
163 |
|
(type => '#element', |
164 |
|
namespace_uri => $NS_XHTML1, |
165 |
|
local_name => 'li'), |
166 |
}); |
}); |
167 |
} |
} |
168 |
} catch SuikaWiki::DB::Util::Error with { |
} catch SuikaWiki::DB::Util::Error with { |
169 |
# |
my $err = shift; |
170 |
|
$err->throw if $err->{-type} eq 'ERROR_REPORTED'; |
171 |
}; |
}; |
172 |
$p->{-parent}->remove_child_node ($list) unless $list->count; |
$p->{-parent}->remove_child_node ($list) unless $list->count; |
173 |
|
|
190 |
try { |
try { |
191 |
$content = $o->{wiki}->{db}->get (content => $page); |
$content = $o->{wiki}->{db}->get (content => $page); |
192 |
} catch SuikaWiki::DB::Util::Error with { |
} catch SuikaWiki::DB::Util::Error with { |
193 |
|
my $err = shift; |
194 |
|
$err->throw if $err->{-type} eq 'ERROR_REPORTED'; |
195 |
$content = undef; |
$content = undef; |
196 |
}; |
}; |
197 |
$content = $p->{case_sensible} ? $content : lc $content; |
$content = $p->{case_sensitive} ? $content : lc $content; |
198 |
$content =~ s/^[^\x0A\x0D]+[\x0D\x0A]+//s; |
$content =~ s/^[^\x0A\x0D]+[\x0D\x0A]+//s; |
199 |
$page = $o->{wiki}->name ($page); |
$page = $o->{wiki}->name ($page); |
200 |
my $n_page = $page->stringify (wiki => $o->{wiki}); |
my $n_page = $page->stringify (wiki => $o->{wiki}); |
214 |
map {$_->[0]->stringify (wiki => $o->{wiki}, delimiter => "\x1D") |
map {$_->[0]->stringify (wiki => $o->{wiki}, delimiter => "\x1D") |
215 |
."\x1F".$_->[1]} @r; |
."\x1F".$_->[1]} @r; |
216 |
$o->{wiki}->{db}->set (m__search_result => [$word] => $sr); |
$o->{wiki}->{db}->set (m__search_result => [$word] => $sr); |
217 |
## TODO: Cache & case-sensibility |
## TODO: Cache & case-sensitivility |
218 |
} else { |
} else { |
219 |
@r = map {[$o->{wiki}->name ($_->[0], delimiter_reg => qr/\x1D/), $_->[1]]} |
@r = map {[$o->{wiki}->name ($_->[0], delimiter_reg => qr/\x1D/), $_->[1]]} |
220 |
map {[split /\x1F/, $_, 2]} split /\x1E/, $sr; |
map {[split /\x1F/, $_, 2]} split /\x1E/, $sr; |
229 |
(name => 'Link:toWikiPage:SourceLabelLong:SearchResult', |
(name => 'Link:toWikiPage:SourceLabelLong:SearchResult', |
230 |
wiki => $o->{wiki}, o => $o); |
wiki => $o->{wiki}, o => $o); |
231 |
for (@r) { |
for (@r) { |
|
my $li = $list->append_new_node |
|
|
(type => '#element', |
|
|
namespace_uri => $NS_XHTML1, |
|
|
local_name => 'li'); |
|
232 |
$WIKILINKING->to_wikipage_in_html ({ |
$WIKILINKING->to_wikipage_in_html ({ |
233 |
label => $p->{template}, |
label => $p->{template}, |
234 |
} => { |
} => { |
237 |
wiki_mode => $p->{mode}, |
wiki_mode => $p->{mode}, |
238 |
}, { |
}, { |
239 |
o => $o, |
o => $o, |
240 |
parent => $li, |
parent => $list->append_new_node |
241 |
|
(type => '#element', |
242 |
|
namespace_uri => $NS_XHTML1, |
243 |
|
local_name => 'li'), |
244 |
-m__weight => $_->[1], |
-m__weight => $_->[1], |
245 |
}); |
}); |
246 |
} |
} |
255 |
ViewFragment: |
ViewFragment: |
256 |
@Name: ws--post-content |
@Name: ws--post-content |
257 |
@Description: |
@Description: |
258 |
@@@: After content body -- navigation bar |
@@@: After content body -- children and backward links |
259 |
@@lang:en |
@@lang:en |
260 |
@Order: 100 |
@Order: 100 |
261 |
@Formatting: |
@Formatting: |
273 |
title => {%res(name=>SeeAlso);}p, heading, |
title => {%res(name=>SeeAlso);}p, heading, |
274 |
content => {%search-result;}p, |
content => {%search-result;}p, |
275 |
); |
); |
|
%section ( |
|
|
id => referer, |
|
|
title => {%res(name=>Referer);}p, heading, |
|
|
content => {%referer-list;}p, |
|
|
); |
|
276 |
|
|
277 |
Resource: |
Resource: |
278 |
@Children:Title: |
@Children:Title: |
301 |
); |
); |
302 |
%span(class=>headline,content=>{%page-headline;}p); |
%span(class=>headline,content=>{%page-headline;}p); |
303 |
|
|
304 |
## TODO: |
## TODO: Make recent-changes page name customizable |
305 |
ViewFragment: |
ViewFragment: |
306 |
@Name: navbar |
@Name: navbar |
307 |
@Order: 21 |
@Order: 21 |
309 |
%link-to-wikipage ( |
%link-to-wikipage ( |
310 |
page => {RecentChanges}, |
page => {RecentChanges}, |
311 |
label => {%link-to-it ( |
label => {%link-to-it ( |
312 |
label=>"%res(name=>GoToRecentChanges);"p, |
label => {%res (name => GoToRecentChanges);}p, |
313 |
description=>"%res(name=>GoToRecentChangesLong);"p, |
description => {%res (name => GoToRecentChangesLong);}p, |
314 |
);}, |
);}, |
315 |
rel => news, |
rel => news, |
316 |
); |
); |
325 |
label => {%html-link ( |
label => {%html-link ( |
326 |
description => {%res(name=>GoToRecentChangesLink);}p, |
description => {%res(name=>GoToRecentChangesLink);}p, |
327 |
);}, |
);}, |
|
); |
|
328 |
|
); |
329 |
|
|
330 |
|
Resource: |
331 |
|
@GoToRecentChanges: |
332 |
|
@@@: Recent |
333 |
|
@@lang: en |
334 |
|
@GoToRecentChangesLink: |
335 |
|
@@@: Recently modified WikiPages list |
336 |
|
@@lang: en |
337 |
|
@GoToRecentChangesLong: |
338 |
|
@@@: Review recently modified WikiPages list |
339 |
|
@@lang: en |
340 |
|
|
341 |
|
|
342 |
|
|