Wiki Home » Panels » ClassSwitcher

ClassSwitcher

Last modified by Administrator on 2010/09/24 19:24
Name
Class Switcher
Panel type
edit
Category
Tools
Description

Form that allows choosing the class for the object to be added to the current document.

Content

#largepanelheader('Class Switcher')
$xwiki.jsx.use('Panels.ClassSwitcher')
<div>
<form id="changeclass" method="post" action="$doc.getURL("redirect")">
<div>
<select id="classname" name="xredirect" size="1">
<option value="-">Edit another class</option>

 Existing classes are enumerated, grouped by space name.
The list is already sorted alphabetically

#set($prevSpace = "")
#set($optGroupOpen = false)
#foreach ($classname in $xwiki.classList)
  #if($!xwiki.hasAccessLevel("edit", $classname))
    #set($classdoc = $xwiki.getDocument($classname))
    #if($classdoc.space != $prevSpace)
      #if($optGroupOpen)
        </optgroup>
      #else
        #set($optGroupOpen = true)
      #end
          <optgroup label="$classdoc.space">
      #set($prevSpace = $classdoc.space)
    #end
    <option value="$classdoc.getURL("edit", "editor=class")">$classdoc.name</option>
  #end
#end
#if($optGroupOpen)
        </optgroup>
#end
</select>
<span class="buttonwrapper"><input class="button" type="submit" value="$msg.get("changeclass")"/></span></div>
#warning($msg.get('xe.panels.classedit.unsavedchanges'))
</form>
</div>
#panelfooter()

Tags:
Created by Administrator on 2006/07/28 09:40

Copyright 2004-2025 XWiki
4.0-milestone-1