  
                    





                
                
  
  



<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
  <head>
                    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                                    <title>Benutzerspezifisch konfigurierbare Bereiche</title>
                        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
                <link rel="shortcut icon" href="resources/icons/xwiki/favicon.ico" />
        <link rel="icon" href="resources/icons/xwiki/favicon16.png" type="image/png" />
        <link rel="icon" href="resources/icons/xwiki/favicon.svg" type="image/svg+xml" />
        <link rel="apple-touch-icon" href="resources/icons/xwiki/favicon144.png" />
                <meta http-equiv="Content-Script-Type" content="text/javascript" />
                        <meta http-equiv="imagetoolbar" content="no"/>
                                <link rel="canonical" href="xwiki.XWiki.ConfigurableClass.html" />
                            <meta name="document" content="XWiki.ConfigurableClass"/>
    <meta name="wiki" content="xwiki"/>
    <meta name="space" content="XWiki"/>
    <meta name="page" content="ConfigurableClass"/>
    <meta name="version" content="1.1"/>
    <meta name="restURL" content="/rest/wikis/xwiki/spaces/XWiki/pages/ConfigurableClass"/>
    <meta name="form_token" content="0yPVOyUMidhQCoKhz1FIaA"/>
                <meta name="gwt:property" content="locale=de" />
                <meta name="revisit-after" content="7 days" />
<meta name="description" content="Benutzerspezifisch konfigurierbare Bereiche" />
<meta name="keywords" content="wiki" />
<meta name="distribution" content="GLOBAL" />
<meta name="rating" content="General" />
<meta name="author" content="Administrator" />
<meta http-equiv="reply-to" content="" />
<meta name="language" content="de" />
<meta name="google-site-verification" content="qE1BFB2hw6qPJgzEuttEuj-GlvC4aWOtFVY4rJKYhWw" />
<link rel="icon" href="attachment/xwiki.XWiki.DefaultSkin.favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="attachment/xwiki.XWiki.DefaultSkin.favicon.ico" type="image/x-icon"/>
<link rel="alternate" type="application/rss+xml" title="Wiki Feed RSS" href="http://ci.bytebang.at/Main/WebRss?xpage=rdf" />
<link rel="alternate" type="application/rss+xml" title="Blog RSS Feed" href="http://ci.bytebang.at/Blog/GlobalBlogRss?xpage=plain" />

                <!-- com.xpn.xwiki.plugin.skinx.LinkExtensionPlugin -->
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
<link href="skins/colibri/style.css?colorTheme=ColorThemes.DefaultColorTheme" rel="stylesheet" type="text/css" media="all" />
<link href="skins/colibri/print.css?colorTheme=ColorThemes.DefaultColorTheme" rel="stylesheet" type="text/css" media="print" />
        <!--[if IE]>
  <link href="skins/colibri/ie-all.css?colorTheme=ColorThemes.DefaultColorTheme" rel="stylesheet" type="text/css" />
<![endif]-->
    <!-- com.xpn.xwiki.plugin.skinx.CssResourceSkinExtensionPlugin -->
  <!-- com.xpn.xwiki.plugin.skinx.CssSkinExtensionPlugin -->
  <!-- com.xpn.xwiki.plugin.skinx.CssSkinFileExtensionPlugin -->

                                                                                                                                                                                                                                                        <!-- com.xpn.xwiki.plugin.skinx.JsResourceSkinExtensionPlugin -->
    <!-- com.xpn.xwiki.plugin.skinx.JsSkinFileExtensionPlugin -->
    <!-- com.xpn.xwiki.plugin.skinx.JsSkinExtensionPlugin -->

