.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Jifty::Web::Menu 3pm" .TH Jifty::Web::Menu 3pm "2011-02-07" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Jifty::Web::Menu \- Handle the API for menu navigation .SH "METHODS" .IX Header "METHODS" .SS "new \s-1PARAMHASH\s0" .IX Subsection "new PARAMHASH" Creates a new Jifty::Web::Menu object. Possible keys in the \&\fI\s-1PARAMHASH\s0\fR are \*(L"label\*(R", \*(L"parent\*(R", \*(L"sort_order\*(R", \*(L"url\*(R", and \&\*(L"active\*(R". See the subroutines with the respective name below for each option's use. .SS "label [\s-1STRING\s0]" .IX Subsection "label [STRING]" Sets or returns the string that the menu item will be displayed as. .SS "parent [\s-1MENU\s0]" .IX Subsection "parent [MENU]" Gets or sets the parent Jifty::Web::Menu of this item; this defaults to null. This ensures that the reference is weakened. .SS "raw_html [\s-1STRING\s0]" .IX Subsection "raw_html [STRING]" Sets the content of this menu item to a raw blob of \s-1HTML\s0. When asked or output, rather than constructing a link, Jifty will return this raw content. No escaping is done. .SS "sort_order [\s-1NUMBER\s0]" .IX Subsection "sort_order [NUMBER]" Gets or sets the sort order of the item, as it will be displayed under the parent. This defaults to adding onto the end. .SS "link" .IX Subsection "link" Gets or set a Jifty::Web::Form::Link object that represents this menu item. If you're looking to do complex ajaxy things with menus, this is likely the option you want. .SS "target [\s-1STRING\s0]" .IX Subsection "target [STRING]" Get or set the frame or pseudo-target for this link. something like _blank .SS "class [\s-1STRING\s0]" .IX Subsection "class [STRING]" Gets or sets the \s-1CSS\s0 class the link should have in addition to the default classes. This is only used if \*(L"link\*(R" isn't specified. .SS "render_children_inline [\s-1BOOLEAN\s0]" .IX Subsection "render_children_inline [BOOLEAN]" Gets or sets whether children are rendered inline as a menu \*(L"group\*(R" instead of a true submenu. Only used when rendering with \s-1YUI\s0 for now. Defaults to false. .PP Note that \s-1YUI\s0 doesn't support rendering nested menu groups, so having direct parent/children render_children_inline is likely not going to do what you want or expect. .SS "url" .IX Subsection "url" Gets or sets the \s-1URL\s0 that the menu's link goes to. If the link provided is not absolute (does not start with a \*(L"/\*(R"), then is is treated as relative to it's parent's url, and made absolute. .SS "active [\s-1BOOLEAN\s0]" .IX Subsection "active [BOOLEAN]" Gets or sets if the menu item is marked as active. Setting this cascades to all of the parents of the menu item. .SS "child \s-1KEY\s0 [, \s-1PARAMHASH\s0]" .IX Subsection "child KEY [, PARAMHASH]" If only a \fI\s-1KEY\s0\fR is provided, returns the child with that \fI\s-1KEY\s0\fR. .PP Otherwise, creates or overwrites the child with that key, passing the \&\fI\s-1PARAMHASH\s0\fR to \*(L"new\*(R" in Jifty::Web::Menu. Additionally, the paramhash's \&\*(L"label\*(R" defaults to the \fI\s-1KEY\s0\fR, and the \*(L"sort_order\*(R" defaults to the pre-existing child's sort order (if a \f(CW\*(C`KEY\*(C'\fR is being over-written) or the end of the list, if it is a new \f(CW\*(C`KEY\*(C'\fR. .PP If the paramhash contains a key called \f(CW\*(C`menu\*(C'\fR, that will be used instead of creating a new Jifty::Web::Menu. .SS "active_child" .IX Subsection "active_child" Returns the first active child node, or \f(CW\*(C`undef\*(C'\fR is there is none. .SS "delete \s-1KEY\s0" .IX Subsection "delete KEY" Removes the child with the provided \fI\s-1KEY\s0\fR. .SS "children" .IX Subsection "children" Returns the children of this menu item in sorted order; as an array in array context, or as an array reference in scalar context. .SS "render_as_menu" .IX Subsection "render_as_menu" Render this menu with \s-1HTML\s0 markup as multiple dropdowns, suitable for an application's menu .PP Any arguments are passed to render_as_hierarchical_menu_item. .SS "render_as_context_menu" .IX Subsection "render_as_context_menu" Render this menu with html markup as an inline dropdown menu. .SS "render_as_hierarchical_menu_item" .IX Subsection "render_as_hierarchical_menu_item" Render an
  • for this item. suitable for use in a regular or contextual menu. Currently renders one level of submenu, if it exists, using \&\*(L"render_submenu\*(R". .PP If you pass \f(CW\*(C`expand =\*(C'\fR 0>, the javascript expansion \f(CW\*(C`span\*(C'\fR won't be output. .PP Any arguments are passed to render_submenu. .SS "render_submenu" .IX Subsection "render_submenu" Renders a