Index: trunk/core/kernel/application.php =================================================================== diff -u -r3212 -r3214 --- trunk/core/kernel/application.php (.../application.php) (revision 3212) +++ trunk/core/kernel/application.php (.../application.php) (revision 3214) @@ -212,16 +212,11 @@ $this->VerifyThemeId(); } - $this->SetVar('lang.current_id', $this->GetVar('m_lang') ); - $this->SetVar('theme.current_id', $this->GetVar('m_theme') ); if( $this->GetVar('m_cat_id') === false ) $this->SetVar('m_cat_id', 0); - - $language =& $this->recallObject( 'lang.current', null, Array('live_table' => true) ); - if( !$this->RecallVar('UserGroups') ) { - $ses =& $this->recallObject('Session'); - $user_groups = trim($ses->GetField('GroupList'), ','); + $session =& $this->recallObject('Session'); + $user_groups = trim($session->GetField('GroupList'), ','); if (!$user_groups) $user_groups = $this->ConfigValue('User_GuestGroup'); $this->StoreVar('UserGroups', $user_groups); } @@ -230,6 +225,10 @@ $this->SetVar('visits_id', $this->RecallVar('visit_id') ); + $this->SetVar('lang.current_id', $this->GetVar('m_lang') ); + $this->SetVar('theme.current_id', $this->GetVar('m_theme') ); + $language =& $this->recallObject( 'lang.current', null, Array('live_table' => true) ); + $this->ValidateLogin(); // TODO: write that method if( $this->isDebugMode() ) @@ -315,13 +314,10 @@ function GetPrimaryCurrency() { - $this->setUnitOption('mod','AutoLoad',false); - $module =& $this->recallObject('mod'); - $this->setUnitOption('mod','AutoLoad',true); - - if( $module->Load('In-Commerce') && $module->GetDBField('Loaded') == 1 ) + $has_incommerce = getArrayValue($this->ModuleInfo, 'In-Commerce'); + if($has_incommerce && $has_incommerce['Loaded'] ) { - $table = $this->getUnitOption('curr','TableName'); + $table = $this->getUnitOption('curr', 'TableName'); return $this->DB->GetOne('SELECT ISO FROM '.$table.' WHERE IsPrimary = 1'); } else Index: trunk/core/kernel/utility/http_query.php =================================================================== diff -u -r3210 -r3214 --- trunk/core/kernel/utility/http_query.php (.../http_query.php) (revision 3210) +++ trunk/core/kernel/utility/http_query.php (.../http_query.php) (revision 3214) @@ -283,11 +283,11 @@ if($prev_passed) { $prev_passed = explode(',', $prev_passed); - $passed = array_unique( array_merge_recursive2($prev_passed, $passed) ); + $passed = array_unique( array_merge($passed, $prev_passed) ); } $passed = implode(',', $passed); - $this->Set('passed', $passed); + $env = $this->Application->BuildEnv( $this->Get('t'), $module_params, $passed, false, false ); $this->Set(ENV_VAR_NAME, $env); $_REQUEST['env'] = $_GET['env'] = $env; // for capability with old in-portal code @@ -434,8 +434,7 @@ $passed[] = $module_prefix; $module_event = new kEvent($module_prefix.':ParseEnv', Array('url_parts' => $url_parts) ); $this->Application->HandleEvent($module_event); - $module_object =& $module_event->getObject(); - $item_id = $module_object->GetID(); + $item_id = $this->Get($module_prefix.'_id'); $module_params = Array($module_prefix.'_id' => $item_id ? $item_id : '0' ); } Index: trunk/core/kernel/event_handler.php =================================================================== diff -u -r3212 -r3214 --- trunk/core/kernel/event_handler.php (.../event_handler.php) (revision 3212) +++ trunk/core/kernel/event_handler.php (.../event_handler.php) (revision 3214) @@ -214,9 +214,6 @@ if (!$url_parts) return false; $ret = ''; - - $object =& $event->getObject( Array('skip_autoload' => true) ); - $url_part = array_shift($url_parts); // match module page @@ -236,10 +233,16 @@ } // match item's filename - $object->Load($url_part, 'Filename'); - if( $object->isLoaded() ) + $db =& $this->Application->GetADODBConnection(); + $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); + $table = $this->Application->getUnitOption($event->Prefix, 'TableName'); + $sql = 'SELECT '.$id_field.' + FROM '.$table.' + WHERE Filename = '.$db->qstr($url_part); + $item_id = $db->GetOne($sql); + if($item_id !== false) { - $this->Application->SetVar( $event->getPrefixSpecial().'_id', $object->GetID() ); + $this->Application->SetVar($event->getPrefixSpecial().'_id', $item_id); } }