Изменения документа Настраиваемые разделы

Редактировал(а) Alexey Semenihin 23.10.2026, 15:12

От версии 3.1
отредактировано Dmitriy Rybakov
на 20.06.2025, 16:36
Изменить комментарий: Install extension [org.xwiki.platform:xwiki-platform-administration-ui/16.10.8]
К версии 1.1
отредактировано Admin xWiKi
на 15.10.2019, 13:19
Изменить комментарий: Install extension [org.xwiki.platform:xwiki-platform-administration-ui/11.8.1]

Сводка

Подробности

Свойства страницы
Автор документа
... ... @@ -1,1 +1,1 @@
1 -XWiki.rybakovds
1 +XWiki.admin
Синтаксис
... ... @@ -1,1 +1,1 @@
1 -XWiki 2.1
1 +XWiki 2.0
Содержимое
... ... @@ -50,6 +50,10 @@
50 50  #end
51 51  #set($currentSpace = $xwiki.getDocument($currentDoc).getSpace())
52 52  ##
53 +## This application should not run with programming rights because it evaluates code which may not be trustworthy.
54 +## Removing the next line will open a security hole.
55 +$doc.dropPermissions()##
56 +##
53 53  ##------------------------------------------------------------------------------------------------------------
54 54  ## If $section exists then we are viewing the admin page for a particular section.
55 55  ## eg: 'Registration', 'Presentation', 'Import' etc.
... ... @@ -69,8 +69,7 @@
69 69   #foreach($appName in $outputList)
70 70   ##
71 71   ## Make sure the current user has permission to edit the configurable application.
72 - ## Unless we are in the page administration which is never about modifying the application configuration page
73 - #set($userHasAccessToDocument = $level == '.page' || $xcontext.hasAccessLevel('edit', $appName))
76 + #set($userHasAccessToDocument = $xcontext.hasAccessLevel('edit', $appName))
74 74   ##
75 75   ## If the document was not last saved by a user with edit privilege on this page
76 76   ## then we can't safely display the page but we should warn the viewer.
... ... @@ -124,10 +124,7 @@
124 124   {{warning}}{{translation key="xe.admin.configurable.cannotLockNoJavascript"/}}{{/warning}}
125 125  
126 126   </noscript>
127 - {{/html}}
128 -
129 - {{html clean=false}}
130 - <script>
130 + <script type="text/javascript">
131 131   document.observe("xwiki:dom:loaded", function() {
132 132   XWiki.DocumentLock && new XWiki.DocumentLock('$escapetool.javascript($app.prefixedFullName)').lock();
133 133   });
... ... @@ -143,7 +143,10 @@
143 143   #set($configurableObjs = [])
144 144   #foreach($configurableObj in $allConfigurableObjs)
145 145   #if($app.getValue('displayInSection', $configurableObj) == $section)
146 - #set($discard = $configurableObjs.add($configurableObj))
146 + ## If this is space admin, then don't display global, if global don't display space.
147 + #if($globaladmin == ($app.getValue('configureGlobally', $configurableObj) == 1))
148 + #set($discard = $configurableObjs.add($configurableObj))
149 + #end
147 147   #end
148 148   #end
149 149   #if($configurableObjs.size() == 0)
... ... @@ -150,8 +150,7 @@
150 150   ## Internal error, not translated.
151 151   #showHeading($appName, $headingShowing)
152 152  
153 - {{error}}Internal error: All objects were filtered out for application:
154 - $services.rendering.escape($appName, 'xwiki/2.1').{{/error}}
156 + {{error}}Internal error: All objects were filtered out for application: $appName.{{/error}}
155 155  
156 156   #else
157 157   #set($formAction = $xwiki.getURL($app.getFullName(), 'save'))
... ... @@ -158,23 +158,16 @@
158 158   #set($formId = "${section.toLowerCase()}_${app.getFullName()}")
159 159   #set($escapedAppName = $escapetool.xml($app.getFullName()))
160 160   #foreach($configurableObj in $configurableObjs)
161 - #set ($heading = $app.getValue('heading', $configurableObj))
162 - #set ($codeToExecute = "$!app.getValue('codeToExecute', $configurableObj)")
163 - ## If linkPrefix is set, then we will make each property label a link which starts with that prefix.
164 - #set ($linkPrefix = "$!app.getValue('linkPrefix', $configurableObj)")
165 - #if (!$app.restricted)
166 - #set ($evaluatedConfigurableObj = $configurableObj.evaluate())
167 - #set ($heading = $evaluatedConfigurableObj.heading)
168 - #set ($linkPrefix = $evaluatedConfigurableObj.linkPrefix)
169 - #end
170 170   ## Display the header if one exists.
164 + #set($heading = $app.getValue('heading', $configurableObj))
171 171   #if($heading && $heading != '')
172 - == $services.rendering.escape($heading, 'xwiki/2.1') ==
166 + == #evaluate($heading) ==
173 173   #end
174 - ## Display code to execute
175 - #if ($codeToExecute != '')
168 + ##
169 + #set($codeToExecute = "$!app.getValue('codeToExecute', $configurableObj)")
170 + #if($codeToExecute != '')
176 176   (%class="codeToExecute"%)(((##
177 - $configurableObj.display('codeToExecute', 'view', false)
172 + #evaluate($codeToExecute)##
178 178   )))
179 179   #end
180 180   ##
... ... @@ -184,6 +184,9 @@
184 184   #set($propertiesToShow = [])
185 185   #end
186 186   ##
182 + ## If linkPrefix is set, then we will make each property label a link which starts with that prefix.
183 + #set($linkPrefix = "$!app.getValue('linkPrefix', $configurableObj)")
184 + ##
187 187   ## If the Configurable object specifies a configuration class, use it,
188 188   ## otherwise assume custom forms are used instead.
189 189   #set($configClassName = "$!app.getValue('configurationClass', $configurableObj)")
... ... @@ -202,12 +202,7 @@
202 202   #showHeading($appName, $headingShowing)
203 203  
204 204   {{error}}
205 - #set($escapedObjClassName =
206 - $services.rendering.escape($escapetool.java($objClass.getName()), 'xwiki/2.1'))
207 - #set($translationEscapedAppName =
208 - $services.rendering.escape($escapetool.java($app.getFullName()), 'xwiki/2.1'))
209 - {{translation key="xe.admin.configurable.noObjectOfConfigurationClassFound"
210 - parameters="~"$escapedObjClassName~", ~"$translationEscapedAppName~""/}}
203 + {{translation key="xe.admin.configurable.noObjectOfConfigurationClassFound" parameters="$objClass.getName(), $app.getFullName()"/}}
211 211   {{/error}}
212 212  
213 213   #else
... ... @@ -273,7 +273,7 @@
273 273   #end## Foreach document name in names to configure
274 274  
275 275   {{html}}
276 - <script>
269 + <script type="text/javascript">
277 277   /* <![CDATA[ */
278 278   ## Alt+Shift+S presses the first saveAndContinue button it finds, not what we want so we will disable edit shortcuts.
279 279   document.observe('xwiki:dom:loaded', function() {
... ... @@ -283,7 +283,7 @@
283 283   </script>
284 284   {{/html}}##
285 285   ##
286 -#elseif ($currentDoc != 'XWiki.ConfigurableClass')
279 +#else
287 287   ##
288 288   ##------------------------------------------------------------------------------------------------------------
289 289   ## If section is not set then we are viewing the main administration page.
... ... @@ -358,7 +358,7 @@
358 358   #if($globaladmin)
359 359   #set($queryString = "editor=globaladmin&amp;section=")
360 360   #else
361 - #set($queryString = "space=$escapetool.url($currentSpace)&amp;section=")
354 + #set($queryString = "space=${currentSpace}&amp;section=")
362 362   #if($request.getParameter('editor'))
363 363   #set($queryString = "editor=$escapetool.url($request.getParameter('editor'))&amp;$queryString")
364 364   #end
... ... @@ -400,9 +400,9 @@
400 400  
401 401   ## Finally we display an error message if there are any applications which we were unable to view.
402 402   #if($appsUserCannotView.size() > 0)
403 - {{error}}$services.localization.render('xe.admin.configurable.noViewAccessSomeApplications',
404 - 'xwiki/2.1', [$appsUserCannotView]){{/error}}
405 405  
397 + {{error}}$services.localization.render('xe.admin.configurable.noViewAccessSomeApplications', [$appsUserCannotView]){{/error}}
398 +
406 406   #end
407 407  #end## If we should be looking at the main administration page.
408 408  {{/velocity}}
categoryIcon
codeToExecute
Редактор
... ... @@ -1,1 +1,1 @@
1 ----
1 +Text
configurationClass
Allow large strings
... ... @@ -1,1 +1,0 @@
1 -0
configureGlobally
Name
... ... @@ -1,0 +1,1 @@
1 +configureGlobally
Pretty Name
... ... @@ -1,0 +1,1 @@
1 +configureGlobally
Display Form Type
... ... @@ -1,0 +1,1 @@
1 +checkbox
Number
... ... @@ -1,0 +1,1 @@
1 +4
displayBeforeCategory
displayInCategory
displayInSection
heading
iconAttachment
linkPrefix
propertiesToShow
Allow large strings
... ... @@ -1,1 +1,0 @@
1 -0
sectionOrder
scope
Name
... ... @@ -1,1 +1,0 @@
1 -scope
Pretty Name
... ... @@ -1,1 +1,0 @@
1 -scope
Relational Storage
... ... @@ -1,1 +1,0 @@
1 -0
Display Type
... ... @@ -1,1 +1,0 @@
1 -select
Multiple Select
... ... @@ -1,1 +1,0 @@
1 -0
Size
... ... @@ -1,1 +1,0 @@
1 -1
Join separator (for display)
... ... @@ -1,1 +1,0 @@
1 -
Cache
... ... @@ -1,1 +1,0 @@
1 -0
Multiselect separators (for editing)
... ... @@ -1,1 +1,0 @@
1 -|,
Allow large strings
... ... @@ -1,1 +1,0 @@
1 -0
Number
... ... @@ -1,1 +1,0 @@
1 -12
Use Suggest
... ... @@ -1,1 +1,0 @@
1 -1
Values
... ... @@ -1,1 +1,0 @@
1 -WIKI|SPACE|ALL_SPACES|WIKI+ALL_SPACES