KWeb
6.4
|
Class supporting creation of menus. More...
Public Member Functions | |
__construct ($id=false) | |
count () | |
addSubmenu (Menu_ItemInterface $item, $pos=false, $insertAfter=false) | |
Adds subitem. | |
removeSubmenu ($itemOrPos) | |
Removes submenu item. | |
moveSubmenu ($itemOrPos, $pos=false, $insertAfter=false) | |
Moves specified submenu to new position. | |
mergeSubmenus ($menu) | |
Merges two submenus together. | |
mergeSubmenusLater ($merge) | |
Works like mergeSubmenus(), but postpones merging, until mergePostponedSubmenus() is called. | |
mergePostponedSubmenus () | |
sortSubmenus ($onField= 'title', $ascending=true) | |
sortSubmenusCompare ($a, $b, $onField, $ascending) | |
getMenuId () | |
getMenuOnClick () | |
Returns javascript for onClick. | |
getMenuTitle () | |
getMenuIcon () | |
getMenuUrl () | |
Returns URL. | |
setMenuId ($id) | |
setMenuTitle ($title) | |
setMenuIcon ($icon) | |
setMenuUrl ($url) | |
setMenuTarget ($target) | |
setMenuOnClick ($onClick) | |
getMenuInfo () | |
setMenuInfo ($info) | |
getMenuOptions () | |
getMenuOption ($name, $default=null) | |
setMenuOption ($name, $value) | |
getSubmenus () | |
hasSubmenu () | |
getSubmenu ($id, $create=false) | |
Returns submenu item with specified id. | |
getMenuType () | |
isMenuVisible () | |
isMenuActive () | |
isMenuExpanded () | |
isMenuDisabled () | |
isMenuImportant () | |
setMenuVisible ($value) | |
setMenuActive ($value) | |
setMenuDisabled ($value) | |
setMenuExpanded ($value) | |
setMenuImportant ($value) | |
setMenuType ($type) | |
setInputType ($type, $name, $value) | |
printMenu (Menu_PrinterInterface $printer, array $options=array()) | |
printMenuContent (Menu_PrinterInterface $printer, array $options=array()) | |
getCssClass () | |
setCssClass ($class) | |
addCssClass ($class) | |
getHtmlAttr ($name, $default=null) | |
setHtmlAttr ($name, $value) | |
getMenuTarget () | |
Static Public Member Functions | |
static | create ($id=false, $title=null, $url=null, $icon=null, $onClick=null, array $options=array()) |
static | createMenu ($id=false, array $options=array()) |
static | instance ($id, $create=true) |
Returns registered menu, or creates it. | |
static | registerInstance (Menu_ItemInterface $menu) |
Registers menu as a named menu. | |
Data Fields | |
const | OPT_CSS_CLASS = 'cssClass' |
const | OPT_HTML_ATTR = 'htmlAttr' |
const | OPT_REL = 'rel' |
const | OPT_VISIBLE = 'visible' |
const | OPT_EXPANDED = 'expanded' |
const | OPT_ACTIVE = 'active' |
const | OPT_TARGET = 'target' |
const | OPT_DISABLED = 'disabled' |
const | OPT_IMPORTANT = 'important' |
const | OPT_INFO = 'info' |
const | OPT_TYPE = 'type' |
const | OPT_INPUT_NAME = "inputName" |
const | OPT_INPUT_VALUE = "inputValue" |
const | OPT_PRINTER = "printer" |
Printer, which will print this item's contents (printMenuContent and printSubmenu. | |
const | OPT_PRINTER_OUTER = "printerOuter" |
Printer, which will print the whole item, including containing element, which normally should be printed by the parent item's printer. | |
const | OPT_HIDDEN_IF_EMPTY = "hiddenIfEmpty" |
const | OPT_MERGE_LATER = "mergeLater" |
const | TYPE_MENU = 'menu' |
Root menu - it doesn't have an item ot it's own. | |
const | TYPE_ACCORDION = 'accordion' |
Accordion type menu. | |
const | TYPE_OPTIONS = 'options' |
List of options type menu. | |
const | TYPE_ITEM = 'item' |
Standard menu item. | |
const | TYPE_CHECKBOX = 'checkbox' |
const | TYPE_RADIO = 'radio' |
const | TYPE_LIST = 'list' |
List of items type menu. | |
const | TYPE_TITLE = 'title' |
const | TYPE_PANEL = 'panel' |
const | TYPE_ICONS = 'icons' |
$title | |
$icon | |
$url | |
$onClick | |
$options = array() | |
Protected Attributes | |
$id | |
$items = array() | |
Static Protected Attributes | |
static | $instances |
Class supporting creation of menus.
Menu_Item::__construct | ( | $ | id = false | ) |
Reimplemented in KWebMenu_FormAction_Clipboard, and KWebMenu_FormAction.
Menu_Item::addCssClass | ( | $ | class | ) |
Menu_Item::addSubmenu | ( | Menu_ItemInterface $ | item, |
$ | pos = false , |
||
$ | insertAfter = false |
||
) |
Menu_Item::count | ( | ) |
static Menu_Item::create | ( | $ | id = false , |
$ | title = null , |
||
$ | url = null , |
||
$ | icon = null , |
||
$ | onClick = null , |
||
array $ | options = array() |
||
) | [static] |
static Menu_Item::createMenu | ( | $ | id = false , |
array $ | options = array() |
||
) | [static] |
Menu_Item::getCssClass | ( | ) |
Menu_Item::getHtmlAttr | ( | $ | name, |
$ | default = null |
||
) |
Menu_Item::getMenuIcon | ( | ) |
Implements Menu_ItemInterface.
Reimplemented in KWebMenu_ObjectItem.
Menu_Item::getMenuId | ( | ) |
Implements Menu_ItemInterface.
Menu_Item::getMenuInfo | ( | ) |
Menu_Item::getMenuOnClick | ( | ) |
Returns javascript for onClick.
Implements Menu_ItemInterface.
Reimplemented in KWebMenu_FormAction_Clipboard, and KWebMenu_FormAction.
Menu_Item::getMenuOption | ( | $ | name, |
$ | default = null |
||
) |
Implements Menu_ItemInterface.
Reimplemented in KWebMenu_ObjectItem.
Menu_Item::getMenuOptions | ( | ) |
Menu_Item::getMenuTarget | ( | ) |
Implements Menu_ItemInterface.
Menu_Item::getMenuTitle | ( | ) |
Implements Menu_ItemInterface.
Reimplemented in KWebMenu_ObjectItem.
Menu_Item::getMenuType | ( | ) |
Implements Menu_ItemInterface.
Menu_Item::getMenuUrl | ( | ) |
Menu_Item::getSubmenu | ( | $ | id, |
$ | create = false |
||
) |
Returns submenu item with specified id.
$create | - if TRUE, the submenu will be created |
Menu_Item::getSubmenus | ( | ) |
Implements Menu_ItemInterface.
Menu_Item::hasSubmenu | ( | ) |
Implements Menu_ItemInterface.
static Menu_Item::instance | ( | $ | id, |
$ | create = true |
||
) | [static] |
Returns registered menu, or creates it.
Menu_Item::isMenuActive | ( | ) |
Implements Menu_ItemInterface.
Menu_Item::isMenuDisabled | ( | ) |
Menu_Item::isMenuExpanded | ( | ) |
Implements Menu_ItemInterface.
Menu_Item::isMenuImportant | ( | ) |
Menu_Item::isMenuVisible | ( | ) |
Implements Menu_ItemInterface.
Menu_Item::mergePostponedSubmenus | ( | ) |
Menu_Item::mergeSubmenus | ( | $ | menu | ) |
Merges two submenus together.
$menu | - Menu_Item object - all subitems will be added to this menu You can pass an array with $position => Menu_Item elements. If position is an integer, the item will be prepended, if it's a string, it will be passed as position to addSubmenu() if it's prepended with '+', the item will be inserted after specified position. If the item object equals null, the item at that position will be removed If the item is an array, mergeSubmenus will be called for that item (or an item created) |
For example: array(0 => $item1, ' 1' => $item2, 'id' => $item3, '+id' => $item4, 'menu' => false); $item1 will be appended to the submenu $item2 will be inserted at position 1 $item3 will be inserted at position of item with id 'id' (or appended) $item4 will be inserted after position of item with id 'id' (or appended) 'menu' will be removed
Menu_Item::mergeSubmenusLater | ( | $ | merge | ) |
Works like mergeSubmenus(), but postpones merging, until mergePostponedSubmenus() is called.
It will be always called just before printing...
Menu_Item::moveSubmenu | ( | $ | itemOrPos, |
$ | pos = false , |
||
$ | insertAfter = false |
||
) |
Moves specified submenu to new position.
Menu_Item::printMenu | ( | Menu_PrinterInterface $ | printer, |
array $ | options = array() |
||
) |
Implements Menu_ItemInterface.
Reimplemented in KWebMenu_ObjectItem.
Menu_Item::printMenuContent | ( | Menu_PrinterInterface $ | printer, |
array $ | options = array() |
||
) |
Implements Menu_ItemInterface.
Reimplemented in KWebMenu_ObjectItem.
static Menu_Item::registerInstance | ( | Menu_ItemInterface $ | menu | ) | [static] |
Registers menu as a named menu.
Menu_Item::removeSubmenu | ( | $ | itemOrPos | ) |
Removes submenu item.
Menu_Item::setCssClass | ( | $ | class | ) |
Menu_Item::setHtmlAttr | ( | $ | name, |
$ | value | ||
) |
Menu_Item::setInputType | ( | $ | type, |
$ | name, | ||
$ | value | ||
) |
Menu_Item::setMenuActive | ( | $ | value | ) |
Menu_Item::setMenuDisabled | ( | $ | value | ) |
Menu_Item::setMenuExpanded | ( | $ | value | ) |
Menu_Item::setMenuIcon | ( | $ | icon | ) |
Menu_Item::setMenuId | ( | $ | id | ) |
Menu_Item::setMenuImportant | ( | $ | value | ) |
Menu_Item::setMenuInfo | ( | $ | info | ) |
Menu_Item::setMenuOnClick | ( | $ | onClick | ) |
Menu_Item::setMenuOption | ( | $ | name, |
$ | value | ||
) |
Menu_Item::setMenuTarget | ( | $ | target | ) |
Menu_Item::setMenuTitle | ( | $ | title | ) |
Menu_Item::setMenuType | ( | $ | type | ) |
Menu_Item::setMenuUrl | ( | $ | url | ) |
Menu_Item::setMenuVisible | ( | $ | value | ) |
Menu_Item::sortSubmenus | ( | $ | onField = 'title' , |
$ | ascending = true |
||
) |
Menu_Item::sortSubmenusCompare | ( | $ | a, |
$ | b, | ||
$ | onField, | ||
$ | ascending | ||
) |
Menu_Item::$icon |
Menu_Item::$id [protected] |
Menu_Item::$instances [static, protected] |
Menu_Item::$items = array() [protected] |
Menu_Item::$onClick |
Menu_Item::$options = array() |
Menu_Item::$title |
Menu_Item::$url |
const Menu_Item::OPT_ACTIVE = 'active' |
const Menu_Item::OPT_CSS_CLASS = 'cssClass' |
const Menu_Item::OPT_DISABLED = 'disabled' |
const Menu_Item::OPT_EXPANDED = 'expanded' |
const Menu_Item::OPT_HIDDEN_IF_EMPTY = "hiddenIfEmpty" |
const Menu_Item::OPT_HTML_ATTR = 'htmlAttr' |
const Menu_Item::OPT_IMPORTANT = 'important' |
const Menu_Item::OPT_INFO = 'info' |
const Menu_Item::OPT_INPUT_NAME = "inputName" |
const Menu_Item::OPT_INPUT_VALUE = "inputValue" |
const Menu_Item::OPT_MERGE_LATER = "mergeLater" |
const Menu_Item::OPT_PRINTER = "printer" |
Printer, which will print this item's contents (printMenuContent and printSubmenu.
const Menu_Item::OPT_PRINTER_OUTER = "printerOuter" |
Printer, which will print the whole item, including containing element, which normally should be printed by the parent item's printer.
const Menu_Item::OPT_REL = 'rel' |
const Menu_Item::OPT_TARGET = 'target' |
const Menu_Item::OPT_TYPE = 'type' |
const Menu_Item::OPT_VISIBLE = 'visible' |
const Menu_Item::TYPE_ACCORDION = 'accordion' |
Accordion type menu.
const Menu_Item::TYPE_CHECKBOX = 'checkbox' |
const Menu_Item::TYPE_ICONS = 'icons' |
const Menu_Item::TYPE_ITEM = 'item' |
Standard menu item.
const Menu_Item::TYPE_LIST = 'list' |
List of items type menu.
const Menu_Item::TYPE_MENU = 'menu' |
Root menu - it doesn't have an item ot it's own.
const Menu_Item::TYPE_OPTIONS = 'options' |
List of options type menu.
const Menu_Item::TYPE_PANEL = 'panel' |
const Menu_Item::TYPE_RADIO = 'radio' |
const Menu_Item::TYPE_TITLE = 'title' |