Index: trunk/core/units/custom_data/custom_data_config.php =================================================================== diff -u --- trunk/core/units/custom_data/custom_data_config.php (revision 0) +++ trunk/core/units/custom_data/custom_data_config.php (revision 4016) @@ -0,0 +1,75 @@ + '', + + 'Clones' => Array( + + 'u-cdata' => Array( + 'TableName' => TABLE_PREFIX.'PortalUserCustomData', + 'ParentPrefix' => 'u', + ), + + 'l-cdata' => Array( + 'TableName' => TABLE_PREFIX.'LinkCustomData', + 'ParentPrefix' => 'l', + ), + + 'n-cdata' => Array( + 'TableName' => TABLE_PREFIX.'NewsCustomData', + 'ParentPrefix' => 'n', + ), + + 'bb-cdata' => Array( + 'TableName' => TABLE_PREFIX.'TopicCustomData', + 'ParentPrefix' => 'bb', + ), + + 'p-cdata' => Array( + 'TableName' => TABLE_PREFIX.'ProductsCustomData', + 'ParentPrefix' => 'p', + ), + ), + + + 'ItemClass' => Array('class' => 'kDBItem', 'file' => '','build_event' => 'OnItemBuild'), + 'ListClass' => Array('class' => 'kDBList', 'file' => '','build_event' => 'OnListBuild'), + 'EventHandlerClass' => Array('class' => 'kDBEventHandler', 'file' => '', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => Array('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'), + 'AutoLoad' => true, + + 'Hooks' => Array( + Array( + 'Mode' => hAFTER, + 'Conditional' => false, + 'HookToPrefix' => 'm', + 'HookToSpecial' => '*', + 'HookToEvent' => Array('OnAfterConfigRead'), + 'DoPrefix' => '', + 'DoSpecial' => '', + 'DoEvent' => 'OnCreateCustomFields', + ), + ), + + 'IDField' => 'CustomDataId', + + 'ParentTableKey' => 'ResourceId', + 'ForeignKey' => 'ResourceId', + 'AutoDelete' => true, + 'AutoClone' => true, + + 'CalculatedFields' => Array( + '' => Array(), + ), + + 'ListSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s'), + 'ItemSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s'), + + 'Fields' => Array( + 'CustomDataId' => Array(), + 'ResourceId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), + ), + ); + + +?> \ No newline at end of file Index: trunk/kernel/units/custom_data/custom_data_config.php =================================================================== diff -u --- trunk/kernel/units/custom_data/custom_data_config.php (revision 0) +++ trunk/kernel/units/custom_data/custom_data_config.php (revision 4016) @@ -0,0 +1,75 @@ + '', + + 'Clones' => Array( + + 'u-cdata' => Array( + 'TableName' => TABLE_PREFIX.'PortalUserCustomData', + 'ParentPrefix' => 'u', + ), + + 'l-cdata' => Array( + 'TableName' => TABLE_PREFIX.'LinkCustomData', + 'ParentPrefix' => 'l', + ), + + 'n-cdata' => Array( + 'TableName' => TABLE_PREFIX.'NewsCustomData', + 'ParentPrefix' => 'n', + ), + + 'bb-cdata' => Array( + 'TableName' => TABLE_PREFIX.'TopicCustomData', + 'ParentPrefix' => 'bb', + ), + + 'p-cdata' => Array( + 'TableName' => TABLE_PREFIX.'ProductsCustomData', + 'ParentPrefix' => 'p', + ), + ), + + + 'ItemClass' => Array('class' => 'kDBItem', 'file' => '','build_event' => 'OnItemBuild'), + 'ListClass' => Array('class' => 'kDBList', 'file' => '','build_event' => 'OnListBuild'), + 'EventHandlerClass' => Array('class' => 'kDBEventHandler', 'file' => '', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => Array('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'), + 'AutoLoad' => true, + + 'Hooks' => Array( + Array( + 'Mode' => hAFTER, + 'Conditional' => false, + 'HookToPrefix' => 'm', + 'HookToSpecial' => '*', + 'HookToEvent' => Array('OnAfterConfigRead'), + 'DoPrefix' => '', + 'DoSpecial' => '', + 'DoEvent' => 'OnCreateCustomFields', + ), + ), + + 'IDField' => 'CustomDataId', + + 'ParentTableKey' => 'ResourceId', + 'ForeignKey' => 'ResourceId', + 'AutoDelete' => true, + 'AutoClone' => true, + + 'CalculatedFields' => Array( + '' => Array(), + ), + + 'ListSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s'), + 'ItemSQLs' => Array('' => 'SELECT %1$s.* %2$s FROM %1$s'), + + 'Fields' => Array( + 'CustomDataId' => Array(), + 'ResourceId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), + ), + ); + + +?> \ No newline at end of file Index: trunk/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -r4000 -r4016 --- trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 4000) +++ trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 4016) @@ -127,6 +127,10 @@ $this->ParseConfigClones($clone_prefix); } + if (!$prefix) { + // configs, that used only for cloning & not used ifself + unset($this->configData[$prefix]); + } } function ParseConfigs()