Skip to content
Snippets Groups Projects
GetIt.php 31.8 KiB
Newer Older
<?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\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;
    protected $sid;
    protected $format;
    protected $facetAvail;
    protected $multipart;
    protected $isCollection;
    protected $institution;
    protected $megacollection;
    protected $collection;
    protected $isbn;
    protected $issn;

    protected $accordeonColorDefault;
    protected $accordeonColorAlternative;
    protected $accordeonHeadlineDefault;
    protected $accordeonHeadlineAlternative;

    /**
     * GetIt constructor.
     *
     * @param Config $getItConfig Get It box Configuration
     */
    public function __construct($getItConfig, $fidClient)
    {
        $this->config = $getItConfig;
        $this->fidClient = $fidClient;
    }

    /**
     * @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_links');
        $this->accordeonHeadlineAlternative = $this->translate('getit_infos');

        return $this;
    }

    /**
     * @param $value
     *
     * @return array
     */
    private function _getSourceIds($value)
    {
        $sids = $this->config->SourceIds;
        return isset($sids->$value) ? explode(',', $sids->$value) : [];
    }

    /**
     * @param $value
     *
     * @return string
     */
    private function _getNonSourceIds($value)
    {
        $sids = $this->config->NonSourceIds;
        return isset($sids->$value) ? $sids->$value : '';
    }

    /**
     * @param $defaultval
     * @param $additionalval
     *
     * @return mixed
     */
    private function _accordeon($defaultval, $additionalval)
    {
        if (in_array($this->sid, $this->_getSourceIds('source_idsV1'))) {
            return $additionalval;
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV3'))) {
            return $additionalval;
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV5'))) {
            return $additionalval;
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV7'))) {
            return $additionalval;
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV8'))) {
            if (in_array('Free', $this->facetAvail)) {
                return $additionalval;
            } 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))
            ) {
                return $additionalval;
            }
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV10'))) {
            return $additionalval;
        }
        return $defaultval;
    }

    /**
     * @return string
     */
    public function getAccordeonColor()
    {
        return $this->_accordeon('azure', 'amber');
    }

    /**
     * @return mixed
     */
    public function getAccordeonHeadline()
    {
        $links = $this->translate('getit_links');
        $infos = $this->translate('getit_infos');
        return $this->_accordeon($infos, $links);
    }

    /**
     * @return string
     */
    public function getBoxHeadline()
    {
        if (in_array($this->sid, $this->_getSourceIds('source_idsV3'))) {
            if (!$this->fidClient->isLoggedOn()) {
                return $this->translate('getit_logged_not');
            }
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV4'))) {
            if (!$this->fidClient->isLoggedOn()) {
                return $this->translate('getit_logged_not');
            }
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV5'))) {
            if (!$this->fidClient->isLoggedOn()) {
                return $this->translate('getit_logged_not');
            }
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV8'))) {
            $isLogin = false;
            if (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 (in_array($this->sid, $this->_getSourceIds('source_idsV9'))
                && preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->format)
            ) {
                $isLogin = true;
            }
            if ($isLogin && !$this->fidClient->isLoggedOn()) {
                return $this->translate('getit_logged_not');
            }
        }
        return $this->translate('Get it');
    }

    /**
     * @return string
     */
    public function getNotices()
    {
        if (in_array($this->sid, $this->_getSourceIds('source_idsV1'))) {
            return $this->translate('getit_text_1');
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV3'))) {
            return;
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV4'))) {
            if (!$this->fidClient->isLoggedOn()) {
                return $this->translate('getit_text_2');
            } else {
                return $this->translate('getit_text_12');
            }
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV5'))) {
            if (!$this->fidClient->isLoggedOn()) {
                return $this->translate('getit_text_3_1');
            } else {
                return $this->translate('getit_text_13');
            }
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV6'))) {
            return $this->translate('getit_text_4');
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV7'))) {
            return $this->translate('getit_text_5');
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV10'))) {
            return $this->translate('getit_text_6');
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV11'))) {
            return $this->translate('getit_text_7');
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV8'))) {
            if (in_array($this->sid, $this->_getSourceIds('source_idsV9'))) {
                if (preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)) {
                    if (!$this->fidClient->isLoggedOn()) {
                        return $this->translate('getit_text_3_1');
                    } else {
                        return $this->translate('getit_text_13');
                    }
                }
                if ($this->isCollection) {
                    return $this->translate('getit_text_11',['%%hierarchy_tree%%' => $this->translate('hierarchy_tree')]);
                }
                if (preg_grep($this->_getNonSourceIds('source_idsV8_7'), $this->megacollection)
                ) {
                    return $this->translate('getit_text_1');
                }
                if (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()) {
                        return $this->translate('getit_text_10');
                    } elseif (preg_grep($this->_getNonSourceIds('source_idsV8_3'), $this->format)) {
                        return $this->translate('getit_text_14');
                    } else {
                        return '';
                    }
                }
                if (in_array('Local', $this->facetAvail)
                    && preg_grep($this->_getNonSourceIds('source_idsV8_2'), $this->format)
                ) {
                    return $this->translate('getit_text_8');
                }
                if (in_array('Free', $this->facetAvail)) {
                    return $this->translate('getit_text_1');
                }
                if (in_array('Online', $this->facetAvail)
                    && (preg_grep($this->_getNonSourceIds('source_idsV8_5'), $this->format)
                        || preg_grep($this->_getNonSourceIds('source_idsV8_6'), $this->format))
                ) {
                    return $this->translate('getit_text_9');
                } elseif (in_array('Online', $this->facetAvail)
                    && preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
                ) {
                    if (!$this->fidClient->isLoggedOn()) {
                        return $this->translate('getit_text_10');
                    } else {
                        return $this->translate('getit_text_15');
                    }
                }
            } elseif ($this->isCollection) {
                return $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)
            ) {
                return $this->translate('getit_text_8');
            } elseif (in_array('Local', $this->facetAvail)) {
                if (!$this->fidClient->isLoggedOn()) {
                    return $this->translate('getit_text_10');
                } elseif (preg_grep($this->_getNonSourceIds('source_idsV8_3'), $this->format)) {
                    return $this->translate('getit_text_14');
                } else {
                    return '';
                }
            } elseif (in_array('Free', $this->facetAvail)) {
                return $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))
            ) {
                return $this->translate('getit_text_9');
            } elseif (in_array('Online', $this->facetAvail)
                && preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
            ) {
                if (!$this->fidClient->isLoggedOn()) {
                    return $this->translate('getit_text_10');
                } else {
                    return $this->translate('getit_text_15');
                }
            }
        }
        return $this->translate('getit_text_default');
    }

    /**
     * @return bool
     */
    public function showLinks()
    {
        if (in_array($this->sid, $this->_getSourceIds('source_idsV5'))
            || (in_array($this->sid, $this->_getSourceIds('source_idsV9'))
                && preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection))
        ) {
            if (!$this->fidClient->isLoggedOn()) {
                return false;
            }
        }
        return true;
    }

    /**
     * @return bool
     */
    public function showOrderButton()
    {
        if (in_array($this->sid, $this->_getSourceIds('source_idsV9'))
            && preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
            && !in_array($this->_getNonSourceIds('source_idsV8_9'), $this->institution)
            && !$this->isCollection
            && !preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
        ) {
            return true;
        }
        return false;
    }

    /**
     * @return bool
     */
    public function showPartCopyButton()
    {
        if (!in_array('Free', $this->facetAvail)
            && in_array($this->sid, $this->_getSourceIds('source_idsV8'))
            && preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
            && !$this->isCollection
            && !preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
        ) {
            return true;
        }
        return false;
    }

    /**
     * @return bool
     */
    public function showBOSSData()
    {
        if (!in_array('Free', $this->facetAvail)
            && in_array($this->sid, $this->_getSourceIds('source_idsV8'))
            //&& (!empty($this->isbn) || !empty($this->issn))
            && !preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
        ) {
            if (preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
            ) {
                return true;
            } elseif (in_array('Local', $this->facetAvail)
                && preg_grep($this->_getNonSourceIds('source_idsV8_3'), $this->format)
            ) {
                return true;
            }
        }
        return false;
    }

    public function isEBCEBooks()
    {
        if (in_array('Online', $this->facetAvail)
            && in_array($this->sid, $this->_getSourceIds('source_idsV9'))
            && preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
        ) {
            return true;
        }
        return false;
    }

    public function hideNotice()
    {
        if (in_array($this->sid, $this->_getSourceIds('source_idsV8'))) {
            if (in_array('Online', $this->facetAvail)
Dorian Merz's avatar
Dorian Merz committed
                && (preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
                    || preg_grep($this->_getNonSourceIds('source_idsV8_5'), $this->format)
                    || preg_grep($this->_getNonSourceIds('source_idsV8_6'), $this->format))
            ) {
                return false;
            } elseif (in_array('Local', $this->facetAvail)
                && (preg_grep($this->_getNonSourceIds('source_idsV8_3'), $this->format)
                    || preg_grep($this->_getNonSourceIds('source_idsV8_2'), $this->format))
            } elseif (in_array('Local', $this->facetAvail)
                && preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
            ) {
                return false;
        } elseif (in_array($this->sid, $this->_getSourceIds('source_idsV3'))) {
            return false;

    public function isAISIDRecord()
    {
        if (in_array($this->sid, $this->_getSourceIds('source_idsV3'))) {
            return true;
        }
        return false;
    }
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892

    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;
        $bossData = false;
        $isEBCEBooks = false;
        $hideNotice = true;
        $isAiSidRecord = false;

        // 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,
                    $bossData,
                    $isEBCEBooks,
                    $hideNotice,
                    $isAiSidRecord
                );
                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',
            'bossData',
            'isEBCEBooks',
            'hideNotice',
            'isAiSidRecord'
        );
    }

    public function get_config_source_idsV1(
        &$accordeonColor,
        &$accordeonHeadline,
        &$boxHeadline,
        &$notice,
        &$showLinks,
        &$showOrderButton,
        &$showPartCopyButton,
        &$bossData,
        &$isEBCEBooks,
        &$hideNotice,
        &$isAiSidRecord
    )
    {
        $accordeonColor = $this->accordeonColorAlternative;
        $accordeonHeadline = $this->accordeonHeadlineAlternative;
        $notice = $this->translate('getit_text_1');
    }

    public function get_config_source_idsV3(
        &$accordeonColor,
        &$accordeonHeadline,
        &$boxHeadline,
        &$notice,
        &$showLinks,
        &$showOrderButton,
        &$showPartCopyButton,
        &$bossData,
        &$isEBCEBooks,
        &$hideNotice,
        &$isAiSidRecord
    )
    {
        $accordeonColor = $this->accordeonColorAlternative;
        $accordeonHeadline = $this->accordeonHeadlineAlternative;
        $boxHeadline = $this->fidClient->isLoggedOn() ? $this->translate('Get it') : $this->translate('getit_logged_not');
        $notice = '';
        $isAiSidRecord = true;
    }

    public function get_config_source_idsV4(
        &$accordeonColor,
        &$accordeonHeadline,
        &$boxHeadline,
        &$notice,
        &$showLinks,
        &$showOrderButton,
        &$showPartCopyButton,
        &$bossData,
        &$isEBCEBooks,
        &$hideNotice,
        &$isAiSidRecord
    )
    {
        $boxHeadline = $this->fidClient->isLoggedOn() ? $this->translate('Get it') : $this->translate('getit_logged_not');
        $notice = $this->fidClient->isLoggedOn() ? $this->translate('getit_text_12') : $this->translate('getit_text_2');
    }

    public function get_config_source_idsV5(
        &$accordeonColor,
        &$accordeonHeadline,
        &$boxHeadline,
        &$notice,
        &$showLinks,
        &$showOrderButton,
        &$showPartCopyButton,
        &$bossData,
        &$isEBCEBooks,
        &$hideNotice,
        &$isAiSidRecord
    )
    {
        $accordeonColor = $this->accordeonColorAlternative;
        $accordeonHeadline = $this->accordeonHeadlineAlternative;
        $notice = !$this->fidClient->isLoggedOn() ? $this->translate('getit_text_3_1') : $this->translate('getit_text_13');
        $boxHeadline = $this->fidClient->isLoggedOn() ? $this->translate('Get it') : $this->translate('getit_logged_not');
        $showLinks = $this->fidClient->isLoggedOn();
    }

    public function get_config_source_idsV6(
        &$accordeonColor,
        &$accordeonHeadline,
        &$boxHeadline,
        &$notice,
        &$showLinks,
        &$showOrderButton,
        &$showPartCopyButton,
        &$bossData,
        &$isEBCEBooks,
        &$hideNotice,
        &$isAiSidRecord
    )
    {
        $notice = $this->translate('getit_text_4');
    }

    public function get_config_source_idsV7(
        &$accordeonColor,
        &$accordeonHeadline,
        &$boxHeadline,
        &$notice,
        &$showLinks,
        &$showOrderButton,
        &$showPartCopyButton,
        &$bossData,
        &$isEBCEBooks,
        &$hideNotice,
        &$isAiSidRecord
    )
    {
        $accordeonColor = $this->accordeonColorAlternative;
        $accordeonHeadline = $this->accordeonHeadlineAlternative;
        $notice = $this->translate('getit_text_5');
    }

    public function get_config_source_idsV8(
        &$accordeonColor,
        &$accordeonHeadline,
        &$boxHeadline,
        &$notice,
        &$showLinks,
        &$showOrderButton,
        &$showPartCopyButton,
        &$bossData,
        &$isEBCEBooks,
        &$hideNotice,
        &$isAiSidRecord
    )
    {
        //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()) {
            $headLine = $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');
                } 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');
                } 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');
            } elseif (preg_grep($this->_getNonSourceIds('source_idsV8_3'), $this->format)) {
                $notice = $this->translate('getit_text_14');
            } else {
                $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');
            } 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 (preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
            ) {
                $bossData = true;
                if (!$this->isCollection) {
                    $showPartCopyButton = true;
                }
            } elseif (in_array('Local', $this->facetAvail)
                && preg_grep($this->_getNonSourceIds('source_idsV8_3'), $this->format)
            ) {
                $bossData = true;
            }
        }
        //END bossData
        //hideNotice
        if (in_array('Online', $this->facetAvail))
        {
            if (preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
                || preg_grep($this->_getNonSourceIds('source_idsV8_5'), $this->format)
                || preg_grep($this->_getNonSourceIds('source_idsV8_6'), $this->format)
            ) {
                $hideNotice = false;
            }
        } elseif (in_array('Local', $this->facetAvail))
        {
            if (preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
                || preg_grep($this->_getNonSourceIds('source_idsV8_2'), $this->format)
                || preg_grep($this->_getNonSourceIds('source_idsV8_3'), $this->format)
            ) {
                $hideNotice = false;
            }
        }
        //END hideNotice
    }

    public function get_config_source_idsV9(
        &$accordeonColor,
        &$accordeonHeadline,
        &$boxHeadline,
        &$notice,
        &$showLinks,
        &$showOrderButton,
        &$showPartCopyButton,
        &$bossData,
        &$isEBCEBooks,
        &$hideNotice,
        &$isAiSidRecord
    )
    {
        //showLinks
        if (
            preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
        ) {
            if (!$this->fidClient->isLoggedOn()) {
                $showLinks = false;
            }
        }
        //END showLinks
        //orderButton
        if (preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
            && !in_array($this->_getNonSourceIds('source_idsV8_9'), $this->institution)
            && !$this->isCollection
            && !preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
        ) {
            $showOrderButton = true;
        }
        //END orderButton
        //EBCEbooks
        if (in_array('Online', $this->facetAvail)
            && preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
        ) {
            $isEBCEBooks = true;
        }
        //END EBCEbooks
    }

    public function get_config_source_idsV10(
        &$accordeonColor,
        &$accordeonHeadline,
        &$boxHeadline,
        &$notice,
        &$showLinks,
        &$showOrderButton,
        &$showPartCopyButton,
        &$bossData,
        &$isEBCEBooks,
        &$hideNotice,
        &$isAiSidRecord
    )
    {
        $accordeonColor = $this->accordeonColorAlternative;
        $accordeonHeadline = $this->accordeonHeadlineAlternative;
        $notice = $this->translate('getit_text_6');
    }

    public function get_config_source_idsV11(
        &$accordeonColor,
        &$accordeonHeadline,
        &$boxHeadline,
        &$notice,
        &$showLinks,
        &$showOrderButton,
        &$showPartCopyButton,
        &$bossData,
        &$isEBCEBooks,
        &$hideNotice,
        &$isAiSidRecord
    )
    {
        $notice = $this->translate('getit_text_7');
    }