Index: trunk/core/units/general/cat_event_handler.php =================================================================== diff -u -r2041 -r2596 --- trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 2041) +++ trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 2596) @@ -4,48 +4,48 @@ $application->Factory->includeClassFile('kDBEventHandler'); class kCatDBEventHandler extends InpDBEventHandler { - + 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 } - + function OnCut(&$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', '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 } - + function OnPaste(&$event) { $ids = $this->Application->RecallVar($event->getPrefixSpecial().'_clipboard'); if ($ids == '') { $event->redirect = false; return; } - + //recalling by different name, because we may get kDBList, if we recall just by prefix $object =& $this->Application->recallObject($event->getPrefixSpecial().'.item', $event->Prefix); $this->prepareObject($object, $event); - + if ($this->Application->RecallVar($event->getPrefixSpecial().'_clipboard_mode') == 'copy') { $ids_arr = explode(',', $ids); - + $temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - + if($ids_arr) { $temp->CloneItems($event->Prefix, $event->Special, $ids_arr); @@ -60,7 +60,7 @@ } $event->status = erSUCCESS; } - + /** * Occurs when pasting category * @@ -70,7 +70,7 @@ { $inp_clipboard = $this->Application->RecallVar('ClipBoard'); $inp_clipboard = explode('-', $inp_clipboard, 2); - + if($inp_clipboard[0] == 'COPY') { $saved_cat_id = $this->Application->GetVar('m_cat_id'); @@ -100,7 +100,7 @@ $this->Application->SetVar('m_cat_id', $saved_cat_id); } } - + /** * Apply scope clause * @@ -109,7 +109,7 @@ function SetCustomQuery(&$event) { $object =& $event->getObject(); - + if ($event->Special != 'showall') { if ( $event->getEventParam('parent_cat_id') ) { $parent_cat_id = $event->getEventParam('parent_cat_id'); @@ -123,7 +123,7 @@ $parent_cat_id = 0; } } - + if ((string) $parent_cat_id != 'any') { if ($event->getEventParam('recursive')) { $current_path = $this->Conn->GetOne('SELECT ParentPath FROM '.TABLE_PREFIX.'Category WHERE CategoryId='.$parent_cat_id); @@ -138,7 +138,7 @@ else { $object->addFilter('primary_filter', 'PrimaryCat = 1'); } - + $view_perm = 1; $object->addFilter('perm_filter', 'perm.PermId = '.$view_perm); if (!defined('ADMIN')) { @@ -149,18 +149,18 @@ $view_filter = implode(' OR ', $view_filters); $object->addFilter('perm_filter2', $view_filter); } - + if (!defined('ADMIN')) { $object->addFilter('status_filter', $object->TableName.'.Status = 1'); } - + /*$list_type = $event->getEventParam('ListType'); switch($list_type) { case 'favorites': $fav_table = $this->Application->getUnitOption('fav','TableName'); $user_id =& $this->Application->GetVar('u_id'); - + $sql = 'SELECT DISTINCT f.ResourceId FROM '.$fav_table.' f LEFT JOIN '.$object->TableName.' p ON p.ResourceId = f.ResourceId