Class ::xowiki::YUIMenu (public)
::xo::tdom::Class ::xowiki::YUIMenu
Defined in
- Testcases:
-
No testcase defined.
Source code:
namespace eval ::xowiki {}
::nsf::object::alloc ::xo::tdom::Class ::xowiki::YUIMenu {set :__default_metaclass ::xotcl::Class
set :__default_superclass ::xotcl::Object}
::xowiki::YUIMenu instproc init {} {
::xowiki::Includelet require_YUI_CSS -ajaxhelper 1 "menu/assets/skins/sam/menu.css"
::xowiki::Includelet require_YUI_JS -ajaxhelper 1 "yahoo-dom-event/yahoo-dom-event.js"
::xowiki::Includelet require_YUI_JS -ajaxhelper 1 "container/container_core-min.js"
::xowiki::Includelet require_YUI_JS -ajaxhelper 1 "menu/menu-min.js"
next
}
::xowiki::YUIMenu instproc render {} {
append :CSSclass " yuimenu"
set :extrajs ""
html::div [:get_attributes {CSSclass class} id style] {
html::t \n
if {[info exists :header]} {
html::div -class "hd" {
html::t [:header]
}
}
html::t \n
html::div -class "bd" {
foreach group [:split_menu_groups [:children]] {
html::ul -class yuiml {
foreach menuitemlist $group {$menuitemlist render}
}
}
}
if {[info exists :footer]} {
html::div -class "ft" {
html::t [:footer]
}
}
if {[info exists :shadow]} {
html::div -class "yui-menu-shadow" {}
}
if {[info exists :__parent]} {
${:__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}
"
}
}
}
}
::xowiki::YUIMenu instproc split_menu_groups list {
set result [list]
if {[llength $list] < 1} {return $result}
set group_name [[lindex $list 0] group]
set group_list [list]
foreach e $list {
set gn [$e group]
if {$gn ne $group_name} {
lappend result $group_list
set group_name $gn
set group_list [list]
}
lappend group_list $e
}
lappend result $group_list
return $result
}
::xowiki::YUIMenu instparametercmd configuration
::xowiki::YUIMenu instparametercmd autorender
::xowiki::YUIMenu instparametercmd header
::xowiki::YUIMenu instparametercmd shadow
::xowiki::YUIMenu instparametercmd footer
::nsf::relation::set ::xowiki::YUIMenu superclass ::xowiki::Menu
::nx::slotObj -container slot ::xowiki::YUIMenu
::xowiki::YUIMenu::slot eval {set :__parameter {
header
footer
shadow
{autorender false}
{configuration {{}}}
}}
::nsf::object::alloc ::xotcl::Attribute ::xowiki::YUIMenu::slot::footer {set :accessor public
set :configurable true
set :convert false
set :defaultmethods {}
set :disposition alias
set :domain ::xowiki::YUIMenu
set :incremental 0
set :manager ::xowiki::YUIMenu::slot::footer
set :methodname footer
set :multiplicity 1..1
set :name footer
set :per-object false
set :position 0
set :required false
set :trace none
: init}
::nsf::object::alloc ::xotcl::Attribute ::xowiki::YUIMenu::slot::configuration {set :accessor public
set :configurable true
set :convert false
set :default {{}}
set :defaultmethods {}
set :disposition alias
set :domain ::xowiki::YUIMenu
set :incremental 0
set :manager ::xowiki::YUIMenu::slot::configuration
set :methodname configuration
set :multiplicity 1..1
set :name configuration
set :per-object false
set :position 0
set :required false
set :substdefault 0b111
set :trace none
: init}
::nsf::object::alloc ::xotcl::Attribute ::xowiki::YUIMenu::slot::header {set :accessor public
set :configurable true
set :convert false
set :defaultmethods {}
set :disposition alias
set :domain ::xowiki::YUIMenu
set :incremental 0
set :manager ::xowiki::YUIMenu::slot::header
set :methodname header
set :multiplicity 1..1
set :name header
set :per-object false
set :position 0
set :required false
set :trace none
: init}
::nsf::object::alloc ::xotcl::Attribute ::xowiki::YUIMenu::slot::autorender {set :accessor public
set :configurable true
set :convert false
set :default false
set :defaultmethods {}
set :disposition alias
set :domain ::xowiki::YUIMenu
set :incremental 0
set :manager ::xowiki::YUIMenu::slot::autorender
set :methodname autorender
set :multiplicity 1..1
set :name autorender
set :per-object false
set :position 0
set :required false
set :substdefault 0b111
set :trace none
: init}
::nsf::object::alloc ::xotcl::Attribute ::xowiki::YUIMenu::slot::shadow {set :accessor public
set :configurable true
set :convert false
set :defaultmethods {}
set :disposition alias
set :domain ::xowiki::YUIMenu
set :incremental 0
set :manager ::xowiki::YUIMenu::slot::shadow
set :methodname shadow
set :multiplicity 1..1
set :name shadow
set :per-object false
set :position 0
set :required false
set :trace none
: init}
namespace eval ::xowiki {::namespace export Menu YUIMenuBar YUIMenuBarItem YUIMenu YUIMenuItem YUIMenuItemList YUIContextMenu YUIContextMenuItem}
XQL Not present:Generic, PostgreSQL, Oracle
[
hide source ]
| [
make this the default ]