2 require_once(
'./Modules/Bibliographic/classes/class.ilBiblOverviewGUI.php');
65 if (! isset(self::$instances[
$entry_id])) {
89 $this->
setEntryId($ilDB->nextID(
'il_bibl_entry'));
91 $ilDB->manipulate(
"INSERT INTO il_bibl_entry " .
"(data_id, id, type) VALUES (" . $ilDB->quote($this->getBibliographicObjId(),
"integer")
93 $ilDB->quote($this->getEntryId(),
"integer") .
"," .
94 $ilDB->quote($this->getType(),
"text") .
99 $id = $ilDB->nextID(
'il_bibl_attribute');
100 $ilDB->manipulate(
"INSERT INTO il_bibl_attribute " .
"(entry_id, name, value, id) VALUES (" . $ilDB->quote($this->getEntryId(),
"integer")
102 $ilDB->quote($attribute[
'name'],
"text") .
"," .
103 $ilDB->quote($attribute[
'value'],
"text") .
"," .
104 $ilDB->quote($id,
"integer") .
113 $set = $ilDB->query(
"SELECT * FROM il_bibl_entry " .
" WHERE id = " . $ilDB->quote($this->getEntryId(),
"integer"));
114 while ($rec = $ilDB->fetchAssoc($set)) {
125 $ilDB->manipulate($up =
"UPDATE il_bibl_entry SET " .
" type = " . $ilDB->quote($this->getType(),
"integer") .
126 " WHERE id = " . $ilDB->quote($this->getEntryId(),
"integer"));
129 $ilDB->manipulate($up =
"UPDATE il_bibl_attribute SET " .
" name = " . $ilDB->quote($attribute[
'name'],
"integer") .
"," .
130 " value = " . $ilDB->quote($attribute[
'value'],
"integer") .
"," .
131 " WHERE id = " . $ilDB->quote($attribute[
'id'],
"integer"));
139 $this->deleteOptions();
140 $ilDB->manipulate(
"DELETE FROM il_bibl_entry WHERE id = " . $ilDB->quote($this->getEntryId(),
"integer"));
141 $ilDB->manipulate(
"DELETE FROM il_bibl_attribute WHERE entry_id = " . $ilDB->quote($this->getEntryId(),
"integer"));
152 $all_attributes = array();
154 $set = $ilDB->query(
"SELECT * FROM il_bibl_attribute " .
" WHERE entry_id = " . $ilDB->quote($this->getEntryId(),
"integer"));
155 while ($rec = $ilDB->fetchAssoc($set)) {
156 $all_attributes[$rec[
'name']] = $rec[
'value'];
158 if ($this->file_type ==
"ris") {
164 $parsed_attributes = array();
165 foreach ($all_attributes as $key => $value) {
168 $value = preg_replace(
'!(http)(s)?:\/\/[a-zA-Z0-9.?&_/\-~\!\'\*()+,:;@=$#\[\]%]+!',
"<a href=\"\\0\" target=\"_blank\" rel=\"noopener\">\\0</a>", $value);
169 $parsed_attributes[strtolower($this->file_type .
'_' .
$type .
'_' . $key)] = $value;
172 return $parsed_attributes;
288 $set = $ilDB->query(
"SELECT id FROM il_bibl_entry " .
" WHERE data_id = " . $ilDB->quote($object_id,
"integer"));
289 while ($rec = $ilDB->fetchAssoc($set)) {
290 $entries[][
'entry_id'] = $rec[
'id'];
__construct($file_type, $entry_id=NULL)
static getInstance($file_type, $entry_id=NULL)
setAttributes($attributes)
static getAllEntries($object_id)
Read all entries from the database.
loadAttributes()
Reads all the entrys attributes from database.
Class ilBibliographicEntry.
setBibliographicObjId($bibliographic_obj_id)