Пример #1
0
     break;
 case 'deleteEntrymask':
     $entrymask = $this->params['objectID'];
     $confirmed = $this->params['confirmed'];
     $positive = $this->params['positive'];
     $winID = $this->params['wid'];
     // Check if entrymask is still used
     $contentblockIds = sCblockMgr()->getCblockLinkByEntrymaskId($entrymask);
     if (count($contentblockIds) > 0) {
         // Still used!
         if ($confirmed != 'true') {
             $parameters = array('objectID' => $entrymask, 'wid' => $winID);
             $koala->callJSFunction('Koala.yg_confirm', $itext['TXT_DELETE_USED_ENTRYMASK_TITLE'] != '' ? $itext['TXT_DELETE_USED_ENTRYMASK_TITLE'] : '$TXT_DELETE_USED_ENTRYMASK_TITLE', $itext['TXT_DELETE_USED_ENTRYMASK'] != '' ? $itext['TXT_DELETE_USED_ENTRYMASK'] : '$TXT_DELETE_USED_ENTRYMASK', $action, json_encode($parameters));
         } else {
             if ($confirmed == 'true' && $positive == 'true') {
                 $successfullyDeleted = $entrymaskMgr->remove($entrymask);
                 if (in_array($entrymask, $successfullyDeleted)) {
                     foreach ($successfullyDeleted as $successfullyDeletedItem) {
                         $jsQueue->add($successfullyDeletedItem, HISTORYTYPE_ENTRYMASK, 'OBJECT_DELETE', sGuiUS(), 'entrymask', NULL, NULL, $successfullyDeletedItem . '-entrymask', 'name');
                         $koala->queueScript('$(Koala.windows[\'wid_' . $winID . '\'].boundWindow).addClassName(\'boxghost\');');
                         $koala->queueScript('Koala.windows[Koala.windows[\'wid_' . $winID . '\'].boundWindow].init();');
                     }
                 } else {
                     $koala->alert($itext['TXT_ERROR_ACCESS_DENIED']);
                 }
             }
         }
     } else {
         // Not used, delete entrymask
         $successfullyDeleted = $entrymaskMgr->remove($entrymask);
         if (in_array($entrymask, $successfullyDeleted)) {