%3 ::xowiki::BootstrapNavbar ::xowiki::BootstrapNavbar render ::xowiki::Menu ::xowiki::Menu render ::xowiki::BootstrapNavbar->::xowiki::Menu ::xowiki::YUIMenuItemList ::xowiki::YUIMenuItemList ::xowiki::YUIMenuItemList->::xowiki::Menu ::xowiki::BootstrapNavbarDropdownMenu ::xowiki::BootstrapNavbarDropdownMenu render ::xowiki::BootstrapNavbarDropdownMenu->::xowiki::Menu ::xowiki::YUIMenu ::xowiki::YUIMenu render ::xowiki::YUIMenu->::xowiki::Menu ::xowiki::MenuComponent ::xowiki::MenuComponent ::xowiki::Menu->::xowiki::MenuComponent ::xowiki::YUIMenuBar ::xowiki::YUIMenuBar render ::xowiki::YUIMenuBar->::xowiki::YUIMenu ::xowiki::YUIContextMenu ::xowiki::YUIContextMenu render ::xowiki::YUIContextMenu->::xowiki::YUIMenu

Class ::xowiki::YUIMenu

::xowiki::YUIMenu[i] create ... \
           [ -autorender (default "false") ] \
           [ -configuration (default "{}") ] \
           [ -footer footer ] \
           [ -header header ] \
           [ -shadow shadow ]

Class Relations

  • class: ::xo::tdom::Class[i]
  • superclass: ::xowiki::Menu[i]
  • subclass: ::xowiki::YUIMenuBar[i], ::xowiki::YUIContextMenu[i]
::xo::tdom::Class create ::xowiki::YUIMenu \
     -superclass ::xowiki::Menu

Methods (to be applied on instances)

  • render (scripted, public)

     <instance of xowiki::YUIMenu[i]> render

    http://developer.yahoo.com/yui/menu/

    Partial Call Graph (max 5 caller/called nodes):
    %3 security::csp::nonce security::csp::nonce (public) xowiki::YUIMenu instproc render xowiki::YUIMenu instproc render xowiki::YUIMenu instproc render->security::csp::nonce

    Testcases:
    No testcase defined.
    append :CSSclass " yuimenu"
    set :extrajs ""
    
    # I want the menu to show up when JS is disabled
    # This gets overridden by JS, so its only relevant for the non-JS version
    #set :style "visibility: visible; position: relative;"
    
    html::div [:get_attributes {CSSclass class} id style] {
      # Header
      html::t \n
      if {[info exists :header]} {
        html::div -class "hd" {
          html::t [:header]
        }
      }
      # Body
      html::t \n
      html::div -class "bd" {
        foreach group [:split_menu_groups [:children]] {
          html::ul -class yuiml {
            foreach menuitemlist $group {$menuitemlist render}
          }
        }
      }
      # Footer
      if {[info exists :footer]} {
        html::div -class "ft" {
          html::t [:footer]
        }
      }
      # Shadow
      if {[info exists :shadow]} {
        html::div -class "yui-menu-shadow" {}
      }
      # JavaScript
      # only "root-level" menus need JS
      # TODO: is this parent-check sufficient / future-safe?
      if {[info exists :__parent]} {
        #
        # propagate extrajs from rendering
        #
        #ns_log notice "### propagate extrajs <${:extrajs}> from [:info class] to [${:__parent} info class]"
        ${:__parent} append extrajs ${:extrajs}
      } else {
        html::script -nonce [security::csp::nonce] -type "text/javascript" {
          html::t "var [:js_name] = new YAHOO.widget.Menu(\"[:id]\", ${:configuration});"
          html::t "
                        [:js_name].render();
                        [:js_name].show();
                        ${:extrajs}
                    "
        }
      }
    }