BxDolTwigModule::_actionBrowseFans PHP Method

_actionBrowseFans() public method

public _actionBrowseFans ( $sUri, $sFuncAllowed, $sFuncDbGetFans, $iPerPage, $sUrlBrowse, $sTitle )
    function _actionBrowseFans($sUri, $sFuncAllowed, $sFuncDbGetFans, $iPerPage, $sUrlBrowse, $sTitle)
    {
        if (!($aDataEntry = $this->_preProductTabs($sUri, $sTitle))) {
            return;
        }
        if (!$this->{$sFuncAllowed}($aDataEntry)) {
            $this->_oTemplate->displayAccessDenied();
            return;
        }
        $iPage = (int) $_GET['page'];
        if ($iPage < 1) {
            $iPage = 1;
        }
        $iStart = ($iPage - 1) * $iPerPage;
        $aProfiles = array();
        $iNum = $this->_oDb->{$sFuncDbGetFans}($aProfiles, $aDataEntry[$this->_oDb->_sFieldId], $iStart, $iPerPage);
        if (!$iNum || !$aProfiles) {
            $this->_oTemplate->displayNoData();
            return;
        }
        $iPages = ceil($iNum / $iPerPage);
        bx_import('BxTemplSearchProfile');
        $oBxTemplSearchProfile = new BxTemplSearchProfile();
        $sMainContent = '';
        foreach ($aProfiles as $aProfile) {
            $sMainContent .= $oBxTemplSearchProfile->displaySearchUnit($aProfile);
        }
        $sRet = $GLOBALS['oFunctions']->centerContent($sMainContent, '.searchrow_block_simple');
        $sRet .= '<div class="clear_both"></div>';
        bx_import('BxDolPaginate');
        $sUrlStart = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . $sUrlBrowse . $aDataEntry[$this->_oDb->_sFieldUri];
        $sUrlStart .= false === strpos($sUrlStart, '?') ? '?' : '&';
        $oPaginate = new BxDolPaginate(array('page_url' => $sUrlStart . 'page={page}&per_page={per_page}' . (false !== bx_get($this->sFilterName) ? '&' . $this->sFilterName . '=' . bx_get($this->sFilterName) : ''), 'count' => $iNum, 'per_page' => $iPerPage, 'page' => $iPage, 'on_change_per_page' => "document.location='" . $sUrlStart . "page=1&per_page=' + this.value + '" . (false !== bx_get($this->sFilterName) ? '&' . $this->sFilterName . '=' . bx_get($this->sFilterName) . "';" : "';")));
        $sRet .= $oPaginate->getPaginate();
        $this->_oTemplate->pageStart();
        echo DesignBoxContent($sTitle, $sRet, 11);
        $this->_oTemplate->pageCode($sTitle, false, false);
    }

Usage Example

コード例 #1
0
 function actionBrowseFans($sUri)
 {
     parent::_actionBrowseFans($sUri, 'isAllowedViewFans', 'getFansBrowse', $this->_oDb->getParam('bx_groups_perpage_browse_fans'), 'browse_fans/', _t('_bx_groups_page_title_fans'));
 }
All Usage Examples Of BxDolTwigModule::_actionBrowseFans