Index: branches/unlabeled/unlabeled-1.166.4/core/kernel/application.php =================================================================== diff -u -r6881 -r7036 --- branches/unlabeled/unlabeled-1.166.4/core/kernel/application.php (.../application.php) (revision 6881) +++ branches/unlabeled/unlabeled-1.166.4/core/kernel/application.php (.../application.php) (revision 7036) @@ -676,6 +676,17 @@ }*/ } + if ($this->isModuleEnabled('Proj-CMS')) { + $cms_handler =& $this->recallObject('st_EventHandler'); + if (!$this->TemplatesCache->TemplateExists($t) && !$this->IsAdmin()) { + $t = $cms_handler->GetDesignTemplate(); + } + /*else { + $cms_handler->SetCatByTemplate(); + }*/ + } + + if($this->isDebugMode() && constOn('DBG_PROFILE_MEMORY')) { $this->Debugger->appendMemoryUsage('Application before Parsing:'); } @@ -1077,21 +1088,21 @@ $wid = $this->Application->GetVar('m_wid'); $stack_name = rtrim('opener_stack_'.$wid, '_'); $opener_stack = $this->RecallVar($stack_name); - + if ($opener_stack && $opener_stack != serialize(Array())) { $opener_stack = unserialize($opener_stack); list($index_file, $env) = explode('|', $opener_stack[count($opener_stack) - 1]); $ret = $this->BaseURL($prefix, $ssl).$index_file.'?'.ENV_VAR_NAME.'='.$env; if ( getArrayValue($params,'escape') ) $ret = addslashes($ret); - + if (isset($params['m_opener']) && $params['m_opener'] == 'u') { array_pop($opener_stack); if (!$opener_stack) { $this->RemoveVar($stack_name); // remove popups last templates, because popup is closing now $this->RemoveVar('last_template_'.$wid); $this->RemoveVar('last_template_popup_'.$wid); - + // don't save popups last templates again :) $this->SetVar('skip_last_template', 1); } @@ -1226,7 +1237,7 @@ return $pass_info; } - function BuildEnv_NEW($t, $params, $pass = 'all', $pass_events = false) + function BuildEnv_NEW($t, $params, $pass='all', $pass_events = false) { // $session =& $this->recallObject('Session'); $force_admin = getArrayValue($params,'admin') || $this->GetVar('admin'); @@ -2108,7 +2119,7 @@ } return $current_prefix; } - + function &EmailEventAdmin($email_event_name, $to_user_id = -1, $send_params = false) { return $this->EmailEvent($email_event_name, 1, $to_user_id, $send_params); @@ -2212,7 +2223,7 @@ $mode = $this->GetVar($top_prefix.'_mode'); return $mode != '' ? substr($mode, 1) : ''; } - + /** * Get temp table name * @@ -2225,7 +2236,7 @@ if (preg_match('/prefix:(.*)/', $wid, $regs)) { $wid = $this->GetTopmostWid($regs[1]); } - + return TABLE_PREFIX.'ses_'.$this->GetSID().($wid ? '_'.$wid : '').'_edit_'.$table; } @@ -2234,7 +2245,7 @@ if (preg_match('/prefix:(.*)/', $wid, $regs)) { $wid = $this->GetTopmostWid($regs[1]); } - + return TABLE_PREFIX.'ses_'.$this->GetSID().($wid ? '_'.$wid : '').'_edit_'; } @@ -2253,7 +2264,7 @@ { if( preg_match('/'.TABLE_PREFIX.'ses_'.$this->GetSID().'(_[\d]+){0,1}_edit_(.*)/',$temp_table, $rets) ) { - // cut wid from table end if any + // cut wid from table end if any return $rets[2]; } else