Index: branches/5.0.x/units/topics/topics_config.php =================================================================== diff -u -r13237 -r13285 --- branches/5.0.x/units/topics/topics_config.php (.../topics_config.php) (revision 13237) +++ branches/5.0.x/units/topics/topics_config.php (.../topics_config.php) (revision 13285) @@ -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' => '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: branches/5.0.x/units/topics/topics_event_handler.php =================================================================== diff -u -r12916 -r13285 --- branches/5.0.x/units/topics/topics_event_handler.php (.../topics_event_handler.php) (revision 12916) +++ branches/5.0.x/units/topics/topics_event_handler.php (.../topics_event_handler.php) (revision 13285) @@ -1,6 +1,6 @@ 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