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

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

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

Сводка

Подробности

Свойства страницы
Автор документа
... ... @@ -1,1 +1,1 @@
1 -XWiki.admin
1 +XWiki.rybakovds
Синтаксис
... ... @@ -1,1 +1,1 @@
1 -XWiki 2.0
1 +XWiki 2.1
Содержимое
... ... @@ -50,10 +50,6 @@
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 -##
57 57  ##------------------------------------------------------------------------------------------------------------
58 58  ## If $section exists then we are viewing the admin page for a particular section.
59 59  ## eg: 'Registration', 'Presentation', 'Import' etc.
... ... @@ -127,7 +127,10 @@
127 127   {{warning}}{{translation key="xe.admin.configurable.cannotLockNoJavascript"/}}{{/warning}}
128 128  
129 129   </noscript>
130 - <script type="text/javascript">
126 + {{/html}}
127 +
128 + {{html clean=false}}
129 + <script>
131 131   document.observe("xwiki:dom:loaded", function() {
132 132   XWiki.DocumentLock && new XWiki.DocumentLock('$escapetool.javascript($app.prefixedFullName)').lock();
133 133   });
... ... @@ -143,10 +143,7 @@
143 143   #set($configurableObjs = [])
144 144   #foreach($configurableObj in $allConfigurableObjs)
145 145   #if($app.getValue('displayInSection', $configurableObj) == $section)
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
145 + #set($discard = $configurableObjs.add($configurableObj))
150 150   #end
151 151   #end
152 152   #if($configurableObjs.size() == 0)
... ... @@ -153,7 +153,8 @@
153 153   ## Internal error, not translated.
154 154   #showHeading($appName, $headingShowing)
155 155  
156 - {{error}}Internal error: All objects were filtered out for application: $appName.{{/error}}
152 + {{error}}Internal error: All objects were filtered out for application:
153 + $services.rendering.escape($appName, 'xwiki/2.1').{{/error}}
157 157  
158 158   #else
159 159   #set($formAction = $xwiki.getURL($app.getFullName(), 'save'))
... ... @@ -160,16 +160,23 @@
160 160   #set($formId = "${section.toLowerCase()}_${app.getFullName()}")
161 161   #set($escapedAppName = $escapetool.xml($app.getFullName()))
162 162   #foreach($configurableObj in $configurableObjs)
160 + #set ($heading = $app.getValue('heading', $configurableObj))
161 + #set ($codeToExecute = "$!app.getValue('codeToExecute', $configurableObj)")
162 + ## If linkPrefix is set, then we will make each property label a link which starts with that prefix.
163 + #set ($linkPrefix = "$!app.getValue('linkPrefix', $configurableObj)")
164 + #if (!$app.restricted)
165 + #set ($evaluatedConfigurableObj = $configurableObj.evaluate())
166 + #set ($heading = $evaluatedConfigurableObj.heading)
167 + #set ($linkPrefix = $evaluatedConfigurableObj.linkPrefix)
168 + #end
163 163   ## Display the header if one exists.
164 - #set($heading = $app.getValue('heading', $configurableObj))
165 165   #if($heading && $heading != '')
166 - == #evaluate($heading) ==
171 + == $services.rendering.escape($heading, 'xwiki/2.1') ==
167 167   #end
168 - ##
169 - #set($codeToExecute = "$!app.getValue('codeToExecute', $configurableObj)")
170 - #if($codeToExecute != '')
173 + ## Display code to execute
174 + #if ($codeToExecute != '')
171 171   (%class="codeToExecute"%)(((##
172 - #evaluate($codeToExecute)##
176 + $configurableObj.display('codeToExecute', 'view', false)
173 173   )))
174 174   #end
175 175   ##
... ... @@ -179,9 +179,6 @@
179 179   #set($propertiesToShow = [])
180 180   #end
181 181   ##
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 - ##
185 185   ## If the Configurable object specifies a configuration class, use it,
186 186   ## otherwise assume custom forms are used instead.
187 187   #set($configClassName = "$!app.getValue('configurationClass', $configurableObj)")
... ... @@ -200,7 +200,12 @@
200 200   #showHeading($appName, $headingShowing)
201 201  
202 202   {{error}}
203 - {{translation key="xe.admin.configurable.noObjectOfConfigurationClassFound" parameters="$objClass.getName(), $app.getFullName()"/}}
204 + #set($escapedObjClassName =
205 + $services.rendering.escape($escapetool.java($objClass.getName()), 'xwiki/2.1'))
206 + #set($translationEscapedAppName =
207 + $services.rendering.escape($escapetool.java($app.getFullName()), 'xwiki/2.1'))
208 + {{translation key="xe.admin.configurable.noObjectOfConfigurationClassFound"
209 + parameters="~"$escapedObjClassName~", ~"$translationEscapedAppName~""/}}
204 204   {{/error}}
205 205  
206 206   #else
... ... @@ -266,7 +266,7 @@
266 266   #end## Foreach document name in names to configure
267 267  
268 268   {{html}}
269 - <script type="text/javascript">
275 + <script>
270 270   /* <![CDATA[ */
271 271   ## Alt+Shift+S presses the first saveAndContinue button it finds, not what we want so we will disable edit shortcuts.
272 272   document.observe('xwiki:dom:loaded', function() {
... ... @@ -276,7 +276,7 @@
276 276   </script>
277 277   {{/html}}##
278 278   ##
279 -#else
285 +#elseif ($currentDoc != 'XWiki.ConfigurableClass')
280 280   ##
281 281   ##------------------------------------------------------------------------------------------------------------
282 282   ## If section is not set then we are viewing the main administration page.
... ... @@ -351,7 +351,7 @@
351 351   #if($globaladmin)
352 352   #set($queryString = "editor=globaladmin&amp;section=")
353 353   #else
354 - #set($queryString = "space=${currentSpace}&amp;section=")
360 + #set($queryString = "space=$escapetool.url($currentSpace)&amp;section=")
355 355   #if($request.getParameter('editor'))
356 356   #set($queryString = "editor=$escapetool.url($request.getParameter('editor'))&amp;$queryString")
357 357   #end
... ... @@ -393,9 +393,9 @@
393 393  
394 394   ## Finally we display an error message if there are any applications which we were unable to view.
395 395   #if($appsUserCannotView.size() > 0)
402 + {{error}}$services.localization.render('xe.admin.configurable.noViewAccessSomeApplications',
403 + 'xwiki/2.1', [$appsUserCannotView]){{/error}}
396 396  
397 - {{error}}$services.localization.render('xe.admin.configurable.noViewAccessSomeApplications', [$appsUserCannotView]){{/error}}
398 -
399 399   #end
400 400  #end## If we should be looking at the main administration page.
401 401  {{/velocity}}
categoryIcon
codeToExecute
Редактор
... ... @@ -1,1 +1,1 @@
1 -Text
1 +---
configurationClass
Allow large strings
... ... @@ -1,0 +1,1 @@
1 +0
displayBeforeCategory
displayInCategory
displayInSection
heading
iconAttachment
linkPrefix
propertiesToShow
Allow large strings
... ... @@ -1,0 +1,1 @@
1 +0
scope
Name
... ... @@ -1,0 +1,1 @@
1 +scope
Pretty Name
... ... @@ -1,0 +1,1 @@
1 +scope
Relational Storage
... ... @@ -1,0 +1,1 @@
1 +0
Display Type
... ... @@ -1,0 +1,1 @@
1 +select
Multiple Select
... ... @@ -1,0 +1,1 @@
1 +0
Size
... ... @@ -1,0 +1,1 @@
1 +1
Join separator (for display)
... ... @@ -1,0 +1,1 @@
1 +
Cache
... ... @@ -1,0 +1,1 @@
1 +0
Multiselect separators (for editing)
... ... @@ -1,0 +1,1 @@
1 +|,
Allow large strings
... ... @@ -1,0 +1,1 @@
1 +0
Number
... ... @@ -1,0 +1,1 @@
1 +12
Use Suggest
... ... @@ -1,0 +1,1 @@
1 +1
Values
... ... @@ -1,0 +1,1 @@
1 +WIKI|SPACE|ALL_SPACES|WIKI+ALL_SPACES
sectionOrder
configureGlobally
Name
... ... @@ -1,1 +1,0 @@
1 -configureGlobally
Pretty Name
... ... @@ -1,1 +1,0 @@
1 -configureGlobally
Display Form Type
... ... @@ -1,1 +1,0 @@
1 -checkbox
Number
... ... @@ -1,1 +1,0 @@
1 -4