2 require_once(
'./Modules/Bibliographic/classes/class.ilBiblOverviewGUI.php');
65 if (!isset(self::$instances[
$entry_id])) {
79 public static function exists(
$entry_id, $obj_id) {
80 $q =
"SELECT * FROM il_bibl_entry WHERE id = %s AND data_id = %s";
88 return (
$r->numRows() > 0);
107 $ilDB = $DIC[
'ilDB'];
111 $ilDB->manipulate(
"INSERT INTO il_bibl_entry " .
"(data_id, id, type) VALUES (" .
$ilDB->quote($this->getBibliographicObjId(),
"integer")
113 $ilDB->quote($this->getEntryId(),
"integer") .
"," .
114 $ilDB->quote($this->getType(),
"text") .
119 $id =
$ilDB->nextID(
'il_bibl_attribute');
120 $ilDB->manipulate(
"INSERT INTO il_bibl_attribute " .
"(entry_id, name, value, id) VALUES (" .
$ilDB->quote($this->getEntryId(),
"integer")
122 $ilDB->quote($attribute[
'name'],
"text") .
"," .
123 $ilDB->quote($attribute[
'value'],
"text") .
"," .
124 $ilDB->quote($id,
"integer") .
132 $ilDB = $DIC[
'ilDB'];
134 $set =
$ilDB->query(
"SELECT * FROM il_bibl_entry " .
" WHERE id = " .
$ilDB->quote($this->getEntryId(),
"integer"));
135 while ($rec =
$ilDB->fetchAssoc($set)) {
145 $ilDB = $DIC[
'ilDB'];
147 $ilDB->manipulate($up =
"UPDATE il_bibl_entry SET " .
" type = " .
$ilDB->quote($this->getType(),
"integer") .
148 " WHERE id = " .
$ilDB->quote($this->getEntryId(),
"integer"));
151 $ilDB->manipulate($up =
"UPDATE il_bibl_attribute SET " .
" name = " .
$ilDB->quote($attribute[
'name'],
"integer") .
"," .
152 " value = " .
$ilDB->quote($attribute[
'value'],
"integer") .
"," .
153 " WHERE id = " .
$ilDB->quote($attribute[
'id'],
"integer"));
160 $ilDB = $DIC[
'ilDB'];
162 $this->deleteOptions();
163 $ilDB->manipulate(
"DELETE FROM il_bibl_entry WHERE id = " .
$ilDB->quote($this->getEntryId(),
"integer"));
164 $ilDB->manipulate(
"DELETE FROM il_bibl_attribute WHERE entry_id = " .
$ilDB->quote($this->getEntryId(),
"integer"));
175 $ilDB = $DIC[
'ilDB'];
176 $all_attributes =
array();
178 $set =
$ilDB->query(
"SELECT * FROM il_bibl_attribute " .
" WHERE entry_id = " .
$ilDB->quote($this->getEntryId(),
"integer"));
179 while ($rec =
$ilDB->fetchAssoc($set)) {
180 $all_attributes[$rec[
'name']] = $rec[
'value'];
182 if ($this->file_type ==
"ris") {
188 $parsed_attributes =
array();
189 foreach ($all_attributes as $key => $value) {
192 $value = preg_replace(
'!(http)(s)?:\/\/[a-zA-Z0-9.?&_/\-~\!\'\*()+,:;@=$#\[\]%]+!',
"<a href=\"\\0\" target=\"_blank\" rel=\"noopener\">\\0</a>", $value);
193 $parsed_attributes[strtolower($this->file_type .
'_' .
$type .
'_' . $key)] = $value;
196 return $parsed_attributes;
311 $ilDB = $DIC[
'ilDB'];
313 $set =
$ilDB->query(
"SELECT id FROM il_bibl_entry " .
" WHERE data_id = " .
$ilDB->quote($object_id,
"integer"));
314 while ($rec =
$ilDB->fetchAssoc($set)) {
315 $entries[][
'entry_id'] = $rec[
'id'];
setAttributes($attributes)
static getAllEntries($object_id)
Read all entries from the database.
static getInstance($file_type, $entry_id=null)
Create styles array
The data for the language used.
loadAttributes()
Reads all the entrys attributes from database.
Class ilBibliographicEntry.
__construct($file_type, $entry_id=null)
setBibliographicObjId($bibliographic_obj_id)