61 if (!isset(self::$instances[
$entry_id])) {
90 $this->
setEntryId($ilDB->nextID(
'il_bibl_entry'));
92 $ilDB->manipulate(
"INSERT INTO il_bibl_entry " .
"(data_id, id, type) VALUES (" . $ilDB->quote($this->getBibliographicObjId(),
"integer")
94 $ilDB->quote($this->getEntryId(),
"integer") .
"," .
95 $ilDB->quote($this->getType(),
"text") .
100 $id = $ilDB->nextID(
'il_bibl_attribute');
101 $ilDB->manipulate(
"INSERT INTO il_bibl_attribute " .
"(entry_id, name, value, id) VALUES (" . $ilDB->quote($this->getEntryId(),
"integer")
103 $ilDB->quote($attribute[
'name'],
"text") .
"," .
104 $ilDB->quote($attribute[
'value'],
"text") .
"," .
105 $ilDB->quote($id,
"integer") .
117 $set = $ilDB->query(
"SELECT * FROM il_bibl_entry " .
" WHERE id = " . $ilDB->quote($this->getEntryId(),
"integer"));
118 while ($rec = $ilDB->fetchAssoc($set)) {
132 $ilDB->manipulate($up =
"UPDATE il_bibl_entry SET " .
" type = " . $ilDB->quote($this->getType(),
"integer") .
133 " WHERE id = " . $ilDB->quote($this->getEntryId(),
"integer"));
136 $ilDB->manipulate($up =
"UPDATE il_bibl_attribute SET " .
" name = " . $ilDB->quote($attribute[
'name'],
"integer") .
"," .
137 " value = " . $ilDB->quote($attribute[
'value'],
"integer") .
"," .
138 " WHERE id = " . $ilDB->quote($attribute[
'id'],
"integer"));
149 $this->deleteOptions();
150 $ilDB->manipulate(
"DELETE FROM il_bibl_entry WHERE id = " . $ilDB->quote($this->getEntryId(),
"integer"));
151 $ilDB->manipulate(
"DELETE FROM il_bibl_attribute WHERE entry_id = " . $ilDB->quote($this->getEntryId(),
"integer"));
162 $all_attributes = array();
164 $set = $ilDB->query(
"SELECT * FROM il_bibl_attribute " .
" WHERE entry_id = " . $ilDB->quote($this->getEntryId(),
"integer"));
165 while ($rec = $ilDB->fetchAssoc($set)) {
166 $all_attributes[$rec[
'name']] = $rec[
'value'];
168 if ($this->file_type ==
"ris") {
174 $parsed_attributes = array();
175 foreach ($all_attributes as $key => $value) {
178 $value = preg_replace(
'!(http)(s)?:\/\/[a-zA-Z0-9.?&_/\-~\!\'\*()+,:;@=$#\[\]%]+!',
"<a href=\"\\0\" target=\"_blank\">\\0</a>", $value);
179 $parsed_attributes[strtolower($this->file_type .
'_' .
$type .
'_' . $key)] = $value;
182 return $parsed_attributes;
210 if (!$overviewModels[$this->file_type][$entryType]) {
211 $entryType =
'default';
216 preg_match_all(
'/\[(.*?)\]/', $single_entry, $placeholders);
217 foreach ($placeholders[1] as $key => $placeholder) {
219 $cuts = explode(
'|', $placeholder);
222 $attribute_elements = explode(
'_', $cuts[1]);
223 $attribute_elements[1] = strtolower($this->
getType());
224 $cuts[1] = implode(
'_', $attribute_elements);
228 $single_entry = str_replace($placeholders[0][$key], $cuts[0] .
$attributes[$cuts[1]] . $cuts[2], $single_entry);
231 $first_sign_after_begin_emph_tag = strpos(strtolower($single_entry),
'<emph>') + 6;
232 $last_sign_after_end_emph_tag = strpos(strtolower($single_entry),
'</emph>');
233 $italic_text_length = $last_sign_after_end_emph_tag - $first_sign_after_begin_emph_tag;
235 if ($last_sign_after_end_emph_tag) {
236 $italic_text = substr($single_entry, $first_sign_after_begin_emph_tag, $italic_text_length);
238 $it_tpl =
new ilTemplate(
"tpl.bibliographic_italicizer.html",
true,
true,
"Modules/Bibliographic");
239 $it_tpl->setCurrentBlock(
"italic_section");
240 $it_tpl->setVariable(
'ITALIC_STRING', $italic_text);
241 $it_tpl->parseCurrentBlock();
243 $text_before_emph_tag = substr($single_entry, 0, $first_sign_after_begin_emph_tag - 6);
244 $text_after_emph_tag = substr($single_entry, $last_sign_after_end_emph_tag + 7);
245 $single_entry = $text_before_emph_tag . $it_tpl->get() . $text_after_emph_tag;
247 }
while ($last_sign_after_end_emph_tag);
250 $single_entry = str_replace($placeholders[0][$key],
'', $single_entry);
253 $this->Overwiew = $single_entry;
261 return $this->Overwiew;
323 $set = $ilDB->query(
"SELECT id FROM il_bibl_entry " .
" WHERE data_id = " . $ilDB->quote($object_id,
"integer"));
324 while ($rec = $ilDB->fetchAssoc($set)) {
325 $entries[][
'entry_id'] = $rec[
'id'];