function getCategTopMenuHtml($aParam, $iBoxId, $sAction = '')
 {
     $aItems = array();
     $aTopMenu = $this->getCategTopMenu($aParam, $sAction);
     foreach ($aTopMenu as $sName => $aItem) {
         $aItems[$sName] = array('dynamic' => true, 'active' => $aItem['active'], 'href' => $aItem['href']);
     }
     return BxDolPageView::getBlockCaptionItemCode($iBoxId, $aItems);
 }
Example #2
0
 function displaySearchBox($sCode, $sPaginate = '', $bAdminBox = false)
 {
     $sMenu = '';
     if (isset($this->aCurrent['rss']) && $this->aCurrent['rss']['link']) {
         bx_import('BxDolPageView');
         $sMenu = BxDolPageView::getBlockCaptionItemCode(time(), array(_t('RSS') => array('href' => $this->aCurrent['rss']['link'] . (false === strpos($this->aCurrent['rss']['link'], '?') ? '?' : '&') . 'rss=1', 'icon' => 'rss')));
     }
     $sTitle = _t($this->aCurrent['title']);
     if (!$bAdminBox) {
         $sCode = DesignBoxContent($sTitle, $sCode . $sPaginate, 1, $sMenu);
     } else {
         $sCode = DesignBoxAdmin($sTitle, $sCode, '', $sPaginate, 1);
     }
     if (!isset($_GET['searchMode'])) {
         $sCode = '<div id="page_block_' . $this->id . '">' . $sCode . '<div class="clear_both"></div></div>';
     }
     return $sCode;
 }
Example #3
0
 /**
  * Function will generate activity types toggle elements;
  *
  * @param  : $sPageUrl (string) - nedded page's url;
  * @return : (text) - html presentation data;
  */
 function getActivityTypesToggles($sPageUrl = '')
 {
     //-- Generate the page toggle ellements -- //;
     $aToggleItems = array('all' => _t('_bx_spy_all_activity'), 'content_activity' => _t('_bx_spy_content_updates'), 'profiles_activity' => _t('_bx_spy_profiles_updates'));
     // define page's mode;
     $sExtraParam = null;
     if (isset($_GET['mode'])) {
         $sExtraParam = '&mode=' . $_GET['mode'];
     }
     //$sExtraParam = '?' . substr($sExtraParam,1);
     // define page's Url;
     $sRequest = !$sPageUrl ? $this->sPathToModule . $sExtraParam : $sPageUrl . $sExtraParam;
     foreach ($aToggleItems as $sKey => $sValue) {
         $aTopToggleEllements[$sValue] = array('href' => $sRequest . '&spy_type=' . $sKey, 'dynamic' => false, 'active' => isset($_GET['spy_type']) && $_GET['spy_type'] == $sKey || !isset($_GET['spy_type']) && $sKey == 'all' ? true : false);
     }
     return BxDolPageView::getBlockCaptionItemCode(mktime(), $aTopToggleEllements);
 }
Example #4
0
 function genToggleElements()
 {
     // generate toggle ellements ;
     $aToggleItems = array('main' => _t('_bx_poll_main'), 'add' => _t('_bx_poll_add'), 'manage' => _t('_bx_poll_manage'), 'pending' => _t('_bx_poll_pending'));
     // set default
     if (!$this->aPollSettings['mode']) {
         $this->aPollSettings['mode'] = 'main';
     }
     // add new toggle el;
     if ($this->aPollSettings['mode'] == 'edit_poll') {
         $aToggleItems['edit_poll'] = _t('_bx_poll_edit');
     }
     $aItems = array();
     foreach ($aToggleItems as $sKey => $sValue) {
         $aItems[$sValue] = array('href' => $this->sPathToModule . '&mode=' . $sKey, 'active' => $this->aPollSettings['mode'] == $sKey ? 1 : 0);
     }
     bx_import('BxDolPageView');
     return BxDolPageView::getBlockCaptionItemCode(0, $aItems);
 }
