Allgemeine Aktionen:
Anmelden
Erstellen
▼
:
Kommentar erstellen
Wiki
▼
:
Dokumentenindex
»
Space:
AnnotationCode
▼
:
Dokumentenverzeichnis
»
Seite:
Settings
Suche
Aktionen:
Exportieren
▼
:
Als PDF exportieren
Als RTF exportieren
Als HTML exportieren
Weitere Aktionen
▼
:
Druckvorschau
Zeige den Quellcode
Willkommen in den metamagix Wikis!
»
WebHome
»
Settings
Wiki-Quellcode von
Settings
Zuletzt geändert von
Administrator
am 2010/04/22 16:11
Inhalt
·
Kommentare
(0)
·
Anmerkungen
(0)
·
Anhänge
(0)
·
Historie
·
Information
Zeilennummern anzeigen
{{velocity output="false"}} #* * Display the checkboxes for a given criterion, according to the values passed in $options * @param $label the pabel of the criterion, the way it should be displayed * @param $expanded true if the criterion should be displayed with options visible, false otherwise * @param $active true if any value in this criterion is checked, false otherwise * @param $options map of maps with the values to display for this criterion, which contains, for each value, the value to be sent to the filter request as key and as value a map with "checked" a boolean indicating whether the value is chosen or not and "prettyName" the display string corresponding to the respective value *# #macro(displayCriterion $label $name $expanded $active $options) <div class="criterion #if(!$expanded) collapsed #end #if($active) active #end"> <span class="criterion-label">$label <span class="details">($msg.get('annotations.filters.anyvalue'))</span> <span class="clear">($msg.get('annotations.filters.clearvalue'))</span></span> ## and the hidden input holding the criterion name, that allows the javascript to extract the filter from this criterion <input type="hidden" name="${name}" value="${name}"/> #if ($expanded) <div class="criterion-options"> <div class="criterion-option-list"> #if ($options.keySet().size() == 0) <span class="no-option">$msg.get('annotations.filters.nooption', [$label])</span> #end #foreach ($option in $options.keySet()) #set($optionValue = $options.get($option)) <label class="option #if($optionValue.checked) selected #end"><input type="checkbox" value="${option}" #if($optionValue.checked) checked="checked" #end/>$optionValue.prettyName</label> #end </div> </div> #end </div> #end #* * Extracts the unique values of propertyName for the annotations in annotationsList and returns them, along with the number of occurrences, in $valuesMap. * @param $annotationsList the list of annotations to group the values for * @param $propertyName the property whose values to group * @param $valuesMap the map to return the values in *# #macro(getValues $annotationsList $propertyName $valuesMap) #set($valuesMap = {}) #foreach($ann in $annotationsList) #set($value = "") #set($value = $ann.get($propertyName)) #if("$!{value}" != "") #set($previousValue = $valuesMap.get($value)) #if ($previousValue) #set($newValue = $previousValue + 1) #set($dispose = $valuesMap.put($value, $newValue)) #else #set($dispose = $valuesMap.put($value, 1)) #end #end #end #end #* * Displays the annotators checkbox selectors for the annotations authors. * @param $annotationsList the list of annotations to display the annotators selector for *# #macro(displayAnnotatorCheckboxes $annotationsList) #set($checkboxesMap = {}) #set($valuesMap = {}) #getValues($annotationsList, "author", $valuesMap) #foreach($value in $valuesMap.keySet()) #set($dispose = $checkboxesMap.put($value, {"checked" : false, "prettyName" : $xwiki.getUserName($value, false)})) #end #set($config = 'AnnotationCode.AnnotationConfig') #set($annotationClassDocName = $xwiki.getDocument($config).getObject($config).getProperty('annotationClass').value) #set($annotationClass = $xwiki.getDocument("$!{annotationClassDocName}").getxWikiClass()) #displayCriterion($annotationClass.get("author").prettyName, "author", true, false, $checkboxesMap) #end #* * Displays the checkboxes for criterion extracted from the passed property name. * @param $propertyName the name of the property to extract this criterion from * @param $annotationsList the list of annotations to display the annotators selector for *# #macro(displayPropertyCheckboxes $annotationsList $propertyName) #set($checkboxesMap = {}) #set($valuesMap = {}) #getValues($annotationsList, $propertyName, $valuesMap) #foreach($value in $valuesMap.keySet()) #set($dispose = $checkboxesMap.put($value, {"checked" : false, "prettyName" : $value})) #end #set($config = 'AnnotationCode.AnnotationConfig') #set($annotationClassDocName = $xwiki.getDocument($config).getObject($config).getProperty('annotationClass').value) #set($annotationClass = $xwiki.getDocument("$!{annotationClassDocName}").getxWikiClass()) #displayCriterion($annotationClass.get($propertyName).prettyName, $propertyName, true, false, $checkboxesMap) #end {{/velocity}} {{velocity}} {{html clean="false"}} <div class="annotationsettings"> #if ("$!{request.target}" != "") ## check the syntax of the target (should be an annotations function called instead of a standard xwiki call) #set($targetDoc = $xwiki.getDocument($!request.target)) #set($targetDocSyntax = $targetDoc.syntax) #if (!($targetDocSyntax.type.id == 'xwiki' && $targetDocSyntax.version == '1.0')) <div class="box plainmessage">$msg.get("annotations.action.create.helpmessage", ["<strong>Ctrl + M (Meta + M)</strong>"])</div> <input type="checkbox" name="annotationsdisplay" id="annotationsdisplay" /> <label for="annotationsdisplay">$msg.get('annotations.settings.display')</label> <div class="annotation-filters collapsed" id="annotation-filters"> <div class="annotation-filters-toggler"><a href="#annotation-filters">$msg.get('annotations.filters.show')</a></div> <div class="criteria"> #set($annotationsList = $annotations.getAnnotations($!request.target)) #displayAnnotatorCheckboxes($annotationsList) </div> </div> <div class="clearfloats" /> #else <div class="box infomessage">$msg.get("annotations.settings.error.wrongsyntax")</div> #end #else <div class="box infomessage">$msg.get("annotations.settings.error.notarget")</div> #end </div> {{/html}} {{/velocity}}