function getBlockCode_Browse()
 {
     bx_events_import('SearchResult');
     $o = new BxEventsSearchResult('user', process_db_input($this->_aProfile['NickName'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION));
     $o->aCurrent['rss'] = 0;
     $o->sBrowseUrl = "browse/my";
     $o->aCurrent['title'] = _t('_bx_events_block_my_events');
     if ($o->isError) {
         return MsgBox(_t('_Empty'));
     }
     if ($s = $o->processing()) {
         $this->_oTemplate->addCss(array('unit.css', 'main.css', 'twig.css'));
         return $s;
     } else {
         return DesignBoxContent(_t('_bx_events_block_user_events'), MsgBox(_t('_Empty')), 1);
     }
 }
Beispiel #2
0
 function getMain()
 {
     $aPathInfo = pathinfo(__FILE__);
     require_once $aPathInfo['dirname'] . '/BxEventsSearchResult.php';
     return BxEventsSearchResult::getMain();
 }
 function actionSearch($sKeyword = '', $sCountry = '')
 {
     if (!$this->isAllowedSearch()) {
         $this->_oTemplate->displayAccessDenied();
         return;
     }
     $this->_oTemplate->pageStart();
     if ($sKeyword) {
         $_GET['Keyword'] = $sKeyword;
     }
     if ($sCountry) {
         $_GET['Country'] = explode(',', $sCountry);
     }
     if (is_array($_GET['Country']) && 1 == count($_GET['Country']) && !$_GET['Country'][0]) {
         unset($_GET['Country']);
         unset($sCountry);
     }
     if ($sCountry || $sKeyword) {
         $_GET['submit_form'] = 1;
     }
     bx_events_import('FormSearch');
     $oForm = new BxEventsFormSearch();
     $oForm->initChecker();
     if ($oForm->isSubmittedAndValid()) {
         bx_events_import('SearchResult');
         $o = new BxEventsSearchResult('search', $oForm->getCleanValue('Keyword'), $oForm->getCleanValue('Country'));
         if ($o->isError) {
             $this->_oTemplate->displayPageNotFound();
             return;
         }
         if ($s = $o->processing()) {
             echo $s;
         } else {
             $this->_oTemplate->displayNoData();
             return;
         }
         $this->isAllowedSearch(true);
         // perform search action
         $this->_oTemplate->addCss(array('unit.css', 'main.css', 'twig.css'));
         $this->_oTemplate->pageCode($o->aCurrent['title'], false, false);
         return;
     }
     echo $oForm->getCode();
     $this->_oTemplate->addCss('main.css');
     $this->_oTemplate->pageCode(_t('_bx_events_caption_search'));
 }