Index: branches/unlabeled/unlabeled-1.22.2/core/units/categories/categories_event_handler.php =================================================================== diff -u -N -r5517 -r5609 --- branches/unlabeled/unlabeled-1.22.2/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 5517) +++ branches/unlabeled/unlabeled-1.22.2/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 5609) @@ -317,6 +317,78 @@ } $this->clearSelectedIDs($event); } + + /** + * Add selected items to clipboard with mode = COPY (CLONE) + * + * @param kEvent $event + */ + function OnCopy(&$event) + { + $clipboard_helper =& $this->Application->recallObject('ClipboardHelper'); + $clipboard_helper->setClipboard($event, 'copy', $this->StoreSelectedIDs($event)); + } + + /** + * Add selected items to clipboard with mode = CUT + * + * @param kEvent $event + */ + function OnCut(&$event) + { + $clipboard_helper =& $this->Application->recallObject('ClipboardHelper'); + $clipboard_helper->setClipboard($event, 'cut', $this->StoreSelectedIDs($event)); + } + + /** + * Paste categories with subitems from clipboard + * + * @param kEvent $event + */ + function OnPaste(&$event) + { + echo 'performs category paste'; + $event->redirect = false; + + +// $clipboard_prefix = $this->Application->RecallVar('clipboard_prefix'); + + + /*$ids = $this->Application->RecallVar($event->getPrefixSpecial().'_clipboard'); + if ($ids == '') { + $event->redirect = false; + return; + } + + $ids_arr = explode(',', $ids); + + if ($this->Application->RecallVar($event->getPrefixSpecial().'_clipboard_mode') == 'copy') { + $temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); + + if ($ids_arr) { + $temp->CloneItems($event->Prefix, $event->Special, $ids_arr); + } + } + else { // mode == cut + $object =& $this->Application->recallObject($event->getPrefixSpecial().'.item', $event->Prefix, Array('skip_autoload' => true)); + + foreach ($ids_arr as $id) { + $object->Load($id); + $object->MoveToCat(); + } + } + $event->status = erSUCCESS;*/ + } + + /** + * Cleares clipboard content + * + * @param kEvent $event + */ + function OnClearClipboard(&$event) + { + $this->Application->RemoveVar('clipboard'); + } } ?> \ No newline at end of file