Allgemeine Aktionen:
Anmelden
Erstellen
▼
:
Kommentar erstellen
Wiki
▼
:
Dokumentenindex
»
Space:
AnnotationCode
▼
:
Dokumentenverzeichnis
»
Seite:
CreateForm
Suche
Aktionen:
Exportieren
▼
:
Als PDF exportieren
Als RTF exportieren
Als HTML exportieren
Weitere Aktionen
▼
:
Druckvorschau
Zeige den Quellcode
Willkommen in den metamagix Wikis!
»
WebHome
»
CreateForm
Wiki-Quellcode von
CreateForm
Zuletzt geändert von
Administrator
am 2010/06/25 11:24
Inhalt
·
Kommentare
(0)
·
Anmerkungen
(0)
·
Anhänge
(0)
·
Historie
·
Information
Zeilennummern anzeigen
{{include document="AnnotationCode.Macros" /}} {{velocity}} #if("$!{request.wiki}" == "" || "$!{request.space}" == "" || "$!{request.page}" == "") {{warning}}$msg.get('annotations.action.create.error.notarget'){{/warning}} #else ## pretty dirtish but it's so gonna do the job: don't display this form to users which don't have the right to create annotations, instead send a nice unauthorized message #if(!$annotations.canAddAnnotation("$!{request.wiki}", "$!{request.space}", "$!{request.page}")) #set($message = $msg.get("annotations.action.create.error.unauthorized")) #if ($context.user.equals("XWiki.XWikiGuest")) #set($message = $msg.get("annotations.action.create.error.unauthorizedguest")) #end ## unauthorized, with a nice i18n message $response.sendError(401, $message) #end {{html}} ## get create a hashmap with request data about the selection #set($annData = $util.hashMap) #set($dispose = $annData.put("selection", $!request.selection)) #set($dispose = $annData.put("selectionContext", $!request.selectionContext)) #set($dispose = $annData.put("selectionOffset", $!request.selectionOffset)) ## pretend that annotation author is current user, and annotation date is now ##Even if they get sent to the server, the server will overwrite with anything's logged in in there anyway #set($dispose = $annData.put("author", $context.user)) #set($dispose = $annData.put("date", $util.date)) #displayCreateBox("$!{request.wiki}", "$!{request.space}", "$!{request.page}", $annData) {{/html}} #end {{/velocity}}