Changes for page homeopathsSheet
Last modified by Jip-jan Alunkel on March 26, 17:31
From version 3.56
edited by Jip-jan Alunkel
on March 09, 14:33
on March 09, 14:33
Change comment:
Rollback to version 1.38
To version 3.53
edited by Jip-jan Alunkel
on March 09, 14:22
on March 09, 14:22
Change comment:
Rollback to version 1.38
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -64,8 +64,6 @@ 64 64 'certification': {'type': 'checkbox', 'opener': 1, 'checked': $cert}, 65 65 'certificationFrom': {'type': 'text', 'parent': 'certification'} 66 66 }) 67 - #createAddress($theClass) 68 -#* 69 69 #foreach($property in $classProperties.keySet()) 70 70 #if($theDocObj.getProperty($property)) 71 71 <p class="property"> ... ... @@ -81,7 +81,6 @@ 81 81 #end 82 82 #end 83 83 #end 84 -*# 85 85 #if($hasRight) 86 86 <p class="buttons text-align-right"> 87 87 <a class="btn btn-secondary" title="Edit" data-toggle="modal" data-target="#detailsModal" role="button" rel="nofollow"> ... ... @@ -119,7 +119,7 @@ 119 119 </div> 120 120 <div class="modal-body"> 121 121 <fieldset class="fieldset"> 122 -#createAddress( $theClass)119 +#createAddress() 123 123 </fieldset> 124 124 #set($lastChild = "") 125 125 #foreach($propertyName in $classProperties.keySet()) ... ... @@ -200,15 +200,42 @@ 200 200 This page can not be viewed in inline mode. 201 201 #end 202 202 203 -#macro(createAddress $className) 204 - #set($docObj = $doc.getObject($className)) 200 +#macro(createElementObjects $properties) 201 + #foreach($item in $properties.keySet()) 202 + #set($label = $services.localization.render("homeopaths.classproperty.${item}")) 203 + #if($theDocObj.getProperty($item)) 204 + #set($value = $theDocObj.getProperty($item).value) 205 + #set($newElem = { 206 + "id" : "$item", 207 + "type" : $classProperties[$item].type, 208 + "required" : "false", 209 + "label" : "$label", 210 + "data-create-xobj" : "true", 211 + "data-xobj-classname" : $theClass, 212 + "data-xobj-fieldname" : "$item", 213 + "value" : "$value" 214 + }) 215 + #if($classProperties[$item].opener == 1) 216 + #set($discard = $newElem.put("data-opener", "true")) 217 + #end 218 + #if($classProperties[$item].extraAttributes) 219 + #set($attrMap = $classProperties[$item].extraAttributes) 220 + #foreach($attr in $attrMap.keySet()) 221 + #set($discard = $newElem.put("$attr", $attrMap[$attr])) 222 + #end 223 + #end 224 + #set($thisObj["$item"] = $newElem) 225 + #end 226 + #end 227 +#end 228 +#macro(createAddress) 205 205 <address> 206 206 $doc.getTitle()<br /> 207 207 #set($addressArray = ['pmStreet','pmHousenumber','pmPostcode','pmCity','pmState','pmCounty','pmCountry']) 208 208 #set($x = {}) 209 209 #foreach($datapart in $addressArray) 210 - #if($ docObj.getProperty($datapart))211 - #set($datapart4Publish = $ docObj.getProperty($datapart).value)234 + #if($theDocObj.getProperty($datapart)) 235 + #set($datapart4Publish = $theDocObj.getProperty($datapart).value) 212 212 #if($datapart == 'pmCountry') 213 213 #set($datapart4Publish = $datapart4Publish.toUpperCase()) 214 214 #end