iElementsCntInLine = (int)getParam('nav_menu_elements_on_line_' . (isLogged() ? 'usr' : 'gst')); $this->sSiteUrl = BX_DOL_URL_ROOT; $this->iJumpedMenuID = 0; $this->sCustomSubIconUrl = ''; $this->sCustomSubHeader = ''; $this->sCustomActions = ''; $this->sBreadCrumb = ''; $this->bDebugMode = false; $this->sWidth = $GLOBALS['oSysTemplate']->getPageWidth(); } function setCustomSubIconUrl($sCustomSubIconUrl) { $this->sCustomSubIconUrl = $sCustomSubIconUrl; } function setCustomSubHeader($sCustomSubHeader) { $this->sCustomSubHeader = $sCustomSubHeader; } function setCustomSubActions2($aCustomActions) { if (is_array($aCustomActions) && count($aCustomActions) > 0) { $sActions = ''; foreach ($aCustomActions as $iID => $aCustomAction) { $sTitle = $sLink = $sIcon = ''; $sTitle = $aCustomAction['title']; $sLink = $aCustomAction['url']; $sIcon = $aCustomAction['icon']; $sActions .= << {$sTitle}
EOF; } $sCustomActions = <<
{$sActions}
EOF; $this->sCustomActions = $sCustomActions; } } /* * Generate actions in submenu place at right. */ function setCustomSubActions(&$aKeys, $sActionsType, $bSubMenuMode = true) { if (!$sActionsType) { $this->sCustomActions = ''; return; } // prepare all needed keys $aKeys['url'] = $this->sSiteUrl; $aKeys['window_width'] = $this->oTemplConfig->popUpWindowWidth; $aKeys['window_height'] = $this->oTemplConfig->popUpWindowHeight; $aKeys['anonym_mode'] = $this->oTemplConfig->bAnonymousMode; // $aKeys['member_id'] = $iMemberID; // $aKeys['member_pass'] = getPassword($iMemberID); //$GLOBALS['oFunctions']->iDhtmlPopupMenu = 1; $sActions = $GLOBALS['oFunctions']->genObjectsActions($aKeys, $sActionsType, $bSubMenuMode); $this->sCustomActions = ''; } /* * Generate navigation menu source */ function getCode() { if (isset($GLOBALS['bx_profiler'])) $GLOBALS['bx_profiler']->beginMenu('Main Menu'); $this->getMenuInfo(); $this->genTopHeader(); $this->genTopItems(); $this->genTopFooter(); if (!defined('BX_INDEX_PAGE')) { $this->genSubContHeader(); $this->genSubMenus(); $this->genSubContFooter(); } if (isset($GLOBALS['bx_profiler'])) $GLOBALS['bx_profiler']->endMenu('Main Menu'); return $this->sCode; } /* * Generate top header part */ function genTopHeader() { $iCurrent = $this->checkShowCurSub() ? 0 : $this->aMenuInfo['currentTop']; $this->sCode .= ''; } /* * Generate top menu elements */ function genTopItems() { $iCounter = 0; foreach( $this->aTopMenu as $iItemID => $aItem ) { if( $aItem['Type'] != 'top' ) continue; if( !$this->checkToShow( $aItem ) ) continue; if ($aItem['Caption'] == "{profileNick}" && $this->aMenuInfo['profileNick']=='') continue; $bActive = ( $iItemID == $this->aMenuInfo['currentTop'] ); if ($bActive && $iCounter >= $this->iElementsCntInLine) { $this->iJumpedMenuID = $iItemID; break; } $iCounter++; } $iCounter = 0; foreach( $this->aTopMenu as $iItemID => $aItem ) { if( $aItem['Type'] != 'top' ) continue; if( !$this->checkToShow( $aItem ) ) continue; //generate list( $aItem['Link'] ) = explode( '|', $aItem['Link'] ); $aItem['Link'] = $this->replaceMetas( $aItem['Link'] ); $aItem['Onclick'] = $this->replaceMetas( $aItem['Onclick'] ); $aItem['Caption'] = $this->replaceMetas( $aItem['Caption'] ); $bActive = ( $iItemID == $this->aMenuInfo['currentTop'] ); $bActive = ($aItem['Link']=='index.php' && $this->aMenuInfo['currentTop']==0) ? true : $bActive; if ($this->bDebugMode) print $iItemID . $aItem['Caption'] . '__' . $aItem['Link'] . '__' . $bActive . '
'; $isBold = ($aItem['Icon'] != '') ? true : false; $sImage = ($aItem['Icon'] != '') ? $aItem['Icon'] : $aItem['Picture']; //Draw jumped element if ($this->iJumpedMenuID>0 && $this->iElementsCntInLine == $iCounter) { $aItemJmp = $this->aTopMenu[$this->iJumpedMenuID]; list( $aItemJmp['Link'] ) = explode( '|', $aItemJmp['Link'] ); $aItemJmp['Link'] = $this->replaceMetas( $aItemJmp['Link'] ); $aItemJmp['Onclick'] = $this->replaceMetas( $aItemJmp['Onclick'] ); $bJumpActive = ( $this->iJumpedMenuID == $this->aMenuInfo['currentTop'] ); $bJumpActive = ($aItemJmp['Link']=='index.php' && $this->aMenuInfo['currentTop']==0) ? true : $bJumpActive; $this->genTopItem(_t($aItemJmp['Caption']), $aItemJmp['Link'], $aItemJmp['Target'], $aItemJmp['Onclick'], $bJumpActive, $this->iJumpedMenuID, $isBold); if ($this->bDebugMode) print '
pre_pop: ' . $this->iJumpedMenuID . $aItemJmp['Caption'] . '__' . $aItemJmp['Link'] . '__' . $bJumpActive . '

'; } if ($this->iElementsCntInLine == $iCounter) { $this->GenMoreElementBegin(); if ($this->bDebugMode) print '
more begin here ' . '

'; } if ($this->iJumpedMenuID>0 && $iItemID == $this->iJumpedMenuID) { //continue; if ($this->bDebugMode) print '
was jump out here ' . '

'; } else { if ($this->iElementsCntInLine > $iCounter) { $this->genTopItem(_t($aItem['Caption']), $aItem['Link'], $aItem['Target'], $aItem['Onclick'], $bActive, $iItemID, $isBold, $sImage); } else { $this->genTopItemMore(_t($aItem['Caption']), $aItem['Link'], $aItem['Target'], $aItem['Onclick'], $bActive, $iItemID); } } $iCounter++; } if ($this->iElementsCntInLine < $iCounter) { $this->GenMoreElementEnd(); } } /* * Generate top footer part */ function genTopFooter() { global $oSysTemplate; $sResult = ''; $aFunctions = array('genMoreLanguagesElement', 'genMoreTemplatesElement', 'genSearchElement'); foreach($aFunctions as $sFunction) { $aVariables = $this->$sFunction(); if(!empty($aVariables)) { $aVariables['right'] = empty($sResult) ? 'right' : ''; $sResult = $oSysTemplate->parseHtmlByName('navigation_menu_item.html', $aVariables) . $sResult; } } $this->sCode .= $sResult . "
"; } /* * Generate search element */ function genSearchElement() { $sSearchC = process_line_output(_t('_Search')); ob_start(); ?>
  • getTemplateIcon('tm_item_search.png'), 'element_content' => $sSearchElement ); } /* * Generate templates element */ function genMoreTemplatesElement(){ if(!getParam("enable_template")) return; $aExistedTemplates = get_templates_array(); if(count($aExistedTemplates) <= 1) return; $sCurTemplate = strlen($_GET['skin']) ? $_GET['skin'] : $_COOKIE['skin']; $sTemplateElement = ''; foreach ($aExistedTemplates as $sTemplateID => $sTemplateVal) { $sIActiveClass = ($sCurTemplate == $sTemplateID) ? ' active' : ''; $sTemplateUrl = ''; if ($sCurTemplate == $sTemplateID) { $sTemplateUrl = 'javascript: void(0)'; } else { if (defined('BX_PROFILE_PAGE')) { global $profileID; $sTemplateUrl = getProfileLink($profileID) . '&skin='. $sTemplateID; } else { $sGetTransfer = bx_encode_url_params($_GET, array('skin')); $sTemplateUrl = bx_html_attribute($_SERVER['PHP_SELF']) . '?' . $sGetTransfer . 'skin='. $sTemplateID; } } //$sIOnclick = "window.open('{$sTemplateUrl}','_self');"; // old version $sTemplateElement .= '
  • '.$sTemplateVal.''; } if($sTemplateElement == '') return; return array( 'icon_url' => getTemplateIcon('tm_item_templates.png'), 'element_content' => $sTemplateElement ); } /* * Generate languages element */ function genMoreLanguagesElement(){ $aExistedLanguages = getLangsArr(); if(count($aExistedLanguages) <= 1) return; $sCurLanguage = strlen($_GET['lang']) ? $_GET['lang'] : $_COOKIE['lang']; $sLanguageElement = ''; foreach ($aExistedLanguages as $sLanguageID => $sLanguageVal) { $sIActiveClass = ($sCurLanguage == $sLanguageID) ? ' active' : ''; $sLanguageUrl = ''; if ($sCurLanguage == $sLanguageID) { $sLanguageUrl = 'javascript: void(0)'; } else { $sGetTransfer = bx_encode_url_params($_GET, array('lang')); $sLanguageUrl = bx_html_attribute($_SERVER['PHP_SELF']) . '?' . $sGetTransfer . 'lang='. $sLanguageID; } $sLanguageElement .= '
  • '.$sLanguageVal.''; } if ($sLanguageElement == '') return; return array( 'icon_url' => getTemplateIcon('tm_item_languages.png'), 'element_content' => $sLanguageElement ); } /* * Generate sub container header */ function genSubContHeader() { $this->sCode .= '
    '; } /* * Generate sub menu elements */ function genSubMenus() { foreach( $this->aTopMenu as $iTItemID => $aTItem ) { if( $aTItem['Type'] != 'top' && $aTItem['Type'] !='system') continue; if( !$this->checkToShow( $aTItem ) ) continue; if( $this->aMenuInfo['currentTop'] == $iTItemID && $this->checkShowCurSub() ) $sDisplay = 'block'; else { $sDisplay = 'none'; if ($aTItem['Caption']=='_Home' && $this->aMenuInfo['currentTop']==0) $sDisplay = 'block'; } $sCaption = _t( $aTItem['Caption'] ); $sCaption = $this->replaceMetas($sCaption); //generate if ($sDisplay == 'block') { $sPicture = $aTItem['Picture']; $iFirstID = $this->genSubFirstItem( $iTItemID ); $this->genSubHeader( $iTItemID, $iFirstID, $sCaption, $sDisplay, $sPicture ); $this->genSubItems( $iTItemID ); $this->genSubFooter(); } } } /* * Generate sub items of sub menu elements */ function genSubItems( $iTItemID = 0 ) { if( !$iTItemID ) $iTItemID = $this->aMenuInfo['currentTop']; $sSubItems = ''; foreach( $this->aTopMenu as $iItemID => $aItem ) { if( $aItem['Type'] != 'custom' ) continue; if( $aItem['Parent'] != $iTItemID ) continue; if( !$this->checkToShow( $aItem ) ) continue; //generate list( $aItem['Link'] ) = explode( '|', $aItem['Link'] ); $aItem['Link'] = $this->replaceMetas( $aItem['Link'] ); $aItem['Onclick'] = $this->replaceMetas( $aItem['Onclick'] ); $aItem['Caption'] = $this->replaceMetas( $aItem['Caption'] ); $bActive = ( $iItemID == $this->aMenuInfo['currentCustom'] ); $sSubItems .= $this->genSubItem( _t( $aItem['Caption'] ), $aItem['Link'], $aItem['Target'], $aItem['Onclick'], $bActive ); } $this->sCode .= ($sSubItems=='') ? '' : << {$sSubItems}
    EOF; } /* * Generate top menu elements */ function genTopItem($sText, $sLink, $sTarget, $sOnclick, $bActive, $iItemID, $isBold = false, $sPicture = '') { $sActiveStyle = ($bActive) ? ' id="tm_active"' : ''; if (!$bActive) { $sOnclick = $sOnclick ? ( ' onclick="' . $sOnclick . '"' ) : ''; $sTarget = $sTarget ? ( ' target="' . $sTarget . '"' ) : ''; } $sLink = (strpos($sLink, 'http://') === false && !strlen($sOnclick)) ? $this->sSiteUrl . $sLink : $sLink; $sMoreIcon = getTemplateIcon('tm_sitem_down.gif'); $sSubMenu = $this->getAllSubMenus($iItemID); $sBoldStyle = ($isBold) ? 'style="font-weight:bold;"' : ''; $sImgTabStyle = $sPictureRep = ''; if ($isBold && $sPicture != '') { $sPicturePath = getTemplateIcon($sPicture); $sPictureRep = ''; $sText = ''; $sImgTabStyle = 'style="width:38px;"'; } $sMainSubs = ($sSubMenu=='') ? '' : << EOF; } /* * Get parent of submenu element */ function genSubFirstItem( $iTItemID = 0 ) { if( !$iTItemID ) $iTItemID = $this->aMenuInfo['currentTop']; foreach( $this->aTopMenu as $iItemID => $aItem ) { if( $aItem['Type'] != 'custom' ) continue; if( $aItem['Parent'] != $iTItemID ) continue; if( !$this->checkToShow( $aItem ) ) continue; return $iItemID; } } /* * Generate header for sub items of sub menu elements */ function genSubHeader( $iTItemID, $iFirstID, $sCaption, $sDisplay, $sPicture = '' ) { $sLoginSection = $sSubElementCaption = $sProfStatusMessage = $sProfStatusMessageWhen = $sProfileActions = ''; $sCaptionWL = $sProfStatusMessageEl = $sMiddleImg = ''; if ($this->aMenuInfo['currentCustom'] == 0 && $iFirstID > 0) $this->aMenuInfo['currentCustom'] = $iFirstID; //comment need when take header for profile page if ($this->sCustomSubHeader == '' && $this->aMenuInfo['currentCustom'] > 0) { $sSubCapIcon = getTemplateIcon('_submenu_capt_right.gif'); $sSubElementCaption = _t($this->aTopMenu[$this->aMenuInfo['currentCustom']]['Caption']); $sCustomPic = $this->aTopMenu[$this->aMenuInfo['currentCustom']]['Picture']; $sPicture = ($sCustomPic != '') ? $sCustomPic : $sPicture; $sMiddleImg = ''; $sSubElementCaption = <<{$sSubElementCaption} EOF; } if(!isMember()) $sLoginSection = $GLOBALS['oSysTemplate']->ParseHtmlByName('login_join.html', array()); /////Picture//////// if ($this->sCustomSubHeader == '' && !empty($this->aMenuInfo['profileID'])) { $sPictureEl = get_member_icon($this->aMenuInfo['profileID'], 'left'); $sSubCapIcon = getTemplateIcon('_submenu_capt_right.gif'); $aProfInfo = getProfileInfo($this->aMenuInfo['profileID']); $sProfStatusMessage = process_line_output($aProfInfo['UserStatusMessage']); $sRealWhen = ($aProfInfo['UserStatusMessageWhen'] != 0) ? $aProfInfo['UserStatusMessageWhen'] : time(); $sProfStatusMessageWhen = defineTimeInterval($sRealWhen); $isButtonNotify = false; if (defined('BX_PROFILE_PAGE') && $this->aMenuInfo['memberID'] == $this->aMenuInfo['profileID']) { $isButtonNotify = true; $sProfStatusMessage = ($sProfStatusMessage=='') ? _t('_Click_here_to_update_your_status') : $sProfStatusMessage . ''.$sProfStatusMessageWhen.''; $sProfStatusMessage = << function InloadStatusMessageEl() { $('#inloadedStatusMess').load("change_status.php?action=get_prof_status_mess"); $('#StatusMessage').hide(); }
    {$sProfStatusMessage}
    EOF; } elseif ($sProfStatusMessage != '') { $sProfStatusMessage = <<{$sProfStatusMessage}
    EOF; $sProfileActions = $this->getProfileActions($aProfInfo, $this->aMenuInfo['memberID']); } if ($sProfStatusMessageWhen != '' && $sProfStatusMessage != '') { $sProfStatusMessageEl = $GLOBALS['oFunctions']->genNotifyMessage($sProfStatusMessage, 'left', $isButtonNotify); } } else { $sPicturePath = (isset($sPicture) && $sPicture!='') ? getTemplateIcon($sPicture) : ''; $sPictureEl = ($sPicturePath == '') ? '' : << EOF; } $sPictureEl = ($this->sCustomSubIconUrl == '') ? $sPictureEl : << EOF; /////Picture end//////// if (true) { // $sSubElementCaption != '') { $aAllSubMainLinks = array(); $sSubMainLinks = ''; if (!empty($this->aTopMenu[$iFirstID]['Link'])) { list($aAllSubMainLinks) = explode('|', $this->aTopMenu[$iFirstID]['Link']); $sSubMainLinks = $this->replaceMetas($aAllSubMainLinks); if (empty($sSubMainLinks)) { //try define the parent menu's item url $sSubMainLinks = $this -> sSiteUrl . $this -> aTopMenu[ $this -> aMenuInfo['currentTop'] ]['Link']; } $sSubMainOnclick = $this->replaceMetas($this->aTopMenu[$iFirstID]['Onclick']); } $sSubMainOnclick = !empty($sSubMainOnclick) ? ' onclick="' . $sSubMainOnclick . '"' : ''; $sCaption = <<{$sCaption} EOF; $sCaptionWL = $sCaption; } if ($this->sCustomSubHeader != '') { $sCaptionWL = $this->sCustomSubHeader; } if ($this->sCustomActions != '') { $sProfileActions = $this->sCustomActions; } $iMemID = getID($_GET['ID']); $name = getFirstName($iMemID); $nick = getNickName($iMemID); $link = getProfileLink($iMemID); if ($sCaptionWL == $nick) { $sCaptionWL = $name; } // array of keys $aTemplateKeys = array ( 'submenu_id' => $iTItemID, 'display_value' => $sDisplay, 'picture' => $sPictureEl, 'sub_caption' => $sCaptionWL, 'profile_status' => $sProfStatusMessageEl, 'login_section' => $sLoginSection, 'profile_actions' => $sProfileActions, 'injection_title_zone' => $sProfileActions, ); $this->sCode .= $GLOBALS['oSysTemplate']->parseHtmlByName('navigation_menu_sub_header.html', $aTemplateKeys); $aBreadcrumb = array(); if($iFirstID > 0 && $sCaption != '') $aBreadcrumb[] = $sCaption; if($sSubElementCaption != '') $aBreadcrumb[] = $sSubElementCaption; $this->sBreadCrumb = $this->genBreadcrumb($aBreadcrumb); } function getProfileActions($p_arr, $iMemberID) { $iViewedMemberID = (int)$p_arr['ID']; if( (!$iMemberID or !$iViewedMemberID) or ($iMemberID == $iViewedMemberID) ) return null; // prepare all needed keys $p_arr['url'] = $this->sSiteUrl; $p_arr['window_width'] = $this->oTemplConfig->popUpWindowWidth; $p_arr['window_height'] = $this->oTemplConfig->popUpWindowHeight; $p_arr['anonym_mode'] = $this->oTemplConfig->bAnonymousMode; $p_arr['member_id'] = $iMemberID; $p_arr['member_pass'] = getPassword( $iMemberID ); $GLOBALS['oFunctions']->iDhtmlPopupMenu = 1; $sActions = $GLOBALS['oFunctions']->genObjectsActions($p_arr, 'Profile', true); return ''; } function genSubItem( $sCaption, $sLink, $sTarget, $sOnclick, $bActive ) { $sIcon1_a_l = getTemplateImage("tm_cm_item_left_act.png"); $sIcon1_a_c = getTemplateImage("tm_cm_item_center_act.png"); $sIcon1_a_r = getTemplateImage("tm_cm_item_right_act.png"); $sSubItems = ''; if( !$bActive ) { $sOnclick = $sOnclick ? ( ' onclick="' . $sOnclick . '"' ) : ''; $sTarget = $sTarget ? ( ' target="' . $sTarget . '"' ) : ''; if ( strpos( $sLink, 'http://' ) === false && !strlen($sOnclick) ) $sLink = $this->sSiteUrl . $sLink; $sSubItems .= << EOF; } else { $sSubItems .= <<
      {$sSubMenu}
    •  
    EOF; $this->sCode .= << {$sPictureRep}{$sText}
    {$sMainSubs}
    {$sCaption}
    EOF; } return $sSubItems; } /* * Generate footer for sub items of sub menu elements */ function genSubFooter() { $this->sCode .= << EOF; } function getAllSubMenus($iItemID, $bActive = false) { $aMenuInfo = $this->aMenuInfo; $ret = ''; $aTTopMenu = $this->aTopMenu; foreach( $aTTopMenu as $iTItemID => $aTItem ) { if( !$this->checkToShow( $aTItem ) ) continue; if ($iItemID == $aTItem['Parent']) { //generate list( $aTItem['Link'] ) = explode( '|', $aTItem['Link'] ); $aTItem['Link'] = str_replace( "{memberID}", isset($aMenuInfo['memberID']) ? $aMenuInfo['memberID'] : '', $aTItem['Link'] ); $aTItem['Link'] = str_replace( "{memberNick}", isset($aMenuInfo['memberNick']) ? $aMenuInfo['memberNick'] : '', $aTItem['Link'] ); $aTItem['Link'] = str_replace( "{memberLink}", isset($aMenuInfo['memberLink']) ? $aMenuInfo['memberLink'] : '', $aTItem['Link'] ); $aTItem['Link'] = str_replace( "{profileID}", isset($aMenuInfo['profileID']) ? $aMenuInfo['profileID'] : '', $aTItem['Link'] ); $aTItem['Onclick'] = str_replace( "{profileID}", isset($aMenuInfo['profileID']) ? $aMenuInfo['profileID'] : '', $aTItem['Onclick'] ); $aTItem['Link'] = str_replace( "{profileNick}", isset($aMenuInfo['profileNick']) ? $aMenuInfo['profileNick'] : '', $aTItem['Link'] ); $aTItem['Onclick'] = str_replace( "{profileNick}", isset($aMenuInfo['profileNick']) ? $aMenuInfo['profileNick'] : '', $aTItem['Onclick'] ); $aTItem['Link'] = str_replace( "{profileLink}", isset($aMenuInfo['profileLink']) ? $aMenuInfo['profileLink'] : '', $aTItem['Link'] ); $aTItem['Onclick'] = str_replace( "{memberID}", isset($aMenuInfo['memberID']) ? $aMenuInfo['memberID'] : '', $aTItem['Onclick'] ); $aTItem['Onclick'] = str_replace( "{memberNick}", isset($aMenuInfo['memberNick']) ? $aMenuInfo['memberNick'] : '', $aTItem['Onclick'] ); $aTItem['Onclick'] = str_replace( "{memberPass}", getPassword( isset($aMenuInfo['memberID']) ? $aMenuInfo['memberID'] : ''), $aTItem['Onclick'] ); $sElement = $this->getCustomMenuItem( _t( $aTItem['Caption'] ), $aTItem['Link'], $aTItem['Target'], $aTItem['Onclick'], ( $iTItemID == $aMenuInfo['currentCustom'] ) ); $ret .= $sElement; } } return $ret; } function getCustomMenuItem($sText, $sLink, $sTarget, $sOnclick, $bActive, $bSub = false) { //$sIActiveStyles = ($bActive) ? 'color:#333;font-weight:bold;' : ''; $sIActiveClass = ($bActive) ? ' active' : ''; $sITarget = (strlen($sTarget)) ? $sTarget : '_self'; $sILink = (strpos($sLink, 'http://') === false && !strlen($sOnclick)) ? $this->sSiteUrl . $sLink : $sLink; //$sIOnclick = (strlen($sOnclick)) ? $sOnclick : "window.open('{$sILink}','{$sITarget}');"; //old version $sIOnclick = (strlen($sOnclick)) ? 'onclick="'.$sOnclick.'"' : ''; return << {$sText}
  • EOF; } function GenMoreElementBegin() { $sMoreIcon = getTemplateIcon("tm_sitem_down.gif"); $sMoreMainIcon = getTemplateIcon('tm_item_more.png'); $this->sCode .= <<
      EOF; } function genTopItemMore($sText, $sLink, $sTarget, $sOnclick, $bActive, $iItemID) { //$sIActiveStyles = ($bActive) ? 'color:#333;font-weight:bold;' : ''; $sIActiveClass = ($bActive) ? ' active' : ''; $sITarget = (strlen($sTarget)) ? $sTarget : '_self'; $sILink = (strpos($sLink, 'http://') === false && !strlen($sOnclick)) ? $this->sSiteUrl . $sLink : $sLink; //$sIOnclick = (strlen($sOnclick)) ? $sOnclick : "window.open('{$sILink}','{$sITarget}');"; //old version $sIOnclick = (strlen($sOnclick)) ? 'onclick="'.$sOnclick.'"' : ''; $sSubMenu = $this->getAllSubMenus($iItemID); $sActiveStyle = ($bActive) ? 'active' : ''; $sActiveVisibleStyle = ($bActive) ? 'display:block;' : 'display:none;'; $sSpacerIcon = getTemplateIcon( 'spacer.gif' ); $this->iJSTempCnt++; if ($sSubMenu == '') { $this->sCode .= << {$sText} EOF; } else { $this->sCode .= << {$sText}
        {$sSubMenu}
      EOF; } $this->iJSTempCnt++; } function GenMoreElementEnd() { $this->sCode .= << 
    EOF; } /* * param is array of Path like * $aPath[0] = 'XXX' * $aPath[1] = 'XXX1' * $aPath[2] = 'XXX2' */ function genBreadcrumb($aPath = array()) { $sRootItem = '' . _t('_Home') . ''; if (!empty($this->aCustomBreadcrumbs)) { $a = array(); foreach ($this->aCustomBreadcrumbs as $sTitle => $sLink) if ($sTitle) $a[] = $sLink ? '' . $sTitle . '' : $sTitle; $aPath = array_merge(array($sRootItem), $a); } elseif(!is_array($aPath) || empty($aPath)) { $aPath = array($sRootItem); } else { $aPath = array_merge(array($sRootItem), $aPath); } //define current url for single page (not contain any child pages) if( $this -> aMenuInfo['currentTop'] != -1 && count($aPath) == 1) { $aPath[] = _t($this -> aTopMenu[ $this -> aMenuInfo['currentTop'] ]['Caption']); } //--- Get breadcrumb path(left side) ---// $sDivider = ''; $aPathLinks = array(); foreach($aPath as $sLink) $aPathLinks[] = '
    ' . $sLink . '
    '; $sPathLinks = implode($sDivider, $aPathLinks); //--- Get additional links(right side) ---// $sAddons = ""; if(isMember()) { $aProfile = getProfileInfo(); $FullName = $aProfile['FirstName']." ".$aProfile['LastName']; $sAddons = _t('_Hello member', $FullName); $sAddons .= ' ' . _t('_sys_breadcrumb_account') . ''; $sAddons .= ' ' . _t('_sys_breadcrumb_logout') . ''; } else { $sAddons = _t('_Hello member', _t('_sys_breadcrumb_guest')); $sAddons .= ' ' . _t('_sys_breadcrumb_join') . ''; $sAddons .= ' ' . _t('_sys_breadcrumb_login') . ''; } return ''; } } ?>