Index: branches/RC/core/units/related_searches/related_searches_tag_processor.php
===================================================================
diff -u
--- branches/RC/core/units/related_searches/related_searches_tag_processor.php (revision 0)
+++ branches/RC/core/units/related_searches/related_searches_tag_processor.php (revision 9329)
@@ -0,0 +1,22 @@
+getObject($params);
+ $keyword = $object->GetDBField('Keyword');
+
+ return $this->Application->HREF($params['search_template'],'', Array(
+ 'keywords' => $keyword,));
+ }
+}
+
+?>
\ No newline at end of file
Index: branches/RC/kernel/admin_templates/categories/categories_edit_related_searches.tpl
===================================================================
diff -u
--- branches/RC/kernel/admin_templates/categories/categories_edit_related_searches.tpl (revision 0)
+++ branches/RC/kernel/admin_templates/categories/categories_edit_related_searches.tpl (revision 9329)
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " id="">
+ img/itemicons/">
+
+ |
+
+
+
+
+">
+
+
+
\ No newline at end of file
Index: branches/RC/core/units/categories/categories_config.php
===================================================================
diff -u -r9279 -r9329
--- branches/RC/core/units/categories/categories_config.php (.../categories_config.php) (revision 9279)
+++ branches/RC/core/units/categories/categories_config.php (.../categories_config.php) (revision 9329)
@@ -79,6 +79,7 @@
'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!"),
@@ -97,6 +98,13 @@
'edit_status_labels' => Array('c-rel'=>'!la_title_Editing_Relationship!'),
'format' => "#c_status# '#c_titlefield#' - #c-rel_status#",
),
+
+ '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#",
+ ),
+
'tree_site' => Array('format' => '!la_selecting_categories!'),
),
@@ -217,7 +225,7 @@
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'),
- 'SubItems' => Array('c-rel', 'c-img', 'c-cdata', 'c-perm'),
+ 'SubItems' => Array('c-rel', 'c-search','c-img', 'c-cdata', 'c-perm'),
'ListSortings' => Array(
'' => Array(
Index: branches/RC/core/units/related_searches/related_searches_config.php
===================================================================
diff -u
--- branches/RC/core/units/related_searches/related_searches_config.php (revision 0)
+++ branches/RC/core/units/related_searches/related_searches_config.php (revision 9329)
@@ -0,0 +1,112 @@
+ 'search',
+
+ 'Clones' => Array(
+ 'c-search' => Array('ParentPrefix' => 'c'),
+ /*'l-rel' => Array('ParentPrefix' => 'l'),
+ 'n-rel' => Array('ParentPrefix' => 'n'),
+ 'bb-rel'=> Array('ParentPrefix' => 'bb'),
+ 'p-rel' => Array('ParentPrefix' => 'p'),
+ 'cms-rel'=> Array('ParentPrefix' => 'cms'),*/
+ ),
+
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'RelatedSearchEventHandler','file'=>'related_searches_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'RelatedSearchTagProcessor','file'=>'related_searches_tag_processor.php','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => '#PARENT#',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnAfterItemDelete'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ /*'DoEvent' => 'OnDeleteForeignRelations',*/
+ ),
+ ),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ ),
+ 'IDField' => 'RelatedSearchId',
+ 'StatusField' => Array('Enabled'),
+ 'TableName' => TABLE_PREFIX.'RelatedSearches',
+ 'ParentTableKey' => 'ResourceId',
+ 'ForeignKey' => 'ResourceId',
+ 'ParentPrefix' => 'p',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_disabled'), 'type' => WHERE_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_recip','show_oneway'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Enabled != 1' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Enabled != 0' ),
+ 's1' => Array(),
+ /*
+ 'show_recip' => Array('label' => 'la_Reciprocal', 'on_sql' => '', 'off_sql' => '%1$s.Type != 1' ),
+ 'show_oneway' => Array('label' => 'la_OneWay', 'on_sql' => '', 'off_sql' => '%1$s.Type != 2' ),
+ */
+ )
+ ),
+
+ 'CalculatedFields' => Array(
+ '' => Array(
+ /* 'ItemName' => 'TRIM(CONCAT(#ITEM_NAMES#))',
+ 'ItemType' => '#ITEM_TYPES#', */
+ ),
+ ),
+
+ 'ListSQLs' => Array( ''=> 'SELECT %1$s.* %2$s FROM %1$s',
+ ), // key - special, value - list select sql
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('Keyword' => 'asc'),
+ )
+ ),
+ 'ItemSQLs' => Array( '' => 'SELECT %1$s.* %2$s FROM %1$s',),
+
+ 'Fields' => Array(
+ 'RelatedSearchId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array('type'=>'int', 'required' => 1, 'default' => NULL),
+ 'Keyword' => Array('type'=>'string', 'required' => 1, 'not_null' => 1, 'default' => ''),
+ /*
+ 'SourceType' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ 'TargetType' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ */
+ 'ItemType' => Array('type'=>'int', 'required' => 1, 'default' => NULL),
+ 'Enabled' => Array('type'=>'int','formatter'=>'kOptionsFormatter','options'=>Array(0=>'la_Disabled',1=>'la_Enabled'),'not_null'=>1,'default'=>1,'use_phrases'=>1),
+ 'Priority' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ ),
+ 'VirtualFields' => Array(
+ /*
+ 'ItemName' => Array(),
+ 'ItemType' => Array(),
+ */
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif','1_0'=>'icon16_relation_one-way.gif','0_0'=>'icon16_relation_one-way_disabled.gif','1_1'=>'icon16_relation_reciprocal.gif','0_1'=>'icon16_relation_reciprocal_disabled.gif'), // icons for each StatusField values, if no matches or no statusfield selected, then "default" icon is used
+ 'Fields' => Array(
+ /* 'RelatedSearchId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td'), */
+ 'Keyword' => Array( 'title'=>'la_col_Keyword', 'data_block' => 'grid_keyword_td'),
+ 'Enabled' => Array( 'title'=>'la_col_Status' ),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Index: branches/RC/core/admin_templates/categories/categories_edit_related_searches.tpl
===================================================================
diff -u
--- branches/RC/core/admin_templates/categories/categories_edit_related_searches.tpl (revision 0)
+++ branches/RC/core/admin_templates/categories/categories_edit_related_searches.tpl (revision 9329)
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " id="">
+ img/itemicons/">
+
+ |
+
+
+
+
+">
+
+
+
\ No newline at end of file
Index: branches/RC/kernel/units/related_searches/related_searches_config.php
===================================================================
diff -u
--- branches/RC/kernel/units/related_searches/related_searches_config.php (revision 0)
+++ branches/RC/kernel/units/related_searches/related_searches_config.php (revision 9329)
@@ -0,0 +1,112 @@
+ 'search',
+
+ 'Clones' => Array(
+ 'c-search' => Array('ParentPrefix' => 'c'),
+ /*'l-rel' => Array('ParentPrefix' => 'l'),
+ 'n-rel' => Array('ParentPrefix' => 'n'),
+ 'bb-rel'=> Array('ParentPrefix' => 'bb'),
+ 'p-rel' => Array('ParentPrefix' => 'p'),
+ 'cms-rel'=> Array('ParentPrefix' => 'cms'),*/
+ ),
+
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'RelatedSearchEventHandler','file'=>'related_searches_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'RelatedSearchTagProcessor','file'=>'related_searches_tag_processor.php','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => '#PARENT#',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnAfterItemDelete'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ /*'DoEvent' => 'OnDeleteForeignRelations',*/
+ ),
+ ),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ ),
+ 'IDField' => 'RelatedSearchId',
+ 'StatusField' => Array('Enabled'),
+ 'TableName' => TABLE_PREFIX.'RelatedSearches',
+ 'ParentTableKey' => 'ResourceId',
+ 'ForeignKey' => 'ResourceId',
+ 'ParentPrefix' => 'p',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_disabled'), 'type' => WHERE_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_recip','show_oneway'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Enabled != 1' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Enabled != 0' ),
+ 's1' => Array(),
+ /*
+ 'show_recip' => Array('label' => 'la_Reciprocal', 'on_sql' => '', 'off_sql' => '%1$s.Type != 1' ),
+ 'show_oneway' => Array('label' => 'la_OneWay', 'on_sql' => '', 'off_sql' => '%1$s.Type != 2' ),
+ */
+ )
+ ),
+
+ 'CalculatedFields' => Array(
+ '' => Array(
+ /* 'ItemName' => 'TRIM(CONCAT(#ITEM_NAMES#))',
+ 'ItemType' => '#ITEM_TYPES#', */
+ ),
+ ),
+
+ 'ListSQLs' => Array( ''=> 'SELECT %1$s.* %2$s FROM %1$s',
+ ), // key - special, value - list select sql
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('Keyword' => 'asc'),
+ )
+ ),
+ 'ItemSQLs' => Array( '' => 'SELECT %1$s.* %2$s FROM %1$s',),
+
+ 'Fields' => Array(
+ 'RelatedSearchId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array('type'=>'int', 'required' => 1, 'default' => NULL),
+ 'Keyword' => Array('type'=>'string', 'required' => 1, 'not_null' => 1, 'default' => ''),
+ /*
+ 'SourceType' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ 'TargetType' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ */
+ 'ItemType' => Array('type'=>'int', 'required' => 1, 'default' => NULL),
+ 'Enabled' => Array('type'=>'int','formatter'=>'kOptionsFormatter','options'=>Array(0=>'la_Disabled',1=>'la_Enabled'),'not_null'=>1,'default'=>1,'use_phrases'=>1),
+ 'Priority' => Array('type'=>'int','not_null'=>1,'default'=>0),
+ ),
+ 'VirtualFields' => Array(
+ /*
+ 'ItemName' => Array(),
+ 'ItemType' => Array(),
+ */
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif','1_0'=>'icon16_relation_one-way.gif','0_0'=>'icon16_relation_one-way_disabled.gif','1_1'=>'icon16_relation_reciprocal.gif','0_1'=>'icon16_relation_reciprocal_disabled.gif'), // icons for each StatusField values, if no matches or no statusfield selected, then "default" icon is used
+ 'Fields' => Array(
+ /* 'RelatedSearchId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td'), */
+ 'Keyword' => Array( 'title'=>'la_col_Keyword', 'data_block' => 'grid_keyword_td'),
+ 'Enabled' => Array( 'title'=>'la_col_Status' ),
+ ),
+
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Index: branches/RC/themes/default2007/platform/elements/side_boxes/related_searches.tpl
===================================================================
diff -u
--- branches/RC/themes/default2007/platform/elements/side_boxes/related_searches.tpl (revision 0)
+++ branches/RC/themes/default2007/platform/elements/side_boxes/related_searches.tpl (revision 9329)
@@ -0,0 +1,9 @@
+
+
+
+
+
+">
+
+
+
\ No newline at end of file
Index: branches/RC/core/admin_templates/img/toolbar/tool_new_related_search.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/core/admin_templates/img/toolbar/tool_new_related_search_f2.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/kernel/units/related_searches/related_searches_event_handler.php
===================================================================
diff -u
--- branches/RC/kernel/units/related_searches/related_searches_event_handler.php (revision 0)
+++ branches/RC/kernel/units/related_searches/related_searches_event_handler.php (revision 9329)
@@ -0,0 +1,24 @@
+getObject();
+
+ $table_info = $object->getLinkedInfo();
+
+ $source_itemtype = $this->Application->getUnitOption($table_info['ParentPrefix'], 'ItemType');
+ $object->SetDBField('ItemType', $source_itemtype);
+ }
+ }
+
+
+?>
\ No newline at end of file
Index: branches/RC/core/units/related_searches/related_searches_event_handler.php
===================================================================
diff -u
--- branches/RC/core/units/related_searches/related_searches_event_handler.php (revision 0)
+++ branches/RC/core/units/related_searches/related_searches_event_handler.php (revision 9329)
@@ -0,0 +1,24 @@
+getObject();
+
+ $table_info = $object->getLinkedInfo();
+
+ $source_itemtype = $this->Application->getUnitOption($table_info['ParentPrefix'], 'ItemType');
+ $object->SetDBField('ItemType', $source_itemtype);
+ }
+ }
+
+
+?>
\ No newline at end of file
Index: branches/RC/core/admin_templates/categories/related_searches_edit.tpl
===================================================================
diff -u
--- branches/RC/core/admin_templates/categories/related_searches_edit.tpl (revision 0)
+++ branches/RC/core/admin_templates/categories/related_searches_edit.tpl (revision 9329)
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/RC/kernel/admin_templates/categories/related_searches_edit.tpl
===================================================================
diff -u
--- branches/RC/kernel/admin_templates/categories/related_searches_edit.tpl (revision 0)
+++ branches/RC/kernel/admin_templates/categories/related_searches_edit.tpl (revision 9329)
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/RC/core/admin_templates/categories/categories_tabs.tpl
===================================================================
diff -u -r8929 -r9329
--- branches/RC/core/admin_templates/categories/categories_tabs.tpl (.../categories_tabs.tpl) (revision 8929)
+++ branches/RC/core/admin_templates/categories/categories_tabs.tpl (.../categories_tabs.tpl) (revision 9329)
@@ -22,6 +22,7 @@
+
Index: branches/RC/kernel/units/related_searches/related_searches_tag_processor.php
===================================================================
diff -u
--- branches/RC/kernel/units/related_searches/related_searches_tag_processor.php (revision 0)
+++ branches/RC/kernel/units/related_searches/related_searches_tag_processor.php (revision 9329)
@@ -0,0 +1,22 @@
+getObject($params);
+ $keyword = $object->GetDBField('Keyword');
+
+ return $this->Application->HREF($params['search_template'],'', Array(
+ 'keywords' => $keyword,));
+ }
+}
+
+?>
\ No newline at end of file
Index: branches/RC/kernel/admin_templates/categories/categories_tabs.tpl
===================================================================
diff -u -r8929 -r9329
--- branches/RC/kernel/admin_templates/categories/categories_tabs.tpl (.../categories_tabs.tpl) (revision 8929)
+++ branches/RC/kernel/admin_templates/categories/categories_tabs.tpl (.../categories_tabs.tpl) (revision 9329)
@@ -22,6 +22,7 @@
+