Index: branches/RC/core/units/categories/categories_tag_processor.php =================================================================== diff -u -r11661 -r11682 --- branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11661) +++ branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11682) @@ -360,7 +360,8 @@ if ($no_special) return $this->Special; $list_unique_key = $this->getUniqueListKey($params); - if (!$this->Application->IsAdmin()) { + // check for "admin" variable, because we are parsing front-end template from admin when using template editor feature + if ($this->Application->GetVar('admin') || !$this->Application->IsAdmin()) { // add parent category to special, when on Front-End, // because there can be many category lists on same page $list_unique_key .= $parent_cat_id; @@ -1069,15 +1070,7 @@ $themes_helper =& $this->Application->recallObject('ThemesHelper'); /* @var $themes_helper kThemesHelper */ - $sql = 'SELECT ' . $page->IDField . ' - FROM ' . $page->TableName . ' - WHERE - ( - (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR - (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ') - ) - AND (ThemeId = ' . $themes_helper->getCurrentThemeId() . ' OR ThemeId = 0)'; - $page_id = $this->Conn->GetOne($sql); + $page_id = $themes_helper->getPageByTemplate($template); $page->Load($page_id); } @@ -1224,7 +1217,7 @@ continue; } - $text = preg_replace('/@@' . $page_id . '@@/', $this->Application->HREF($templates[$page_id], '', Array ('pass' => 'm')), $text); + $text = preg_replace('/@@' . $page_id . '@@/', $this->Application->HREF(strtolower($templates[$page_id]), '', Array ('pass' => 'm')), $text); } return $text; @@ -1409,9 +1402,15 @@ $display_mode = array_key_exists('mode', $params) ? $params['mode'] : false; $edit_code = ''; - if ($display_mode != 'end') { - $page =& $this->_getPage($params); + $page =& $this->_getPage($params); + if (!$page->isLoaded()) { + // when "EditingScripts" tag is not used, make sure, that scripts are also included + return $this->EditingScripts($params); + } + + // show "EditPage" button only for pages, that exists in structure + if ($display_mode != 'end') { $url_params = Array( 'pass' => 'm,c', 'm_opener' => 'd',