<script type="text/javascript" src="resources/js/xwiki/compatibility.js" defer="defer"></script>
<script type="text/javascript" src="resources/js/xwiki/markerScript.js" defer="defer"></script>
<script type="text/javascript">
// <![CDATA[
require.config({
  baseUrl: '/',
    paths: { 'jquery': "resources/js/amd/jquery" },
  map: {
    '*': { 'jquery': 'jQueryNoConflict' },
    'jQueryNoConflict': { 'jquery': 'jquery' }
  }
});
define('jQueryNoConflict', ['jquery'], function($) { $.noConflict(); return $; });
XWiki.webapppath = "";
XWiki.servletpath = "bin/";
XWiki.contextPath = "";
XWiki.mainWiki = "xwiki";
XWiki.currentWiki = "xwiki";
XWiki.currentSpace = "XWiki";
XWiki.currentPage = "ConfigurableClass";
XWiki.editor = "";
XWiki.viewer = "";
XWiki.contextaction = "export";
XWiki.docisnew = false;
XWiki.docsyntax = "xwiki/2.0";
XWiki.docvariant = "";
XWiki.blacklistedSpaces = [ "Import","Panels","Scheduler","Stats","XAppClasses","XAppSheets","XAppTemplates","XWiki","WatchCode","WatchSheets","XApp","WatchAdmin","Watch","ColorThemes","AnnotationCode" ];
XWiki.hasEdit = false;
XWiki.hasProgramming = false;
XWiki.hasBackupPackImportRights = false;
XWiki.hasRenderer = true;
window.docviewurl = "xwiki.XWiki.ConfigurableClass.html";
window.docediturl = "http://ci.bytebang.at/bin/edit/XWiki/ConfigurableClass";
window.docsaveurl = "http://ci.bytebang.at/bin/save/XWiki/ConfigurableClass";
window.docgeturl = "http://ci.bytebang.at/bin/get/XWiki/ConfigurableClass";
// ]]>
</script>

  </head>
  <body id="body" class="skin-colibri wiki-xwiki space-XWiki viewbody hidelefthideright">
<div id="xwikimaincontainer">
<div id="xwikimaincontainerinner">

  <div id="menuview">
    <div id="mainmenu" class="layoutsubsection actionmenu">
<div class="gradientfilterIE"></div>
<div class="componentcontainer">
<strong id="xwikimenutitle" class="hidden">Allgemeine Aktionen:</strong>
<div class="rightmenu">
      <div id="tmLogin" class="tmLogin topmenuentry ">
   <a class="tme" href="http://ci.bytebang.at/bin/login/XWiki/XWikiLogin?xredirect=http%3A%2F%2Fci.bytebang.at%2Fbin%2Fexport%2FXWiki%2FConfigurableClass%3Fformat%3Dhtml%26viewer%3Dcode%26xpage%3Dprint"><strong>Anmelden</strong></a>
  </div>
    <div id="tmRegister" class="tmRegister topmenuentry ">
   <a class="tme" href="http://ci.bytebang.at/bin/register/XWiki/Register"><strong>Registrieren</strong></a>
  </div>
</div>
<div class="leftmenu">
  <div id="tmMainWiki" class="tmMainWiki topmenuentry dropdownmenuentry  hasIcon" onmouseover="showsubmenu(this);" onmouseout="hidesubmenu(this);">
<span class="tme-extensible">
   <a class="tme" href="http://ci.bytebang.at/bin/Main/"><strong>Start</strong></a>
    <span class="menuarrow">&#9660;</span><span class="hidden menucolon">: </span>
</span><span class="submenu hidden">
        <span class="submenuitem "><a href="http://ci.bytebang.at/bin/WikiManager/" id="tmWikiIndex" class="tmWikiIndex">Wiki Verzeichnis</a></span>
      </span></div>
<div class="topmenuentry"><span class="separator">&raquo;</span></div>
  <div id="tmSpace" class="tmSpace topmenuentry hasIcon">
      <span class="tmetype">Bereich: </span><a class="tme hastype" href="http://ci.bytebang.at/bin/XWiki/"><strong>XWiki</strong></a>
  </div>
<div class="topmenuentry"><span class="separator">&raquo;</span></div>
  <div id="tmPage" class="tmPage topmenuentry hasIcon">
      <span class="tmetype">Seite: </span><a class="tme hastype" href="xwiki.XWiki.ConfigurableClass.html"><strong>ConfigurableClass</strong></a>
  </div>
</div>
</div>
</div>

  </div>
 <div id="headerglobal" class="layoutsection">
<div class="minwidthd"></div>
  <div id="company">
  <div id="companylogo">
    <a href="http://ci.bytebang.at/bin/Main/" title="Home" rel="home">
    <img src="attachment/xwiki.ColorThemes.DefaultColorTheme.logo.png" alt="Wiki Logo"/>
    </a>
  </div>   </div>   <div id="globallinks">
      <span class="glink" id="headerlanguages">
            <a href="xwiki.XWiki.ConfigurableClass.html" class="language-default language-current">default</a>
      </span>
  </div>   <div class="clearfloats"></div>
  </div> 

