コード例 #1
0
 protected function handleQuotaUpdate()
 {
     include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
     ilDiskQuotaHandler::handleUpdatedSourceObject($this->getType(), $this->getId(), ilUtil::dirsize($this->initStorage($this->getId())), array($this->getId()), true);
 }
コード例 #2
0
 protected static function handleQuotaUpdate(ilObjMediaObject $a_mob)
 {
     global $ilSetting;
     // if neither workspace nor portfolios are activated, we skip
     // the quota update here. this due to performance reasons on installations
     // that do not use workspace/portfolios, but heavily copy content.
     // in extreme cases (media object in pool and personal blog, deactivate workspace, change media object,
     // this may lead to incorrect data in the quota calculation)
     if ($ilSetting->get("disable_personal_workspace") && !$ilSetting->get('user_portfolios')) {
         return;
     }
     $parent_obj_ids = array();
     foreach ($a_mob->getUsages() as $item) {
         $parent_obj_id = $a_mob->getParentObjectIdForUsage($item);
         if ($parent_obj_id && !in_array($parent_obj_id, $parent_obj_ids)) {
             $parent_obj_ids[] = $parent_obj_id;
         }
     }
     // we could suppress this if object is present in a (repository) media pool
     // but this would lead to "quota-breaches" when the pool item is deleted
     // and "suddenly" all workspace owners get filesize added to their
     // respective quotas, regardless of current status
     include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
     ilDiskQuotaHandler::handleUpdatedSourceObject($a_mob->getType(), $a_mob->getId(), ilUtil::dirSize($a_mob->getDataDirectory()), $parent_obj_ids);
 }
コード例 #3
0
 protected static function handleQuotaUpdate(ilObjMediaObject $a_mob)
 {
     $parent_obj_ids = array();
     foreach ($a_mob->getUsages() as $item) {
         $parent_obj_id = $a_mob->getParentObjectIdForUsage($item);
         if ($parent_obj_id && !in_array($parent_obj_id, $parent_obj_ids)) {
             $parent_obj_ids[] = $parent_obj_id;
         }
     }
     // we could suppress this if object is present in a (repository) media pool
     // but this would lead to "quota-breaches" when the pool item is deleted
     // and "suddenly" all workspace owners get filesize added to their
     // respective quotas, regardless of current status
     include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
     ilDiskQuotaHandler::handleUpdatedSourceObject($a_mob->getType(), $a_mob->getId(), ilUtil::dirSize($a_mob->getDataDirectory()), $parent_obj_ids);
 }
コード例 #4
0
ファイル: class.ilObjFile.php プロジェクト: arlendotcn/ilias
 protected static function handleQuotaUpdate(ilObjFile $a_file)
 {
     include_once "Services/MediaObjects/classes/class.ilObjMediaObject.php";
     $mob = new ilObjMediaObject();
     // file itself could be workspace item
     $parent_obj_ids = array($a_file->getId());
     foreach ($a_file->getUsages() as $item) {
         $parent_obj_id = $mob->getParentObjectIdForUsage($item);
         if ($parent_obj_id && !in_array($parent_obj_id, $parent_obj_ids)) {
             $parent_obj_ids[] = $parent_obj_id;
         }
     }
     include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
     ilDiskQuotaHandler::handleUpdatedSourceObject($a_file->getType(), $a_file->getId(), $a_file->getDiskUsage(), $parent_obj_ids);
 }