Index: branches/5.0.x/units/products/products_event_handler.php =================================================================== diff -u -r13262 -r13286 --- branches/5.0.x/units/products/products_event_handler.php (.../products_event_handler.php) (revision 13262) +++ branches/5.0.x/units/products/products_event_handler.php (.../products_event_handler.php) (revision 13286) @@ -1,6 +1,6 @@ 'la_tab_ShopCartEntry', 't' => 'in-commerce/paid_listings/paid_listing_type_shopcart', 'priority' => 2); $this->Application->setUnitOption($event->MasterEvent->Prefix, 'EditTabPresets', $edit_tab_presets); } + + /** + * [HOOK] Allows to add cloned subitem to given prefix + * + * @param kEvent $event + */ + function OnCloneSubItem(&$event) + { + parent::OnCloneSubItem($event); + + if ($event->MasterEvent->Prefix == 'rev') { + $clones = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'Clones'); + $subitem_prefix = $event->Prefix . '-' . $event->MasterEvent->Prefix; + + $clones[$subitem_prefix]['ConfigMapping'] = Array ( + 'PerPage' => 'Comm_Perpage_Reviews', + + 'ReviewDelayInterval' => 'product_ReviewDelay_Value', + 'ReviewDelayValue' => 'product_ReviewDelay_Interval', + ); + + $this->Application->setUnitOption($event->MasterEvent->Prefix, 'Clones', $clones); + } + } } \ No newline at end of file Index: branches/5.0.x/units/products/products_config.php =================================================================== diff -u -r13267 -r13286 --- branches/5.0.x/units/products/products_config.php (.../products_config.php) (revision 13267) +++ branches/5.0.x/units/products/products_config.php (.../products_config.php) (revision 13286) @@ -1,6 +1,6 @@ '*', 'DoEvent' => 'OnDefineCustomFields', ), + + Array ( + 'Mode' => hBEFORE, + 'Conditional' => false, + 'HookToPrefix' => 'rev', + 'HookToSpecial' => '*', + 'HookToEvent' => Array ('OnAfterConfigRead'), + 'DoPrefix' => '', + 'DoSpecial' => '*', + 'DoEvent' => 'OnCloneSubItem', + ), + + Array ( + 'Mode' => hBEFORE, + 'Conditional' => false, + 'HookToPrefix' => 'fav', + 'HookToSpecial' => '*', + 'HookToEvent' => Array ('OnAfterConfigRead'), + 'DoPrefix' => '', + 'DoSpecial' => '*', + 'DoEvent' => 'OnCloneSubItem', + ), + + Array ( + 'Mode' => hBEFORE, + 'Conditional' => false, + 'HookToPrefix' => 'ci', + 'HookToSpecial' => '*', + 'HookToEvent' => Array ('OnAfterConfigRead'), + 'DoPrefix' => '', + 'DoSpecial' => '*', + 'DoEvent' => 'OnCloneSubItem', + ), ), 'IDField' => 'ProductId', @@ -426,10 +459,10 @@ 'ProductId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,), 'Name' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'required' => 1, 'max_len' =>255, 'default' => ''), 'AutomaticFilename' => Array ( - 'type' => 'int', - 'formatter' => 'kOptionsFormatter', + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), - 'use_phrases' => 1, 'not_null' => 1, 'default' => 1, + 'use_phrases' => 1, 'not_null' => 1, 'default' => 1, ), 'SKU' => Array ('type' => 'string', 'required' => 1, 'max_len' =>255, 'error_msgs' => Array ('required' => 'Please fill in'), 'default' => NULL), 'Description' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'using_fck' => 1, 'default' => NULL), @@ -439,7 +472,7 @@ 'ManufacturerId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' =>Array (0 => ''), 'options_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Manufacturers ORDER BY Name', 'option_key_field' => 'ManufacturerId', 'option_title_field' => 'Name', 'not_null' => 1, 'default' => 0), 'Status' => Array ( 'type' => 'int', - 'formatter' => 'kOptionsFormatter', + 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'default' => 2, 'not_null' => 1, ), @@ -497,10 +530,10 @@ 'ProcessingData' => Array ('type' => 'string', 'default' => ''), 'PackageContent' => Array ('type' => 'string', 'default' => NULL), 'IsRecurringBilling' => Array ( - 'type' => 'int', - 'formatter' => 'kOptionsFormatter', + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), - 'use_phrases' => 1, 'not_null' => 1, 'default' => 0, + 'use_phrases' => 1, 'not_null' => 1, 'default' => 0, ), //'PayPalRecurring' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => '1', 'default' => '0'), 'ShippingMode' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' =>Array (0 => 'la_shipping_AnyAndSelected', 1 => 'la_shipping_Limited'), 'not_null' => 1, 'default' =>0), @@ -519,7 +552,7 @@ 'MetaKeywords' => Array ('type' => 'string', 'default' => null), 'MetaDescription' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null), ), - + 'VirtualFields' => Array ( 'Qty' => 1, 'Price' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => NULL), @@ -538,8 +571,8 @@ 'LineEndings' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Windows', 2 => 'UNIX'), 'default' => 1), 'LineEndingsInside' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'CRLF', 2 => 'LF'), 'default' => 2), 'IncludeFieldTitles' => Array ( - 'type' => 'int', - 'formatter' => 'kOptionsFormatter', + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1, ), @@ -548,8 +581,8 @@ 'CategoryFormat' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_MixedCategoryPath', 2 => 'la_SeparatedCategoryPath'), 'use_phrases' => 1, 'default' => 1), 'CategorySeparator' => Array ('type' => 'string', 'default' => ':'), 'IsBaseCategory' => Array ( - 'type' => 'int', - 'formatter' => 'kOptionsFormatter', + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0, ), @@ -587,7 +620,7 @@ 'LocalPath' => Array ('type' => 'string', 'default' => ''), 'FullUrl' => Array ('type' => 'string', 'default' => ''), ), - + 'Grids' => Array ( 'Default' => Array ( 'Icons' => Array (