<div class="contenthidelefthideright" id="contentcontainer">
<div id="contentcontainerinner">
<div class="leftsidecolumns">
  <div id="contentcolumn"> 
        <div class="main layoutsubsection">
      <div id="contentmenu" class="actionmenu">
    <div class="gradientfilterIE"></div>
<div class="componentcontainer">
<strong id="xwikicontentmenutitle" class="hidden">Aktionen:</strong>
<div class="rightmenu">
</div>
<div class="leftmenu">
  <div id="tmExport" class="tmExport topmenuentry dropdownmenuentry dropdownnolink " onmouseover="showsubmenu(this);" onmouseout="hidesubmenu(this);">
<span class="tme-extensible">
   <a class="tme"><strong>Exportieren</strong></a>
    <span class="menuarrow">&#9660;</span><span class="hidden menucolon">: </span>
</span><span class="submenu hidden">
    <span class="submenuitem "><a href="xwiki.XWiki.ConfigurableClass.html" id="tmExportPdf" class="tmExportPdf">Als PDF exportieren</a></span>
    <span class="submenuitem "><a href="http://ci.bytebang.at/bin/export/XWiki/ConfigurableClass?format=rtf&amp;format=html&amp;viewer=code&amp;xpage=print" id="tmExportRtf" class="tmExportRtf">Als RTF exportieren</a></span>
  <span class="submenuitem "><a href="http://ci.bytebang.at/bin/export/XWiki/ConfigurableClass?format=html&amp;format=html&amp;viewer=code&amp;xpage=print" id="tmExportHtml" class="tmExportHtml">Als HTML exportieren</a></span>
    </span></div>
  <div id="tmMoreActions" class="tmMoreActions topmenuentry dropdownmenuentry dropdownnolink " onmouseover="showsubmenu(this);" onmouseout="hidesubmenu(this);">
<span class="tme-extensible">
   <a class="tme"><strong>Weitere Aktionen</strong></a>
    <span class="menuarrow">&#9660;</span><span class="hidden menucolon">: </span>
</span><span class="submenu hidden">
  <span class="submenuitem "><a href="xwiki.XWiki.ConfigurableClass.html" id="tmPrintPreview" class="tmPrintPreview">Druckvorschau</a></span>
  <span class="submenuitem "><a href="xwiki.XWiki.ConfigurableClass.html" id="tmViewSource" class="tmViewSource">Zeige den Quellcode</a></span>
  </span></div>
  </div>
</div>
    </div>
    <div id="mainContentArea">
  
   <div id="hierarchy">
                                          <a href='http://ci.bytebang.at/bin/Main/'>Willkommen bei bytebang</a> <span class='separator'>&#187;</span> <a href='http://ci.bytebang.at/bin/XWiki/'>XWiki Bereich</a> <span class='separator'>&#187;</span> <span class='current'>Benutzerspezifisch konfigurierbare Bereiche</span>
                      </div>

      <div id="document-title"><h1>Wiki-Quellcode von <a href="xwiki.XWiki.ConfigurableClass.html">Benutzerspezifisch konfigurierbare Bereiche</a></h1></div>
                    <div id="document-info">
    <div class="xdocLastModification">       Zuletzt geändert von <span class="wikilink"><a href="http://ci.bytebang.at/bin/XWiki/Admin">Administrator</a></span> am 2014/06/29 19:28
    </div>
    <div>
                      <span id="attachmentsshortcut"><a href="xwiki.XWiki.ConfigurableClass.html">Anhänge</a> <span class="itemCount">(1)</span></span>
               <span class="separator">&#183;</span>         <span id="informationshortcut"><a href="xwiki.XWiki.ConfigurableClass.html">Information</a></span>
          </div>
    <div class="clearfloats"></div>
  </div>

