Cheetah
|
Public Member Functions | |
__construct () | |
getGetExtraMenuLink (&$aLinkInfo) | |
getDescriptionWindow ($sDescription) | |
getCacheObject () | |
_parseStructure ($aMemberInfo, $aMenuStructure) | |
genMemberMenu ($memberID=0) | |
getSubMenuContent ( $iMemberId, $sSubMenuCode, $aLinkedItems=array()) | |
getCacheKey ($iProfileId) | |
deleteMemberMenuKeyFile ($iProfile) | |
deleteMemberMenuCaches () | |
createMemberMenuCache () | |
getLinkedItem ($iMenuId) | |
getImage ($sImg, $sAlt='', $sAttr='') | |
Public Attributes | |
$sBubbles = null | |
$sMemberMenuPosition = null | |
$iBubblesUpdateTime = 30000 | |
$iNotifyDestroyTime = 3000 | |
$sQueryPageReciver = 'member_menu_queries.php' | |
$sBubblePrefix = 'bubble_' | |
$sMenuPopupPrefix = 'extra_menu_popup_' | |
$sDescriptionPrefix = 'descr_' | |
$oCacheObject | |
$iKeysFileTTL = 600 | |
$sMenuCacheFile = 'sys_menu_member' | |
$sMenuMemberKeysCache = 'mm_sys_menu_member_keys_' | |
This work, "Cheetah - https://www.cheetahwsb.com", is a derivative of "Dolphin Pro V7.4.2" by BoonEx Pty Limited - https://www.boonex.com/, used under CC-BY. "Cheetah" is licensed under CC-BY by Dean J. Bassett Jr. CC-BY License - http://creativecommons.org/licenses/by/3.0/ Member menu
Related classes:
To add a new menu item, you need to navigate to "admin/member_menu_compose.php" through web interface where you can do it. If you need to add a specific menu item, you will find the whole list of menu properties below. Table structure - sys_menu_member
;
Caption
- menu caption; Name
- menu item name (to be used in the Admin Panel); Icon
- menu icon (to be displayed in the menu); Link
- URL assigned to the menu item; Script
- javascript code (an onclick event will be created); Eval
- system field (you can find its explanation below); PopupMenu
- use it when you need to create a drop-down list for the menu item (below you will find an example); Order
- sorting; Active
- this field can have "0" or "1" which stands for "invisible" and "visible" respectively; Editable
- this field can have "0" or "1" thus being ineditable or editable respectively in the Admin Panel; Deletable
- this field can have "0" or "1" thus being undeletable or deletable (respectively) through the Admin Panel web interface; Target
- the "target" attribute for the link (for example, "_blank" will open the link in a new window); Position
- menu item position (it can have one of the two values: 'top' to place the menu item in the left position on the menu, 'top_extra' to place the item in the right position on the menu); Type
- menu type (it can be one of these three types: 'link','system','linked_item'). 'link' - is an ordinary link, 'system' - this menu item will be created by the function specified in the Eval
field‘ ????, 'linked_item’ - a child element of the menu item (see an example below); Parent
- this field specifies the parent of the menu item (it is usually used together with the linked_item
menu type), Bubble
- a special field which enables drawing different events notifiers next to the menu item (see an example below), Description
- menu item description (when hovering over the menu item with a mouse, a block with this description will be displayed below the menu item; this field is language keys based)
Example of usage:
Eval
field:Link
field; so, you need to change the URL in the Link
field in the following way: http://my.com?ID={evalResult} (here the marker {evalResult} will be replaced with the function output Then you create a function in the Eval
field: return (isset($_COOKIE['memberID']) && isMember() ) ? (int) $_COOKIE['memberID'] : 0;PopupMenu
fieldassume you need to create a News
menu item and create a drop-down block in it which would display some information. To do so, you first need to run an SQL query which will insert data into the appropriate fields: ...Caption
= '_News', Link
= 'news.php'... and then specify some code in the PopupMenu
field which will create the contents of the current menu:
//example of PHP code into PopupMenu
field; require_once('News.php'); return getNewsSubMenu();
Bubble
field (system notifiers)assume you need your menu item to display the number of mails in real time (i.e. if someone has written you a mail, you would be notified immediately), to do so, you need to create a menu item as in the previous example and create a function in the Bubble
field which will request the mail script for any changes:
ch_import('ChTemplMailBox'); // return list of new messages ; $aRetEval= ChTemplMailBox::get_member_menu_bubble_new_messages({ID}, {iOldCount});
where $aRetEval is an array which will be processed (it shouldn't be renamed!!!) the first parameter {ID} is Profile's ID, the second parameter is the number of mails retrieved during the previous iteration.
the function will return an array looking like this:
$aRetEval = array( 'count' => $iNewMessages, 'messages' => $aNotifyMessages, );
where 'count' is the whole number of mails, 'messages' is an array of messages;
profile
menu item To do so, specify the name of your module in the Name
field (for example 'maps'). Then put a PHP code in the Eval
field; it will form the content of your menu item (
Memberships/ACL: no levelsAlerts: no alerts
Definition at line 91 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::__construct | ( | ) |
Class constructor;
Reimplemented in ChTemplMemberMenu, ChTemplMemberMenu, ChTemplMemberMenu, and ChBaseMemberMenu.
Definition at line 120 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::_parseStructure | ( | $aMemberInfo, | |
$aMenuStructure | |||
) |
Parse member menu structure
$aMemberInfo | array |
$aMenuStructure | array |
Definition at line 201 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::createMemberMenuCache | ( | ) |
@description : function will create menu's cache file ;
Definition at line 585 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::deleteMemberMenuCaches | ( | ) |
Delete all member menu cache files
Definition at line 571 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::deleteMemberMenuKeyFile | ( | $iProfile | ) |
Delete member menu key file
$iProfile | integer |
Definition at line 560 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::genMemberMenu | ( | $memberID = 0 | ) |
Function will generate extra navigation menu for logged member ;
: | $memberID | ( integer ) - member's ID ; |
Definition at line 477 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::getCacheKey | ( | $iProfileId | ) |
Generate name for cache
$iProfileId | integer |
Definition at line 545 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::getCacheObject | ( | ) |
ChWsbMemberMenu::getDescriptionWindow | ( | $sDescription | ) |
Function will generate description window for menu's items;
: | $sDescription | (string) - item's description; |
Definition at line 164 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::getGetExtraMenuLink | ( | & | $aLinkInfo | ) |
Function will generate extra sub menu item;
: | $aLinkInfo | (array); ['item_link'] - (string) module's URL; ['item_onclick'] - (string) if isset this value that script will generate onclick param into link; ['item_title'] - (string) module's title; ['extra_info'] - (string) module's extra info (fore exmaple: number of polls); ['item_img_src'] - (string) module's icon's URL; ['item_img_alt'] - (string) module's icon's alt text; ['item_img_width'] - (integer) module's icon's width; ['item_img_height'] - (integer) module's icon's height; |
Definition at line 140 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::getImage | ( | $sImg, | |
$sAlt = '' , |
|||
$sAttr = '' |
|||
) |
Definition at line 638 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::getLinkedItem | ( | $iMenuId | ) |
Function will get all linked item for recived menu's item;
: | $iMenuId | (integer) - menu's Id; |
Definition at line 622 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::getSubMenuContent | ( | $iMemberId, | |
$sSubMenuCode, | |||
$aLinkedItems = array() |
|||
) |
Function will return menu's sub content;
: | $iMemberId | (integer) - logged member's Id; |
: | $sSubMenuCode | (string) - sub menu's php code; |
: | $aLinkedItems | (array) - linked links items; |
Definition at line 521 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::$iBubblesUpdateTime = 30000 |
Definition at line 99 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::$iKeysFileTTL = 600 |
Definition at line 112 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::$iNotifyDestroyTime = 3000 |
Definition at line 101 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::$oCacheObject |
Definition at line 110 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::$sBubblePrefix = 'bubble_' |
Definition at line 106 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::$sBubbles = null |
Definition at line 94 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::$sDescriptionPrefix = 'descr_' |
Definition at line 108 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::$sMemberMenuPosition = null |
Definition at line 97 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::$sMenuCacheFile = 'sys_menu_member' |
Definition at line 113 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::$sMenuMemberKeysCache = 'mm_sys_menu_member_keys_' |
Definition at line 114 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::$sMenuPopupPrefix = 'extra_menu_popup_' |
Definition at line 107 of file ChWsbMemberMenu.php.
ChWsbMemberMenu::$sQueryPageReciver = 'member_menu_queries.php' |
Definition at line 104 of file ChWsbMemberMenu.php.