Index: branches/unlabeled/unlabeled-1.64.2/core/units/general/cat_event_handler.php =================================================================== diff -u -N -r5602 -r5609 --- branches/unlabeled/unlabeled-1.64.2/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 5602) +++ branches/unlabeled/unlabeled-1.64.2/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 5609) @@ -48,32 +48,39 @@ return parent::CheckPermission($event); } + /** + * Add selected items to clipboard with mode = COPY (CLONE) + * + * @param kEvent $event + */ function OnCopy(&$event) { - $object = $event->getObject(); - $this->StoreSelectedIDs($event); - $ids = $this->getSelectedIDs($event); - $this->Application->StoreVar($event->getPrefixSpecial().'_clipboard', implode(',', $ids)); - $this->Application->StoreVar($event->getPrefixSpecial().'_clipboard_mode', 'copy'); - -// $this->Application->StoreVar('ClipBoard', 'COPY-0.'.$object->TableName.'.ResourceId=0'); - $event->redirect_params = Array('opener' => 's', 'pass_events'=>true); //do not go up - STAY + $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) { - $object = $event->getObject(); - $ids = $this->StoreSelectedIDs($event); - $this->Application->StoreVar($event->getPrefixSpecial().'_clipboard', implode(',', $ids)); - $this->Application->StoreVar($event->getPrefixSpecial().'_clipboard_mode', 'cut'); - -// $this->Application->StoreVar('ClipBoard', 'CUT-0.'.$object->TableName.'.ResourceId=0'); - $event->redirect_params = Array('opener' => 's', 'pass_events'=>true); //do not go up - STAY + $clipboard_helper =& $this->Application->recallObject('ClipboardHelper'); + $clipboard_helper->setClipboard($event, 'cut', $this->StoreSelectedIDs($event)); } + /** + * Performs category item paste + * + * @param kEvent $event + */ function OnPaste(&$event) { - $ids = $this->Application->RecallVar($event->getPrefixSpecial().'_clipboard'); + echo 'pasting categories'; + $event->redirect = false; // for debugging + + /*$ids = $this->Application->RecallVar($event->getPrefixSpecial().'_clipboard'); if ($ids == '') { $event->redirect = false; return; @@ -96,15 +103,15 @@ $object->MoveToCat(); } } - $event->status = erSUCCESS; + $event->status = erSUCCESS;*/ } /** * Occurs when pasting category * * @param kEvent $event */ - function OnCatPaste(&$event) + /*function OnCatPaste(&$event) { $inp_clipboard = $this->Application->RecallVar('ClipBoard'); $inp_clipboard = explode('-', $inp_clipboard, 2); @@ -135,7 +142,7 @@ $this->Application->SetVar('m_cat_id', $saved_cat_id); } - } + }*/ /** * Return type clauses for list bulding on front