<div>
  <a href="xwiki.XWiki.ConfigurableClass.html" id="toggleLineNumbers">Zeilennummern verstecken</a>
                                  <textarea readonly="readonly" class="wiki-code" rows="25" cols="80">
  1: {{include reference=&quot;XWiki.ConfigurableClassMacros&quot; /}}
  2: 
  3: {{velocity}}
  4: #*
  5:  * This part takes the configuration from any documents containing XWiki.ConfigurableClass objects and creates a form
  6:  * for each. To includeForm this document, you may specify:
  7:  *
  8:  * $section - String - The section which we are administrating eg: &quot;Registration&quot;, &quot;Users&quot;, or &quot;Import&quot;.
  9:  *                     If none is specified then it checks for a request parameter called &quot;section&quot; and uses that,
 10:  *                     if no parameter, then this code assumes that it is part of the admin icons sheet and adds icons
 11:  *                     for any section which is not in $sections, in that event, this code assumes it is being run
 12:  *                     inside of a &lt;ul&gt; block.
 13:  *
 14:  * $sections - List&lt;String&gt; - If section is not specified, any sections on this list will not have icons made for them,
 15:  *                            the assumption being that the icons are already there. If section is specified then this
 16:  *                            is not taken into account and may safely be undefined.
 17:  *
 18:  * $currentDoc - String (document.fullName) - The administration document, users who don't have permission to edit
 19:  *                                            it will not be able to include applications (possibly injecting
 20:  *                                            arbitrary code.) if none specified then $doc.getFullName() is used.
 21:  *
 22:  * $globaladmin - boolean - If set true then we will assume we are administrationg the entire wiki.
 23:  *                          If not set then we look for a request parameter called &quot;editor&quot; if that exists and equals
 24:  *                          &quot;globaladmin&quot; then $globaladmin is true, if it doesn't exist then we check to see if
 25:  *                          $currentDoc.getFullName() equals &quot;XWiki.XWikiPreferences&quot;.
 26:  *###
 27: ##
 28: ## Form submission depends on this.
 29: $xwiki.jsfx.use('js/xwiki/actionbuttons/actionButtons.js', true)
 30: ##
 31: #if(!$section)
 32:   #set($section = $request.getParameter('section'))
 33: #end
 34: #if(!$currentDoc)
 35:   #set($currentDoc = $doc.getFullName())
 36: #end
 37: ## Get value of $globaladmin if not specified.
 38: #if(&quot;$!globaladmin&quot; == '')
 39:   #if($editor != 'globaladmin'
 40:       &amp;&amp; $request.getParameter('editor') != 'globaladmin'
 41:       &amp;&amp; $currentDoc != 'XWiki.XWikiPreferences')
 42:   ##
 43:     #set($globaladmin = false)
 44:   #else
 45:     #set($globaladmin = true)
 46:   #end
 47: #end
 48: #set($currentSpace = $xwiki.getDocument($currentDoc).getSpace())
 49: ##
 50: ## This application should not run with programming rights because it evaluates code which may not be trustworthy.
 51: ## Removing the next line will open a security hole.
 52: $doc.dropPermissions()##
 53: ##
 54: ##------------------------------------------------------------------------------------------------------------
 55: ## If $section exists then we are viewing the admin page for a particular section.
 56: ## eg: 'Registration', 'Presentation', 'Import' etc.
 57: ##------------------------------------------------------------------------------------------------------------
 58: ##
 59: #if($section &amp;&amp; $section != '')
 60:   ##
 61:   ## This is for keeping track of whether we have shown the heading yet or not.
 62:   ## If the heading doesn't need to be shown, but an error occurs in processing, then we show the heading
 63:   ## so that the user knows what the error relates to.
 64:   #set($headingShowing = false)
 65:   ##
 66:   ## Searches the database for names of apps to be configured
 67:   #set($outputList = [])
 68:   #findNamesOfAppsToConfigure($section, $globaladmin, $xwiki.getDocument($currentDoc).getSpace(), $outputList)
 69:   ##
 70:   #foreach($appName in $outputList)
 71:     ##
 72:     ## Make sure the current user has permission to edit the configurable application.
 73:     #set($userHasAccessToDocument = $xcontext.hasAccessLevel('edit', $appName))
 74:     ##
 75:     ## If the document was not last saved by a user with edit privilege on this page
 76:     ## then we can't safely display the page but we should warn the viewer.
 77:     #if($userHasAccessToDocument)
 78:       ## Get the configurable application
 79:       #set($app = $xwiki.getDocument($appName))
 80:       ##
 81:       #set($documentSavedByAuthorizedUser = false)
 82:       #checkDocumentSavedByAuthorizedUser($app, $currentDoc, $documentSavedByAuthorizedUser)
 83:     #end
 84:     ##
 85:     ## There is no need to display a heading unless:
 86:     ## 1. There was already a section before this document.
 87:     ## 2. This is not the first document in this section.
 88:     ##
 89:     ## If we are displaying the heading and there is an error to be shown Javascript will not strip the heading.
 90:     #if(!$appName.equals($outputList.get(0)) || $sections.contains($section))
 91:       ## Create a document heading.
 92:       #showHeading($appName, $headingShowing)
 93:     #end
 94:     ##
 95:     #if(!$userHasAccessToDocument)
 96:       #showHeading($appName, $headingShowing)
 97: 
 98:       {{error}}{{translation key=&quot;xe.admin.configurable.noPermissionThisApplication&quot;/}}{{/error}}
 99: 
