function BxTemplSearchProfile($sParamName = '', $sParamValue = '', $sParamValue1 = '', $sParamValue2 = '')
 {
     parent::BxBaseSearchProfile($sParamName, $sParamValue, $sParamValue1, $sParamValue2);
 }
Example #2
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);
     $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 = '';
     $sOutputMode = isset($_REQUEST['search_result_mode']) && $_REQUEST['search_result_mode'] == 'ext' ? 'ext' : 'sim';
     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++;
     }
     // gen sorting block ( type of : drop down );
     $sSortBlock = $oPaginate->getSorting(array('none' => _t('_None'), 'activity' => _t('_Latest activity'), 'date_reg' => _t('_FieldCaption_DateReg_View')));
     $sSortBlock = '<div class="ordered_block">' . $sSortBlock . '</div><div class="clear_both"></div>';
     $sContent = $GLOBALS['oSysTemplate']->parseHtmlByName('designbox_top_controls.html', array('top_controls' => $sSortBlock));
     $sContent .= $GLOBALS['oSysTemplate']->parseHtmlByName('view_profiles.html', array('margin_type' => $sOutputMode == 'sim' ? '-thd' : '', 'content' => $sOutputHtml)) . $oPaginate->getPaginate();
     $aLinks = 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'));
     return array($aLinks, $sContent);
 }
 function __construct($sParamName = '', $sParamValue = '', $sParamValue1 = '', $sParamValue2 = '')
 {
     parent::__construct($sParamName, $sParamValue, $sParamValue1, $sParamValue2);
 }