Index: trunk/kernel/units/general/cat_event_handler.php =================================================================== diff -u -r3031 -r3133 --- trunk/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 3031) +++ trunk/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 3133) @@ -218,7 +218,7 @@ $object->addFilter('favorites_filter', '%1$s.`ResourceId` IN ('.implode(',',$ids).')'); break; case 'search': - $search_results_table = TABLE_PREFIX.'ses_'.$this->Application->GetVar('sid').'_'.TABLE_PREFIX.'Search'; + $search_results_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; $sql = ' SELECT DISTINCT ResourceId FROM '.$search_results_table.' WHERE ItemType=11'; @@ -336,7 +336,7 @@ } $event->redirect = false; - $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetVar('sid').'_'.TABLE_PREFIX.'Search'; + $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; $keywords = trim($this->Application->GetVar('keywords')); if( !$this->Application->GetVar('INPORTAL_ON') ) @@ -620,7 +620,7 @@ */ function OnSubSearch(&$event) { - $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetVar('sid').'_'.TABLE_PREFIX.'Search'; + $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; $sql = 'SHOW TABLES LIKE "'.$search_table.'"'; if($this->Conn->Query($sql)) { @@ -928,7 +928,7 @@ $where_clause .= ' AND '.$product_table.'.Status = 1'; // building final search query - $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetVar('sid').'_'.TABLE_PREFIX.'Search'; + $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; $this->Conn->Query('DROP TABLE IF EXISTS '.$search_table); @@ -946,6 +946,55 @@ $res = $this->Conn->Query($sql); } + + /** + * Enter description here... + * + * @param kEvent $event + */ + function BuildEnv(&$event) + { + $prefix_special = $event->getPrefixSpecial(); + $url_params = $event->getEventParam('url_params'); + + $query_vars = $this->Application->getUnitOption($event->Prefix, 'QueryString'); + + //if pass events is off and event is not implicity passed + if ( !$event->getEventParam('pass_events') && !isset($url_params[$prefix_special.'_event']) ) + { + $url_params[$prefix_special.'_event'] = ''; // remove event from url if requested + //otherwise it will use value from get_var + } + + if(!$query_vars) + { + $event->setEventParam('env_string', ''); + return true; + + } + + + + + /*$tmp_string = Array(0 => $prefix_special); + foreach($query_vars as $index => $var_name) + { + //if value passed in params use it, otherwise use current from application + $var_name = $prefix_special.'_'.$var_name; + $tmp_string[$index] = isset( $url_params[$var_name] ) ? $url_params[$var_name] : $this->Application->GetVar($var_name); + if ( isset($url_params[$var_name]) ) unset( $url_params[$var_name] ); + } + + $escaped = Array(); + foreach ($tmp_string as $tmp_val) + { + $escaped[] = str_replace( Array('-',':'), Array('\-','\:'), $tmp_val); + } + + $portal_env = $this->Application->getUnitOption($event->Prefix, 'PortalStyleEnv'); + $ret .= $portal_env ? array_shift($escaped).array_shift($escaped).'-'.implode('-',$escaped) : implode('-', $escaped);*/ + + } } ?> \ No newline at end of file Index: trunk/core/units/general/cat_event_handler.php =================================================================== diff -u -r3031 -r3133 --- trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 3031) +++ trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 3133) @@ -218,7 +218,7 @@ $object->addFilter('favorites_filter', '%1$s.`ResourceId` IN ('.implode(',',$ids).')'); break; case 'search': - $search_results_table = TABLE_PREFIX.'ses_'.$this->Application->GetVar('sid').'_'.TABLE_PREFIX.'Search'; + $search_results_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; $sql = ' SELECT DISTINCT ResourceId FROM '.$search_results_table.' WHERE ItemType=11'; @@ -336,7 +336,7 @@ } $event->redirect = false; - $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetVar('sid').'_'.TABLE_PREFIX.'Search'; + $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; $keywords = trim($this->Application->GetVar('keywords')); if( !$this->Application->GetVar('INPORTAL_ON') ) @@ -620,7 +620,7 @@ */ function OnSubSearch(&$event) { - $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetVar('sid').'_'.TABLE_PREFIX.'Search'; + $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; $sql = 'SHOW TABLES LIKE "'.$search_table.'"'; if($this->Conn->Query($sql)) { @@ -928,7 +928,7 @@ $where_clause .= ' AND '.$product_table.'.Status = 1'; // building final search query - $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetVar('sid').'_'.TABLE_PREFIX.'Search'; + $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; $this->Conn->Query('DROP TABLE IF EXISTS '.$search_table); @@ -946,6 +946,55 @@ $res = $this->Conn->Query($sql); } + + /** + * Enter description here... + * + * @param kEvent $event + */ + function BuildEnv(&$event) + { + $prefix_special = $event->getPrefixSpecial(); + $url_params = $event->getEventParam('url_params'); + + $query_vars = $this->Application->getUnitOption($event->Prefix, 'QueryString'); + + //if pass events is off and event is not implicity passed + if ( !$event->getEventParam('pass_events') && !isset($url_params[$prefix_special.'_event']) ) + { + $url_params[$prefix_special.'_event'] = ''; // remove event from url if requested + //otherwise it will use value from get_var + } + + if(!$query_vars) + { + $event->setEventParam('env_string', ''); + return true; + + } + + + + + /*$tmp_string = Array(0 => $prefix_special); + foreach($query_vars as $index => $var_name) + { + //if value passed in params use it, otherwise use current from application + $var_name = $prefix_special.'_'.$var_name; + $tmp_string[$index] = isset( $url_params[$var_name] ) ? $url_params[$var_name] : $this->Application->GetVar($var_name); + if ( isset($url_params[$var_name]) ) unset( $url_params[$var_name] ); + } + + $escaped = Array(); + foreach ($tmp_string as $tmp_val) + { + $escaped[] = str_replace( Array('-',':'), Array('\-','\:'), $tmp_val); + } + + $portal_env = $this->Application->getUnitOption($event->Prefix, 'PortalStyleEnv'); + $ret .= $portal_env ? array_shift($escaped).array_shift($escaped).'-'.implode('-',$escaped) : implode('-', $escaped);*/ + + } } ?> \ No newline at end of file