Cheetah
Public Member Functions | Public Attributes | List of all members
ChWsbMemberMenu Class Reference
Inheritance diagram for ChWsbMemberMenu:
ChBaseMemberMenu ChTemplMemberMenu

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_'
 

Detailed Description

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:

See also
ChBaseMemberMenu - member menu base representation
ChTemplMemberMenu - member menu template representation

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:

  1. Example of using the Eval field:
    • for example, you need to append a member's ID to the URL specified in the 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;
  2. Example of using the PopupMenu field
    • assume 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();

  3. Example of using the 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;

      See also
      ChTemplMailBox::get_member_menu_bubble_new_messages;
  4. Example of using the 'linked_item' type field
    • For example, you need to append your menu item to already existing one, for example to the 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 (
      See also
      ChWsbService::serviceGetMemberMenuLink ) in the Parent field specify the ID of the item you need to append your item to and specify 'linked_item' in the Type field
      Memberships/ACL: no levels

Alerts: no alerts

Definition at line 91 of file ChWsbMemberMenu.php.

Constructor & Destructor Documentation

◆ __construct()

ChWsbMemberMenu::__construct ( )

Class constructor;

Reimplemented in ChTemplMemberMenu, ChTemplMemberMenu, ChTemplMemberMenu, and ChBaseMemberMenu.

Definition at line 120 of file ChWsbMemberMenu.php.

Member Function Documentation

◆ _parseStructure()

ChWsbMemberMenu::_parseStructure (   $aMemberInfo,
  $aMenuStructure 
)

Parse member menu structure

Parameters
$aMemberInfoarray
$aMenuStructurearray
Returns
text

Definition at line 201 of file ChWsbMemberMenu.php.

◆ createMemberMenuCache()

ChWsbMemberMenu::createMemberMenuCache ( )

@description : function will create menu's cache file ;

Returns
array

Definition at line 585 of file ChWsbMemberMenu.php.

◆ deleteMemberMenuCaches()

ChWsbMemberMenu::deleteMemberMenuCaches ( )

Delete all member menu cache files

Returns
boolean

Definition at line 571 of file ChWsbMemberMenu.php.

◆ deleteMemberMenuKeyFile()

ChWsbMemberMenu::deleteMemberMenuKeyFile (   $iProfile)

Delete member menu key file

Parameters
$iProfileinteger
Returns
unknown_type

Definition at line 560 of file ChWsbMemberMenu.php.

◆ genMemberMenu()

ChWsbMemberMenu::genMemberMenu (   $memberID = 0)

Function will generate extra navigation menu for logged member ;

Parameters
:$memberID( integer ) - member's ID ;
Returns
: Html presentation data or array with menu's structure;

Definition at line 477 of file ChWsbMemberMenu.php.

◆ getCacheKey()

ChWsbMemberMenu::getCacheKey (   $iProfileId)

Generate name for cache

Parameters
$iProfileIdinteger
Returns
string

Definition at line 545 of file ChWsbMemberMenu.php.

◆ getCacheObject()

ChWsbMemberMenu::getCacheObject ( )

Get instance of cache object

Returns
object

Definition at line 181 of file ChWsbMemberMenu.php.

◆ getDescriptionWindow()

ChWsbMemberMenu::getDescriptionWindow (   $sDescription)

Function will generate description window for menu's items;

Parameters
:$sDescription(string) - item's description;
Returns
: Html presentation data;

Definition at line 164 of file ChWsbMemberMenu.php.

◆ getGetExtraMenuLink()

ChWsbMemberMenu::getGetExtraMenuLink ( $aLinkInfo)

Function will generate extra sub menu item;

Parameters
:$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.

◆ getImage()

ChWsbMemberMenu::getImage (   $sImg,
  $sAlt = '',
  $sAttr = '' 
)

Definition at line 638 of file ChWsbMemberMenu.php.

◆ getLinkedItem()

ChWsbMemberMenu::getLinkedItem (   $iMenuId)

Function will get all linked item for recived menu's item;

Parameters
:$iMenuId(integer) - menu's Id;
Returns
: (array); [code] - (string) evaluate code;

Definition at line 622 of file ChWsbMemberMenu.php.

◆ getSubMenuContent()

ChWsbMemberMenu::getSubMenuContent (   $iMemberId,
  $sSubMenuCode,
  $aLinkedItems = array() 
)

Function will return menu's sub content;

Parameters
:$iMemberId(integer) - logged member's Id;
:$sSubMenuCode(string) - sub menu's php code;
:$aLinkedItems(array) - linked links items;
Returns
: Html presentation data;

Definition at line 521 of file ChWsbMemberMenu.php.

Member Data Documentation

◆ $iBubblesUpdateTime

ChWsbMemberMenu::$iBubblesUpdateTime = 30000

Definition at line 99 of file ChWsbMemberMenu.php.

◆ $iKeysFileTTL

ChWsbMemberMenu::$iKeysFileTTL = 600

Definition at line 112 of file ChWsbMemberMenu.php.

◆ $iNotifyDestroyTime

ChWsbMemberMenu::$iNotifyDestroyTime = 3000

Definition at line 101 of file ChWsbMemberMenu.php.

◆ $oCacheObject

ChWsbMemberMenu::$oCacheObject

Definition at line 110 of file ChWsbMemberMenu.php.

◆ $sBubblePrefix

ChWsbMemberMenu::$sBubblePrefix = 'bubble_'

Definition at line 106 of file ChWsbMemberMenu.php.

◆ $sBubbles

ChWsbMemberMenu::$sBubbles = null

Definition at line 94 of file ChWsbMemberMenu.php.

◆ $sDescriptionPrefix

ChWsbMemberMenu::$sDescriptionPrefix = 'descr_'

Definition at line 108 of file ChWsbMemberMenu.php.

◆ $sMemberMenuPosition

ChWsbMemberMenu::$sMemberMenuPosition = null

Definition at line 97 of file ChWsbMemberMenu.php.

◆ $sMenuCacheFile

ChWsbMemberMenu::$sMenuCacheFile = 'sys_menu_member'

Definition at line 113 of file ChWsbMemberMenu.php.

◆ $sMenuMemberKeysCache

ChWsbMemberMenu::$sMenuMemberKeysCache = 'mm_sys_menu_member_keys_'

Definition at line 114 of file ChWsbMemberMenu.php.

◆ $sMenuPopupPrefix

ChWsbMemberMenu::$sMenuPopupPrefix = 'extra_menu_popup_'

Definition at line 107 of file ChWsbMemberMenu.php.

◆ $sQueryPageReciver

ChWsbMemberMenu::$sQueryPageReciver = 'member_menu_queries.php'

Definition at line 104 of file ChWsbMemberMenu.php.


The documentation for this class was generated from the following file: