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 verstecken
1: {{include document="AnnotationCode.Macros" /}} 2: 3: {{velocity}} 4: #if("$!{request.wiki}" == "" || "$!{request.space}" == "" || "$!{request.page}" == "") 5: {{warning}}$msg.get('annotations.action.create.error.notarget'){{/warning}} 6: #else 7: ## 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 8: #if(!$annotations.canAddAnnotation("$!{request.wiki}", "$!{request.space}", "$!{request.page}")) 9: #set($message = $msg.get("annotations.action.create.error.unauthorized")) 10: #if ($context.user.equals("XWiki.XWikiGuest")) 11: #set($message = $msg.get("annotations.action.create.error.unauthorizedguest")) 12: #end 13: ## unauthorized, with a nice i18n message 14: $response.sendError(401, $message) 15: #end 16: 17: {{html}} 18: ## get create a hashmap with request data about the selection 19: #set($annData = $util.hashMap) 20: #set($dispose = $annData.put("selection", $!request.selection)) 21: #set($dispose = $annData.put("selectionContext", $!request.selectionContext)) 22: #set($dispose = $annData.put("selectionOffset", $!request.selectionOffset)) 23: ## pretend that annotation author is current user, and annotation date is now 24: ##Even if they get sent to the server, the server will overwrite with anything's logged in in there anyway 25: #set($dispose = $annData.put("author", $context.user)) 26: #set($dispose = $annData.put("date", $util.date)) 27: #displayCreateBox("$!{request.wiki}", "$!{request.space}", "$!{request.page}", $annData) 28: {{/html}} 29: #end 30: {{/velocity}}