Index: branches/RC/core/units/themes/themes_tag_processor.php =================================================================== diff -u -N -r10832 -r11495 --- branches/RC/core/units/themes/themes_tag_processor.php (.../themes_tag_processor.php) (revision 10832) +++ branches/RC/core/units/themes/themes_tag_processor.php (.../themes_tag_processor.php) (revision 11495) @@ -55,7 +55,11 @@ function SelectedTheme($params) { $object =& $this->getObject($params); - return $object->GetDBField('ThemeId') == $this->Application->GetVar('m_theme'); + + $themes_helper =& $this->Application->recallObject('ThemesHelper'); + /* @var $themes_helper kThemesHelper */ + + return $object->GetDBField('ThemeId') == $themes_helper->getCurrentThemeId(); } } ?> \ No newline at end of file Index: branches/RC/core/units/categories/categories_tag_processor.php =================================================================== diff -u -N -r11368 -r11495 --- branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11368) +++ branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11495) @@ -2,6 +2,20 @@ class CategoriesTagProcessor extends kDBTagProcessor { + /** + * Cached version of site menu + * + * @var Array + */ + var $Menu = null; + + /** + * Parent path mapping used in CachedMenu tag + * + * @var Array + */ + var $ParentPaths = Array (); + function SubCatCount($params) { $object =& $this->getObject($params); @@ -62,16 +76,20 @@ return parent::ItemIcon($params); } - $object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params); - $status = $object->GetDBField('Status'); - if($status == 1) - { - $ret = $object->GetDBField('IsNew') ? 'icon16_cat_new.gif' : 'icon16_cat.gif'; + $object =& $this->getObject($params); + if ($object->GetDBField('IsMenu')) { + $status = $object->GetDBField('Status'); + if ($status == 1) { + $ret = $object->GetDBField('IsNew') ? 'icon16_cat_new.gif' : 'icon16_folder.gif'; + } + else { + $ret = $status ? 'icon16_cat_pending.gif' : 'icon16_cat_disabled.gif'; + } } - else - { - $ret = $status ? 'icon16_cat_pending.gif' : 'icon16_cat_disabled.gif'; + else { + $ret = 'icon16_folder-red.gif'; } + return $ret; } @@ -156,6 +174,18 @@ return $this->Conn->GetOne($sql); } + /** + * Returns current category name + * + * @param Array $params + * @return string + * @todo Find where it's used + */ + function CurrentCategory($params) + { + return $this->CurrentCategoryName($params); + } + function getTitleField() { $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); @@ -179,7 +209,7 @@ if (isset($cache[$category_id])) { //check if sym. link category is valid - $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); + $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); $sql = 'SELECT '.$id_field.' @@ -196,25 +226,25 @@ { $category_id = getArrayValue($params, 'cat_id'); - if ($category_id === false) { - $category_id = $this->Application->GetVar($this->getPrefixSpecial().'_id'); - } + if ($category_id === false) { + $category_id = $this->Application->GetVar($this->getPrefixSpecial().'_id'); + } - if ("$category_id" == 'Root') { - $category_id = $this->Application->findModule('Name', $params['module'], 'RootCat'); - } - elseif ("$category_id" == 'current') { - $category_id = $this->Application->GetVar('m_cat_id'); - } + if ("$category_id" == 'Root') { + $category_id = $this->Application->findModule('Name', $params['module'], 'RootCat'); + } + elseif ("$category_id" == 'current') { + $category_id = $this->Application->GetVar('m_cat_id'); + } - $category_id = $this->getCategorySymLink($category_id); + $category_id = $this->getCategorySymLink($category_id); - unset($params['cat_id'], $params['module']); + unset($params['cat_id'], $params['module']); - $new_params = Array ('pass' => 'm', 'm_cat_id' => $category_id, 'pass_category' => 1); - $params = array_merge_recursive2($params, $new_params); + $new_params = Array ('pass' => 'm', 'm_cat_id' => $category_id, 'pass_category' => 1); + $params = array_merge_recursive2($params, $new_params); - return $this->Application->ProcessParsedTag('m', 't', $params); + return $this->Application->ProcessParsedTag('m', 't', $params); } function CategoryList($params) @@ -252,7 +282,7 @@ function Meta($params) { - $object =& $this->Application->recallObject($this->Prefix.'.-item'); + $object =& $this->Application->recallObject($this->Prefix); // .'.-item' /* @var $object CategoriesItem */ $meta_type = $params['name']; @@ -272,8 +302,8 @@ /* @var $mod_rewrite_helper kModRewriteHelper */ $category_params = Array ( - 'CategoryId' => $object->GetID(), - 'ParentPath' => $object->GetDBField('ParentPath'), + 'CategoryId' => $object->GetID(), + 'ParentPath' => $object->GetDBField('ParentPath'), ); $item_template = $mod_rewrite_helper->GetItemTemplate($category_params, $module_info['Var']); @@ -335,6 +365,7 @@ // because there can be many category lists on same page $list_unique_key .= $parent_cat_id; } + if ($list_unique_key == '') { return parent::BuildListSpecial($params); } @@ -368,8 +399,10 @@ $wid = $this->Application->GetVar('m_wid'); list($index_file, $env) = explode('|', $this->Application->RecallVar(rtrim('last_template_'.$wid, '_')), 2); - $this->Application->SetVar(ENV_VAR_NAME, str_replace('%5C', '\\', $env)); - $this->Application->HttpQuery->processQueryString(); + $vars = $this->Application->HttpQuery->processQueryString( str_replace('%5C', '\\', $env) ); + foreach ($vars as $var_name => $var_value) { + $this->Application->SetVar($var_name, $var_value); + } // update required fields $this->Application->SetVar('m_cat_id', $category_id); @@ -518,6 +551,19 @@ return $object->IsRoot(); } + /** + * Used for disabling "Home" and "Up" buttons in category list + * + * @param Array $params + * @return bool + */ + function ModuleRootCategory($params) + { + $root_category = $this->Application->findModule('Name', 'Proj-CMS', 'RootCat'); + + return $this->Application->GetVar('m_cat_id') == $root_category; + } + function CatalogItemCount($params) { $object =& $this->GetList($params); @@ -570,28 +616,56 @@ return $this->Application->ParseBlock($params, 1); } + /** + * Determines, that printed category/menu item is currently active (will also match parent category) + * + * @param Array $params + * @return bool + */ function IsActive($params) { - $cat_id = isset($params['cat_id']) && $params['cat_id'] ? $params['cat_id'] : false; - if ($cat_id === false) { - // category not supplied -> get current from PrintList - $cat_id = $this->Application->GetVar($this->getPrefixSpecial().'_id'); - $current_cat =& $this->getObject($params); + static $current_path = null; + + if (!isset($current_path)) { + $sql = 'SELECT ParentPath + FROM ' . TABLE_PREFIX . 'Category + WHERE CategoryId = ' . $this->Application->GetVar('m_cat_id'); + $current_path = $this->Conn->GetOne($sql); } + + if (array_key_exists('parent_path', $params)) { + $test_path = $params['parent_path']; + } else { - if ("$cat_id" == 'Root') { - $cat_id = $this->Application->findModule('Name', $params['module'], 'RootCat'); + $template = $params['template']; + if ($template) { + // when using from "c:CachedMenu" tag + $sql = 'SELECT ParentPath + FROM ' . TABLE_PREFIX . 'Category + WHERE NamedParentPath = ' . $this->Conn->qstr('Content/' . $template); + $test_path = $this->Conn->GetOne($sql); } - $current_cat =& $this->Application->recallObject($this->Prefix.'.-c'.$cat_id, $this->Prefix, Array ('skip_autoload' => true)); - $current_cat->Load($cat_id); - } + else { + // when using from "c:PrintList" tag + $cat_id = array_key_exists('cat_id', $params) && $params['cat_id'] ? $params['cat_id'] : false; + if ($cat_id === false) { + // category not supplied -> get current from PrintList + $category =& $this->getObject($params); + } + else { + if ("$cat_id" == 'Root') { + $cat_id = $this->Application->findModule('Name', $params['module'], 'RootCat'); + } - $current_path = $current_cat->GetDBField('ParentPath'); - static $parent_path = null; - if (!isset($parent_path)) { - $parent_path = $this->Conn->GetOne('SELECT ParentPath FROM '.TABLE_PREFIX.'Category WHERE CategoryId = '.$this->Application->GetVar('m_cat_id')); + $category =& $this->Application->recallObject($this->Prefix . '.-c' . $cat_id, $this->Prefix, Array ('skip_autoload' => true)); + $category->Load($cat_id); + } + + $test_path = $category->GetDBField('ParentPath'); + } } - return strpos($parent_path, $current_path) !== false; + + return strpos($current_path, $test_path) !== false; } /** @@ -632,36 +706,36 @@ */ function LastUpdated($params) { - $category_id = $this->Application->GetVar('m_cat_id'); - $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); + $category_id = $this->Application->GetVar('m_cat_id'); + $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); if (isset($params['local']) && $params['local'] && $category_id > 0) { // scan only current category & it's children - $sql = 'SELECT TreeLeft, TreeRight + $sql = 'SELECT TreeLeft, TreeRight FROM '.TABLE_PREFIX.'Category WHERE CategoryId = '.$category_id; - $tree_info = $this->Conn->GetRow($sql); + $tree_info = $this->Conn->GetRow($sql); - $sql = 'SELECT MAX(c.Modified) AS ModDate, MAX(c.CreatedOn) AS NewDate + $sql = 'SELECT MAX(c.Modified) AS ModDate, MAX(c.CreatedOn) AS NewDate FROM '.TABLE_PREFIX.'Category c WHERE c.TreeLeft BETWEEN '.$tree_info['TreeLeft'].' AND '.$tree_info['TreeRight']; - } + } else { // scan all categories in system $sql = 'SELECT MAX(Modified) AS ModDate, MAX(CreatedOn) AS NewDate FROM '.$table_name; - } + } - $row_data = $this->Conn->GetRow($sql); - if (!$row_data) { - return ''; - } + $row_data = $this->Conn->GetRow($sql); + if (!$row_data) { + return ''; + } - $date = $row_data[ $row_data['NewDate'] > $row_data['ModDate'] ? 'NewDate' : 'ModDate' ]; + $date = $row_data[ $row_data['NewDate'] > $row_data['ModDate'] ? 'NewDate' : 'ModDate' ]; - // format date - $format = isset($params['format']) ? $params['format'] : '_regional_DateTimeFormat'; - if (preg_match("/_regional_(.*)/", $format, $regs)) { + // format date + $format = isset($params['format']) ? $params['format'] : '_regional_DateTimeFormat'; + if (preg_match("/_regional_(.*)/", $format, $regs)) { $lang =& $this->Application->recallObject('lang.current'); if ($regs[1] == 'DateTimeFormat') { // combined format @@ -826,8 +900,8 @@ if (is_object($result)) { // webservice responded -> save in local database $fields_hash = Array ( - 'MisspelledWord' => $keywords, - 'SuggestedCorrection' => $result->Data, + 'MisspelledWord' => $keywords, + 'SuggestedCorrection' => $result->Data, ); $this->Conn->doInsert($fields_hash, $table_name); @@ -852,14 +926,6 @@ return $this->Application->ProcessParsedTag('m', 'Link', $params); } - function PageBrowseLink($params) - { - $object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); - $template = $object->GetDBField('NamedParentPath'); - $url_params = Array('admin' => 1, 'pass' => 'm', 'index_file' => 'index.php'); - return $this->Application->HREF($template,'_FRONT_END_', $url_params); - } - function InitCatalogTab($params) { $tab_params['mode'] = $this->Application->GetVar('tm'); // single/multi selection possible @@ -917,6 +983,868 @@ } return $category_path; } + + // structure related + + /** + * Returns page object based on requested params + * + * @param Array $params + * @return PagesItem + */ + function &_getPage($params) + { + $page =& $this->Application->recallObject($this->Prefix . '.-virtual', null, $params); + /* @var $page kDBItem */ + + // 1. load by given id + $page_id = array_key_exists('page_id', $params) ? $params['page_id'] : false; + if ($page_id) { + if ($page_id != $page->GetID()) { + // load if different + $page->Load($page_id); + } + + return $page; + } + + // 2. load by template + $template = array_key_exists('page', $params) ? $params['page'] : ''; + if (!$template) { + $template = $this->Application->GetVar('t'); + } + + if (strtolower($page->GetDBField('NamedParentPath')) != strtolower('Content/'.$template)) { + // load, when used page object doesn't match requested page object + $page->Load('Content/'.$template, 'NamedParentPath'); + } + + return $page; + } + + /** + * Returns requested content block content of current or specified page + * + * @param Array $params + * @return string + */ + function ContentBlock($params) + { + $num = getArrayValue($params, 'num'); + if (!$num) { + return 'NO CONTENT NUM SPECIFIED'; + } + + $page =& $this->_getPage($params); + /* @var $page kDBItem */ + + if (!$page->isLoaded()) { + // page is not created yet => all blocks are empty + return ''; + } + + $page_id = $page->GetID(); + + $data = Array ('PageId' => $page_id, 'ContentNum' => $num); + $content =& $this->Application->recallObject('content.-block', null, Array ('skip_autoload' => true)); + /* @var $content kDBItem */ + + $content->Load($data); + if (!$content->isLoaded()) { + // bug: missing content blocks are created even if user have no SMS-management rights + $content->SetFieldsFromHash($data); + $content->Create(); + } + + $edit_code = ''; + if (EDITING_MODE == EDITING_MODE_CMS) { + $bg_color = isset($params['bgcolor']) ? $params['bgcolor'] : '#ffffff'; + $url_params = Array ( + 'pass' => 'm,st,content', + 'm_opener' => 'd', + 'st_id' => $page->GetID(), + 'content_id' => $content->GetID(), + 'front' => 1, + 'admin' => 1, + '__URLENCODE__' => 1, + '__NO_REWRITE__'=> 1, + 'escape' => 1, + 'index_file' => 'index.php', + // 'bgcolor' => $bg_color, + // '__FORCE_SID__' => 1 + ); + + if (isset($params['float'])) { + $pos_float = 'position: relative; float: '.$params['float'].';'; + } + else { + $pos_float = 'width: auto; position: absolute;'; + } + + // link from Front-End to admin, don't remove "index.php" + $edit_url = $this->Application->HREF('in-edit/pages/content_edit', ADMIN_DIRECTORY, $url_params, 'index.php'); + $button_css = 'font-family: Arial, Verdana; font-size: 9pt; '.$pos_float.' z-index: 99; background-color: #F7C300; color: #CE0031; border: 1px solid #CE0031; padding: 1px 10px 1px 10px; cursor: pointer;'; + $edit_code = '
Edit
'; + + if (isset($params['forms_later']) && $params['forms_later']) { + $tmp = $edit_code; + $edit_code = ''; + } + $edit_code .= '
'; + $edit_code .= ''; + $edit_code .= ''; + $edit_code .= ''; + $edit_code .= ''; + $edit_code .= ''; + $edit_code .= '
'; + if (isset($params['forms_later']) && $params['forms_later']) { + $all_forms = $this->Application->GetVar('all_forms'); + $all_forms .= $edit_code; + $this->Application->SetVar('all_forms', $all_forms); + $edit_code = $tmp; + } + } + + if ($this->Application->GetVar('_editor_preview_') == 1) { + $data = $this->Application->RecallVar('_editor_preview_content_'); + } else { + $data = $content->GetField('Content'); + } + + return $edit_code . $this->_replacePageIds($data); + } + + /** + * Replace links like "@@ID@@" to actual template names in given text + * + * @param string $text + * @return string + */ + function _replacePageIds($text) + { + if (!preg_match_all('/@@(\\d+)@@/', $text, $regs)) { + return $text; + } + + $page_ids = $regs[1]; + + $sql = 'SELECT NamedParentPath, CategoryId + FROM ' . TABLE_PREFIX . 'Category + WHERE CategoryId IN (' . implode(',', $page_ids) . ')'; + + $templates = $this->Conn->GetCol($sql, 'CategoryId'); + + foreach ($page_ids as $page_id) { + $text = preg_replace('/@@' . $page_id . '@@/', $this->Application->HREF($templates[$page_id], '', Array ('pass' => 'm')), $text); + } + + return $text; + } + + /** + * Returns current page name or page based on page/page_id parameters + * + * @param Array $params + * @return string + * @todo Used? + */ + function PageName($params) + { + $page =& $this->_getPage($params); + + return $page->GetDBField('Name'); + } + + /** + * Returns current/given page information + * + * @param Array $params + * @return string + */ + function PageInfo($params) + { + $page =& $this->_getPage($params); + + if ($params['type'] == 'index_tools') { + $page_info = $page->GetDBField('IndexTools'); + if ($page_info) { + return $page_info; + } + else { + if (PROTOCOL == 'https://') { + return $this->Application->ConfigValue('cms_DefaultIndextoolsCode_SSL'); + } + else { + return $this->Application->ConfigValue('cms_DefaultIndextoolsCode'); + } + } + } + + switch ($params['type']) { + case 'title': + $db_field = 'Title'; + break; + + case 'htmlhead_title': + $db_field = 'Name'; + break; + + case 'meta_title': + $db_field = 'MetaTitle'; + break; + + case 'meta_keywords': + $db_field = 'MetaKeywords'; + $cat_field = 'Keywords'; + break; + + case 'meta_description': + $db_field = 'MetaDescription'; + $cat_field = 'Description'; + break; + + default: + return ''; + } + + $default = isset($params['default']) ? $params['default'] : ''; + $val = $page->GetField($db_field); + if (!$default) { + if ($this->Application->isModuleEnabled('In-Portal')) { + if (!$val && ($params['type'] == 'meta_keywords' || $params['type'] == 'meta_description')) { + // take category meta if it's not set for the page + return $this->Application->ProcessParsedTag('c', 'Meta', Array('name' => $cat_field)); + } + } + } + + if (isset($params['force_default']) && $params['force_default']) { + return $default; + } + + if (preg_match('/^_Auto:/', $val)) { + $val = $default; + + /*if ($db_field == 'Title') { + $page->SetDBField($db_field, $default); + $page->Update(); + }*/ + } + elseif ($page->GetID() == false) { + return $default; + } + + return $val; + } + + /** + * Prints "Edit Page" button on cms page + * + * @param Array $params + * @return string + */ + function EditPage($params) + { + if (!EDITING_MODE) { + return ''; + } + + $page =& $this->_getPage($params); + + $url_params = Array( + 'pass' => 'm,st', + 'm_opener' => 'd', + 'st_id' => $page->GetID(), + 'st_mode' => 't', + // 'st_event' => 'OnEdit', + 'front' => 1, + '__URLENCODE__' => 1, + '__NO_REWRITE__'=> 1, + 'escape' => 1, + 'index_file' => 'index.php', + ); + + $edit_url = $this->Application->HREF('proj-cms/structure/structure_edit', '/admin', $url_params); + $button_css = 'position: absolute; z-index: 1; top: 1; left 1; font-family: Arial, Verdana; font-size: 9px; background-color: #F7C300; color: #CE0031; border: 1px solid #CE0031; width: auto; padding: 2px 10px 2px 10px; cursor: pointer;'; + $edit_code = '
Page Properties'; + $title = $this->PageInfo(array('type' => 'htmlhead_title')); + + $edit_code .= '
'; + $edit_code .= ''; + $edit_code .= ''; + $edit_code .= '
'; + + if (!$this->Application->GetVar('admin_scripts_included')) { + $this->Application->SetVar('admin_script_included', 1); + $edit_code .= ''; + $edit_code .= ''; + $edit_code .= ''; + $edit_code .= ''; + } + + /*$browse_url = $this->Application->HREF('index', '/admin', array('m_cat_id'=>1,'m_theme'=>'','admin' => 1, 'pass' => 'm', 'm_opener' => 'r'), '../index.php'); + + $edit_code .= ' +
'."\n";*/ + + $edit_code .= ''."\n"; + + return $edit_code; + } + + /** + * Builds cached menu version + * + * @return Array + */ + function _prepareMenu() + { + static $root_cat = null; + static $root_path = null; + + if (!$root_cat) { + $root_cat = $this->Application->ModuleInfo['Proj-CMS']['RootCat']; + $root_path = $this->Conn->GetOne('SELECT ParentPath FROM '.TABLE_PREFIX.'Category WHERE CategoryId = '.$root_cat); + } + + if (!$this->Menu) { + $menu = $this->Conn->GetRow('SELECT Data, Cached FROM '.TABLE_PREFIX.'Cache WHERE VarName = "cms_menu"'); + if ($menu && $menu['Cached'] > 0) { + $menu = unserialize($menu['Data']); + $this->ParentPaths = $menu['ParentPaths']; + } + else { + $menu = $this->_altBuildMenuStructure(array('CategoryId' => $root_cat, 'ParentPath' => $root_path)); + $menu['ParentPaths'] = $this->ParentPaths; + $this->Conn->Query('REPLACE '.TABLE_PREFIX.'Cache (VarName, Data, Cached) VALUES ("cms_menu", '.$this->Conn->qstr(serialize($menu)).', '.adodb_mktime().')'); + } + unset($menu['ParentPaths']); + $this->Menu = $menu; + } + + return Array ($this->Menu, $root_path); + } + + /** + * Returns category id based tag parameters + * + * @param Array $params + * @return int + */ + function _getCategoryId($params) + { + $cat = isset($params['category_id']) && $params['category_id'] != '' ? $params['category_id'] : $this->Application->GetVar('m_cat_id'); + if ("$cat" == 'parent') { + $this_category =& $this->Application->recallObject('c'); + /* @var $this_category kDBItem */ + + $cat = $this_category->GetDBField('ParentId'); + } + else if ($cat == 0) { + $cat = $this->Application->ModuleInfo['Proj-CMS']['RootCat']; + } + + return $cat; + } + + /** + * Prepares cms menu item block parameters + * + * @param Array $page + * @param int $real_cat_id + * @param string $root_path + * @return Array + */ + function _prepareMenuItem($page, $real_cat_id, $root_path) + { + static $language_id = null; + static $primary_language_id = null; + + if (!isset($language_id)) { + $language_id = $this->Application->GetVar('m_lang'); + $primary_language_id = $this->Application->GetDefaultLanguageId(); + } + + $title = $page['l'.$language_id.'_ItemName'] ? $page['l'.$language_id.'_ItemName'] : $page['l'.$primary_language_id.'_ItemName']; + $active = false; + $category_active = false; + + if ($page['ItemType'] == 'cat') { + if ( isset($this->ParentPaths[$real_cat_id])) { + $active = strpos($this->ParentPaths[$real_cat_id], $page['ParentPath']) !== false; + } + $category_active = $page['CategoryId'] == $real_cat_id; + } + + if ($page['ItemType'] == 'cat_index') { + $check_path = str_replace($root_path, '', $page['ParentPath']); + $active = strpos($parent_path, $check_path) !== false; + } + + if ($page['ItemType'] == 'page') { + $active = $page['ItemPath'] == preg_replace('/^Content\//', '', $this->Application->GetVar('t')); + } + + $block_params = Array ( + 'title'=> $title, + 'template'=> preg_replace('/^Content\//', '', $page['ItemPath']), + 'active'=>$active, + 'category_active' => $category_active, // new + 'parent_path'=>$page['ParentPath'], + 'parent_id'=>$page['ParentId'], + 'cat_id'=>$page['CategoryId'], + 'is_index'=>$page['IsIndex'], + 'item_type'=>$page['ItemType'], + 'page_id'=>$page['ItemId'], + 'has_sub_menu' => isset($page['sub_items']) && count($page['sub_items']) > 0, + 'external_url' => $page['UseExternalUrl'] ? $page['ExternalUrl'] : false, + 'menu_icon' => $page['UseMenuIconUrl'] ? $page['MenuIconUrl'] : false, + + ); + + return $block_params; + } + + /** + * Builds site menu + * + * @param Array $params + * @return string + */ + function CachedMenu($params) + { + list ($menu, $root_path) = $this->_prepareMenu(); + $cat = $this->_getCategoryId($params); + + $parent_path = isset($this->ParentPaths[$cat]) ? $this->ParentPaths[$cat] : ''; + $parent_path = str_replace($root_path, '', $parent_path); //menu starts from module path + $levels = explode('|',trim($parent_path,'|')); + if ($levels[0] === '') $levels = array(); + if (isset($params['level']) && $params['level'] > count($levels)) return ; + + $level = max(isset($params['level']) ? $params['level']-1 : count($levels)-1, 0); + $parent = isset($levels[$level]) ? $levels[$level] : 0; + + $cur_menu =& $menu; + $menu_path = array_slice($levels, 0, $level+1); + foreach ($menu_path as $elem) { + $cur_menu =& $cur_menu['c'.$elem]['sub_items']; + } + + $ret = ''; + $block_params = $this->prepareTagParams($params); + $block_params['name'] = $params['render_as']; + + $this->Application->SetVar('cur_parent_path', $parent_path); + $real_cat_id = $this->Application->GetVar('m_cat_id'); + if (is_array($cur_menu) && $cur_menu) { + $cur_item = 1; + $cur_menu = $this->_removeNonMenuItems($cur_menu); + $block_params['total_items'] = count($cur_menu); + + foreach ($cur_menu as $page) { + $block_params = array_merge_recursive2( + $block_params, + $this->_prepareMenuItem($page, $real_cat_id, $root_path) + ); + + $block_params['is_last'] = $cur_item == $block_params['total_items']; + $block_params['is_first'] = $cur_item == 1; + + // bug #1: this breaks active section highlighting when 2 menu levels are printed on same page (both visible) + // bug #2: people doesn't pass cat_id parameter to m_Link tags in their blocks, so this line helps them; when removed their links will lead to nowhere + $this->Application->SetVar('m_cat_id', $page['CategoryId']); + + $ret .= $this->Application->ParseBlock($block_params, 1); + $cur_item++; + } + + $this->Application->SetVar('m_cat_id', $real_cat_id); + } + + return $ret; + } + + /** + * Returns only items, that are visible in menu + * + * @param Array $menu + * @return Array + */ + function _removeNonMenuItems($menu) + { + foreach ($menu as $menu_index => $menu_item) { + // $menu_index is in "cN" format, where N is category id + if (!$menu_item['IsMenu']) { + unset($menu[$menu_index]); + } + } + + return $menu; + } + + /** + * Trick to allow some kind of output formatting when using CachedMenu tag + * + * @param Array $params + * @return bool + */ + function SplitColumn($params) + { + return $this->Application->GetVar($params['i']) > ceil($params['total'] / $params['columns']); + } + + /** + * Returns direct children count of given category + * + * @param Array $params + * @return int + */ + function HasSubCats($params) + { + $sql = 'SELECT COUNT(*) + FROM ' . TABLE_PREFIX . 'Category + WHERE ParentId = ' . $params['cat_id']; + + return $this->Conn->GetOne($sql); + } + + /** + * Prints sub-pages of given/current page. + * + * @param Array $params + * @return string + * @todo This could be reached by using "parent_cat_id" parameter. Only difference here is new block parameter "path". Need to rewrite. + */ + function PrintSubPages($params) + { + $list =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix.'_List', $params); + /* @var $list kDBList */ + + $category_id = array_key_exists('category_id', $params) ? $params['category_id'] : $this->Application->GetVar('m_cat_id'); + + $list->addFilter('current_pages', TABLE_PREFIX . 'CategoryItems.CategoryId = ' . $category_id); + $list->Query(); + $list->GoFirst(); + + $o = ''; + $block_params = $this->prepareTagParams($params); + $block_params['name'] = $params['render_as']; + + while (!$list->EOL()) { + $block_params['path'] = $list->GetDBField('Path'); + $o .= $this->Application->ParseBlock($block_params, 1); + + $list->GoNext(); + } + + return $o; + } + + /** + * Builds link for browsing current page on Front-End + * + * @param Array $params + * @return string + */ + function PageBrowseLink($params) + { + $object =& $this->getObject($params); + + $template = $object->GetDBField('NamedParentPath'); + $url_params = Array ('admin' => 1, 'pass' => 'm', 'index_file' => 'index.php'); + + return $this->Application->HREF($template, '_FRONT_END_', $url_params); + } + + /** + * Builds link to cms page (used?) + * + * @param Array $params + * @return string + */ + function ContentPageLink($params) + { + $object =& $this->getObject($params); + $params['t'] = $object->GetDBField('NamedParentPath'); + $params['m_cat_id'] = 0; + + return $this->Application->ProcessParsedTag('m', 'Link', $params); + } + + /** + * Builds cache for children of given category (no matter, what menu status is) + * + * @param Array $parent + * @return Array + */ + function _altBuildMenuStructure($parent) + { + static $languages_count = null; + + if (!isset($languages_count)) { + $sql = 'SELECT COUNT(*) + FROM ' . TABLE_PREFIX . 'Language'; + $languages_count = ceil($this->Conn->GetOne($sql) / 5) * 5; + } + + $items = Array (); + + $lang_part = ''; + for ($i = 1; $i <= $languages_count; $i++) { + $lang_part .= 'c.l' . $i . '_Name AS l' . $i . '_ItemName,' . "\n"; + // $lang_part .= 'p.l' . $i . '_MenuTitle AS l' . $i . '_ItemName,' . "\n"; + } + + // Sub-categories from current category + $query = 'SELECT + c.CategoryId AS CategoryId, + CONCAT(\'c\', c.CategoryId) AS ItemId, + c.Priority AS ItemPriority, + ' . $lang_part . ' + IF(IsIndex = 2, ( + SELECT cc.NamedParentPath FROM ' . TABLE_PREFIX . 'Category AS cc + WHERE + cc.ParentId = c.CategoryId + AND + cc.Status IN (1,4) + AND + cc.IsIndex = 1 + ), + c.NamedParentPath) AS ItemPath, + 0 AS IsIndex, + c.ParentPath AS ParentPath, + c.ParentId As ParentId, + \'cat\' AS ItemType, + c.IsMenu, c.UseExternalUrl, c.ExternalUrl, c.UseMenuIconUrl, c.MenuIconUrl + FROM ' . TABLE_PREFIX . 'Category AS c + WHERE + c.Status IN (1,4) AND + #c.IsMenu = 1 AND + c.ParentId = ' . $parent['CategoryId']; + $items = array_merge($items, $this->Conn->Query($query, 'ItemId')); + + uasort($items, Array (&$this, '_menuSort')); + + $the_items = array(); + foreach ($items as $an_item) { + $the_items[ $an_item['ItemId'] ] = $an_item; + $this->ParentPaths[ $an_item['CategoryId'] ] = $an_item['ParentPath']; + } + + $items = $the_items; + foreach ($items as $key => $menu_item) { + if ($menu_item['CategoryId'] == $parent['CategoryId']) { + continue; + } + + $sub_items = $this->_altBuildMenuStructure($menu_item); + if ($sub_items) { + $items[$key]['sub_items'] = $sub_items; + } + } + + return $items; + } + + /** + * Method for sorting pages by priority in decending order + * + * @param Array $a + * @param Array $b + * @return int + */ + function _menuSort($a, $b) + { + if ($a['ItemPriority'] == $b['ItemPriority']) { + return 0; + } + + return ($a['ItemPriority'] < $b['ItemPriority']) ? 1 : -1; //descending + } + + /** + * Prepares cms page description for search result page + * + * @param Array $params + * @return string + */ + function SearchDescription($params) + { + $object =& $this->getObject($params); + $desc = $object->GetField('MetaDescription'); + if (!$desc) { + $sql = 'SELECT * + FROM ' . TABLE_PREFIX . 'PageContent + WHERE PageId = ' . $object->GetID() . ' AND ContentNum = 1'; + $content = $this->Conn->GetRow($sql); + + if ($content['l'.$this->Application->GetVar('m_lang').'_Content']) { + $desc = $content['l'.$this->Application->GetVar('m_lang').'_Content']; + } + else { + $desc = $content['l'.$this->Application->GetDefaultLanguageId().'_Content']; + } + } + + return mb_substr($desc, 0, 300).(mb_strlen($desc) > 300 ? '...' : ''); + } + + /** + * Simplified version of "c:CategoryLink" for "c:PrintList" + * + * @param Array $params + * @return string + * @todo Used? Needs refactoring. + */ + function EnterCatLink($params) + { + $object =& $this->getObject($params); + + $url_params = Array ('pass' => 'm', 'm_cat_id' => $object->GetID()); + return $this->Application->HREF($params['template'], '', $url_params); + } + + /** + * Simplified version of "c:CategoryPath", that do not use blocks for rendering + * + * @param Array $params + * @return string + * @todo Used? Maybe needs to be removed. + */ + function PagePath($params) + { + $object =& $this->getObject($params); + $path = $object->GetField('CachedNavbar'); + if ($path) { + $items = explode('&|&', $path); + array_shift($items); + return implode(' -> ', $items); + } + + return ''; + } + + /** + * Returns configuration variable value + * + * @param Array $params + * @return string + * @todo Needs to be replaced with "m:GetConfig" tag + */ + function AllowManualFilenames($params) + { + return $this->Application->ConfigValue('ProjCMSAllowManualFilenames'); + } + + /** + * Draws path to current page (each page can be link to it) + * + * @param Array $params + * @return string + */ + function CurrentPath($params) + { + $block_params = $this->prepareTagParams($params); + $block_params['name'] = $block_params['render_as']; + + $object =& $this->Application->recallObject($this->Prefix); + /* @var $object kDBItem */ + + $category_ids = explode('|', substr($object->GetDBField('ParentPath'), 1, -1)); + + $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); + $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); + + $language = $this->Application->GetVar('m_lang'); + + $sql = 'SELECT l'.$language.'_Name AS Name, NamedParentPath + FROM '.$table_name.' + WHERE '.$id_field.' IN ('.implode(',', $category_ids).')'; + $categories_data = $this->Conn->Query($sql); + + $ret = ''; + foreach ($categories_data as $index => $category_data) { + if ($category_data['Name'] == 'Content') { + continue; + } + $block_params['title'] = $category_data['Name']; + $block_params['template'] = preg_replace('/^Content\//', '', $category_data['NamedParentPath']); + $block_params['is_first'] = $index == 1; // because Content is 1st element + $block_params['is_last'] = $index == count($categories_data) - 1; + + $ret .= $this->Application->ParseBlock($block_params); + } + + return $ret; + } + + /** + * Synonim to PrintList2 for "onlinestore" theme + * + * @param Array $params + * @return string + */ + function ListPages($params) + { + return $this->PrintList2($params); + } + + /** + * Returns information about parser element locations in template + * + * @param Array $params + * @return mixed + */ + function BlockInfo($params) + { + if (!EDITING_MODE) { + return ''; + } + + $template_helper =& $this->Application->recallObject('TemplateHelper'); + /* @var $template_helper TemplateHelper */ + + return $template_helper->blockInfo( $params['name'] ); + } + + /** + * Returns formatted title for template editor + * + * @param Array $params + * @return string + */ + function TemplateEditorTitle($params) + { + if (!EDITING_MODE) { + return ''; + } + + $text = $this->Application->Phrase($params['phrase']); + + $template_helper =& $this->Application->recallObject('TemplateHelper'); + /* @var $template_helper TemplateHelper */ + + $text = sprintf($text, $template_helper->blockInfo(template_file), $template_helper->blockInfo('start_pos'), $template_helper->blockInfo('end_pos')); + + + return $text; + } + } ?> \ No newline at end of file Index: branches/RC/core/install/install_schema.sql =================================================================== diff -u -N -r11411 -r11495 --- branches/RC/core/install/install_schema.sql (.../install_schema.sql) (revision 11411) +++ branches/RC/core/install/install_schema.sql (.../install_schema.sql) (revision 11495) @@ -369,7 +369,7 @@ `Type` int(11) NOT NULL default '0', SymLinkCategoryId int(10) unsigned default NULL, ParentId int(11) NOT NULL default '0', - Name varchar(255) NOT NULL default '', + `Name` varchar(255) NOT NULL default '', l1_Name varchar(255) NOT NULL default '', l2_Name varchar(255) NOT NULL default '', l3_Name varchar(255) NOT NULL default '', @@ -387,7 +387,7 @@ EditorsPick tinyint(4) NOT NULL default '0', `Status` tinyint(4) NOT NULL default '2', Priority int(11) NOT NULL default '0', - MetaKeywords varchar(255) default NULL, + MetaKeywords text, CachedDescendantCatsQty int(11) default NULL, CachedNavbar text, l1_CachedNavbar text, @@ -397,24 +397,54 @@ l5_CachedNavbar text, CreatedById int(11) NOT NULL default '0', ResourceId int(11) default NULL, - ParentPath TEXT NULL DEFAULT NULL, + ParentPath text, TreeLeft bigint(20) NOT NULL default '0', TreeRight bigint(20) NOT NULL default '0', - NamedParentPath TEXT NULL DEFAULT NULL, - MetaDescription varchar(255) default NULL, + NamedParentPath text, + MetaDescription text, HotItem int(11) NOT NULL default '2', NewItem int(11) NOT NULL default '2', PopItem int(11) NOT NULL default '2', Modified int(11) NOT NULL default '0', ModifiedById int(11) NOT NULL default '0', CategoryTemplate varchar(255) NOT NULL default '', CachedCategoryTemplate varchar(255) NOT NULL default '', + Template varchar(255) default NULL, + Path varchar(255) default NULL, + UseExternalUrl tinyint(3) unsigned NOT NULL default '0', + ExternalUrl varchar(255) NOT NULL default '', + UseMenuIconUrl tinyint(3) unsigned NOT NULL default '0', + MenuIconUrl varchar(255) NOT NULL default '', + l1_Title varchar(255) default '', + l2_Title varchar(255) default '', + l3_Title varchar(255) default '', + l4_Title varchar(255) default '', + l5_Title varchar(255) default '', + l1_MenuTitle varchar(255) NOT NULL default '', + l2_MenuTitle varchar(255) NOT NULL default '', + l3_MenuTitle varchar(255) NOT NULL default '', + l4_MenuTitle varchar(255) NOT NULL default '', + l5_MenuTitle varchar(255) NOT NULL default '', + MetaTitle text, + IndexTools text, + IsIndex tinyint(1) NOT NULL default '0', + IsMenu tinyint(4) NOT NULL default '1', + IsSystem tinyint(4) NOT NULL default '0', + FormId int(11) default NULL, + FormSubmittedTemplate varchar(255) default NULL, + l1_Translated tinyint(4) NOT NULL default '0', + l2_Translated tinyint(4) NOT NULL default '0', + l3_Translated tinyint(4) NOT NULL default '0', + l4_Translated tinyint(4) NOT NULL default '0', + l5_Translated tinyint(4) NOT NULL default '0', + FriendlyURL varchar(255) NOT NULL default '', + ThemeId int(10) unsigned NOT NULL, PRIMARY KEY (CategoryId), UNIQUE KEY ResourceId (ResourceId), KEY ParentId (ParentId), KEY Modified (Modified), KEY Priority (Priority), - KEY sorting (Name,Priority), + KEY sorting (`Name`,Priority), KEY Filename (Filename(5)), KEY l1_Name (l1_Name(5)), KEY l2_Name (l2_Name(5)), @@ -429,9 +459,16 @@ KEY TreeLeft (TreeLeft), KEY TreeRight (TreeRight), KEY SymLinkCategoryId (SymLinkCategoryId), - KEY Status (Status), + KEY `Status` (`Status`), KEY CreatedOn (CreatedOn), - KEY EditorsPick (EditorsPick) + KEY EditorsPick (EditorsPick), + KEY IsIndex (IsIndex), + KEY l1_Translated (l1_Translated), + KEY l2_Translated (l2_Translated), + KEY l3_Translated (l3_Translated), + KEY l4_Translated (l4_Translated), + KEY l5_Translated (l5_Translated), + KEY ThemeId (ThemeId) ); CREATE TABLE CategoryCustomData ( @@ -996,4 +1033,62 @@ KEY EmailsQueued (EmailsQueued), KEY `Status` (`Status`), KEY PortalUserId (PortalUserId) +); + +CREATE TABLE PageContent ( + PageContentId int(11) NOT NULL auto_increment, + ContentNum int(11) NOT NULL default '0', + PageId int(11) NOT NULL default '0', + l1_Content text, + l2_Content text, + l3_Content text, + l4_Content text, + l5_Content text, + l1_Translated tinyint(4) NOT NULL default '0', + l2_Translated tinyint(4) NOT NULL default '0', + l3_Translated tinyint(4) NOT NULL default '0', + l4_Translated tinyint(4) NOT NULL default '0', + l5_Translated tinyint(4) NOT NULL default '0', + PRIMARY KEY (PageContentId), + KEY ContentNum (ContentNum,PageId) +); + +CREATE TABLE FormFields ( + FormFieldId int(11) NOT NULL auto_increment, + FormId int(11) NOT NULL default '0', + Type int(11) NOT NULL default '0', + FieldName varchar(255) NOT NULL default '', + FieldLabel varchar(255) default NULL, + Heading varchar(255) default NULL, + Prompt varchar(255) default NULL, + ElementType varchar(50) NOT NULL default '', + ValueList varchar(255) default NULL, + Priority int(11) NOT NULL default '0', + IsSystem tinyint(3) unsigned NOT NULL default '0', + Required tinyint(1) NOT NULL default '0', + DisplayInGrid tinyint(1) NOT NULL default '1', + DefaultValue text NOT NULL, + Validation TINYINT NOT NULL DEFAULT '0', + PRIMARY KEY (FormFieldId), + KEY `Type` (`Type`), + KEY FormId (FormId), + KEY Priority (Priority), + KEY IsSystem (IsSystem), + KEY DisplayInGrid (DisplayInGrid) +); + +CREATE TABLE FormSubmissions ( + FormSubmissionId int(11) NOT NULL auto_increment, + FormId int(11) NOT NULL default '0', + SubmissionTime int(11) NOT NULL default '0', + PRIMARY KEY (FormSubmissionId), + KEY FormId (FormId), + KEY SubmissionTime (SubmissionTime) +); + +CREATE TABLE Forms ( + FormId int(11) NOT NULL auto_increment, + Title VARCHAR(255) NOT NULL DEFAULT '', + Description text, + PRIMARY KEY (FormId) ); \ No newline at end of file Index: branches/RC/core/admin_templates/catalog/catalog_counters.tpl =================================================================== diff -u -N -r11368 -r11495 --- branches/RC/core/admin_templates/catalog/catalog_counters.tpl (.../catalog_counters.tpl) (revision 11368) +++ branches/RC/core/admin_templates/catalog/catalog_counters.tpl (.../catalog_counters.tpl) (revision 11495) @@ -17,4 +17,13 @@ setInnerHTML('category_path', ''); - \ No newline at end of file + + +var $menu_frame = getFrame('menu'); + + + $menu_frame.ReloadFolder('', true); + + + +$menu_frame.SyncActive(''); \ No newline at end of file Index: branches/RC/core/admin_templates/catalog/catalog_elements.tpl =================================================================== diff -u -N -r11412 -r11495 --- branches/RC/core/admin_templates/catalog/catalog_elements.tpl (.../catalog_elements.tpl) (revision 11412) +++ branches/RC/core/admin_templates/catalog/catalog_elements.tpl (.../catalog_elements.tpl) (revision 11495) @@ -107,4 +107,24 @@ + + + + + : + + + + \ No newline at end of file Index: branches/RC/core/units/themes/themes_eh.php =================================================================== diff -u -N -r10745 -r11495 --- branches/RC/core/units/themes/themes_eh.php (.../themes_eh.php) (revision 10745) +++ branches/RC/core/units/themes/themes_eh.php (.../themes_eh.php) (revision 11495) @@ -77,6 +77,13 @@ */ function OnChangeTheme(&$event) { + if ($this->Application->IsAdmin()) { + // for structure theme dropdown + $this->Application->StoreVar('theme_id', $this->Application->GetVar('theme')); + $this->Application->StoreVar('RefreshStructureTree', 1); + return ; + } + $this->Application->SetVar('t', 'index'); $this->Application->SetVar('m_cat_id', 0); @@ -98,14 +105,14 @@ { parent::SetCustomQuery($event); - if ($this->Application->IsAdmin()) { - return ; - } + if ($event->Special == 'enabled' || !$this->Application->IsAdmin()) { + // "enabled" special or Front-End - $object =& $event->getObject(); - /* @var $object kDBList */ + $object =& $event->getObject(); + /* @var $object kDBList */ - $object->addFilter('enabled', '%1$s.Enabled = 1'); + $object->addFilter('enabled_filter', '%1$s.Enabled = 1'); + } } } Index: branches/RC/core/units/general/helpers/template_helper.php =================================================================== diff -u -N -r11428 -r11495 --- branches/RC/core/units/general/helpers/template_helper.php (.../template_helper.php) (revision 11428) +++ branches/RC/core/units/general/helpers/template_helper.php (.../template_helper.php) (revision 11495) @@ -30,6 +30,13 @@ */ var $_parseErrors = Array (); + /** + * Source template, that is being edited + * + * @var string + */ + var $_sourceTemplate = ''; + function TemplateHelper() { parent::kHelper(); @@ -45,6 +52,21 @@ } } + function _getSourceTemplate() + { + // get source template + $t = $this->Application->GetVar('source'); + + $cms_handler =& $this->Application->recallObject('st_EventHandler'); + /* @var $cms_handler StructureEventHandler */ + + if (!$this->Application->TemplatesCache->TemplateExists($t) && !$this->Application->IsAdmin()) { + $t = $cms_handler->GetDesignTemplate($t); + } + + $this->_sourceTemplate = $t; + } + /** * Render source template to get parse errors OR it's element locations * @@ -59,8 +81,10 @@ // 2. parse template $this->Application->InitParser(); // we have no parser when saving block content - $this->Application->Parser->Run($this->Application->GetVar('source') . $append); + $this->_getSourceTemplate(); + $this->Application->Parser->Run($this->_sourceTemplate . $append); + // 3. restore original error handler $this->Application->errorHandlers = $error_handlers; @@ -145,7 +169,7 @@ */ function _isMainTemplate() { - return $this->_blockLocation['template'] == $this->Application->GetVar('source'); + return $this->_blockLocation['template'] == $this->_sourceTemplate; } /** Index: branches/RC/core/install/install_data.sql =================================================================== diff -u -N -r11409 -r11495 --- branches/RC/core/install/install_data.sql (.../install_data.sql) (revision 11409) +++ branches/RC/core/install/install_data.sql (.../install_data.sql) (revision 11495) @@ -96,6 +96,7 @@ INSERT INTO ConfigurationAdmin VALUES ('AllowDeleteRootCats', 'la_Text_General', 'la_AllowDeleteRootCats', 'checkbox', NULL , NULL , 10.09, 0, 0); INSERT INTO ConfigurationAdmin VALUES ('Catalog_PreselectModuleTab', 'la_Text_General', 'la_config_CatalogPreselectModuleTab', 'checkbox', NULL, NULL, 10.10, 0, 1); INSERT INTO ConfigurationAdmin VALUES ('RecycleBinFolder', 'la_Text_General', 'la_config_RecycleBinFolder', 'text', NULL , NULL , 10.11, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('QuickCategoryPermissionRebuild', 'la_Text_General', 'la_config_QuickCategoryPermissionRebuild', 'checkbox', NULL , NULL , 10.12, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Columns_Category', '2', 'In-Portal', 'Categories'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'DomainSelect','1','In-Portal','in-portal:configure_general'); @@ -266,7 +267,9 @@ INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AllowDeleteRootCats', '0', 'In-Portal', 'in-portal:configure_categories'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Catalog_PreselectModuleTab', 1, 'In-Portal', 'in-portal:configure_categories'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'RecycleBinFolder', '', 'In-Portal', 'in-portal:configure_categories'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'QuickCategoryPermissionRebuild', '1', 'In-Portal', 'in-portal:configure_categories'); + INSERT INTO ItemTypes VALUES (1, 'In-Portal', 'c', 'Category', 'Name', 'CreatedById', NULL, NULL, 'la_ItemTab_Categories', 1, 'admin/category/addcategory.php', 'clsCategory', 'Category'); INSERT INTO ItemTypes VALUES (6, 'In-Portal', 'u', 'PortalUser', 'Login', 'PortalUserId', NULL, NULL, '', 0, '', 'clsPortalUser', 'User'); Index: branches/RC/core/admin_templates/categories/categories_edit.tpl =================================================================== diff -u -N -r11102 -r11495 --- branches/RC/core/admin_templates/categories/categories_edit.tpl (.../categories_edit.tpl) (revision 11102) +++ branches/RC/core/admin_templates/categories/categories_edit.tpl (.../categories_edit.tpl) (revision 11495) @@ -51,32 +51,93 @@ + + + + + + + + +
- - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + @@ -85,14 +146,54 @@
+ \ No newline at end of file Index: branches/RC/themes/default2009/platform/elements/menu.xml.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/platform/elements/menu.xml.tpl (revision 11337) +++ branches/RC/themes/default2009/platform/elements/menu.xml.tpl (revision 0) @@ -1,26 +0,0 @@ - - - - - - " - url="" - ico="['img/']" - enb="true" title="" - subid="sub" - suburl="" >]]> - - - - - - " ico="['img/menu_home.gif']" enb="true" title=""> - - - - \ No newline at end of file Index: branches/RC/core/admin_templates/categories/categories_edit_permissions.tpl =================================================================== diff -u -N -r11102 -r11495 --- branches/RC/core/admin_templates/categories/categories_edit_permissions.tpl (.../categories_edit_permissions.tpl) (revision 11102) +++ branches/RC/core/admin_templates/categories/categories_edit_permissions.tpl (.../categories_edit_permissions.tpl) (revision 11495) @@ -1,5 +1,6 @@ + @@ -112,6 +113,8 @@ + + Index: branches/RC/core/install/upgrades.sql =================================================================== diff -u -N -r11411 -r11495 --- branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 11411) +++ branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 11495) @@ -1008,4 +1008,75 @@ INSERT INTO ConfigurationAdmin VALUES ('ResizableFrames', 'la_Text_Website', 'la_config_ResizableFrames', 'checkbox', '', '', 10.30, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'ResizableFrames', '0', 'In-Portal', 'in-portal:configure_general'); -ALTER TABLE Language ADD UserDocsUrl VARCHAR(255) NOT NULL; \ No newline at end of file +INSERT INTO ConfigurationAdmin VALUES ('QuickCategoryPermissionRebuild', 'la_Text_General', 'la_config_QuickCategoryPermissionRebuild', 'checkbox', NULL , NULL , 10.12, 0, 0); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'QuickCategoryPermissionRebuild', '1', 'In-Portal', 'in-portal:configure_categories'); + +ALTER TABLE Language ADD UserDocsUrl VARCHAR(255) NOT NULL; + +ALTER TABLE Category + ADD ThemeId INT UNSIGNED NOT NULL, + ADD INDEX (ThemeId), + ADD COLUMN UseExternalUrl tinyint(3) unsigned NOT NULL default '0' AFTER Path, + ADD COLUMN ExternalUrl varchar(255) NOT NULL default '' AFTER UseExternalUrl, + ADD COLUMN UseMenuIconUrl tinyint(3) unsigned NOT NULL default '0' AFTER ExternalUrl, + ADD COLUMN MenuIconUrl varchar(255) NOT NULL default '' AFTER UseMenuIconUrl, + CHANGE MetaKeywords MetaKeywords TEXT, + CHANGE MetaDescription MetaDescription TEXT; + +CREATE TABLE PageContent ( + PageContentId int(11) NOT NULL auto_increment, + ContentNum int(11) NOT NULL default '0', + PageId int(11) NOT NULL default '0', + l1_Content text, + l2_Content text, + l3_Content text, + l4_Content text, + l5_Content text, + l1_Translated tinyint(4) NOT NULL default '0', + l2_Translated tinyint(4) NOT NULL default '0', + l3_Translated tinyint(4) NOT NULL default '0', + l4_Translated tinyint(4) NOT NULL default '0', + l5_Translated tinyint(4) NOT NULL default '0', + PRIMARY KEY (PageContentId), + KEY ContentNum (ContentNum,PageId) +); + +CREATE TABLE FormFields ( + FormFieldId int(11) NOT NULL auto_increment, + FormId int(11) NOT NULL default '0', + Type int(11) NOT NULL default '0', + FieldName varchar(255) NOT NULL default '', + FieldLabel varchar(255) default NULL, + Heading varchar(255) default NULL, + Prompt varchar(255) default NULL, + ElementType varchar(50) NOT NULL default '', + ValueList varchar(255) default NULL, + Priority int(11) NOT NULL default '0', + IsSystem tinyint(3) unsigned NOT NULL default '0', + Required tinyint(1) NOT NULL default '0', + DisplayInGrid tinyint(1) NOT NULL default '1', + DefaultValue text NOT NULL, + Validation TINYINT NOT NULL DEFAULT '0', + PRIMARY KEY (FormFieldId), + KEY `Type` (`Type`), + KEY FormId (FormId), + KEY Priority (Priority), + KEY IsSystem (IsSystem), + KEY DisplayInGrid (DisplayInGrid) +); + +CREATE TABLE FormSubmissions ( + FormSubmissionId int(11) NOT NULL auto_increment, + FormId int(11) NOT NULL default '0', + SubmissionTime int(11) NOT NULL default '0', + PRIMARY KEY (FormSubmissionId), + KEY FormId (FormId), + KEY SubmissionTime (SubmissionTime) +); + +CREATE TABLE Forms ( + FormId int(11) NOT NULL auto_increment, + Title VARCHAR(255) NOT NULL DEFAULT '', + Description text, + PRIMARY KEY (FormId) +); \ No newline at end of file Index: branches/RC/themes/default2009/platform/elements/menu.elm.tpl =================================================================== diff -u -N -r11474 -r11495 --- branches/RC/themes/default2009/platform/elements/menu.elm.tpl (.../menu.elm.tpl) (revision 11474) +++ branches/RC/themes/default2009/platform/elements/menu.elm.tpl (.../menu.elm.tpl) (revision 11495) @@ -37,7 +37,7 @@ " ico="['img/menu_home.gif']" enb="true" title="">]]> - + @@ -71,7 +71,7 @@ - + Index: branches/RC/core/admin_templates/catalog/catalog.tpl =================================================================== diff -u -N -r11395 -r11495 --- branches/RC/core/admin_templates/catalog/catalog.tpl (.../catalog.tpl) (revision 11395) +++ branches/RC/core/admin_templates/catalog/catalog.tpl (.../catalog.tpl) (revision 11495) @@ -1,7 +1,7 @@ - + Index: branches/RC/core/admin_templates/incs/close_popup.tpl =================================================================== diff -u -N -r11482 -r11495 --- branches/RC/core/admin_templates/incs/close_popup.tpl (.../close_popup.tpl) (revision 11482) +++ branches/RC/core/admin_templates/incs/close_popup.tpl (.../close_popup.tpl) (revision 11495) @@ -61,16 +61,22 @@ // 1. cycle through popups to get main window try { // will be error, when other site is opened in parent window + var $i = 0; while ($main_window.opener) { + if ($i == 10) { + break; + } + $main_window = $main_window.opener; + $i++; } } catch (err) { // catch Access/Permission Denied error - // alert('getFrame.Error: [' + err.description + ']'); + // alert('getFrame.Error: [' + err.description + ']'); return window; } - + var $frameset = $main_window.parent.frames; for ($i = 0; $i < $frameset.length; $i++) { if ($frameset[$i].name == $name) { Index: branches/RC/core/kernel/kbase.php =================================================================== diff -u -N -r11271 -r11495 --- branches/RC/core/kernel/kbase.php (.../kbase.php) (revision 11271) +++ branches/RC/core/kernel/kbase.php (.../kbase.php) (revision 11495) @@ -503,7 +503,12 @@ function GetFieldOptions($field) { if (isset($this->Fields[$field])) { - $this->PrepareFieldOptions($field); + $options_prepared = array_key_exists('options_prepared', $this->Fields[$field]) ? $this->Fields[$field]['options_prepared'] : false; + if (!$options_prepared) { + $this->PrepareFieldOptions($field); + $this->Fields[$field]['options_prepared'] = true; + } + return $this->Fields[$field]; } else { Index: branches/RC/core/admin_templates/categories/xml/tree_categories.tpl =================================================================== diff -u -N -r11368 -r11495 --- branches/RC/core/admin_templates/categories/xml/tree_categories.tpl (.../tree_categories.tpl) (revision 11368) +++ branches/RC/core/admin_templates/categories/xml/tree_categories.tpl (.../tree_categories.tpl) (revision 11495) @@ -4,14 +4,14 @@ Index: branches/RC/core/admin_templates/catalog/advanced_view.tpl =================================================================== diff -u -N -r11395 -r11495 --- branches/RC/core/admin_templates/catalog/advanced_view.tpl (.../advanced_view.tpl) (revision 11395) +++ branches/RC/core/admin_templates/catalog/advanced_view.tpl (.../advanced_view.tpl) (revision 11495) @@ -1,7 +1,7 @@ - + Index: branches/RC/core/units/categories/categories_config.php =================================================================== diff -u -N -r11368 -r11495 --- branches/RC/core/units/categories/categories_config.php (.../categories_config.php) (revision 11368) +++ branches/RC/core/units/categories/categories_config.php (.../categories_config.php) (revision 11495) @@ -1,359 +1,410 @@ 'c', - 'ItemClass' => Array('class'=>'CategoriesItem','file'=>'categories_item.php','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class'=>'CategoriesEventHandler','file'=>'categories_event_handler.php','build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'CategoriesTagProcessor','file'=>'categories_tag_processor.php','build_event'=>'OnBuild'), + $config = Array ( + 'Prefix' => 'c', + 'ItemClass' => Array ('class' => 'CategoriesItem', 'file' => 'categories_item.php', 'build_event' => 'OnItemBuild'), + 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), + 'EventHandlerClass' => Array ('class' => 'CategoriesEventHandler', 'file' => 'categories_event_handler.php', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => Array ('class' => 'CategoriesTagProcessor', 'file' => 'categories_tag_processor.php', 'build_event' => 'OnBuild'), - 'RegisterClasses' => Array( - Array('pseudo' => 'kPermCacheUpdater','class' => 'kPermCacheUpdater', 'file' => 'cache_updater.php','build_event'=>''), - ), + 'RegisterClasses' => Array ( + Array ('pseudo' => 'kPermCacheUpdater', 'class' => 'kPermCacheUpdater', 'file' => 'cache_updater.php', 'build_event' => ''), + ), - 'ConfigPriority' => 0, - 'Hooks' => Array ( - Array ( - 'Mode' => hBEFORE, - 'Conditional' => false, - 'HookToPrefix' => '', - 'HookToSpecial' => '*', - 'HookToEvent' => Array('OnAfterConfigRead'), - 'DoPrefix' => 'cdata', - 'DoSpecial' => '*', - 'DoEvent' => 'OnDefineCustomFields', - ), - ), + 'ConfigPriority' => 0, + 'Hooks' => Array ( + Array ( + 'Mode' => hAFTER, + 'Conditional' => false, + 'HookToPrefix' => 'adm', //self + 'HookToSpecial' => '*', + 'HookToEvent' => Array('OnRebuildThemes'), + 'DoPrefix' => '', + 'DoSpecial' => '', + 'DoEvent' => 'OnAfterRebuildThemes', + ), - 'AutoLoad' => true, - 'CatalogItem' => true, - 'AdminTemplatePath' => 'categories', - 'AdminTemplatePrefix' => 'categories_', + Array ( + 'Mode' => hBEFORE, + 'Conditional' => false, + 'HookToPrefix' => '', + 'HookToSpecial' => '*', + 'HookToEvent' => Array('OnAfterConfigRead'), + 'DoPrefix' => 'cdata', + 'DoSpecial' => '*', + 'DoEvent' => 'OnDefineCustomFields', + ), + ), - 'QueryString' => Array( - 1 => 'id', - 2 => 'Page', - 3 => 'event', - 4 => 'mode', - ), - 'AggregateTags' => Array( - Array( - 'AggregateTo' => 'm', - 'AggregatedTagName' => 'CategoryLink', - 'LocalTagName' => 'CategoryLink', - ), - ), - 'IDField' => 'CategoryId', + 'AutoLoad' => true, + 'CatalogItem' => true, + 'AdminTemplatePath' => 'categories', + 'AdminTemplatePrefix' => 'categories_', - 'StatusField' => Array('Status'), + 'QueryString' => Array ( + 1 => 'id', + 2 => 'Page', + 3 => 'event', + 4 => 'mode', + ), - 'TitleField' => 'Name', // field, used in bluebar when editing existing item - 'TitlePhrase' => 'la_Text_Category', - 'ItemType' => 1, // used for custom fields only + 'AggregateTags' => Array ( + Array ( + 'AggregateTo' => 'm', + 'AggregatedTagName' => 'CategoryLink', + 'LocalTagName' => 'CategoryLink', + ), + ), - 'StatisticsInfo' => Array( - 'pending' => Array( - 'icon' => 'icon16_cat_pending.gif', - 'label' => 'la_tab_Categories', - 'js_url' => '#url#', - 'url' => Array('t' => 'catalog/advanced_view', 'SetTab' => 'c', 'pass' => 'm,c.showall', 'c.showall_event' => 'OnSetFilterPattern', 'c.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_pick=1'), - 'status' => STATUS_PENDING, - ), - ), + 'IDField' => 'CategoryId', + 'StatusField' => Array ('IsMenu'), // 'Status' + 'TitleField' => 'Name', - 'TableName' => TABLE_PREFIX.'Category', + 'TitlePhrase' => 'la_Text_Category', + 'ItemType' => 1, // used for custom fields only - 'ViewMenuPhrase' => 'la_text_Categories', - 'CatalogTabIcon' => 'icon16_cat.gif', + 'StatisticsInfo' => Array ( + 'pending' => Array ( + 'icon' => 'icon16_cat_pending.gif', + 'label' => 'la_tab_Categories', + 'js_url' => '#url#', + 'url' => Array('t' => 'catalog/advanced_view', 'SetTab' => 'c', 'pass' => 'm,c.showall', 'c.showall_event' => 'OnSetFilterPattern', 'c.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_pick=1'), + 'status' => STATUS_PENDING, + ), + ), - 'TitlePresets' => Array( - 'default' => Array( 'new_status_labels' => Array('c' => '!la_title_Adding_Category!'), - 'edit_status_labels' => Array('c' => '!la_title_Editing_Category!'), - 'new_titlefield' => Array('c' => ''), - ), - 'category_list' => Array('prefixes' => Array('c_List'), 'format' => "!la_title_Categories! (#c_recordcount#)"), + 'TableName' => TABLE_PREFIX.'Category', - 'catalog' => Array('prefixes' => Array('c_List'), 'format' => "!la_title_Categories!"), + 'ViewMenuPhrase' => 'la_text_Categories', + 'CatalogTabIcon' => 'icon16_cat.gif', - 'advanced_view' => Array('prefixes' => Array('c_List'), 'format' => "!la_title_AdvancedView!"), + 'TitlePresets' => Array ( + 'default' => Array ( + 'new_status_labels' => Array ('c' => '!la_title_Adding_Page!'), // la_title_Adding_Category + 'edit_status_labels' => Array ('c' => '!la_title_Editing_Page!'), // la_title_Editing_Category + ), - 'reviews' => Array('prefixes' => Array(), 'format' => "!la_title_Reviews!"), + 'category_list' => Array ('prefixes' => Array ('c_List'), 'format' => "!la_title_Categories! (#c_recordcount#)"), + 'catalog' => Array ('prefixes' => Array ('c_List'), 'format' => "!la_title_Categories!"), + 'advanced_view' => Array ('prefixes' => Array ('c_List'), 'format' => "!la_title_AdvancedView!"), + 'reviews' => Array ('prefixes' => Array (), 'format' => "!la_title_Reviews!"), + 'review_edit' => Array ('prefixes' => Array (), 'format' => "!la_title_Editing_Review!"), - 'review_edit' => Array('prefixes' => Array(), 'format' => "!la_title_Editing_Review!"), + 'categories_edit' => Array ('prefixes' => Array ('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_General!"), + 'categories_properties' => Array ('prefixes' => Array ('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Properties!"), + 'categories_relations' => Array ('prefixes' => Array ('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Relations!"), + 'categories_related_searches' => Array ('prefixes' => Array ('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_RelatedSearches!"), + 'categories_images' => Array ('prefixes' => Array ('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Images!"), + 'categories_permissions' => Array ('prefixes' => Array ('c', 'g_List'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Permissions!"), + 'categories_custom' => Array ('prefixes' => Array ('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Custom!"), + 'categories_update' => Array ('prefixes' => Array (), 'format' => "!la_title_UpdatingCategories!"), - 'categories_edit' => Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_General!"), - 'categories_properties' => Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Properties!"), - 'categories_relations' => Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Relations!"), - 'categories_related_searches' => Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_RelatedSearches!"), - 'categories_images' => Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Images!"), - 'categories_permissions'=> Array('prefixes' => Array('c', 'g_List'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Permissions!"), - 'categories_custom' => Array('prefixes' => Array('c'), 'format' => "#c_status# '#c_titlefield#' - !la_title_Custom!"), + 'images_edit' => Array ( + 'prefixes' => Array ('c', 'c-img'), + 'new_status_labels' => Array ('c-img' => '!la_title_Adding_Image!'), + 'edit_status_labels' => Array ('c-img' => '!la_title_Editing_Image!'), + 'new_titlefield' => Array ('c-img' => ''), + 'format' => "#c_status# '#c_titlefield#' - #c-img_status# '#c-img_titlefield#'", + ), - 'categories_update' => Array('prefixes' => Array(), 'format' => "!la_title_UpdatingCategories!"), + 'relations_edit' => Array ( + 'prefixes' => Array ('c', 'c-rel'), + 'new_status_labels' => Array ('c-rel' => "!la_title_Adding_Relationship! '!la_title_New_Relationship!'"), + 'edit_status_labels' => Array ('c-rel' => '!la_title_Editing_Relationship!'), + 'format' => "#c_status# '#c_titlefield#' - #c-rel_status#", + ), - 'images_edit' => Array( 'prefixes' => Array('c', 'c-img'), - 'new_status_labels' => Array('c-img'=>'!la_title_Adding_Image!'), - 'edit_status_labels' => Array('c-img'=>'!la_title_Editing_Image!'), - 'new_titlefield' => Array('c-img'=>''), - 'format' => "#c_status# '#c_titlefield#' - #c-img_status# '#c-img_titlefield#'", - ), + 'related_searches_edit' => Array ( + 'prefixes' => Array ('c', 'c-search'), + 'new_status_labels' => Array ('c-search' => "!la_title_Adding_RelatedSearch_Keyword!"), + 'edit_status_labels' => Array ('c-search' => '!la_title_Editing_RelatedSearch_Keyword!'), + 'format' => "#c_status# '#c_titlefield#' - #c-search_status#", + ), - 'relations_edit' => Array( 'prefixes' => Array('c', 'c-rel'), - 'new_status_labels' => Array('c-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"), - 'edit_status_labels' => Array('c-rel'=>'!la_title_Editing_Relationship!'), - 'format' => "#c_status# '#c_titlefield#' - #c-rel_status#", - ), + 'edit_content' => Array ('format' => '!la_EditingContent!'), + 'tree_site' => Array ('format' => '!la_selecting_categories!'), + ), - 'related_searches_edit' => Array( 'prefixes' => Array('c', 'c-search'), - 'new_status_labels' => Array('c-search'=>"!la_title_Adding_RelatedSearch_Keyword!"), - 'edit_status_labels' => Array('c-search'=>'!la_title_Editing_RelatedSearch_Keyword!'), - 'format' => "#c_status# '#c_titlefield#' - #c-search_status#", - ), + 'PermItemPrefix' => 'CATEGORY', + 'PermSection' => Array ('main' => 'CATEGORY:in-portal:categories', /*'search' => 'in-portal:configuration_search',*/ 'email' => 'in-portal:configuration_email', 'custom' => 'in-portal:configuration_custom'), - 'tree_site' => Array('format' => '!la_selecting_categories!'), - ), + /*'Sections' => Array ( + // "Structure & Data" section + 'in-portal:site' => Array ( + 'parent' => 'in-portal:root', + 'icon' => 'struct', + 'label' => 'la_tab_Site_Structure', + 'url' => Array ('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'), + 'permissions' => Array ('view'), + 'priority' => 1, + 'type' => stTREE, + ), - 'PermItemPrefix' => 'CATEGORY', + 'in-portal:browse' => Array ( + 'parent' => 'in-portal:site', + 'icon' => 'catalog', + 'label' => 'la_tab_Browse', + 'url' => Array ('t' => 'catalog/catalog', 'pass' => 'm'), + 'late_load' => Array ('t' => 'categories/xml/tree_categories', 'pass' => 'm', 'm_cat_id' => 0), + 'onclick' => 'checkCatalog(0)', + 'permissions' => Array ('view'), + 'priority' => 0.1, + 'type' => stTREE, + ), - 'PermSection' => Array('main' => 'CATEGORY:in-portal:categories', /*'search' => 'in-portal:configuration_search',*/ 'email' => 'in-portal:configuration_email', 'custom' => 'in-portal:configuration_custom'), + 'in-portal:advanced_view' => Array ( + 'parent' => 'in-portal:site', + 'icon' => 'advanced_view', + 'label' => 'la_tab_AdvancedView', + 'url' => Array ('t' => 'catalog/advanced_view', 'pass' => 'm'), + 'permissions' => Array ('view'), + 'priority' => 0.2, + 'type' => stTREE, + ), + 'in-portal:reviews' => Array ( + 'parent' => 'in-portal:site', + 'icon' => 'reviews', + 'label' => 'la_tab_Reviews', + 'url' => Array ('index_file' => 'reviews.php', 'pass' => 'm'), + 'permissions' => Array ('view'), + 'priority' => 3, + 'type' => stTREE, + ), - /* 'Sections' => Array( - // "Structure & Data" section - 'in-portal:site' => Array( - 'parent' => 'in-portal:root', - 'icon' => 'struct', - 'label' => 'la_tab_Site_Structure', - 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view'), - 'priority' => 1, - 'type' => stTREE, - ), + 'in-portal:configure_categories' => Array ( + 'parent' => 'in-portal:site', + 'icon' => 'cat_settings', + 'label' => 'la_tab_Settings', + 'url' => Array ('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'), + 'permissions' => Array ('view', 'edit'), + 'priority' => 4, + 'type' => stTREE, + ), - 'in-portal:browse' => Array( - 'parent' => 'in-portal:site', - 'icon' => 'catalog', - 'label' => 'la_tab_Browse', - 'url' => Array('t' => 'catalog/catalog', 'pass' => 'm'), - 'late_load' => Array('t' => 'categories/xml/tree_categories', 'pass' => 'm', 'm_cat_id' => 0), - 'onclick' => 'checkCatalog(0)', - 'permissions' => Array('view'), - 'priority' => 0.1, - 'type' => stTREE, - ), - 'in-portal:advanced_view' => Array( - 'parent' => 'in-portal:site', - 'icon' => 'advanced_view', - 'label' => 'la_tab_AdvancedView', - 'url' => Array('t' => 'catalog/advanced_view', 'pass' => 'm'), - 'permissions' => Array('view'), - 'priority' => 0.2, - 'type' => stTREE, - ), + 'in-portal:configuration_search' => Array ( + 'parent' => 'in-portal:site', + 'icon' => 'settings_search', + 'label' => 'la_tab_ConfigSearch', + 'url' => Array ('t' => 'in-portal/config/config_search', 'module_key' => 'category', 'pass_section' => true, 'pass' => 'm'), + 'permissions' => Array ('view', 'edit'), + 'priority' => 5, + 'type' => stTREE, + ), - 'in-portal:reviews' => Array( - 'parent' => 'in-portal:site', - 'icon' => 'reviews', - 'label' => 'la_tab_Reviews', - 'url' => Array('index_file' => 'reviews.php', 'pass' => 'm'), - 'permissions' => Array('view'), - 'priority' => 3, - 'type' => stTREE, - ), + 'in-portal:configuration_email' => Array ( + 'parent' => 'in-portal:site', + 'icon' => 'settings_email', + 'label' => 'la_tab_ConfigE-mail', + 'url' => Array ('t' => 'in-portal/config/config_email', 'module' => 'In-Portal:Category', 'pass_section' => true, 'pass' => 'm'), + 'permissions' => Array ('view', 'edit'), + 'priority' => 6, + 'type' => stTREE, + ), - 'in-portal:configure_categories' => Array( - 'parent' => 'in-portal:site', - 'icon' => 'cat_settings', - 'label' => 'la_tab_Settings', - 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 4, - 'type' => stTREE, - ), + 'in-portal:configuration_custom' => Array ( + 'parent' => 'in-portal:site', + 'icon' => 'settings_custom', + 'label' => 'la_tab_ConfigCustom', + 'url' => Array ('t' => 'custom_fields/custom_fields_list', 'cf_type' => 1, 'pass_section' => true, 'pass' => 'm,cf'), + 'permissions' => Array ('view', 'add', 'edit', 'delete'), + 'priority' => 7, + 'type' => stTREE, + ), + ),*/ - 'in-portal:configuration_search' => Array( - 'parent' => 'in-portal:site', - 'icon' => 'settings_search', - 'label' => 'la_tab_ConfigSearch', - 'url' => Array('t' => 'in-portal/config/config_search', 'module_key' => 'category', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 5, - 'type' => stTREE, - ), + 'FilterMenu' => Array ( + 'Groups' => Array ( + Array ('mode' => 'AND', 'filters' => Array ('show_active', 'show_pending', 'show_disabled'), 'type' => WHERE_FILTER), + Array ('mode' => 'AND', 'filters' => Array ('show_new'), 'type' => HAVING_FILTER), + Array ('mode' => 'AND', 'filters' => Array ('show_pick'), 'type' => WHERE_FILTER), + ), + 'Filters' => Array ( + 'show_active' => Array ('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Status != 1'), + 'show_pending' => Array ('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => 'Status != 2'), + 'show_disabled' => Array ('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Status != 0'), + 's1' => Array (), + 'show_new' => Array ('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1'), + 'show_pick' => Array ('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '`EditorsPick` != 1'), + ) + ), - 'in-portal:configuration_email' => Array( - 'parent' => 'in-portal:site', - 'icon' => 'settings_email', - 'label' => 'la_tab_ConfigE-mail', - 'url' => Array('t' => 'in-portal/config/config_email', 'module' => 'In-Portal:Category', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 6, - 'type' => stTREE, - ), + 'ListSQLs' => Array ( + '' => ' SELECT %1$s.* %2$s + FROM %1$s + LEFT JOIN '.TABLE_PREFIX.'Images img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1 + LEFT JOIN '.TABLE_PREFIX.'PermCache ON '.TABLE_PREFIX.'PermCache.CategoryId = %1$s.CategoryId + LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId' + ), - 'in-portal:configuration_custom' => Array( - 'parent' => 'in-portal:site', - 'icon' => 'settings_custom', - 'label' => 'la_tab_ConfigCustom', - 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 1, 'pass_section' => true, 'pass' => 'm,cf'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 7, - 'type' => stTREE, - ), + 'SubItems' => Array ('c-rel', 'c-search','c-img', 'c-cdata', 'c-perm', 'content'), - ),*/ + 'ListSortings' => Array ( + '' => Array ( + 'ForcedSorting' => Array (/*"CurrentSort" => 'asc',*/ 'Priority' => 'desc'), + 'Sorting' => Array ('Name' => 'asc'), + ) + ), - 'FilterMenu' => Array( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER), - ), - 'Filters' => Array( - 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Status != 1' ), - 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => 'Status != 2' ), - 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Status != 0' ), - 's1' => Array(), - 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ), - 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '`EditorsPick` != 1' ), - ) - ), + 'CalculatedFields' => Array ( + '' => Array ( + 'CurrentSort' => "REPLACE(ParentPath, CONCAT('|', ".'%1$s'.".CategoryId, '|'), '')", - 'ListSQLs' => Array( ''=> ' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'Images img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1 - LEFT JOIN '.TABLE_PREFIX.'PermCache ON '.TABLE_PREFIX.'PermCache.CategoryId = %1$s.CategoryId - LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId'), + 'SameImages' => 'img.SameImages', + 'LocalThumb' => 'img.LocalThumb', + 'ThumbPath' => 'img.ThumbPath', + 'ThumbUrl' => 'img.ThumbUrl', + 'LocalImage' => 'img.LocalImage', + 'LocalPath' => 'img.LocalPath', + 'FullUrl' => 'img.Url', + ) + ), - 'ItemSQLs' => Array( ''=> ' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'Images img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1 - LEFT JOIN '.TABLE_PREFIX.'PermCache ON '.TABLE_PREFIX.'PermCache.CategoryId = %1$s.CategoryId - LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryCustomData cust ON %1$s.ResourceId = cust.ResourceId'), + 'CacheModRewrite' => true, - 'SubItems' => Array('c-rel', 'c-search','c-img', 'c-cdata', 'c-perm'), + 'Fields' => Array ( + 'CategoryId' => Array ('type' => 'int', 'not_null' => 1,'default' => 0), + 'Type' => Array ('type' => 'int', 'not_null' => 1,'default' => 0), + 'SymLinkCategoryId' => Array ('type' => 'int', 'default' => NULL), + 'ParentId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'not_null' => 1,'default' => 0, 'required' => 1), + 'Name' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'format'=>'no_default', 'not_null' => 1, 'required' => 1, 'default' => ''), + 'Filename' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), + 'AutomaticFilename' => Array ('type' => 'int', 'not_null' => 1, 'default' => 1), + 'Description' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'format'=>'no_default', 'default' => null), + 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default'=>'#NOW#', 'required' => 1, 'not_null' => 1), + 'EditorsPick' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'not_null' => 1,'default' => 1), + 'Priority' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => 0), + 'MetaKeywords' => Array ('type' => 'string', 'default' => null), + 'CachedDescendantCatsQty' => Array ('type' => 'int', 'default' => 0), + 'CachedNavbar' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'default' => null), + 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => 0), + 'ResourceId' => Array ('type' => 'int', 'default' => null), + 'ParentPath' => Array ('type' => 'string', 'default' => null), + 'TreeLeft' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'TreeRight' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + 'NamedParentPath' => Array ('type' => 'string', 'default' => null), + 'MetaDescription' => Array ('type' => 'string', 'default' => null), + 'HotItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), + 'NewItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), + 'PopItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), + 'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1,'default' => '#NOW#'), + 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => 0), + 'CategoryTemplate' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), + 'CachedCategoryTemplate' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), - 'ListSortings' => Array( - '' => Array( - 'ForcedSorting' => Array("CurrentSort" => 'asc', 'Priority' => 'desc', 'Name' => 'asc'), - 'Sorting' => Array('Name' => 'asc'), - ) - ), - 'CalculatedFields' => Array ( - '' => Array( - 'CurrentSort' => "REPLACE(ParentPath, CONCAT('|', ".'%1$s'.".CategoryId, '|'), '')", + // fields from Pages + 'Template' => Array ( + 'type' => 'string', + 'formatter' => 'kOptionsFormatter', 'options_sql' => ' SELECT CONCAT(tf.Description, " (", TRIM(TRAILING ".des" FROM TRIM(TRAILING ".tpl" FROM FileName) ), ")") AS Title, + CONCAT(FilePath, "/", TRIM(TRAILING ".tpl" FROM FileName)) AS Value + FROM ' . TABLE_PREFIX . 'ThemeFiles AS tf + LEFT JOIN ' . TABLE_PREFIX . 'Theme AS t ON t.ThemeId = tf.ThemeId + WHERE (t.Enabled = 1) AND (tf.FileName NOT LIKE "%%.elm.tpl") AND (tf.FilePath = "/designs")', + 'option_key_field' => 'Value', 'option_title_field' => 'Title', + 'required' => 1, 'default' => null + ), - 'SameImages' => 'img.SameImages', - 'LocalThumb' => 'img.LocalThumb', - 'ThumbPath' => 'img.ThumbPath', - 'ThumbUrl' => 'img.ThumbUrl', - 'LocalImage' => 'img.LocalImage', - 'LocalPath' => 'img.LocalPath', - 'FullUrl' => 'img.Url', - ) - ), + 'Path' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'regexp'=>'/^[a-zA-Z0-9\-_\.\\/]*$/', 'error_msgs' => Array ('invalid_format'=>'!la_invalid_chars!'), 'default' => null, /*'unique'=>Array ('Path')*/), + 'UseExternalUrl' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, + 'not_null' => 1, 'default' => 0 + ), + 'ExternalUrl' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''), + 'UseMenuIconUrl' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, + 'not_null' => 1, 'default' => 0 + ), + 'MenuIconUrl' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''), + 'Title' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'format'=>'no_default', 'default' => '', 'not_null'=>1), + 'MenuTitle' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'format'=>'no_default', 'not_null' => 1, 'default' => ''), + 'MetaTitle' => Array ('type' => 'string', 'default' => null), + 'IndexTools' => Array ('type' => 'string', 'default' => null), + 'IsIndex' => + Array ( + 'type' => 'int', 'not_null' => 1, 'default' => 0, + 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_Regular', 1 => 'la_CategoryIndex', 2 => 'la_Container'), 'use_phrases' => 1, + ), + 'IsMenu' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Show', 0 => 'la_Hide'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1), + 'IsSystem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_System', 0 => 'la_Regular'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), + 'FormId' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array ('' => ''), + 'options_sql' => 'SELECT Title, FormId FROM '.TABLE_PREFIX.'Forms ORDER BY Title', + 'option_key_field' => 'FormId', 'option_title_field' => 'Title', + 'default' => 0 + ), + 'FormSubmittedTemplate' => Array ('type' => 'string', 'default' => null), + 'Translated' => Array ('type' => 'int', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'default' => 0, 'db_type' => 'tinyint', 'index_type' => 'int'), + 'FriendlyURL' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), + 'ThemeId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), + ), - 'CacheModRewrite' => true, + 'VirtualFields' => Array ( + 'CurrentSort' => Array('type' => 'string', 'default' => ''), + 'IsNew' => Array('type' => 'int', 'default' => 0), + 'OldPriority' => Array('type' => 'int', 'default' => 0), - 'Fields' => Array - ( - 'CategoryId' => Array('type' => 'int','not_null' => 1,'default' => 0), - 'Type' => Array('type' => 'int','not_null' => 1,'default' => 0), - 'SymLinkCategoryId' => Array('type' => 'int', 'default' => NULL), - 'ParentId' => Array('type' => 'int','not_null' => 1,'default' => 0), - 'Name' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'required' => 1, 'default' => ''), - 'Filename' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), - 'AutomaticFilename' => Array('type' => 'int', 'not_null' => 1, 'default' => 1), - 'Description' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'required' => 0, 'default' => null), - 'CreatedOn' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default'=>'#NOW#', 'required' => 1, 'not_null' => 1), - 'EditorsPick' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - 'MetaKeywords' => Array('type' => 'string', 'default' => null), - 'CachedDescendantCatsQty' => Array('type' => 'int', 'default' => 0), - 'CachedNavbar' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'default' => null), - 'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => 0), - 'ResourceId' => Array('type' => 'int', 'default' => null), - 'ParentPath' => Array('type' => 'string', 'default' => null), - 'TreeLeft' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'TreeRight' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'NamedParentPath' => Array('type' => 'string', 'default' => null), - 'MetaDescription' => Array('type' => 'string', 'default' => null), - 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), - 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), - 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), - 'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1,'default' => '#NOW#'), - 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1,'default' => 0), - 'CategoryTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), - 'CachedCategoryTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), - ), + // for primary image + 'SameImages' => Array('type' => 'string', 'default' => ''), + 'LocalThumb' => Array('type' => 'string', 'default' => ''), + 'ThumbPath' => Array('type' => 'string', 'default' => ''), + 'ThumbUrl' => Array('type' => 'string', 'default' => ''), + 'LocalImage' => Array('type' => 'string', 'default' => ''), + 'LocalPath' => Array('type' => 'string', 'default' => ''), + 'FullUrl' => Array('type' => 'string', 'default' => ''), + ), - 'VirtualFields' => Array( - 'CurrentSort' => Array('type' => 'string', 'default' => ''), - 'IsNew' => Array('type' => 'int', 'default' => 0), + 'Grids' => Array( + 'Default' => Array ( + 'Icons' => Array(1 => 'icon16_folder.gif', 0 => 'icon16_folder-red.gif'), + 'Fields' => Array( + 'CategoryId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ), + 'Name' => Array( 'title'=>'la_col_PageTitle', 'data_block' => 'page_browse_td', 'filter_block' => 'grid_like_filter'), + 'Modified_formatted' => Array( 'title'=>'la_col_Modified', 'sort_field' => 'Modified', 'filter_block' => 'grid_date_range_filter' ), + 'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter' ), + 'IsMenu' => Array( 'title'=>'la_col_Visible', 'filter_block' => 'grid_options_filter' ), + 'IsSystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', ), + ), + ), - // for primary image - 'SameImages' => Array('type' => 'string', 'default' => ''), - 'LocalThumb' => Array('type' => 'string', 'default' => ''), - 'ThumbPath' => Array('type' => 'string', 'default' => ''), - 'ThumbUrl' => Array('type' => 'string', 'default' => ''), - 'LocalImage' => Array('type' => 'string', 'default' => ''), - 'LocalPath' => Array('type' => 'string', 'default' => ''), - 'FullUrl' => Array('type' => 'string', 'default' => ''), - ), + 'Radio' => Array ( + 'Selector' => 'radio', + 'Icons' => Array(1 => 'icon16_folder.gif', 0 => 'icon16_folder-red.gif'), + 'Fields' => Array( + 'CategoryId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_radio_td', 'filter_block' => 'grid_range_filter', ), + 'Name' => Array( 'title'=>'la_col_PageTitle', 'data_block' => 'page_browse_td', 'filter_block' => 'grid_like_filter'), + 'Modified_formatted' => Array( 'title'=>'la_col_Modified', 'sort_field' => 'Modified', 'filter_block' => 'grid_date_range_filter' ), + 'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter' ), + 'IsMenu' => Array( 'title'=>'la_col_Visible', 'filter_block' => 'grid_options_filter' ), + 'IsSystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', ), + ), + ), - 'Grids' => Array( - 'Default' => Array ( - 'Icons' => Array(1 => 'icon16_folder.gif', 0 => 'icon16_folder-red.gif'), - 'Fields' => Array( - 'CategoryId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ), - 'Name' => Array( 'title'=>'la_col_PageTitle', 'data_block' => 'page_browse_td', 'filter_block' => 'grid_like_filter'), - 'Modified_formatted' => Array( 'title'=>'la_col_Modified', 'sort_field' => 'Modified', 'filter_block' => 'grid_date_range_filter' ), - 'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter' ), - 'IsMenu' => Array( 'title'=>'la_col_Visible', 'filter_block' => 'grid_options_filter' ), - 'IsSystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', ), - ), - ), + 'Structure' => Array ( + 'Icons' => Array(1 => 'icon16_folder.gif', 0 => 'icon16_folder-red.gif'), + 'Fields' => Array( + 'CategoryId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ), + 'Name' => Array( 'title'=>'la_col_PageTitle', 'data_block' => 'page_browse_td', 'filter_block' => 'grid_like_filter'), + 'Modified_formatted' => Array( 'title'=>'la_col_Modified', 'sort_field' => 'Modified', 'filter_block' => 'grid_date_range_filter' ), + 'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter' ), + 'IsMenu' => Array( 'title'=>'la_col_Visible', 'filter_block' => 'grid_options_filter' ), + 'Path' => Array( 'title'=>'la_col_Path', 'data_block' => 'page_entercat_td', 'filter_block' => 'grid_like_filter' ), + 'IsSystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', ), + ), + ), + ), - 'Radio' => Array ( - 'Selector' => 'radio', - 'Icons' => Array(1 => 'icon16_folder.gif', 0 => 'icon16_folder-red.gif'), - 'Fields' => Array( - 'CategoryId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_radio_td', 'filter_block' => 'grid_range_filter', ), - 'Name' => Array( 'title'=>'la_col_PageTitle', 'data_block' => 'page_browse_td', 'filter_block' => 'grid_like_filter'), - 'Modified_formatted' => Array( 'title'=>'la_col_Modified', 'sort_field' => 'Modified', 'filter_block' => 'grid_date_range_filter' ), - 'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter' ), - 'IsMenu' => Array( 'title'=>'la_col_Visible', 'filter_block' => 'grid_options_filter' ), - 'IsSystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', ), - ), - ), - - 'Structure' => Array ( - 'Icons' => Array(1 => 'icon16_folder.gif', 0 => 'icon16_folder-red.gif'), - 'Fields' => Array( - 'CategoryId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ), - 'Name' => Array( 'title'=>'la_col_PageTitle', 'data_block' => 'page_browse_td', 'filter_block' => 'grid_like_filter'), - 'Modified_formatted' => Array( 'title'=>'la_col_Modified', 'sort_field' => 'Modified', 'filter_block' => 'grid_date_range_filter' ), - 'Template' => Array( 'title'=>'la_col_TemplateType', 'filter_block' => 'grid_options_filter' ), - 'IsMenu' => Array( 'title'=>'la_col_Visible', 'filter_block' => 'grid_options_filter' ), - 'Path' => Array( 'title'=>'la_col_Path', 'data_block' => 'page_entercat_td', 'filter_block' => 'grid_like_filter' ), - 'IsSystem' => Array( 'title'=>'la_col_System', 'filter_block' => 'grid_options_filter', ), - ), - ), - ), - - - - 'ConfigMapping' => Array( - 'PerPage' => 'Perpage_Category', - 'ShortListPerPage' => 'Perpage_Category_Short', - 'DefaultSorting1Field' => 'Category_Sortfield', - 'DefaultSorting2Field' => 'Category_Sortfield2', - 'DefaultSorting1Dir' => 'Category_Sortorder', - 'DefaultSorting2Dir' => 'Category_Sortorder2', - ), - ); - -?> \ No newline at end of file + 'ConfigMapping' => Array ( + 'PerPage' => 'Perpage_Category', + 'ShortListPerPage' => 'Perpage_Category_Short', + 'DefaultSorting1Field' => 'Category_Sortfield', + 'DefaultSorting2Field' => 'Category_Sortfield2', + 'DefaultSorting1Dir' => 'Category_Sortorder', + 'DefaultSorting2Dir' => 'Category_Sortorder2', + ), + ); \ No newline at end of file Index: branches/RC/core/units/sections/sections_config.php =================================================================== diff -u -N -r11395 -r11495 --- branches/RC/core/units/sections/sections_config.php (.../sections_config.php) (revision 11395) +++ branches/RC/core/units/sections/sections_config.php (.../sections_config.php) (revision 11495) @@ -31,8 +31,8 @@ 'in-portal:browse' => Array ( 'parent' => 'in-portal:site', - 'icon' => 'catalog', // 'proj-cms:structure' - 'label' => 'la_tab_Browse', + 'icon' => 'proj-cms:structure', // 'catalog' + 'label' => 'la_title_Structure', // 'la_tab_Browse', 'url' => Array ('t' => 'catalog/catalog', 'pass' => 'm'), 'late_load' => Array ('t' => 'categories/xml/tree_categories', 'pass' => 'm', 'm_cat_id' => 0), 'onclick' => 'checkCatalog(0)', Index: branches/RC/core/admin_templates/catalog_tab.tpl =================================================================== diff -u -N -r11412 -r11495 --- branches/RC/core/admin_templates/catalog_tab.tpl (.../catalog_tab.tpl) (revision 11412) +++ branches/RC/core/admin_templates/catalog_tab.tpl (.../catalog_tab.tpl) (revision 11495) @@ -40,10 +40,20 @@ $Catalog.setCurrentCategory('', ); $Catalog.saveSearch('', '', ''); + /* // makes js error in selectors + var $menu_frame = getFrame('menu'); + + + $menu_frame.ReloadFolder('', true); + + + + $menu_frame.SyncActive('');*/ + - +  *
@@ -53,7 +63,7 @@ , '');" title=""> - +  * @@ -66,25 +76,25 @@ -
+
Grids[''].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6')); - + a_toolbar.DisableButton('upcat'); a_toolbar.DisableButton('homecat'); Index: branches/RC/core/units/admin/admin_events_handler.php =================================================================== diff -u -N -r11409 -r11495 --- branches/RC/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 11409) +++ branches/RC/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 11495) @@ -74,6 +74,7 @@ if ($this->Application->GetVar('ajax') == 'yes') { $event->status = erSTOP; } + $this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName LIKE "mod_rw%"'); } @@ -82,14 +83,16 @@ if ($this->Application->GetVar('ajax') == 'yes') { $event->status = erSTOP; } - $this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "cms_menu"'); + + $this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName IN ("cms_menu", "StructureTree")'); } function OnResetSections(&$event) { if ($this->Application->GetVar('ajax') == 'yes') { $event->status = erSTOP; } + $this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "sections_parsed"'); if (isset($this->Application->Memcached)) { $this->Application->Memcached->delete('master:sections_parsed'); @@ -248,9 +251,9 @@ Table "<?php echo $table_name; ?>" Structure - Close Window
+ Close Window
highlightString($ret); ?> -
Close Window
+
Close Window
Unit Config of "" prefix - Close Window

+ Close Window

Prefix:
Unit Config: highlightString($config_file); ?>
-
Close Window
+
Close Window
" url="" enb="true"> - + \ No newline at end of file Index: branches/RC/core/install/install_toolkit.php =================================================================== diff -u -N -r11213 -r11495 --- branches/RC/core/install/install_toolkit.php (.../install_toolkit.php) (revision 11213) +++ branches/RC/core/install/install_toolkit.php (.../install_toolkit.php) (revision 11495) @@ -626,7 +626,7 @@ function deleteCache($refresh_permissions = false) { $sql = 'DELETE FROM ' . TABLE_PREFIX . 'Cache - WHERE VarName IN ("config_files", "configs_parsed", "sections_parsed")'; + WHERE VarName IN ("config_files", "configs_parsed", "sections_parsed", "cms_menu", "StructureTree")'; $this->Conn->Query($sql); if ($refresh_permissions) { Index: branches/RC/core/units/categories/cache_updater.php =================================================================== diff -u -N -r11357 -r11495 --- branches/RC/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 11357) +++ branches/RC/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 11495) @@ -297,7 +297,7 @@ $add_charset = defined(SQL_CHARSET)? ' CHARACTER SET '.SQL_CHARSET.' ' : ''; $add_collation = defined(SQL_COLLATION)? ' COLLATE '.SQL_COLLATION.' ' : ''; - $this->Conn->Query('CREATE TABLE '.$this->progressTable.'(data LONGTEXT'.$add_charset.$add_collantion.') '.$add_charset.$add_collantion); + $this->Conn->Query('CREATE TABLE '.$this->progressTable.'(data LONGTEXT'.$add_charset.$add_collation.') '.$add_charset.$add_collation); $this->totalCats = (int)$this->Conn->GetOne('SELECT COUNT(*) FROM '.TABLE_PREFIX.'Category'); $this->doneCats = 0; @@ -503,7 +503,7 @@ * Rebuild all cache in one step * */ - function OneStepRun($path='') + function OneStepRun($path = '') { $this->InitUpdater(); $needs_more = true; Index: branches/RC/core/admin_templates/tools/system_tools.tpl =================================================================== diff -u -N -r11215 -r11495 --- branches/RC/core/admin_templates/tools/system_tools.tpl (.../system_tools.tpl) (revision 11215) +++ branches/RC/core/admin_templates/tools/system_tools.tpl (.../system_tools.tpl) (revision 11495) @@ -3,19 +3,11 @@