Creating New Pages
Source : Alex Schroeder: Diary
Another little Oddmuse configuration goodie. I use it on EmacsWiki. If you fisit a page Foo and it doesn’t exist, the page will say “This page does not exist, but you can create it now.”push(@MyInitVariables, sub { my $id = GetId(); $NewText = Ts('This page does not exist, but you can %s.', '[Self:action=edit;id=' . UrlEncode($id) . ' ' . T('create it now') . ']') if $id; }); And the way I’ve written it you can translate it, too.$Translate{'This page does not exist, but you can %s.'} = 'Dies Seite existiert nicht. Wollen Sie die Seite %s?'; $Translate{'create it now'} = 'jetzt erstellen'; ⇒ Dies Seite existiert nicht. Wollen Sie die Seite jetzt erstellen?I like it so much I should add it to the Oddmuse core.Tags: Oddmuse
le 23.08.08 à 13:25
dans Mind
-
Article précédent - Commenter - Article suivant -