Example #5
0
    function showMatchProfiles($iBlockID)
    {
        $iProfileId = getLoggedId();
        if (!$iProfileId) {
            return array('', MsgBox(_t('_Empty')));
        }
        $sSort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'none';
        $aProfiles = getMatchProfiles($iProfileId, false, $sSort);
        if (empty($aProfiles)) {
            return array('', MsgBox(_t('_Empty')));
        }
        $sBaseUri = 'search.php?show=match';
        $sTopLinksUri = '';
        $sPaginateUri = '';
        foreach ($_REQUEST as $sKey => $sVal) {
            switch ($sKey) {
                case 'page':
                    $sPaginateUri .= '&page=' . $sVal;
                    break;
                case 'per_page':
                    $sPaginateUri .= '&per_page=' . $sVal;
                    break;
                case 'sort':
                    $sPaginateUri .= '&sort=' . $sVal;
                    break;
                case 'mode':
                    $sTopLinksUri .= '&mode=' . $sVal;
                    break;
            }
        }
        $aPaginate = array('page_url' => $sBaseUri . $sTopLinksUri . '&page={page}&per_page={per_page}&sort={sorting}', 'info' => true, 'page_links' => true, 'per_page' => isset($_REQUEST['per_page']) ? (int) $_REQUEST['per_page'] : 25, 'sorting' => $sSort, 'count' => count($aProfiles), 'page' => isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : 1, 'page_reloader' => true, 'per_page_changer' => true);
        $sMode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : 'simple';
        $oPaginate = new BxDolPaginate($aPaginate);
        $oSearchProfile = new BxBaseSearchProfile();
        $aExtendedCss = array('ext_css_class' => 'search_filled_block');
        $sTemplateName = $sMode == 'extended' ? 'search_profiles_ext.html' : 'search_profiles_sim.html';
        $iIndex = 0;
        $sOutputHtml = '';
        for ($i = ($aPaginate['page'] - 1) * $aPaginate['per_page']; $i < $aPaginate['page'] * $aPaginate['per_page'] && $i < $aPaginate['count']; $i++) {
            $aProfile = getProfileInfo($aProfiles[$i]);
            if ($aProfile['Couple']) {
                $aCoupleInfo = getProfileInfo($aProfile['Couple']);
                if (!($iIndex % 2)) {
                    $sOutputHtml .= $oSearchProfile->PrintSearhResult($aProfile, $aCoupleInfo, null, $sTemplateName);
                } else {
                    $sOutputHtml .= $oSearchProfile->PrintSearhResult($aProfile, $aCoupleInfo, $aExtendedCss, $sTemplateName);
                }
            } else {
                if (!($iIndex % 2)) {
                    $sOutputHtml .= $oSearchProfile->PrintSearhResult($aProfile, '', null, $sTemplateName);
                } else {
                    $sOutputHtml .= $oSearchProfile->PrintSearhResult($aProfile, '', $aExtendedCss, $sTemplateName);
                }
            }
            $iIndex++;
        }
        $aSortingParam = array('none' => _t('_None'), 'activity' => _t('_Latest activity'), 'date_reg' => _t('_FieldCaption_DateReg_View'));
        // gen sorting block ( type of : drop down ) ;
        $sSortBlock = $oPaginate->getSorting($aSortingParam);
        $sSortElement = <<<EOF
<div class="top_settings_block">
    <div class="ordered_block">
        {$sSortBlock}
    </div>
    <div class="clear_both"></div>
</div>
EOF;
        $sOutputHtml .= '<div class="clear_both"></div>';
        $sContent = $sSortElement . $GLOBALS['oSysTemplate']->parseHtmlByName('view_profiles.html', array('content' => $sOutputHtml)) . $oPaginate->getPaginate();
        $aItems = array(_t('_Simple') => array('href' => $sBaseUri . $sPaginateUri . '&mode=simple', 'dynamic' => true, 'active' => $sMode == 'simple'), _t('_Extended') => array('href' => $sBaseUri . $sPaginateUri . '&mode=extended', 'dynamic' => true, 'active' => $sMode == 'extended'));
        $sLinks = BxDolPageView::getBlockCaptionItemCode($iBlockID, $aItems);
        return array($sLinks, $sContent);
    }