33 protected \
ILIAS\
DI\UIServices $ui
42 $attributes = $this->facade->entryFactory()->loadParsedAttributesByEntryId($entry->
getId());
43 $type = $this->facade->typeFactory()->getInstanceForString($type);
46 switch ($type->getId()) {
48 $prefix =
"bib_default_";
49 if (!empty($attributes[$prefix .
"isbn"])) {
50 $attr = array(
"isbn");
51 } elseif (!empty($attributes[$prefix .
"pmid"])) {
52 $attr = array(
"pmid");
53 } elseif (!empty($attributes[$prefix .
"doi"])) {
55 } elseif (!empty($attributes[$prefix .
"issn"])) {
56 $attr = array(
"issn");
58 $attr = array(
"title",
"author",
"year",
"number",
"volume");
62 $prefix =
"ris_" . strtolower($entry->
getType()) .
"_";
63 if (!empty($attributes[$prefix .
"sn"])) {
65 } elseif (!empty($attributes[$prefix .
"do"])) {
68 $attr = array(
"ti",
"t1",
"au",
"py",
"is",
"vl");
74 if (count($attr) === 1) {
75 if (($attr[0] ===
"doi") || ($attr[0] ===
"pmid")) {
76 $url_params .=
"id=" . $this->
formatAttribute($attr[0], $type, $attributes, $prefix)
77 .
"%3A" . $attributes[$prefix . $attr[0]];
78 } elseif ($attr[0] ===
"do") {
79 $url_params .=
"id=" . $this->
formatAttribute($attr[0], $type, $attributes, $prefix)
80 .
"i%3A" . $attributes[$prefix . $attr[0]];
82 $url_params .= $this->
formatAttribute($attr[0], $type, $attributes, $prefix) .
"=" 83 . urlencode($attributes[$prefix . $attr[0]]);
86 foreach ($attr as
$a) {
87 if (array_key_exists($prefix . $a, $attributes)) {
88 if (strlen($url_params) > 1) {
91 $url_params .= $this->
formatAttribute($a, $type, $attributes, $prefix) .
"=" 92 . urlencode($attributes[$prefix . $a]);
97 return $this->library->getUrl() . $url_params;
106 if (null !== ($img_path = $this->library->getImg())) {
107 $icon = $this->
ui->factory()->symbol()->icon()->custom($img_path,
"");
108 $btn_online_link = $this->
ui->factory()->button()->bulky(
110 $this->
lng->txt(
'bibl_link_online'),
114 $btn_online_link = $this->
ui->factory()->button()->standard(
115 $this->
lng->txt(
'bibl_link_online'),
120 return $this->
ui->renderer()->render($btn_online_link);
138 if (strlen($attributes[$prefix .
"sn"]) <= 9) {
__construct(protected \ilBiblLibraryInterface $library, protected \ilBiblFactoryFacade $facade, protected \ilCtrlInterface $ctrl, protected \ilLanguage $lng, protected \ILIAS\DI\UIServices $ui)
ilBiblLibraryPresentationGUI constructor.
getButton(ilBiblFactoryFacadeInterface $bibl_factory_facade, ilBiblEntry $entry)
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
generateLibraryLink(ilBiblEntry $entry, string $type)
formatAttribute(string $a, ilBiblTypeInterface $type, array $attributes, string $prefix)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getStringRepresentation()
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...