Wiki source code of Administration


Show last authors
1 {{velocity}}
2 #set ($allConfigClasses = ['SUZ.Code.SUZConfigurationClass', 'SUZ.Code.CatalogConfigurationClass', 'SUZ.Code.MetadataConfigurationClass'])
3 #if (!$xwiki.exists('SUZ.Code.SUZConfiguration'))
4 #set ($rdoc = $xwiki.getDocument('SUZ.Code.SUZConfiguration'))
5 #set ($conObj = $rdoc.newObject('SUZ.Code.SUZConfigurationClass'))
6 #set($discard = $conObj.set('name','Общие параметры'))
7 #set ($discard = $rdoc.save())
8 #set ($configDoc = $xwiki.getDocument('SUZ.Code.SUZConfiguration'))
9 #else
10 #set ($configDoc = $xwiki.getDocument('SUZ.Code.SUZConfiguration'))
11 #set ($confObject = $configDoc.getObject('SUZ.Code.SUZConfigurationClass'))
12 #if (!$confObject)
13 #set($conObj = $configDoc.newObject('SUZ.Code.SUZConfigurationClass'))
14 #set($discard = $conObj.set('name','Общие параметры'))
15 #set($discard = $configDoc.save())
16 #set ($configDoc = $xwiki.getDocument('SUZ.Code.SUZConfiguration'))
17 #end
18 #end
19 #set ($requestURL = $xwiki.getRequestURL())
20 {{html wiki="true" clean="false"}}
21 #set ($discard = $xwiki.ssx.use("SUZ.Code.Administration.WebHome"))
22 #foreach ($currentConfigClass in $allConfigClasses)
23 #set ($configClass = $xwiki.getDocument($currentConfigClass).xWikiClass)
24 #set ($configObjects = $configDoc.getObjects($configClass.name))
25 #foreach ($configObject in $configObjects)
26 ##TODO: Добавить вкладки или сворачивание каждой формы
27 <form method="post" action="${xwiki.getURL('SUZ.Code.SUZConfiguration', 'save')}" class='xform'>
28 <div class="hidden">
29 <input type='hidden' name='form_token' value="$!{services.csrf.getToken()}" />
30 <input type='hidden' name='xredirect' value="{{/html}}{{html wiki="false" clean="false"}}$requestURL{{/html}}{{html wiki="true" clean="false"}}" /> ##TODO: Может быть более пправильное решение
31 </div>
32 #foreach ($property in $configClass.properties)
33 #if ($property.name == 'name') ##name нередактируемое свойство, используется для заголовка формы/
34 ##TODO: Добавить вкладки или сворачивание каждой формы
35 <a data-toggle="collapse" href="#${currentConfigClass.replace('SUZ.Code.','')}_${configObject.number}" aria-expanded="false" aria-controls="${currentConfigClass.replace('SUZ.Code.','')}_${configObject.number}" style="text-decoration: none;" class="hideButton d-inline-block">
36 <h3 id="${configClass.name}_${configObject.number}" class="wikigeneratedid wikigeneratedheader d-inline-block" style="color:black;"><span>$configDoc.display($property.name, 'view', $configObject)</span></h3>
37 </a>
38 <div id="${currentConfigClass.replace('SUZ.Code.','')}_${configObject.number}" class="collapse">
39 <dl>
40 #else
41 <dt>
42 ## This must match the id generated by the $doc.display() method below.
43 #set ($propertyId = "${configClass.name}_${configObject.number}_$property.name")
44 <label for="$escapetool.xml($propertyId)">
45 $escapetool.xml($property.translatedPrettyName)
46 </label>
47 ## Support for specifying a translation key as hint in the property definition.
48 <span class="xHint">$!escapetool.xml($services.localization.render($property.hint))</span>
49 </dt>
50 <dd>$configDoc.display($property.name, 'edit', $configObject)</dd>
51 #end
52 #end
53 </dl>
54 <div class='buttonwrapper'>
55 <input value="$services.localization.render('admin.save')" class='button' type='submit'>
56 </div>
57 </div>
58 </form>
59 #end
60 #end
61 {{/html}}
62 {{/velocity}}

Commonwealth of Nations

Languages