Index: in-bulletin/units/topics/topics_config.php =================================================================== --- in-bulletin/units/topics/topics_config.php (revision 13268) +++ in-bulletin/units/topics/topics_config.php (working copy) @@ -44,6 +44,61 @@ 'DoSpecial' => '*', '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' => 'rel', + 'HookToSpecial' => '*', + 'HookToEvent' => Array ('OnAfterConfigRead'), + 'DoPrefix' => '', + 'DoSpecial' => '*', + 'DoEvent' => 'OnCloneSubItem', + ), + + Array ( + 'Mode' => hBEFORE, + 'Conditional' => false, + 'HookToPrefix' => 'img', + 'HookToSpecial' => '*', + 'HookToEvent' => Array ('OnAfterConfigRead'), + 'DoPrefix' => '', + 'DoSpecial' => '*', + 'DoEvent' => 'OnCloneSubItem', + ), + + Array ( + 'Mode' => hBEFORE, + 'Conditional' => false, + 'HookToPrefix' => 'ci', + 'HookToSpecial' => '*', + 'HookToEvent' => Array ('OnAfterConfigRead'), + 'DoPrefix' => '', + 'DoSpecial' => '*', + 'DoEvent' => 'OnCloneSubItem', + ), ), 'CatalogItem' => true, @@ -331,7 +386,7 @@ 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array ( - 0 => 'la_Disabled', + 0 => 'la_Disabled', 1 => 'la_Active', 2 => 'la_Pending', ), Index: in-bulletin/units/topics/topics_event_handler.php =================================================================== --- in-bulletin/units/topics/topics_event_handler.php (revision 13268) +++ in-bulletin/units/topics/topics_event_handler.php (working copy) @@ -207,4 +207,28 @@ $virtual_fields['ShowSignatures']['default'] = (int)$this->Application->RecallPersistentVar('show_sig'); $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); } + + /** + * [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' => 'Perpage_TopicReviews', + + 'ReviewDelayInterval' => 'topic_ReviewDelay_Interval', + 'ReviewDelayValue' => 'topic_ReviewDelay_Value', + ); + + $this->Application->setUnitOption($event->MasterEvent->Prefix, 'Clones', $clones); + } + } } \ No newline at end of file Index: in-commerce/units/products/products_config.php =================================================================== --- in-commerce/units/products/products_config.php (revision 13268) +++ in-commerce/units/products/products_config.php (working copy) @@ -105,6 +105,39 @@ 'DoSpecial' => '*', '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 ( Index: in-commerce/units/products/products_event_handler.php =================================================================== --- in-commerce/units/products/products_event_handler.php (revision 13268) +++ in-commerce/units/products/products_event_handler.php (working copy) @@ -1289,4 +1289,28 @@ $edit_tab_presets['Default']['shopping_cart'] = Array ('title' => '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: in-link/units/links/links_config.php =================================================================== --- in-link/units/links/links_config.php (revision 13268) +++ in-link/units/links/links_config.php (working copy) @@ -42,14 +42,70 @@ Array ( 'Mode' => hBEFORE, 'Conditional' => false, - 'HookToPrefix' => '', + 'HookToPrefix' => '#file', 'HookToSpecial' => '*', 'HookToEvent' => Array ('OnAfterConfigRead'), - 'DoPrefix' => '#file', + 'DoPrefix' => '', 'DoSpecial' => '*', - 'DoEvent' => 'OnDefineFiles', + 'DoEvent' => 'OnCloneSubItem', ), + 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' => 'rel', + 'HookToSpecial' => '*', + 'HookToEvent' => Array ('OnAfterConfigRead'), + 'DoPrefix' => '', + 'DoSpecial' => '*', + 'DoEvent' => 'OnCloneSubItem', + ), + + Array ( + 'Mode' => hBEFORE, + 'Conditional' => false, + 'HookToPrefix' => 'img', + 'HookToSpecial' => '*', + 'HookToEvent' => Array ('OnAfterConfigRead'), + 'DoPrefix' => '', + 'DoSpecial' => '*', + 'DoEvent' => 'OnCloneSubItem', + ), + + Array ( + 'Mode' => hBEFORE, + 'Conditional' => false, + 'HookToPrefix' => 'ci', + 'HookToSpecial' => '*', + 'HookToEvent' => Array ('OnAfterConfigRead'), + 'DoPrefix' => '', + 'DoSpecial' => '*', + 'DoEvent' => 'OnCloneSubItem', + ), + + Array ( 'Mode' => hAFTER, 'Conditional' => false, 'HookToPrefix' => '', @@ -58,7 +114,7 @@ 'DoPrefix' => 'captcha', 'DoSpecial' => '*', 'DoEvent' => 'OnPrepareCaptcha', - ), + ), ), 'QueryString' => Array ( @@ -467,8 +523,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, ), @@ -477,8 +533,8 @@ 'CategoryFormat' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_MixedCategoryPath', 2 => 'la_SeparatedCategoryPath'), 'use_phrases' => 1, 'default' => 1), 'CategorySeparator' => Array ('type' => 'string', 'error_field' => 'CategoryFormat', '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, ), Index: in-link/units/links/links_event_handler.php =================================================================== --- in-link/units/links/links_event_handler.php (revision 13268) +++ in-link/units/links/links_event_handler.php (working copy) @@ -485,4 +485,33 @@ return $events; } + + /** + * [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' => 'Perpage_LinkReviews', + 'ShortListPerPage' => 'Perpage_LinkReviews_Short', + 'DefaultSorting1Field' => 'Link_ReviewsSort', + 'DefaultSorting2Field' => 'Link_ReviewsSort2', + 'DefaultSorting1Dir' => 'Link_ReviewsOrder', + 'DefaultSorting2Dir' => 'Link_ReviewsOrder2', + + 'ReviewDelayInterval' => 'link_ReviewDelay_Interval', + 'ReviewDelayValue' => 'link_ReviewDelay_Value', + ); + + $this->Application->setUnitOption($event->MasterEvent->Prefix, 'Clones', $clones); + } + } } \ No newline at end of file Index: in-news/units/articles/articles_config.php =================================================================== --- in-news/units/articles/articles_config.php (revision 13268) +++ in-news/units/articles/articles_config.php (working copy) @@ -46,21 +46,76 @@ 'HookToPrefix' => '', 'HookToSpecial' => '*', 'HookToEvent' => Array ('OnAfterConfigRead'), - 'DoPrefix' => '#file', + 'DoPrefix' => 'cdata', 'DoSpecial' => '*', - 'DoEvent' => 'OnDefineFiles', + 'DoEvent' => 'OnDefineCustomFields', ), Array ( 'Mode' => hBEFORE, 'Conditional' => false, - 'HookToPrefix' => '', + 'HookToPrefix' => '#file', 'HookToSpecial' => '*', 'HookToEvent' => Array ('OnAfterConfigRead'), - 'DoPrefix' => 'cdata', + 'DoPrefix' => '', 'DoSpecial' => '*', - 'DoEvent' => 'OnDefineCustomFields', + 'DoEvent' => 'OnCloneSubItem', ), + + 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' => 'rel', + 'HookToSpecial' => '*', + 'HookToEvent' => Array ('OnAfterConfigRead'), + 'DoPrefix' => '', + 'DoSpecial' => '*', + 'DoEvent' => 'OnCloneSubItem', + ), + + Array ( + 'Mode' => hBEFORE, + 'Conditional' => false, + 'HookToPrefix' => 'img', + 'HookToSpecial' => '*', + 'HookToEvent' => Array ('OnAfterConfigRead'), + 'DoPrefix' => '', + 'DoSpecial' => '*', + 'DoEvent' => 'OnCloneSubItem', + ), + + Array ( + 'Mode' => hBEFORE, + 'Conditional' => false, + 'HookToPrefix' => 'ci', + 'HookToSpecial' => '*', + 'HookToEvent' => Array ('OnAfterConfigRead'), + 'DoPrefix' => '', + 'DoSpecial' => '*', + 'DoEvent' => 'OnCloneSubItem', + ), ), 'CatalogItem' => true, @@ -339,8 +394,8 @@ 'NewsId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,), 'Title' => Array ('type' => 'string', /*'formatter' => 'kMultiLanguage', */'not_null' => 1, 'required' => 1, 'default' => '', 'max_len' => 255), '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, ), @@ -423,8 +478,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, ), @@ -433,8 +488,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, ), Index: in-news/units/articles/articles_event_handler.php =================================================================== --- in-news/units/articles/articles_event_handler.php (revision 13268) +++ in-news/units/articles/articles_event_handler.php (working copy) @@ -512,4 +512,33 @@ } } } + + /** + * [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' => 'Perpage_NewsReviews', + 'ShortListPerPage' => 'Perpage_NewsReviews_Short', + 'DefaultSorting1Field' => 'News_SortReviews', + 'DefaultSorting2Field' => 'News_SortReviews2', + 'DefaultSorting1Dir' => 'News_SortReviewsOrder', + 'DefaultSorting2Dir' => 'News_SortReviewsOrder2', + + 'ReviewDelayInterval' => 'News_ReviewDelay_Interval', + 'ReviewDelayValue' => 'News_ReviewDelay_Value', + ); + + $this->Application->setUnitOption($event->MasterEvent->Prefix, 'Clones', $clones); + } + } } \ No newline at end of file