/** * Check whether limit is not exceeded */ protected function exceededLimit($a_type) { global $ilSetting, $ilCtrl; if ($this->check_nr_limit[$a_type]) { if (!$this->getRepositoryMode()) { include_once "./Services/Block/classes/class.ilCustomBlock.php"; $costum_block = new ilCustomBlock(); $costum_block->setContextObjId($ilCtrl->getContextObjId()); $costum_block->setContextObjType($ilCtrl->getContextObjType()); $costum_block->setType($a_type); $res = $costum_block->queryCntBlockForContext(); $cnt = (int) $res[0]["cnt"]; } else { return false; // not implemented for repository yet } if ($ilSetting->get("block_limit_" . $a_type) > $cnt) { return false; } else { return true; } } return false; }