Index: branches/unlabeled/unlabeled-1.64.2/kernel/units/general/cat_event_handler.php =================================================================== diff -u -r5610 -r5620 --- branches/unlabeled/unlabeled-1.64.2/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 5610) +++ branches/unlabeled/unlabeled-1.64.2/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 5620) @@ -77,6 +77,10 @@ */ function OnPaste(&$event) { + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + return; + } + $clipboard_data = $event->getEventParam('clipboard_data'); if (!$clipboard_data['cut'] && !$clipboard_data['copy']) { Index: branches/unlabeled/unlabeled-1.15.2/kernel/admin_templates/xml/categories_list.tpl =================================================================== diff -u -r5609 -r5620 --- branches/unlabeled/unlabeled-1.15.2/kernel/admin_templates/xml/categories_list.tpl (.../categories_list.tpl) (revision 5609) +++ branches/unlabeled/unlabeled-1.15.2/kernel/admin_templates/xml/categories_list.tpl (.../categories_list.tpl) (revision 5620) @@ -48,7 +48,7 @@
-
_"> + _" width="50%"> " id=""> ">  );">: Index: branches/unlabeled/unlabeled-1.22.2/core/units/categories/categories_event_handler.php =================================================================== diff -u -r5618 -r5620 --- branches/unlabeled/unlabeled-1.22.2/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 5618) +++ branches/unlabeled/unlabeled-1.22.2/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 5620) @@ -372,9 +372,19 @@ */ function OnPaste(&$event) { - echo 'performs category paste'; - $event->redirect = false; + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + return; + } + + + if ($ids) { + $recursive_helper =& $this->Application->recallObject('RecursiveHelper'); + foreach ($ids as $id) { + $recursive_helper->DeleteCategory($id); + } + } + $this->clearSelectedIDs($event); /*$ids = $this->Application->RecallVar($event->getPrefixSpecial().'_clipboard'); if ($ids == '') { Index: branches/unlabeled/unlabeled-1.15.2/core/admin_templates/categories/xml/categories_list.tpl =================================================================== diff -u -r5609 -r5620 --- branches/unlabeled/unlabeled-1.15.2/core/admin_templates/categories/xml/categories_list.tpl (.../categories_list.tpl) (revision 5609) +++ branches/unlabeled/unlabeled-1.15.2/core/admin_templates/categories/xml/categories_list.tpl (.../categories_list.tpl) (revision 5620) @@ -48,7 +48,7 @@
-
_"> + _" width="50%"> " id=""> ">  );">: Index: branches/unlabeled/unlabeled-1.64.2/core/units/general/cat_event_handler.php =================================================================== diff -u -r5610 -r5620 --- branches/unlabeled/unlabeled-1.64.2/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 5610) +++ branches/unlabeled/unlabeled-1.64.2/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 5620) @@ -77,6 +77,10 @@ */ function OnPaste(&$event) { + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + return; + } + $clipboard_data = $event->getEventParam('clipboard_data'); if (!$clipboard_data['cut'] && !$clipboard_data['copy']) { Index: branches/unlabeled/unlabeled-1.2.2/core/units/general/helpers/recursive_helper.php =================================================================== diff -u -r5594 -r5620 --- branches/unlabeled/unlabeled-1.2.2/core/units/general/helpers/recursive_helper.php (.../recursive_helper.php) (revision 5594) +++ branches/unlabeled/unlabeled-1.2.2/core/units/general/helpers/recursive_helper.php (.../recursive_helper.php) (revision 5620) @@ -73,6 +73,27 @@ WHERE ResourceId IN ('.implode(',', $resource_ids).')'; return $this->Conn->GetCol($sql); } + + // moves selected categories to destination category + function MoveCategory($category_ids, $dest_category_id) + { + if (!$category_ids) return ; + + $id_field = $this->Application->getUnitOption('c', 'IDField'); + $table_name = $this->Application->getUnitOption('c', 'TableName'); + + $sql = 'UPDATE '.$table_name.' + SET ParentId = '.$dest_category_id.' + WHERE '.$id_field.' IN ('.$category_ids.')'; + $this->Conn->Query($sql); + + $this->Application->StoreVar('PermCache_UpdateRequired', 1); + } + + function PasteCategory($category_id) + { + // mode == cut -> just update ParentId of category, items aren't changed, because category_id stays the same + } } ?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.2.2/kernel/units/general/helpers/recursive_helper.php =================================================================== diff -u -r5594 -r5620 --- branches/unlabeled/unlabeled-1.2.2/kernel/units/general/helpers/recursive_helper.php (.../recursive_helper.php) (revision 5594) +++ branches/unlabeled/unlabeled-1.2.2/kernel/units/general/helpers/recursive_helper.php (.../recursive_helper.php) (revision 5620) @@ -73,6 +73,27 @@ WHERE ResourceId IN ('.implode(',', $resource_ids).')'; return $this->Conn->GetCol($sql); } + + // moves selected categories to destination category + function MoveCategory($category_ids, $dest_category_id) + { + if (!$category_ids) return ; + + $id_field = $this->Application->getUnitOption('c', 'IDField'); + $table_name = $this->Application->getUnitOption('c', 'TableName'); + + $sql = 'UPDATE '.$table_name.' + SET ParentId = '.$dest_category_id.' + WHERE '.$id_field.' IN ('.$category_ids.')'; + $this->Conn->Query($sql); + + $this->Application->StoreVar('PermCache_UpdateRequired', 1); + } + + function PasteCategory($category_id) + { + // mode == cut -> just update ParentId of category, items aren't changed, because category_id stays the same + } } ?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.22.2/kernel/units/categories/categories_event_handler.php =================================================================== diff -u -r5618 -r5620 --- branches/unlabeled/unlabeled-1.22.2/kernel/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 5618) +++ branches/unlabeled/unlabeled-1.22.2/kernel/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 5620) @@ -372,9 +372,19 @@ */ function OnPaste(&$event) { - echo 'performs category paste'; - $event->redirect = false; + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + return; + } + + + if ($ids) { + $recursive_helper =& $this->Application->recallObject('RecursiveHelper'); + foreach ($ids as $id) { + $recursive_helper->DeleteCategory($id); + } + } + $this->clearSelectedIDs($event); /*$ids = $this->Application->RecallVar($event->getPrefixSpecial().'_clipboard'); if ($ids == '') {