/** * @param $ref int the reference id of the datacollection object to check. * * @deprecated * @return bool whether or not the current user has admin/write access to the referenced datacollection */ public static function _hasWriteAccess($ref) { return ilObjDataCollectionAccess::_hasWriteAccess($ref); }
/** * @param $found * * @return string */ public function doExtReplace($found) { $ref_rec_ids = $this->record_obj->getRecordFieldValue($this->currentField->getId()); if (!is_array($ref_rec_ids)) { $ref_rec_ids = array($ref_rec_ids); } if (!count($ref_rec_ids) || !$ref_rec_ids) { return; } $ref_recs = array(); foreach ($ref_rec_ids as $ref_rec_id) { $ref_recs[] = ilDataCollectionCache::getRecordCache($ref_rec_id); } $field = $ref_recs[0]->getTable()->getFieldByTitle($found[1]); $tpl = new ilTemplate("tpl.reference_list.html", true, true, "Modules/DataCollection"); $tpl->setCurrentBlock("reference_list"); if (!$field) { if (ilObjDataCollectionAccess::_hasWriteAccess($this->dcl_gui_object->ref_id)) { ilUtil::sendInfo("Bad Viewdefinition at [ext tableOf=\"" . $found[1] . "\" ...]", true); } return; } foreach ($ref_recs as $ref_record) { $tpl->setCurrentBlock("reference"); $tpl->setVariable("CONTENT", $ref_record->getRecordFieldHTML($field->getId())); $tpl->parseCurrentBlock(); } //$ref_rec->getRecordFieldHTML($field->getId()) if ($field) { return $tpl->get(); } }
/** * @param int $ref_id *y * * @return bool */ public function hasPermissionToAddRecord($ref_id) { return $this->getAddPerm() and ilObjDataCollectionAccess::_hasReadAccess($ref_id) and $this->checkLimit() or ilObjDataCollectionAccess::_hasWriteAccess($ref_id); }