69 $this->logger =
$GLOBALS[
'DIC']->logger()->meta();
70 $this->db =
$GLOBALS[
'DIC']->database();
71 $this->entry_id = $a_entry_id;
89 $query =
"SELECT entry_id FROM il_md_cpr_selections ORDER BY is_default DESC, position ASC";
108 $ilDB = $DIC[
'ilDB'];
110 if (!
$entry_id = self::_extractEntryId($a_cp_string)) {
114 $query =
"SELECT title FROM il_md_cpr_selections " .
118 return $row->title ?
$row->title :
'';
134 $ilDB = $DIC[
'ilDB'];
136 if (!
$entry_id = self::_extractEntryId($a_cp_string)) {
140 $query =
"SELECT copyright FROM il_md_cpr_selections " .
144 return $row->copyright ?
$row->copyright :
'';
156 $db = $DIC->database();
158 $query =
'SELECT entry_id FROM il_md_cpr_selections ' .
159 'WHERE copyright = ' .
$db->quote($copyright_text,
'text');
162 return $row->entry_id;
178 if (!preg_match(
'/il_copyright_entry__([0-9]+)__([0-9]+)/', $a_cp_string, $matches)) {
181 if ($matches[1] != IL_INST_ID) {
184 return $matches[2] ? $matches[2] : 0;
217 $query =
"SELECT is_default FROM il_md_cpr_selections " .
218 "WHERE entry_id = " . $this->db->quote($this->entry_id,
'integer');
223 return $row[
'is_default'];
232 $this->outdated = (int) $a_value;
250 $db = $DIC->database();
252 $query =
"SELECT entry_id FROM il_md_cpr_selections " .
253 "WHERE is_default = " .
$db->quote(1,
'integer');
258 return $row[
'entry_id'];
270 $this->title = $a_title;
293 $this->description = $a_desc;
315 $this->copyright = $a_copyright;
337 $this->costs = $a_costs;
381 $this->copyright_and_other_restrictions = $a_status;
403 $this->order_position = (int) $a_position;
417 $query =
"SELECT count(entry_id) total FROM il_md_cpr_selections";
421 return $row[
'total'] + 1;
433 $ilDB = $DIC[
'ilDB'];
435 $next_id =
$ilDB->nextId(
'il_md_cpr_selections');
437 $ilDB->insert(
'il_md_cpr_selections', array(
438 'entry_id' => array(
'integer',$next_id),
439 'title' => array(
'text',$this->
getTitle()),
443 'costs' => array(
'integer',$this->
getCosts()),
447 $this->entry_id = $next_id;
461 $ilDB = $DIC[
'ilDB'];
463 $ilDB->update(
'il_md_cpr_selections', array(
464 'title' => array(
'text',$this->
getTitle()),
468 'costs' => array(
'integer',$this->
getCosts()),
470 'outdated' => array(
'integer',$this->
getOutdated()),
473 'entry_id' => array(
'integer',$this->
getEntryId())
484 public function delete()
488 $ilDB = $DIC[
'ilDB'];
490 $query =
"DELETE FROM il_md_cpr_selections " .
491 "WHERE entry_id = " . $this->db->quote($this->
getEntryId(),
'integer') .
" ";
521 $ilDB = $DIC[
'ilDB'];
523 $query =
"SELECT * FROM il_md_cpr_selections " .
524 "WHERE entry_id = " . $this->db->quote($this->entry_id,
'integer') .
" " .
525 "ORDER BY is_default DESC, position ASC ";
540 $query =
"SELECT count(meta_rights_id) used FROM il_meta_rights " .
541 "WHERE description = " .
$ilDB->quote(
'il_copyright_entry__' . IL_INST_ID .
'__' . $this->
getEntryId(),
'text');
545 $this->usage =
$row->used;
555 return 'il_copyright_entry__' . IL_INST_ID .
'__' . $a_entry_id;
getLanguage()
get language
static _getEntries()
get entries
setLanguage($a_lang_key)
set language
setCosts($a_costs)
set costs
setDescription($a_desc)
set description
getCopyrightAndOtherRestrictions()
get copyright and other restrictions
getCopyright()
get copyright
setCopyrightAndOtherRestrictions($a_status)
set copyright and other restrictions
setOrderPosition($a_position)
Set the order position in the table of copyrights.
static lookupCopyrightByText($copyright_text)
foreach($_POST as $key=> $value) $res
getOrderPosition()
Get the order position in the table of copyrights.
static _extractEntryId($a_cp_string)
extract entry id
__construct($a_entry_id)
Constructor.
static getDefault()
Get default.
static _lookupCopyright($a_cp_string)
lookup copyright by entry id
getDescription()
get description
static createIdentifier($a_entry_id)
Create identifier for entry id.
setTitle($a_title)
set title
setOutdated($a_value)
Set copyright element as outdated and not usable anymore.
static lookupCopyyrightTitle($a_cp_string)
Lookup copyright title.
getIsDefault()
Get if the entry is default No setter for this.
$copyright_and_other_restrictions
setCopyright($a_copyright)
set copyright
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.