Andrew's Web Libraries (AWL)
|
Public Member Functions | |
__construct ( $div_id, $main_class='', $active_class='active') | |
& | AddOption ( $label, $target, $title="", $active=false, $sortkey=null, $external=false) |
& | AddSubMenu (&$submenu_set, $label, $target, $title="", $active=false, $sortkey=2000) |
_HasActive () | |
Size () | |
_OptionExists ( $newlabel) | |
LinkActiveSubMenus () | |
MakeSomethingActive ( $test_pattern) | |
_CompareSequence ( $a, $b) | |
Render ( $submenus_inline=false) | |
RenderAsCSS ( $depth=0, $skip_empty=true) | |
Public Attributes | |
$div_id | |
$main_class | |
$active_class | |
$options | |
$parent | |
$last_sortkey | |
$has_active_options | |
Definition at line 222 of file MenuSet.php.
MenuSet::__construct | ( | $div_id, | |
$main_class = '' , |
|||
$active_class = 'active' |
|||
) |
#- Start a new MenuSet with no options.
string | $div_id | An ID for the HTML div that the menu will be presented in. |
string | $main_class | A CSS class for most menu options. |
string | $active_class | A CSS class for active menu options. |
Definition at line 276 of file MenuSet.php.
MenuSet::_CompareSequence | ( | $a, | |
$b | |||
) |
_CompareSequence is used in sorting the menu options into the sequence order
objectref | $a | The first menu option |
objectref | $b | The second menu option |
Definition at line 448 of file MenuSet.php.
MenuSet::_HasActive | ( | ) |
Does the menu have any options that are active. Most likely used so that we can then set the parent menu as active.
string | $label | A Label for the new menu option |
Definition at line 354 of file MenuSet.php.
MenuSet::_OptionExists | ( | $newlabel | ) |
See if a menu already has this option
Definition at line 380 of file MenuSet.php.
& MenuSet::AddOption | ( | $label, | |
$target, | |||
$title = "" , |
|||
$active = false , |
|||
$sortkey = null , |
|||
$external = false |
|||
) |
Add an option, which is a link. The call will attempt to work out whether the option should be marked as active, and will sometimes get it wrong.
string | $label | A Label for the new menu option |
string | $target | The URL to target for this option. |
string | $title | Some tooltip help for the title tag. |
string | $active | Whether this option should be marked as Active. |
int | $sortkey | An (optional) value to allow option ordering. |
external | open this link in a new window/tab. |
Definition at line 295 of file MenuSet.php.
& MenuSet::AddSubMenu | ( | & | $submenu_set, |
$label, | |||
$target, | |||
$title = "" , |
|||
$active = false , |
|||
$sortkey = 2000 |
|||
) |
Add an option, which is a submenu
object | &$submenu_set | A reference to a menu tree |
string | $label | A Label for the new menu option |
string | $target | The URL to target for this option. |
string | $title | Some tooltip help for the title tag. |
string | $active | Whether this option should be marked as Active. |
int | $sortkey | An (optional) value to allow option ordering. |
Definition at line 341 of file MenuSet.php.
MenuSet::LinkActiveSubMenus | ( | ) |
Mark each MenuOption as active that has an active sub-menu entry.
Currently needs to be called manually before rendering but really should probably be called as part of the render now, and then this could be a private routine.
Definition at line 395 of file MenuSet.php.
MenuSet::MakeSomethingActive | ( | $test_pattern | ) |
Mark each MenuOption as active that has an active sub-menu entry.
Currently needs to be called manually before rendering but really should probably be called as part of the render now, and then this could be a private routine.
Definition at line 413 of file MenuSet.php.
MenuSet::Render | ( | $submenus_inline = false | ) |
Render the menu tree to an HTML fragment.
boolean | $submenus_inline | Indicate whether to render the sub-menus within the menus, or render them entirely separately after we finish rendering the top level ones. |
Definition at line 462 of file MenuSet.php.
MenuSet::RenderAsCSS | ( | $depth = 0 , |
|
$skip_empty = true |
|||
) |
Render the menu tree to an HTML fragment.
boolean | $submenus_inline | Indicate whether to render the sub-menus within the menus, or render them entirely separately after we finish rendering the top level ones. |
Definition at line 494 of file MenuSet.php.
MenuSet::Size | ( | ) |
Find out how many options the menu has.
Definition at line 372 of file MenuSet.php.
MenuSet::$active_class |
Definition at line 242 of file MenuSet.php.
MenuSet::$div_id |
Definition at line 230 of file MenuSet.php.
MenuSet::$has_active_options |
Definition at line 267 of file MenuSet.php.
MenuSet::$last_sortkey |
Definition at line 260 of file MenuSet.php.
MenuSet::$main_class |
Definition at line 236 of file MenuSet.php.
MenuSet::$options |
Definition at line 248 of file MenuSet.php.
MenuSet::$parent |
Definition at line 254 of file MenuSet.php.