31 include_once
'class.ilMDBase.php';
44 $db = $DIC->database();
46 $query =
'SELECT rbac_id FROM il_meta_rights ' .
47 'WHERE ' . $db->in(
'obj_type', $a_types,
false,
'text') .
' ' .
48 'AND ' . $db->in(
'description', $a_copyright,
false,
'text');
55 $obj_ids[] =
$row->rbac_id;
68 $this->costs = $a_costs;
84 $this->caor = $a_caor;
97 $this->description = $a_description;
105 if (is_object($lng_obj)) {
106 $this->description_language = $lng_obj;
111 return is_object($this->description_language) ? $this->description_language :
false;
115 return is_object($this->description_language) ? $this->description_language->getLanguageCode() :
false;
122 $ilDB = $DIC[
'ilDB'];
125 $fields[
'meta_rights_id'] = array(
'integer',$next_id =
$ilDB->nextId(
'il_meta_rights'));
127 if ($this->db->insert(
'il_meta_rights', $fields)) {
138 $ilDB = $DIC[
'ilDB'];
141 if ($this->db->update(
143 $this->__getFields(),
144 array(
"meta_rights_id" => array(
'integer',$this->
getMetaId()))
152 public function delete()
156 $ilDB = $DIC[
'ilDB'];
159 $query =
"DELETE FROM il_meta_rights " .
160 "WHERE meta_rights_id = " .
$ilDB->quote($this->
getMetaId(),
'integer');
172 return array(
'rbac_id' => array(
'integer',$this->
getRBACId()),
173 'obj_id' => array(
'integer',$this->
getObjId()),
174 'obj_type' => array(
'text',$this->
getObjType()),
175 'costs' => array(
'text',$this->
getCosts()),
185 $ilDB = $DIC[
'ilDB'];
187 include_once
'Services/MetaData/classes/class.ilMDLanguageItem.php';
191 $query =
"SELECT * FROM il_meta_rights " .
192 "WHERE meta_rights_id = " .
$ilDB->quote($this->
getMetaId(),
'integer');
217 $writer->xmlStartTag(
'Rights', array(
'Cost' => $this->
getCosts()
223 include_once
'./Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php';
233 $writer->xmlEndTag(
'Rights');
262 $ilDB = $DIC[
'ilDB'];
264 $query =
"SELECT description FROM il_meta_rights " .
265 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
266 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" ";
269 return $row->description ?
$row->description :
'';
273 public static function _getId($a_rbac_id, $a_obj_id)
277 $ilDB = $DIC[
'ilDB'];
279 $query =
"SELECT meta_rights_id FROM il_meta_rights " .
280 "WHERE rbac_id = " .
$ilDB->quote($a_rbac_id,
'integer') .
" " .
281 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
285 return $row->meta_rights_id;
static _getId($a_rbac_id, $a_obj_id)
getDescriptionLanguageCode()
& getDescriptionLanguage()
setDescriptionLanguage(&$lng_obj)
static _lookupDescription($a_rbac_id, $a_obj_id)
Lookup description (copyright)
parseDescriptionFromImport($a_description)
static lookupCopyrightByText($copyright_text)
setMetaId($a_meta_id, $a_read_data=true)
foreach($_POST as $key=> $value) $res
setCopyrightAndOtherRestrictions($a_caor)
getCopyrightAndOtherRestrictions()
static _lookupCopyright($a_cp_string)
lookup copyright by entry id
static createIdentifier($a_entry_id)
Create identifier for entry id.
setDescription($a_description)
static getLogger($a_component_id)
Get component logger.
static lookupRightsByTypeAndCopyright(array $a_types, array $a_copyright)