Index: branches/5.0.x/core/kernel/utility/http_query.php =================================================================== diff -u -r12877 -r12953 --- branches/5.0.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 12877) +++ branches/5.0.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 12953) @@ -1,6 +1,6 @@ Application->GetVar('passed'); + + if (!array_key_exists('editing_mode', $module_params)) { + $module_params['editing_mode'] = ''; + } + $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 Index: branches/5.0.x/core/kernel/application.php =================================================================== diff -u -r12948 -r12953 --- branches/5.0.x/core/kernel/application.php (.../application.php) (revision 12948) +++ branches/5.0.x/core/kernel/application.php (.../application.php) (revision 12953) @@ -1,6 +1,6 @@ Debugger->appendTimestamp('After UnitConfigReader'); } - $rewrite_on = $this->ConfigValue('UseModRewrite'); - // admin=1 - when front is browsed using admin session - $admin_on = getArrayValue($_REQUEST, 'admin') || $this->isAdmin; - define('MOD_REWRITE', $rewrite_on && !$admin_on ? 1 : 0); + define('MOD_REWRITE', $this->ConfigValue('UseModRewrite') && !$this->isAdmin ? 1 : 0); $this->HttpQuery =& $this->recallObject('HTTPQuery'); Index: branches/5.0.x/core/units/categories/categories_tag_processor.php =================================================================== diff -u -r12884 -r12953 --- branches/5.0.x/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 12884) +++ branches/5.0.x/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 12953) @@ -1,6 +1,6 @@ Application->GetVar('t'); $theme_id = $this->Application->GetVar('m_theme'); - $url_params = Array ('block' => '#BLOCK#', 'theme-file_event' => '#EVENT#', 'theme_id' => $theme_id, 'source' => $template, 'pass' => 'all,theme-file', 'front' => 1, 'm_opener' => 'd', 'no_amp' => 1); + $url_params = Array ('block' => '#BLOCK#', 'theme-file_event' => '#EVENT#', 'theme_id' => $theme_id, 'source' => $template, 'pass' => 'all,theme-file', 'front' => 1, 'm_opener' => 'd', '__NO_REWRITE__' => 1, 'no_amp' => 1); $edit_template_url = $this->Application->HREF('themes/template_edit', ADMIN_DIRECTORY, $url_params, 'index.php'); - $url_params = Array ('theme-file_event' => 'OnSaveLayout', 'source' => $template, 'pass' => 'all,theme-file', 'no_amp' => 1); + $url_params = Array ('theme-file_event' => 'OnSaveLayout', 'source' => $template, 'pass' => 'all,theme-file', '__NO_REWRITE__' => 1, 'no_amp' => 1); $save_layout_url = $this->Application->HREF('index', '', $url_params); - $this_url = $this->Application->HREF('', '', Array ('editing_mode' => '#EDITING_MODE#', 'no_amp' => 1)); + $this_url = $this->Application->HREF('', '', Array ('editing_mode' => '#EDITING_MODE#', '__NO_REWRITE__' => 1, 'no_amp' => 1)); $ret .= "var aTemplateManager = new TemplateManager('" . $edit_template_url . "', '" . $this_url . "', '" . $save_layout_url . "', " . (int)EDITING_MODE . ");\n"; $ret .= "var main_title = '" . addslashes( $this->Application->ConfigValue('Site_Name') ) . "';" . "\n"; @@ -1365,7 +1365,7 @@ $ret .= "var base_url = '" . $this->Application->BaseURL() . "';" . "\n"; $ret .= 'TB.closeHtml = \'close
\';' . "\n"; - $url_params = Array('m_theme' => '', 'pass' => 'm', 'm_opener' => 'r', 'no_amp' => 1); + $url_params = Array('m_theme' => '', 'pass' => 'm', 'm_opener' => 'r', '__NO_REWRITE__' => 1, 'no_amp' => 1); $browse_url = $this->Application->HREF('catalog/catalog', ADMIN_DIRECTORY, $url_params, 'index.php'); $browse_url = preg_replace('/&(admin|editing_mode)=[\d]/', '', $browse_url); @@ -1528,7 +1528,7 @@ $sql = 'SELECT FileId FROM ' . TABLE_PREFIX . 'ThemeFiles - WHERE (FilePath = ' . $this->Conn->qstr($file_path) . ') AND (FileName = ' . $this->Conn->qstr($file_name . '.tpl') . ')'; + WHERE (ThemeId = ' . (int)$this->Application->GetVar('m_theme') . ') AND (FilePath = ' . $this->Conn->qstr($file_path) . ') AND (FileName = ' . $this->Conn->qstr($file_name . '.tpl') . ')'; return $this->Conn->GetOne($sql); }