コード例 #1
0
ファイル: Harmoni.class.php プロジェクト: adamfranco/harmoni
 /**
  * @return void
  * @param string $module
  * @param string $action
  * An alias for {@link ActionHandler::forward()}. Purely for convenience.
  */
 function forward($module, $action)
 {
     $this->ActionHandler->forward($module, $action);
 }
コード例 #2
0
ファイル: search.class.php プロジェクト: noikiy/phpfox-dist
 /**
  * Process the search routine.
  *
  */
 private function _getQueries()
 {
     if ($this->_bLiveQuery === true) {
         return;
     }
     if (Phpfox::isModule('input') && ($aVals = Phpfox_Request::instance()->getArray('val')) && isset($aVals['searchByInputs']) && $aVals['searchByInputs']) {
         $this->_aSearch['input'] = array();
         foreach ($aVals as $sName => $mValue) {
             if (empty($mValue)) {
                 continue;
             }
             if (strpos($sName, 'input_') !== false) {
                 $this->_aSearch['input'][substr($sName, 6)] = $mValue;
             }
         }
     }
     if ($this->_bCache) {
         if ($this->_oReq->get('search-id') || $this->_oReq->get('search-rid')) {
             if (isset($_SESSION[Phpfox::getParam('core.session_prefix')]['search'])) {
                 $this->_aSearch = $_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$this->_sType];
             }
             unset($this->_aSearch['submit']);
         } else {
             if (count($this->_aSearch)) {
                 $_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$this->_sType] = $this->_aSearch;
                 if (!$this->isSearch()) {
                     $this->_oUrl->setParam('search-rid', md5(uniqid(rand(), true)));
                     $this->_oUrl->forward($this->_oUrl->getFullUrl());
                 }
             }
         }
         return;
     }
     // Search form posted
     if (is_array($this->_aSearch) && count($this->_aSearch)) {
         if (isset($this->_aParams['custom_search'])) {
             $aCustomSearch = $this->_oReq->getArray('custom');
             if (count($aCustomSearch)) {
                 foreach ($aCustomSearch as $iCustomKey => $mCustomValue) {
                     if (empty($mCustomValue)) {
                         continue;
                     }
                     $this->_aSearch['custom_search_' . $iCustomKey] = $mCustomValue;
                 }
             }
         }
         // Created MD5 search hash which is unique to the search query.
         //$iId = md5(implode('', array_values($this->_aSearch)) . implode('', array_keys($this->_aSearch)));
         $iId = md5(uniqid());
         // Make sure no such search exists before creating it
         if (!isset($_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$this->_sType][$iId])) {
             // Destroy any older searches for this specific search group
             unset($_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$this->_sType]);
             foreach ($this->_aSearch as $sKey => $mValue) {
                 if (empty($mValue)) {
                     continue;
                 }
                 if (is_array($mValue)) {
                     foreach ($mValue as $iKey => $sVal) {
                         $this->_aSearch[$sKey][$sVal] = Phpfox::getLib('parse.input')->clean($sVal);
                     }
                 } else {
                     $this->_aSearch[$sKey] = Phpfox::getLib('parse.input')->clean($mValue);
                 }
             }
             // Store the search in a session array
             /*
             if (!isset($this->_aParams['no_session_search']))
             {
             	$_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$this->_sType][$iId] = $this->_aSearch;
             
             	$this->_oUrl->setParam('search-id', $iId);
             	$this->_oUrl->forward($this->_oUrl->getFullUrl());
             }
             */
         }
     }
     if (($sSearchId = $this->_oReq->get('search-id')) && isset($_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$this->_sType][$sSearchId])) {
         $this->_aSearch = $_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$this->_sType][$sSearchId];
     } else {
         unset($_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$this->_sType]);
     }
 }