General Actions:
Log-in
Wiki:
L3D's Wiki
▼
:
Document Index
»
Space:
Panels
▼
:
Document Index
»
Page:
PanelLayoutUpdate
Search
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Panels
»
Panel Layout Update
Wiki source code of
Panel Layout Update
Last modified by
Administrator
on 2006/12/15 03:10
Content
·
Comments
(0)
·
Attachments
(0)
·
History
·
Information
Hide line numbers
1: #set($place = $request.place) 2: ## 3: ## Get the preferences document where the new layout must be saved (XWiki.XWikiPreferences or Space.WebPreferences) 4: ## 5: #if("$!{request.prefsdoc}" != "") 6: #set($prefsdocument = $request.prefsdoc) 7: #else 8: #set($prefsdocument = "XWiki.XWikiPreferences") 9: #end 10: ## 11: ## Check to see if the current user has admin rights on the current preferences document. 12: ## 13: #if(!$xwiki.hasAccessLevel("admin", $context.user, $prefsdocument)) 14: #xwikimessageboxstart("$msg.get('panelwizard.placemanager')" "") 15: $msg.get("panelwizard.notadmininplace", $place) 16: #xwikimessageboxend() 17: ## 18: ## Set the current panel layout. Note that you must have at least one panel in the new layout column (left or right panels) to keep the layout. 19: ## 20: #elseif($request.xpage && $request.xpage == "plain") 21: #if( (!$place) || ($place == "") ) 22: #set($prefsdoc = $xwiki.getDocument($prefsdocument)) 23: #set($ok = $prefsdoc.use("XWiki.XWikiPreferences")) 24: #set($leftPanels = $request.leftPanels) 25: #set($rightPanels = $request.rightPanels) 26: #set($showLeftPanels = $request.showLeftPanels) 27: #set($showRightPanels = $request.showRightPanels) 28: #if($leftPanels) 29: #set($ok = $prefsdoc.set("leftPanels", $leftPanels)) 30: #end 31: #if($showLeftPanels) 32: #set($ok = $prefsdoc.set("showLeftPanels", $showLeftPanels)) 33: #end 34: #if($rightPanels) 35: #set($ok = $prefsdoc.set("rightPanels", $rightPanels)) 36: #end 37: #if($showRightPanels) 38: #set($ok = $prefsdoc.set("showRightPanels", $showRightPanels)) 39: #end 40: #set($ok = $prefsdoc.save()) 41: SUCCESS 42: #else 43: #set($prefsdoc = $xwiki.getDocument("${place}:${prefsdocument}")) 44: #set($ok = $prefsdoc.use("XWiki.XWikiPreferences")) 45: #set($leftPanels = $request.leftPanels) 46: #set($rightPanels = $request.rightPanels) 47: #if($leftPanels&&$leftPanels!="") 48: #set($ok = $prefsdoc.set("leftPanels", $leftPanels)) 49: #end 50: #if($rightPanels&&$rightPanels!="") 51: #set($ok = $prefsdoc.set("rightPanels", $rightPanels)) 52: #end 53: #set($ok = $prefsdoc.save()) 54: SUCCESS 55: #end 56: #else 57: 1 $msg.get("panelwizard.panellayoutupdate") 58: #set($url = $xwiki.getURL("Panels.PanelWizard")) 59: #warning($msg.get("panelwizard.nodirectaccess", ["<a href='$url'>Panel Wizard</a>"])) 60: #end
Quick Links
L3D Calendar
Wiki Dashboard
Document Index
Blog
Sandbox