function beforeDeleteItem(&$folder)
 {
     if ($folder->otherValues[REPOFIELDOBJECTTYPE] != '') {
         if ($folder->otherValues[REPOFIELDIDRESOURCE] != 0) {
             $lo = createLO($folder->otherValues[REPOFIELDOBJECTTYPE]);
             $ret = $lo->del($folder->otherValues[REPOFIELDIDRESOURCE]);
             return $ret;
         } else {
             return TRUE;
         }
     }
     return parent::beforeDeleteItem($folder);
 }
Esempio n. 2
0
 function beforeDeleteItem(&$folder)
 {
     if ($folder->otherValues[REPOFIELDOBJECTTYPE] != '') {
         if ($folder->otherValues[REPOFIELDIDRESOURCE] != 0) {
             $lo = createLO($folder->otherValues[REPOFIELDOBJECTTYPE]);
             // delete categorized resource
             require_once _lms_ . '/lib/lib.kbres.php';
             $kbres = new KbRes();
             $kbres->deleteResourceFromItem($folder->otherValues[REPOFIELDIDRESOURCE], $folder->otherValues[REPOFIELDOBJECTTYPE], 'course_lo');
             // ---------------------------
             $ret = $lo->del($folder->otherValues[REPOFIELDIDRESOURCE]);
             return $ret;
         } else {
             return TRUE;
         }
     }
     return parent::beforeDeleteItem($folder);
 }