An error occurred while loading the file. Please try again.
-
* set default value noticeLinkType * remove useless variable noticeWithLink
af69dd54
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
GetIt.php 32.39 KiB
<?php
/**
* Get It box view helper
*
* PHP version 7
*
* Copyright (C) Leipzig University Library 2019.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category VuFind
* @package View_Helpers
* @author Gregor Gawol <gawol@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development Wiki
*/
namespace fid\View\Helper\Root;
use VuFind\I18n\Translator\TranslatorAwareTrait;
use VuFind\RecordDriver\AbstractBase;
use VuFind\Role\PermissionManager;
use VuFind\View\Helper\Root\Config;
use Zend\View\Helper\AbstractHelper;
/**
* Get It box view helper
*
* @category VuFind
* @package View_Helpers
* @author Gregor Gawol <gawol@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development Wiki
*/
class GetIt extends AbstractHelper
{
use TranslatorAwareTrait;
/**
* @var \Zend\Config\Config
*/
protected $config;
/**
* @var AbstractBase
*/
protected $driver;
/**
* @var array list of available source ID definitions from config
*/
protected $sids = [
'source_idsV1',
'source_idsV3',
'source_idsV4',
'source_idsV5',
'source_idsV6',
'source_idsV7',
'source_idsV8',
'source_idsV9',
'source_idsV10',
'source_idsV11',
];
/**
* FID API Client
*
* @var \fid\Service\Client
*/
protected $fidClient;
/**
* Permission Manager
*
* @var PermissionManager
*/
protected $permissionManager;
/**
* Solr field source_id
* @var
*/
protected $sid;
/**
* Solr field format
* or instance specific configuration
* @var
*/
protected $format;
/**
* Solr field facet_avail
* @var
*/
protected $facetAvail;
/**
* Solr field multipart_set
* @var
*/
protected $multipart;
/**
* Has a hierarchy parent title
* @var
*/
protected $isCollection;
/**
* Solr field institution
* @var
*/
protected $institution;
/**
* Solr field mega_collection
* @var
*/
protected $megacollection;
/**
* Solr field collection
* @var
*/
protected $collection;
/**
* Solr field isbn
* @var
*/
protected $isbn;
/**
* Solr field issn
* @var
*/
protected $issn;
/**
* Default color of a accordeon
* @var
*/
protected $accordeonColorDefault;
/**
* second color of the accordeon
* @var
*/
protected $accordeonColorAlternative;
/**
* Default headline text of the get it box
* @var
*/
protected $accordeonHeadlineDefault;
/**
* second headline text of the get it box
* @var
*/
protected $accordeonHeadlineAlternative;
/**
* GetIt constructor.
*
* @param Config $getItConfig Get It box Configuration
*/
public function __construct($getItConfig, $fidClient,$permissionManager)
{
$this->config = $getItConfig;
$this->fidClient = $fidClient;
$this->permissionManager = $permissionManager;
}
/**
* Get Solr field data
*
* @param $driver
*/
public function __invoke($driver)
{
$this->driver = $driver;
$this->sid = $this->driver->tryMethod('getSourceID');
$this->format = $this->driver->tryMethod('getFormats');
$this->facetAvail = $this->driver->tryMethod('getFacetAvail');
//$this->multipart = $this->driver->tryMethod('isMultiPartSet');
$this->isCollection = $this->driver->tryMethod('hasChildren');
$this->institution = $this->driver->tryMethod('getInstitutions');
$this->megacollection = $this->driver->tryMethod('getMegaCollection');
$this->collection = $this->driver->tryMethod('getCollection');
$this->isbn = $this->driver->tryMethod('getISBNs');
$this->issn = $this->driver->tryMethod('getISSNs');
$this->accordeonColorDefault = 'azure';
$this->accordeonColorAlternative = 'amber';
$this->accordeonHeadlineDefault = $this->translate('getit_infos');
$this->accordeonHeadlineAlternative = $this->translate('getit_links');
return $this;
}
protected function hasPermission($permission) {
return $this->permissionManager->isAuthorized($permission);
}
/**
* Retrieve SIDs from config (getit.ini)
*
* @param $value
*
* @return array
*/
private function _getSourceIds($value)
{
$sids = $this->config->SourceIds;
return isset($sids->$value) ? explode(',', $sids->$value) : [];
}
/**
* Retrieve NonSIDs from config (getit.ini)
*
* @param $value
*
* @return string
*/
private function _getNonSourceIds($value)
{
$sids = $this->config->NonSourceIds;
return $sids->$value ?? '';
}
/**
* Read specific config of given record
* Set default Values of getit box
*
* @return array config of given record
*/
public function getConfig()
{
//set default values
$accordeonColor = $this->accordeonColorDefault;
$accordeonHeadline = $this->accordeonHeadlineDefault;
$boxHeadline = $this->translate('Get it');
$notice = $this->translate('getit_text_default');
$showLinks = true;
$showOrderButton = false;
$showPartCopyButton = false;
$showArticleButton = false;
$bossData = false;
$isEBCEBooks = false;
$hideNotice = false;
$isAiSidRecord = false;
$noticeLinkType = 'register';
// let specific functions override defaults where necessary
foreach ($this->sids as $sid_config) {
if (in_array($this->sid, $sid = $this->_getSourceIds($sid_config))) {
$foo = 'get_config_' . $sid_config;
$this->$foo(
$accordeonColor,
$accordeonHeadline,
$boxHeadline,
$notice,
$showLinks,
$showOrderButton,
$showPartCopyButton,
$showArticleButton,
$bossData,
$isEBCEBooks,
$hideNotice,
$isAiSidRecord,
$noticeLinkType
);
if ($this->sid !== '0') {
//special case for source ID 0
// this is th only SID that is contained in multiple configs (V8 + V9)
break;
}
}
}
return compact(
'accordeonColor',
'accordeonHeadline',
'boxHeadline',
'notice',
'showLinks',
'showOrderButton',
'showPartCopyButton',
'showArticleButton',
'bossData',
'isEBCEBooks',
'hideNotice',
'isAiSidRecord',
'noticeLinkType'
);
}
/**
*
* Open Access
*
* Configuration of SIDs 13,22,26,28,30,34,53,80,84,87,88,99,101,150,153,170
*
*
* @param $accordeonColor string accordeon color
* @param $accordeonHeadline string accordeon headline
* @param $boxHeadline string headline text get it box
* @param $notice string text of box version
* @param $showLinks boolean display links
* @param $showOrderButton boolean display order button
* @param $showPartCopyButton boolean display part copy button
* @param $showArticleButton boolean display part copy button
* @param $bossData boolean display data of BOSS webservice
* @param $isEBCEBooks boolean is given record UBL-FID-EBC
* @param $hideNotice boolean hide notice
* @param $isAiSidRecord boolean is given record an ai record
* @param $noticeLinkType string type of link
*/
public function get_config_source_idsV1(
&$accordeonColor,
&$accordeonHeadline,
&$boxHeadline,
&$notice,
&$showLinks,
&$showOrderButton,
&$showPartCopyButton,
&$showArticleButton,
&$bossData,
&$isEBCEBooks,
&$hideNotice,
&$isAiSidRecord,
&$noticeLinkType
) {
$accordeonColor = $this->accordeonColorAlternative;
$accordeonHeadline = $this->accordeonHeadlineAlternative;
$notice = $this->translate('getit_text_1');
}
/**
*
* Magazine Articles
*
* Configuration of SID 49,55,68,105
*
* @param $accordeonColor string accordeon color
* @param $accordeonHeadline string accordeon headline
* @param $boxHeadline string headline text get it box
* @param $notice string text of box version
* @param $showLinks boolean display links
* @param $showOrderButton boolean display order button
* @param $showPartCopyButton boolean display part copy button
* @param $showArticleButton boolean display part copy button
* @param $bossData boolean display data of BOSS webservice
* @param $isEBCEBooks boolean is given record UBL-FID-EBC
* @param $hideNotice boolean hide notice
* @param $isAiSidRecord boolean is given record an ai record
* @param $noticeLinkType string type of link
*/
public function get_config_source_idsV3(
&$accordeonColor,
&$accordeonHeadline,
&$boxHeadline,
&$notice,
&$showLinks,
&$showOrderButton,
&$showPartCopyButton,
&$showArticleButton,
&$bossData,
&$isEBCEBooks,
&$hideNotice,
&$isAiSidRecord,
&$noticeLinkType
) {
$accordeonColor = $this->accordeonColorAlternative;
$accordeonHeadline = $this->accordeonHeadlineAlternative;
$boxHeadline = $this->fidClient->isLoggedOn() ? $this->translate('Get it') : $this->translate('getit_logged_not');
$notice = '';
$isAiSidRecord = true;
$showArticleButton = isset($this->config->Permission->allowSubitoArticleCopy) ?
$this->config->Permission->allowSubitoArticleCopy : true;
}
/**
*
* PDA
*
* Configuration of SID 51
*
* @param $accordeonColor string accordeon color
* @param $accordeonHeadline string accordeon headline
* @param $boxHeadline string headline text get it box
* @param $notice string text of box version
* @param $showLinks boolean display links
* @param $showOrderButton boolean display order button
* @param $showPartCopyButton boolean display part copy button
* @param $showArticleButton boolean display part copy button
* @param $bossData boolean display data of BOSS webservice
* @param $isEBCEBooks boolean is given record UBL-FID-EBC
* @param $hideNotice boolean hide notice
* @param $isAiSidRecord boolean is given record an ai record
* @param $noticeLinkType string type of link
*/
public function get_config_source_idsV4(
&$accordeonColor,
&$accordeonHeadline,
&$boxHeadline,
&$notice,
&$showLinks,
&$showOrderButton,
&$showPartCopyButton,
&$showArticleButton,
&$bossData,
&$isEBCEBooks,
&$hideNotice,
&$isAiSidRecord,
&$noticeLinkType
) {
$boxHeadline = $this->fidClient->isLoggedOn() ? $this->translate('Get it') : $this->translate('getit_logged_not');
if ($this->fidClient->isLoggedOn()) {
$notice = $this->translate('getit_text_12');
} else {
$notice = $this->translate('getit_text_2');
$noticeLinkType = "register";
}
$showOrderButton = isset($this->config->Permission->allowPDA) ?
$this->config->Permission->allowPDA : true;
}
/**
*
* EBL
*
* Configuration of SID 76
*
* @param $accordeonColor string accordeon color
* @param $accordeonHeadline string accordeon headline
* @param $boxHeadline string headline text get it box
* @param $notice string text of box version
* @param $showLinks boolean display links
* @param $showOrderButton boolean display order button
* @param $showPartCopyButton boolean display part copy button
* @param $showArticleButton boolean display part copy button
* @param $bossData boolean display data of BOSS webservice
* @param $isEBCEBooks boolean is given record UBL-FID-EBC
* @param $hideNotice boolean hide notice
* @param $isAiSidRecord boolean is given record an ai record
* @param $noticeLinkType string type of link
*/
public function get_config_source_idsV5(
&$accordeonColor,
&$accordeonHeadline,
&$boxHeadline,
&$notice,
&$showLinks,
&$showOrderButton,
&$showPartCopyButton,
&$showArticleButton,
&$bossData,
&$isEBCEBooks,
&$hideNotice,
&$isAiSidRecord,
&$noticeLinkType
) {
$hasEBookAccess = false;
if ($this->fidClient->isLoggedOn()) {
$hasEBookAccess = $this->hasPermission('fid.EBooks');
}
$accordeonColor = $this->accordeonColorAlternative;
$accordeonHeadline = $this->accordeonHeadlineAlternative;
if ($this->fidClient->isLoggedOn()) {
if ($hasEBookAccess) {
$notice = $this->translate('getit_text_13');
} else {
$notice = $this->translate('getit_text_13b_1');
$noticeLinkType = "contact";
}
} else {
$notice = $this->translate('getit_text_3_1');
$noticeLinkType = "register";
}
$boxHeadline = $this->fidClient->isLoggedOn() ? $this->translate('Get it') : $this->translate('getit_logged_not');
$showLinks = $this->fidClient->isLoggedOn() && $hasEBookAccess;
}
/**
*
* IZI Database
*
* Configuration of SID 78
*
* @param $accordeonColor string accordeon color
* @param $accordeonHeadline string accordeon headline
* @param $boxHeadline string headline text get it box
* @param $notice string text of box version
* @param $showLinks boolean display links
* @param $showOrderButton boolean display order button
* @param $showPartCopyButton boolean display part copy button
* @param $showArticleButton boolean display part copy button
* @param $bossData boolean display data of BOSS webservice
* @param $isEBCEBooks boolean is given record UBL-FID-EBC
* @param $hideNotice boolean hide notice
* @param $isAiSidRecord boolean is given record an ai record
* @param $noticeLinkType string type of link
*/
public function get_config_source_idsV6(
&$accordeonColor,
&$accordeonHeadline,
&$boxHeadline,
&$notice,
&$showLinks,
&$showOrderButton,
&$showPartCopyButton,
&$showArticleButton,
&$bossData,
&$isEBCEBooks,
&$hideNotice,
&$isAiSidRecord,
&$noticeLinkType
) {
$notice = $this->translate('getit_text_4');
}
/**
*
* Margaret Herrick Library
*
* Configuration of SID 103
*
* @param $accordeonColor string accordeon color
* @param $accordeonHeadline string accordeon headline
* @param $boxHeadline string headline text get it box
* @param $notice string text of box version
* @param $showLinks boolean display links
* @param $showOrderButton boolean display order button
* @param $showPartCopyButton boolean display part copy button
* @param $showArticleButton boolean display part copy button
* @param $bossData boolean display data of BOSS webservice
* @param $isEBCEBooks boolean is given record UBL-FID-EBC
* @param $hideNotice boolean hide notice
* @param $isAiSidRecord boolean is given record an ai record
* @param $noticeLinkType string type of link
*/
public function get_config_source_idsV7(
&$accordeonColor,
&$accordeonHeadline,
&$boxHeadline,
&$notice,
&$showLinks,
&$showOrderButton,
&$showPartCopyButton,
&$showArticleButton,
&$bossData,
&$isEBCEBooks,
&$hideNotice,
&$isAiSidRecord,
&$noticeLinkType
) {
$accordeonColor = $this->accordeonColorAlternative;
$accordeonHeadline = $this->accordeonHeadlineAlternative;
$notice = $this->translate('getit_text_5');
}
/**
*
* VK Film collection
*
* Configuration of SID 0,109,117,119,127,142,148,151,155
*
* @param $accordeonColor string accordeon color
* @param $accordeonHeadline string accordeon headline
* @param $boxHeadline string headline text get it box
* @param $notice string text of box version
* @param $showLinks boolean display links
* @param $showOrderButton boolean display order button
* @param $showPartCopyButton boolean display part copy button
* @param $showArticleButton boolean display part copy button
* @param $bossData boolean display data of BOSS webservice
* @param $isEBCEBooks boolean is given record UBL-FID-EBC
* @param $hideNotice boolean hide notice
* @param $isAiSidRecord boolean is given record an ai record
* @param $noticeLinkType string type of link
*/
public function get_config_source_idsV8(
&$accordeonColor,
&$accordeonHeadline,
&$boxHeadline,
&$notice,
&$showLinks,
&$showOrderButton,
&$showPartCopyButton,
&$showArticleButton,
&$bossData,
&$isEBCEBooks,
&$hideNotice,
&$isAiSidRecord,
&$noticeLinkType
) {
//accordeon
if (in_array('Free', $this->facetAvail)) {
$accordeonHeadline = $this->accordeonHeadlineAlternative;
$accordeonColor = $this->accordeonColorAlternative;
} elseif (in_array('Online', $this->facetAvail)
&& (preg_grep($this->_getNonSourceIds('source_idsV8_5'), $this->format)
|| preg_grep($this->_getNonSourceIds('source_idsV8_6'), $this->format)
|| preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format))
) {
$accordeonHeadline = $this->accordeonHeadlineAlternative;
$accordeonColor = $this->accordeonColorAlternative;
}
//END accordeon
//box headline
$isLogin = false;
if (in_array($this->sid, $this->_getSourceIds('source_idsV9'))
&& preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->format)
) {
$isLogin = true;
} elseif (in_array('Local', $this->facetAvail)
&& ((preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
&& !in_array($this->_getNonSourceIds('source_idsV8_9'), $this->institution))
|| preg_grep($this->_getNonSourceIds('source_idsV8_3'), $this->format)
)
) {
$isLogin = true;
} elseif (in_array('Online', $this->facetAvail)
&& !in_array('Free', $this->facetAvail)
&& (preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format))
) {
$isLogin = true;
}
if ($isLogin && !$this->fidClient->isLoggedOn()) {
$boxHeadline = $this->translate('getit_logged_not');
}
//END boxheadline
//notice
if (in_array($this->sid, $this->_getSourceIds('source_idsV9'))) {
if (preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)) {
if (!$this->fidClient->isLoggedOn()) {
$notice = $this->translate('getit_text_3_1');
} else {
$notice = $this->translate('getit_text_13');
}
} elseif ($this->isCollection) {
$notice = $this->translate('getit_text_11', ['%%hierarchy_tree%%' => $this->translate('hierarchy_tree')]);
} elseif (preg_grep($this->_getNonSourceIds('source_idsV8_7'), $this->megacollection)
) {
$notice = $this->translate('getit_text_1');
} elseif (in_array('Local', $this->facetAvail)
&& (preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
|| preg_grep($this->_getNonSourceIds('source_idsV8_3'), $this->format))
) {
if (!$this->fidClient->isLoggedOn()) {
$notice = $this->translate('getit_text_10');
$noticeLinkType = "register";
} elseif (preg_grep($this->_getNonSourceIds('source_idsV8_3'), $this->format)) {
$notice = $this->translate('getit_text_14');
} else {
$notice = '';
}
} elseif (in_array('Local', $this->facetAvail)
&& preg_grep($this->_getNonSourceIds('source_idsV8_2'), $this->format)
) {
$notice = $this->translate('getit_text_8');
} elseif (in_array('Free', $this->facetAvail)) {
$notice = $this->translate('getit_text_1');
} elseif (in_array('Online', $this->facetAvail)
&& (preg_grep($this->_getNonSourceIds('source_idsV8_5'), $this->format)
|| preg_grep($this->_getNonSourceIds('source_idsV8_6'), $this->format))
) {
$notice = $this->translate('getit_text_9');
} elseif (in_array('Online', $this->facetAvail)
&& preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
) {
if (!$this->fidClient->isLoggedOn()) {
$notice = $this->translate('getit_text_10');
$noticeLinkType = "register";
} else {
$notice = $this->translate('getit_text_15');
}
}
} elseif ($this->isCollection) {
$notice = $this->translate('getit_text_11', ['%%hierarchy_tree%%' => $this->translate('hierarchy_tree')]);
} elseif (in_array('Local', $this->facetAvail)
&& preg_grep($this->_getNonSourceIds('source_idsV8_2'), $this->format)
) {
$notice = $this->translate('getit_text_8');
} elseif (in_array('Local', $this->facetAvail)) {
if (!$this->fidClient->isLoggedOn()) {
$notice = $this->translate('getit_text_10');
$noticeLinkType = "register";
} elseif (preg_grep($this->_getNonSourceIds('source_idsV8_3'), $this->format)) {
$notice = $this->translate('getit_text_14');
} elseif (!preg_grep($this->_getNonSourceIds('source_idsV8_10'), $this->format)) {
$notice = '';
}
} elseif (in_array('Free', $this->facetAvail)) {
$notice = $this->translate('getit_text_1');
} elseif (in_array('Online', $this->facetAvail)
&& (preg_grep($this->_getNonSourceIds('source_idsV8_5'), $this->format)
|| preg_grep($this->_getNonSourceIds('source_idsV8_6'), $this->format))
) {
$notice = $this->translate('getit_text_9');
} elseif (in_array('Online', $this->facetAvail)
&& preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
) {
if (!$this->fidClient->isLoggedOn()) {
$notice = $this->translate('getit_text_10');
$noticeLinkType = "register";
} else {
$notice = $this->translate('getit_text_15');
}
}
//END notice
//bossData
if (!in_array('Free', $this->facetAvail)
//&& (!empty($this->isbn) || !empty($this->issn))
&& !preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
) {
if (!in_array('Online', $this->facetAvail)
&& preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
) {
if (!$this->isCollection) {
$showPartCopyButton = isset($this->config->Permission->allowSubitoPartialCopy) ?
$this->config->Permission->allowSubitoPartialCopy : true;
}
}
if (preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
) {
$bossData = true;
} elseif (in_array('Local', $this->facetAvail)
&& preg_grep($this->_getNonSourceIds('source_idsV8_3'), $this->format)
) {
$bossData = true;
}
}
//END bossData
//hideNotice
if ($this->fidClient->isLoggedOn()) {
if (in_array('Local', $this->facetAvail)) {
if (preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
&& empty($this->isbn)
&& !preg_grep($this->_getNonSourceIds('source_idsV8_9'), $this->institution)
&& !preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
) {
$hideNotice = true;
}
if ($this->isCollection) {
$hideNotice = false;
}
}
}
//END hideNotice
}
/**
*
* VK Film collection
*
* Configuration of SID 0 (special cases)
*
* @param $accordeonColor string accordeon color
* @param $accordeonHeadline string accordeon headline
* @param $boxHeadline string headline text get it box
* @param $notice string text of box version
* @param $showLinks boolean display links
* @param $showOrderButton boolean display order button
* @param $showPartCopyButton boolean display part copy button
* @param $showArticleButton boolean display part copy button
* @param $bossData boolean display data of BOSS webservice
* @param $isEBCEBooks boolean is given record UBL-FID-EBC
* @param $hideNotice boolean hide notice
* @param $isAiSidRecord boolean is given record an ai record
* @param $noticeLinkType string type of link
*/
public function get_config_source_idsV9(
&$accordeonColor,
&$accordeonHeadline,
&$boxHeadline,
&$notice,
&$showLinks,
&$showOrderButton,
&$showPartCopyButton,
&$showArticleButton,
&$bossData,
&$isEBCEBooks,
&$hideNotice,
&$isAiSidRecord,
&$noticeLinkType
) {
//accordeon
if (preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
|| preg_grep($this->_getNonSourceIds('source_idsV8_7'), $this->megacollection)
) {
$accordeonHeadline = $this->accordeonHeadlineAlternative;
$accordeonColor = $this->accordeonColorAlternative;
}
//END accordeon
//showLinks
if (
preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
) {
if (!$this->fidClient->isLoggedOn()) {
$showLinks = false;
}
}
//END showLinks
//orderButton
if (in_array('Local', $this->facetAvail)
&& preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
&& !preg_grep($this->_getNonSourceIds('source_idsV8_9'), $this->institution)
&& !$this->isCollection
&& !preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
) {
$showOrderButton = isset($this->config->Permission->allowPDA) ?
$this->config->Permission->allowPDA : true;
}
//END orderButton
//EBCEbooks
if (in_array('Online', $this->facetAvail)
&& preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
) {
$isEBCEBooks = true;
}
//END EBCEbooks
}
/**
*
* MediathekViewWeb
*
* Configuration of SID 169
*
* @param $accordeonColor string accordeon color
* @param $accordeonHeadline string accordeon headline
* @param $boxHeadline string headline text get it box
* @param $notice string text of box version
* @param $showLinks boolean display links
* @param $showOrderButton boolean display order button
* @param $showPartCopyButton boolean display part copy button
* @param $showArticleButton boolean display part copy button
* @param $bossData boolean display data of BOSS webservice
* @param $isEBCEBooks boolean is given record UBL-FID-EBC
* @param $hideNotice boolean hide notice
* @param $isAiSidRecord boolean is given record an ai record
* @param $noticeLinkType string type of link
*/
public function get_config_source_idsV10(
&$accordeonColor,
&$accordeonHeadline,
&$boxHeadline,
&$notice,
&$showLinks,
&$showOrderButton,
&$showPartCopyButton,
&$showArticleButton,
&$bossData,
&$isEBCEBooks,
&$hideNotice,
&$isAiSidRecord,
&$noticeLinkType
) {
$accordeonColor = $this->accordeonColorAlternative;
$accordeonHeadline = $this->accordeonHeadlineAlternative;
$notice = $this->translate('getit_text_6');
}
/**
*
* Bielefeld Academic Search Engine (BASE)
*
* Configuration of SID 126
*
* @param $accordeonColor string accordeon color
* @param $accordeonHeadline string accordeon headline
* @param $boxHeadline string headline text get it box
* @param $notice string text of box version
* @param $showLinks boolean display links
* @param $showOrderButton boolean display order button
* @param $showPartCopyButton boolean display part copy button
* @param $showArticleButton boolean display part copy button
* @param $bossData boolean display data of BOSS webservice
* @param $isEBCEBooks boolean is given record UBL-FID-EBC
* @param $hideNotice boolean hide notice
* @param $isAiSidRecord boolean is given record an ai record
* @param $noticeLinkType string type of link
*/
public function get_config_source_idsV11(
&$accordeonColor,
&$accordeonHeadline,
&$boxHeadline,
&$notice,
&$showLinks,
&$showOrderButton,
&$showPartCopyButton,
&$showArticleButton,
&$bossData,
&$isEBCEBooks,
&$hideNotice,
&$isAiSidRecord,
&$noticeLinkType
) {
$notice = $this->translate('getit_text_7');
}
/**
*
* Has User ordered certain Record (SID 51)
*
* @return bool
*/
public function isRecordOrdered()
{
if ($this->fidClient->isLoggedOn()) {
$id = $this->driver->tryMethod('getUniqueID');
$record = $this->fidClient->requestRecord($id);
return $record->getOrdered();
}
return false;
}
}