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