%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/waritko/jetty-distribution-9.4.21.v20190926/webapps/ROOT/skins/flamingo/
Upload File :
Create Path :
Current File : //home/waritko/jetty-distribution-9.4.21.v20190926/webapps/ROOT/skins/flamingo/drawer.vm

#template('drawer_macros.vm')
##
## Display the drawer
##
<div class="drawer-main drawer-default" id="tmDrawer">
  <nav class="drawer-nav">
  
    ##
    ## Drawer header (with elements concerning the current user: profile, login, logout, register, etc...)
    ##
    <div class="drawer-brand clearfix">
      <a href="$xwiki.getURL($xcontext.user, 'view')">
      #largeUserAvatar($xcontext.user)
      </a>
      <div class="brand-links">
        #if ($xcontext.user != 'XWiki.XWikiGuest')
          <a href="$xwiki.getURL($xcontext.user, 'view')" class="brand-user" id="tmUser">$!xwiki.getUserName($xcontext.user, false)</a>
          <a href="$xwiki.getURL('XWiki.XWikiLogout', 'logout', "xredirect=$escapetool.url($xwiki.relativeRequestURL)")" id="tmLogout" rel="nofollow">$services.icon.renderHTML('log-out') $escapetool.xml($services.localization.render('logout'))</a>
        #else
          <a href="$xwiki.getURL('XWiki.XWikiLogin', 'login', "xredirect=$escapetool.url($xwiki.relativeRequestURL)")" id="tmLogin" rel="nofollow">$services.icon.renderHTML('log-in') $escapetool.xml($services.localization.render('login'))</a>
          #if ($xwiki.hasAccessLevel('register', 'XWiki.XWikiPreferences'))
            <a href="$xwiki.getURL('XWiki.XWikiRegister', 'register', "xredirect=$escapetool.url($xwiki.relativeRequestURL)")" id="tmRegister" rel="nofollow">$services.icon.renderHTML('log-in') $escapetool.xml($services.localization.render('register'))</a>
          #end
        #end
         ##
         ## UIX
         ##
         #displayDrawerUIX('org.xwiki.plaftorm.drawer.header')
      </div>
    </div>

    ##
    ## Display the content of the drawer
    ##
    <ul class="drawer-menu">
      #set ($drawerExtensions = $services.uix.getExtensions('org.xwiki.plaftorm.drawer', {'sortByParameter' : 'order'}))
      ##
      ## Local Category
      ##
      #drawerCategoryHeader($services.wiki.currentWikiDescriptor.prettyName)
      ##
      ## Display an "Administer wiki" item if the Administration App is not installed.
      ## The role of the item is to help the user importing content.
      ##
      #if ($hasGlobalAdmin)
        #set ($importaction = $!xwiki.getURL('XWiki.XWikiPreferences', 'import'))
        #if (!$isAdminAppInstalled)
          ## If the admin application is not installed, we add a link to import it.
          ## Otherwise, we let the admin application adds the correct UIX to administrate the wiki.
          #set ($importaction = $!xwiki.getURL('XWiki.XWikiPreferences', 'import'))
          #drawerItem($importaction, 'wrench', $escapetool.xml($services.localization.render('core.menu.admin')), 'tmAdminWiki')
          #drawerSeparator()
        #end
      #end
      ##
      ## UIX: Drawer items for the current wiki
      ##
      #displayTheseDrawerUIX($drawerExtensions, 'local')
      ##
      ## Global category
      ##
      #define ($globalPart)
        ##
        ## Languages
        ##
        #template('menus_language.vm')
        ##
        ## UIX: Drawer items for the global scope
        ##
        #displayTheseDrawerUIX($drawerExtensions, 'global')
      #end
      #if ($stringtool.isNotBlank($globalPart.toString()))
        #drawerCategoryHeader($services.localization.render('core.drawer.global'))
        $globalPart
      #end
    </ul>
  </nav>
</div>
#**
 * Display the UI extensions.
 *
 * @param $name the name of the UI extension to display
 * @param $category the name of the category to filter on (by default, it fallbacks on "local")
 *#
#macro(displayDrawerUIX $name $category)
  #displayTheseDrawerUIX($services.uix.getExtensions($name, {'sortByParameter' : 'order'}), $category)
#end
#**
 * Display the UI extensions.
 *
 * @param $extensions a list of extensions to display
 * @param $category the name of the category to filter on (by default, it fallbacks on "local")
 *#
#macro(displayTheseDrawerUIX $extensions $category)
  #set ($canHaveMenuSeparator = false)
  #if ("$!category" == '')
    #set ($category = 'local')
  #end
  #foreach($uix in $extensions)
    #set ($uixCategory = "$!uix.parameters.category")
    #if (($uixCategory == $category || $category == 'local' && $uixCategory == '') && $services.security.authorization.hasAccess('admin', $uix.authorReference, $services.wiki.currentWikiDescriptor.reference))
      #if ("$!uix.getParameters().separator" == 'true' && $canHaveMenuSeparator)
        #drawerSeparator()
        #set ($canHaveMenuSeparator = false)
      #end
      #set ($content = $services.rendering.render($uix.execute(), 'html/5.0'))
      $content
      #if (!$canHaveMenuSeparator && $stringtool.isNotBlank($content))
        #set ($canHaveMenuSeparator = true)
      #end
    #end
  #end
#end

Zerion Mini Shell 1.0