Panels
CreatePanel
en
0
Panels.WebHome
XWiki.Admin
xwiki:XWiki.msladek
xwiki:XWiki.msladek
1252454400000
1539796440000
1539796440000
1.1

# $msg.get("xe.panels.create")

Imported from XAR
false
xwiki/1.0
false
{{velocity}} #macro(displayCreatePanelForm) {{html}} <form method="post" action="$doc.getURL('view', 'xpage=plain')" onsubmit="cancelCancelEdit()"> <div> <input type="hidden" name="create" value="1"/> <label for="panelTitle" class="hidden">$msg.get("xe.panels.create.title")</label> <input type="text" id="panelTitle" name="panelTitle" value="$msg.get("xe.panels.create.title")" class="panelinput" onfocus="if(this.value=='$msg.get("xe.panels.create.title")') this.value=''" onblur="if(this.value=='') this.value='$msg.get("xe.panels.create.title")'"/> <input type="submit" class="button" value="$msg.get("create")"/> </div> </form> {{/html}} #end #macro(createPanel $title) #set($docName=$title.replaceAll(':', '%3A')) #set($displayTitle = $title) #set($displayTitle = $displayTitle.replaceAll('&(?!#)', '&#38;')) #set($displayTitle = $displayTitle.replaceAll('\\', '&#92;')) #set($panelName = $displayTitle) #set($panelName = $util.encodeURI($panelName)) #set($displayTitle = $displayTitle.replaceAll("'", '&#39;')) #set($template = "$!{request.getParameter('template')}") #if($template == "") #set($template="Panels.PanelTemplate") #end #set($pcontent = "#") #set($pcontent = "${pcontent}panelheader('${displayTitle}')${util.getNewline()}${util.getNewline()}#") #set($pcontent = "${pcontent}panelfooter()") #set($pcontent = $util.encodeURI($pcontent)) #set($redirectaction = "inline") #set($redirectparams = "template=${template}&Panels.PanelClass_0_name=${panelName}&Panels.PanelClass_0_content=$pcontent") #set($newdoc=$xwiki.getDocument($docName)) #if(!$newdoc.isNew()) #set($redirecturl = $newdoc.getURL("view", "xpage=docalreadyexists")) #else #set($redirecturl = $newdoc.getURL($redirectaction, $redirectparams)) #end $response.sendRedirect($redirecturl) $title #end #if("$!{request.create}" == '') #displayCreatePanelForm() #else #createPanel("$!{request.getParameter('panelTitle')}") #end {{/velocity}}