100:     #elseif(!$documentSavedByAuthorizedUser)
101:       #showHeading($appName, $headingShowing)
102: 
103:       {{error}}{{translation key=&quot;xe.admin.configurable.applicationAuthorNoAdmin&quot; parameters=&quot;$app.Author&quot;/}}{{/error}}
104: 
105:     ##
106:     ##------------------------------------------------------------------------------------------------------------
107:     ## If the document is locked and not by the current user and forceEdit is not set true,
108:     #elseif($app.getLocked() &amp;&amp; $app.getLockingUser() != $xcontext.getUser() &amp;&amp; !$request.getParameter('forceEdit'))
109:       #set($requestURL = &quot;$request.getRequestURL()&quot;)
110:       #if($requestURL.indexOf('?') == -1)
111:         #set($requestURL = &quot;${requestURL}?&quot;)
112:       #end
113:       #showHeading($appName, $headingShowing)
114: 
115:       {{error}}{{translation key=&quot;doclockedby&quot;/}} $app.getLockingUser() [[{{translation key=&quot;forcelock&quot;/}}&gt;&gt;${requestURL}&amp;forceEdit=1]]{{/error}}
116: 
117:     #else
118:       ## If the document is not already locked, attempt to acquire the lock.
119:       #if(!$app.getLocked())
120: 
121:         {{html wiki=true}}
122:           &lt;noscript&gt;
123: 
124:             {{warning}}{{translation key=&quot;xe.admin.configurable.cannotLockNoJavascript&quot;/}}{{/warning}}
125: 
126:           &lt;/noscript&gt;
127:           &lt;script type=&quot;text/javascript&quot;&gt;
128:             document.observe(&quot;xwiki:dom:loaded&quot;, function() {
129:               new XWiki.DocumentLock('$escapetool.javascript($app.fullName)').lock();
130:             });
131:           &lt;/script&gt;
132:         {{/html}}
133:       #end
134:       ##------------------------------------------------------------------------------------------------------------
135:       ## Done Locking.
136:       ##
137:       ## Get all objects of the &quot;ConfigurableClass&quot; from this document.
138:       #set($allConfigurableObjs = $app.getObjects($nameOfThisDocument))
139:       ## Separate out the objects which are for this section.
140:       #set($configurableObjs = [])
141:       #foreach($configurableObj in $allConfigurableObjs)
142:         #if($app.getValue('displayInSection', $configurableObj) == $section)
143:           ## If this is space admin, then don't display global, if global don't display space.
144:           #if($globaladmin == ($app.getValue('configureGlobally', $configurableObj) == 1))
145:             #set($discard = $configurableObjs.add($configurableObj))
146:           #end
147:         #end
148:       #end
149:       #if($configurableObjs.size() == 0)
150:         ## Internal error, not translated.
151:         #showHeading($appName, $headingShowing)
152: 
153:         {{error}}Internal error: All objects were filtered out for application: $appName.{{/error}}
154: 
155:       #else
156:         #set($formAction = $xwiki.getURL($app.getFullName(), 'save'))
157:         #set($formId = &quot;${section.toLowerCase()}_${app.getFullName()}&quot;)
158:         #set($escapedAppName = $escapetool.xml($app.getFullName()))
159:         #foreach($configurableObj in $configurableObjs)
160:           ## Display the header if one exists.
161:           #set($heading = $app.getValue('heading', $configurableObj))
162:           #if($heading &amp;&amp; $heading != '')
163:             == #evaluate($heading) ==
164:           #end
165:           ##
166:           #set($codeToExecute = &quot;$!app.getValue('codeToExecute', $configurableObj)&quot;)
167:           #if($codeToExecute != '')
168:             (%class=&quot;codeToExecute&quot;%)(((##
169:               #evaluate($codeToExecute)##
170:             )))
171:           #end
172:           ##
173:           ## If propertiesToShow is set, then we will only show the properties contained therein.
174:           #set($propertiesToShow = $app.getValue('propertiesToShow', $configurableObj))
175:           #if(!$propertiesToShow || $propertiesToShow.getClass().getName().indexOf('List') == -1)
176:             #set($propertiesToShow = [])
177:           #end
178:           ##
179:           ## If linkPrefix is set, then we will make each property label a link which starts with that prefix.
180:           #set($linkPrefix = &quot;$!app.getValue('linkPrefix', $configurableObj)&quot;)
181:           ##
182:           ## If the Configurable object specifies a configuration class, use it,
183:           ## otherwise assume custom forms are used instead.
184:           #set($configClassName = &quot;$!app.getValue('configurationClass', $configurableObj)&quot;)
185:           #if($configClassName != '')
186:             #set($objClass = $xwiki.getDocument($configClassName).getxWikiClass())
187:             #if(!$objClass || $objClass.getClass().getName().indexOf('.Class') == -1)
188:               #showHeading($appName, $headingShowing)
189: 
190:               {{error}}{{translation key=&quot;xe.admin.configurable.configurationClassNonexistant&quot;/}}{{/error}}
191: 
192:             #else
193:               ## Use the first object from the document which is of the configuration class.
194:               #set($obj = $app.getObject($objClass.getName()))
195:               ##
196:               #if(!$obj || $obj.getClass().getName().indexOf('.Object') == -1)
197:                 #showHeading($appName, $headingShowing)
198: 
199:                 {{error}}
200:                   {{translation key=&quot;xe.admin.configurable.noObjectOfConfigurationClassFound&quot; parameters=&quot;$objClass.getName(), $app.getFullName()&quot;/}}
201:                 {{/error}}
202: 
203:               #else
204:                 ##
205:                 ## Merge save buttons, remove headings from subsections, and make information links into popups.
206:                 ## This is not done if there is only a custom defined form.
207:                 $xwiki.jsx.use($nameOfThisDocument)##
208:                 ##
209:                 ## We don't begin the form until we have content for it so that a configurable can specify a
210:                 ## custom form in codeToExecute and if that configurable object is the first of it's kind in that
211:                 ## document, the custom form will not be put inside of our form.
212:                 #if(!$insideForm)
213:                   ## We are opening a form and fieldset without closing it, thus we cannot clean this html.
214: 
215:                   {{html clean=false}}
216:                     &lt;form id=&quot;$formId&quot; method=&quot;post&quot; action=&quot;$formAction&quot; class=&quot;xform half&quot;&gt;
217:                       &lt;fieldset&gt;
218:                   {{/html}}
219:                   #set($insideForm = true)
220:                 #end
221: 
222:                 {{html}}
223:                   $formHtml.toString()
224:                 {{/html}}
225:               #end## If object exists
226:             #end## If class exists
227:           #end## If class name is specified.
228:         #end## Foreach configurable object found in this document
229:         ## If a form was started then we end it.
230:         #if($insideForm)
231: 
232:           ## This is closing an open form which was opened above, we cannot clean this html.
233:           {{html clean=false}}
234:           ## We add in a redirect field to prevent the user from being carried away when they save
235:           ## if they don't have javascript.
236:           #set($thisURL = $request.getRequestURL())
237:           #if($request.getQueryString() &amp;&amp; $request.getQueryString().length() &gt; 0)
238:             #set($thisURL = &quot;${thisURL}?$request.getQueryString()&quot;)
239:           #end
240:           &lt;input type=&quot;hidden&quot; id=&quot;${escapedAppName}_redirect&quot; name=&quot;$redirectParameter&quot; value=&quot;$escapetool.xml($thisURL)&quot; /&gt;
241:           &lt;input type=&quot;hidden&quot; name=&quot;form_token&quot; value=&quot;$!{services.csrf.getToken()}&quot; /&gt;
242:           &lt;/fieldset&gt;
243:           &lt;div class=&quot;bottombuttons&quot;&gt;
244:             &lt;p class=&quot;admin-buttons&quot;&gt;
245:               &lt;span class=&quot;buttonwrapper&quot;&gt;
246:                 ## Text to display on the button. If there is a heading then this button should be labeled
247:                 ## that it is for saving this section. Otherwise it should be a generic &quot;save&quot; button.
248:                 #if($headingShowing)
249:                   #set($buttonText = &quot;$services.localization.render('admin.save') $escapedAppName&quot;)
250:                 #else
251:                   #set($buttonText = &quot;$services.localization.render('admin.save')&quot;)
252:                 #end
253:                 &lt;input class=&quot;button&quot; type=&quot;submit&quot; name=&quot;action_saveandcontinue&quot; value=&quot;$buttonText&quot; /&gt;
254:               &lt;/span&gt;
255:             &lt;/p&gt;
256:           &lt;/div&gt; ## bottombuttons
257:           &lt;/form&gt;
258:           #set($insideForm = false)
259:           {{/html}}
260:         #end
261:       #end## If there are configurable objects
262:     #end## If document is not locked or forceEdit is enabled
263:   #end## Foreach document name in names to configure
264: 
265:   {{html}}
266:   &lt;script type=&quot;text/javascript&quot;&gt;
267:   /* &lt;![CDATA[ */
268:   ## Alt+Shift+S presses the first saveAndContinue button it finds, not what we want so we will disable edit shortcuts.
269:   document.observe('xwiki:dom:loaded', function() {
270:     XWiki.actionButtons.EditActions = Object.extend(XWiki.actionButtons.EditActions, {addShortcuts : function() { }});
271:   });
272:   //]]&gt;
273:   &lt;/script&gt;
274:   {{/html}}##
275:   ##
276: #else
277:   ##
278:   ##------------------------------------------------------------------------------------------------------------
279:   ## If section is not set then we are viewing the main administration page.
280:   ##------------------------------------------------------------------------------------------------------------
281:   ##
282:   ## If there is no list called sections then we set sections to an empty list.
283:   #if(!$sections || $sections.getClass().getName().indexOf('List') == -1)
284:     #set($sections = [])
285:   #end
286:   ##
287:   ## We have to create a list of documents which the current user doesn't have permission to view.
288:   ## So we can add an error message to the bottom of the page if there are any.
289:   #set($appsUserCannotView = [])
290:   ##
291:   ## A list of sections (to be added) which the user is not allowed to edit, icons will be displayed with a message
292:   #set($sectionsUserCannotEdit = [])
293:   ## List of sections to be added, in order by creationDate of oldest contained application.
294:   #set($sectionsToAdd = [])
295:   ## Map of URL of icon to use by the name of the section to use that icon on.
296:   #set($iconBySection = {})
297:   ##
298:   #set($outputList = [])
299:   #findNamesOfAppsToConfigure(&quot;&quot;, $globaladmin, $currentSpace, $outputList)
300:   ##
301:   #foreach($appName in $outputList)
302:     ##
303:     ## Get the configurable application
304:     #set($app = $xwiki.getDocument($appName))
305:     ##
306:     ## If getDocument returns null, then warn the user that they don't have view access to that application.
307:     #if(!$app)
308:       #set($discard = $appsUserCannotView.add($appName))
309:     #end
310:     ##
311:     #set($configurableObjects = $app.getObjects($nameOfThisDocument))
312:     #foreach($configurableObject in $configurableObjects)
313:       #set($displayInSection = $app.getValue('displayInSection', $configurableObject))
314:       ##
315:       ## If there is no section for this configurable or if the section cannot be edited, then check if the
316:       ## application can be edited by the current user, if so then we display the icon from the current app and
317:       ## don't display any message to tell the user they can't edit that section.
318:       #if(!$sections.contains($displayInSection) || $sectionsUserCannotEdit.contains($displayInSection))
319:         ##
320:         ## If there is no section for this configurable, then we will have to add one.
321:         #if(!$sections.contains($displayInSection) &amp;&amp; !$sectionsToAdd.contains($displayInSection))
322:           #set($discard = $sectionsToAdd.add($displayInSection))
323:         #end
324:         ##
325:         ## If an attachment by the filename iconAttachment exists and is an image
326:         #set($attachment = $app.getAttachment(&quot;$app.getValue('iconAttachment', $configurableObject)&quot;))
327:         #if($attachment &amp;&amp; $attachment.isImage())
328:           ## Set the icon for this section as the attachment URL.
329:           #set($discard = $iconBySection.put($displayInSection, $app.getAttachmentURL($attachment.getFilename())))
330:         #end
331:         ##
332:         ## If the user doesn't have edit access to the application, we want to show a message on the icon
333:         #if(!$xcontext.hasAccessLevel(&quot;edit&quot;, $app.getFullName()))
334:           #if(!$sectionsUserCannotEdit.contains($displayInSection))
335:             #set($discard = $sectionsUserCannotEdit.add($displayInSection))
336:           #end
337:         #elseif($sectionsUserCannotEdit.contains($displayInSection))
338:           ## If the user didn't have access to the section before but does have access to _this_ app which is
339:           ## configured in the section, then the section becomes accessible.
340:           #set($discard = $sectionsUserCannotEdit.remove($displayInSection))
341:         #end
342:       #end## If section doesn't exist or user doesn't have access.
343:     #end## Foreach configurable object in this app.
344:   #end## Foreach application which is configurable.
345:   ##
346:   ## Now we go through sectionsToAdd and generate icons for them
347:   #set($defaultIcon = $xwiki.getAttachmentURL($nameOfThisDocument, 'DefaultAdminSectionIcon.png'))
348:   #if($globaladmin)
349:     #set($queryString = &quot;editor=globaladmin&amp;amp;section=&quot;)
350:   #else
351:     #set($queryString = &quot;space=${currentSpace}&amp;amp;section=&quot;)
352:     #if($request.getParameter('editor'))
353:       #set($queryString = &quot;editor=$escapetool.url($request.getParameter('editor'))&amp;amp;$queryString&quot;)
354:     #end
355:   #end
356: 
357:   ## This is an html fragment and thus cannot be cleaned
358:   {{html clean=false}}
359:   #foreach($sectionToAdd in $sectionsToAdd)
360:     #set($icon = $iconBySection.get($sectionToAdd))
361:     #if(!$icon)
362:       #set($icon = $defaultIcon)
363:     #end
364:     &lt;li class=&quot;$escapetool.xml($sectionToAdd).replaceAll(' ', '_')&quot;&gt;
365:       #set($hasAccess = !$sectionsUserCannotEdit.contains($sectionToAdd))
366:       #if($hasAccess)
367:         &lt;a href=&quot;$xwiki.getURL($currentDoc, $xcontext.getAction(), &quot;$queryString$escapetool.url($sectionToAdd)&quot;)&quot;&gt;
368:       #else
369:         &lt;a title=&quot;$services.localization.render('xe.admin.configurable.sectionIconNoAccessTooltip')&quot;&gt;
370:       #end
371:       &lt;span&gt;
372:       &lt;img src=&quot;$icon&quot; alt=&quot;$escapetool.xml($sectionToAdd) icon&quot;/&gt;
373:       ## Try to translate the names of the sections, build the key by adding an &quot;admin.&quot; in front. 
374:       ## Not the best way to translate, but very inline with the way the translations are done in XWiki.AdminSheet for individual administration page titles.
375:       ## If there is no translation (translated message is equals to key), don't display the message key, but the section name instead.
376:       #if($services.localization.get(&quot;admin.${sectionToAdd.toLowerCase()}&quot;)) 
377:         #set($sectionDisplayName = $services.localization.render(&quot;admin.${sectionToAdd.toLowerCase()}&quot;)) 
378:       #else
379:         #set($sectionDisplayName = $sectionToAdd)
380:       #end
381:       $escapetool.xml($sectionDisplayName)
382:       &lt;/span&gt;
383:       #if(!$hasAccess)
384:         &lt;br/&gt;&lt;span class=&quot;errormessage&quot;&gt;$services.localization.render('xe.admin.configurable.sectionIconNoAccess')&lt;/span&gt;
385:       #end
386:       &lt;/a&gt;
387:     &lt;/li&gt;
388:   #end
389:   {{/html}}
390: 
391:   ## Finally we display an error message if there are any applications which we were unable to view.
392:   #if($appsUserCannotView.size() &gt; 0)
393: 
394:     {{error}}$services.localization.render('xe.admin.configurable.noViewAccessSomeApplications', [$appsUserCannotView]){{/error}}
395: 
396:   #end
397: #end## If we should be looking at the main administration page.
398: {{/velocity}}
</textarea>
</div>

    <div class="clearfloats"></div>
  </div>    </div>      </div>
  </div>
<div class="clearfloats"></div>
  </div></div><div id="footerglobal" class="layoutsection">
<div class="minwidth"></div>
<hr/>
  <div id="xwikilicence">(c) 2026,  by bytebang e.U. - <a href="http://www.bytebang.at/About+us/Impressum">Impressum</a> - <a href="http://www.bytebang.at/About+us/PrivacyAndTermsOfUsage">Datenschutz / Nutzungsbedingungen</a></div>
          <div id="xwikiplatformversion">-</div>
<hr/>
</div>

</div></div></body>
</html>


