%PDF- %PDF-
| Direktori : /home/waritko/jetty-distribution-9.4.21.v20190926/webapps/ROOT/templates/ |
| Current File : //home/waritko/jetty-distribution-9.4.21.v20190926/webapps/ROOT/templates/admin.vm |
##-------------------------------------------------
## Determine whether the admin sheet is available
##-------------------------------------------------
#if ($xwiki.exists('XWiki.AdminSheet'))
#set ($adminSheetExists = true)
#else
#set ($adminSheetExists = false)
#end
##-------------------------------------------------
## Determine which editor to use (global or space)
##-------------------------------------------------
#if ("$!{editor}" == '')
#set ($editor = "$!{escapetool.xml($request.getParameter('editor'))}")
#if ($editor == '')
#if ($doc.fullName == 'XWiki.XWikiPreferences')
#set ($editor = 'globaladmin')
#elseif ($doc.documentReference.name == 'WebPreferences')
#set ($editor = 'spaceadmin')
#else
#set ($editor = 'globaladmin')## default editor
#end
#end
#end
##-------------------------------------------------
## Determine the current space, section and admin doc
##-------------------------------------------------
#set ($currentSpace = "$!{request.space}")
#if ($currentSpace == '')
#set ($currentSpace = $doc.space)
#end
#if ($editor == 'globaladmin')
#set ($currentDoc = 'XWiki.XWikiPreferences')
#else
#set ($currentDoc = "${currentSpace}.WebPreferences")
#end
#set ($section = "$!{request.section}")
##-------------------------------------------------
## Start page
##-------------------------------------------------
#template("startpage.vm")
##-------------------------------------------------
## Include XWikiPreferences object
##-------------------------------------------------
#set ($prefsClassName = 'XWiki.XWikiPreferences')
#if ($doc.fullName == $prefsClassName || $doc.documentReference.name == 'WebPreferences')
#if (!$doc.getObject($prefsClassName))
#set ($discard = $doc.newObject($prefsClassName))
#set ($discard = $!doc.setParent("${doc.space}.WebHome"))
#set ($discard = $doc.setHidden(true))
#set ($discard = $doc.setTitle($services.localization.render('admin.preferences.title')))
#set ($discard = $doc.save())
#end
#end
##-----------------------------------------
## Content (if empty wiki display Import)
##-----------------------------------------
<div class="main layoutsubsection">
<div id="mainContentArea">
#set ($force = $!request.get('force'))
#if (!$hasAdmin)
$response.setStatus(403)
#xwikimessageboxstart($services.localization.render('error') $services.localization.render('notallowed'))
#xwikimessageboxend()
#elseif (($tdoc.getLocked() == true) && (!$force))
$response.setStatus(423)
#xwikimessageboxstart($services.localization.render('notice') "$services.localization.render('doclockedby') $xwiki.getUserName($doc.getLockingUser())")
<a href="$doc.getURL($xcontext.action, "$!{request.getQueryString().replaceAll('&', '&').replaceAll('&amp;', '&')}&force=1")">$services.localization.render('forcelock')</a>
#xwikimessageboxend()
#else
#if ($xwiki.exists('XWiki.AdminSheet'))
#set ($importaction = '')
## Display the current document with the XWiki.AdminSheet that is already bound to the XWikiPreferences class.
$services.display.content($doc)
#else
## Admin app not installed, display only Import
#set ($importaction = $doc.getURL('import'))
## Check how many documents that are not XClasses are in the database (a number of XClasses are created
## automatically at startup when the database is empty and we don't want to take them into account).
#set ($documentCount = $services.query.xwql("where doc.xWikiClassXML is null or doc.xWikiClassXML not like '<%'"
).addFilter('unique').count())
## Unfortunately there are at least 3 documents that are not XClasses and which are created automatically (Watchlist
## notifiers) and we want to exclude them also.
#if ($documentCount < 6)
## Less than 6 pages in the wiki, probably a fresh install.
#set ($URL = "https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/EmptyWiki")
#warning($services.localization.render('admin.defaultwikinotinstalled_useflavor', ["<a href='$URL'>", '</a>']))
#else
## More than 6 pages in the wiki and Admin app not installed, probably an upgrade.
#warning($services.localization.render('admin.adminappnotinstalled', ['<a href="http://extensions.xwiki.org/xwiki/bin/view/Extension/Administration+Application">http://extensions.xwiki.org/xwiki/bin/view/Extension/Administration+Application</a>']))
#end
<div id="admin-page">
<div id="admin-page-header">
<h1 id="admin-header">$services.localization.render('admin.import')</h1>
</div> ## admin-page-header
<div id="admin-page-content">
#template("importinline.vm")
</div> ## admin-page-menu
</div> ## admin-page
#end
#end
<div class="clearfloats"></div>
</div>## mainContentArea
</div>## main
##-------------------------------------------------
## End page
##-------------------------------------------------
#template("endpage.vm")