'rel', 'Clones' => Array( 'c-rel' => 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'=>'RelationshipEventHandler','file'=>'relationship_event_handler.php','build_event'=>'OnBuild'), 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','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' => 'RelationshipId', 'StatusField' => Array('Enabled','Type'), 'TableName' => TABLE_PREFIX.'Relationship', 'ParentTableKey'=> 'ResourceId', 'ForeignKey' => 'SourceId', '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.RelationshipId, %1$s.Priority, %1$s.Type, %1$s.Enabled %2$s FROM %1$s #ITEM_JOIN#', ), // key - special, value - list select sql 'ListSortings' => Array( '' => Array( 'ForcedSorting' => Array('Priority' => 'desc'), 'Sorting' => Array('ItemName' => 'asc', 'ItemType' => 'asc'), ) ), 'ItemSQLs' => Array( '' => 'SELECT %1$s.* %2$s FROM %1$s #ITEM_JOIN#',), 'Fields' => Array( 'RelationshipId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), 'SourceId' => Array('type'=>'int', 'required' => 1, 'default' => 0), 'TargetId' => Array('type'=>'int', 'required' => 1, 'default' => ''), 'SourceType' => Array('type'=>'int','not_null'=>1,'default'=>0), 'TargetType' => Array('type'=>'int','not_null'=>1,'default'=>0), 'Type' => Array('type'=>'int','formatter'=>'kOptionsFormatter', 'required' => 1, 'options'=>Array(1=>'la_Reciprocal',0=>'la_OneWay'),'not_null'=>1,'default'=>0,'use_phrases'=>1), '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( 'ItemName' => Array( 'title'=>'la_col_TargetId', 'data_block' => 'grid_checkbox_td'), 'ItemType' => Array( 'title'=>'la_col_TargetType' ), 'Type' => Array( 'title'=>'la_col_RelationshipType' ), 'Enabled' => Array( 'title'=>'la_col_Status' ), ), ), ), ); ?>