Browse Source

Remove unnecessary array_merge_recursive_overrule helper

pull/329/head
Sebastian Meyer 3 years ago
parent
commit
dab00b7a5c
  1. 12
      Classes/Common/AbstractPlugin.php
  2. 22
      Classes/Common/Helper.php
  3. 2
      Classes/Plugins/Collection.php
  4. 2
      Classes/Plugins/Navigation.php
  5. 2
      Classes/Plugins/Search.php
  6. 2
      Classes/Plugins/TableOfContents.php
  7. 2
      Classes/Plugins/Tools/FulltextTool.php
  8. 2
      Classes/Plugins/Tools/ImageDownloadTool.php
  9. 2
      Classes/Plugins/Tools/ImageManipulationTool.php
  10. 2
      Classes/Plugins/Tools/PdfDownloadTool.php

12
Classes/Common/AbstractPlugin.php

@ -83,37 +83,37 @@ abstract class AbstractPlugin extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
$this->cObj->readFlexformIntoConf($this->cObj->data['pi_flexform'], $flexFormConf);
if (!empty($flexFormConf))
{
$conf = Helper::array_merge_recursive_overrule($flexFormConf, $conf);
$conf = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($flexFormConf, $conf);
}
// Read plugin TS configuration.
$pluginConf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][get_class($this).'.'];
if (is_array($pluginConf))
{
$conf = Helper::array_merge_recursive_overrule($pluginConf, $conf);
$conf = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($pluginConf, $conf);
}
// Read old plugin TS configuration.
$oldPluginConf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_dlf_'.strtolower(get_class($this)).'.'];
if (is_array($oldPluginConf))
{
$conf = Helper::array_merge_recursice_overrule($oldPluginConf, $conf);
$conf = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($oldPluginConf, $conf);
}
// Read general TS configuration.
$generalConf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId.'.'];
if (is_array($generalConf))
{
$conf = Helper::array_merge_recursive_overrule($generalConf, $conf);
$conf = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($generalConf, $conf);
}
// Read extension configuration.
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]);
if (is_array($extConf))
{
$conf = Helper::array_merge_recursive_overrule($extConf, $conf);
$conf = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($extConf, $conf);
}
// Read TYPO3_CONF_VARS configuration.
$varsConf = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey];
if (is_array($varsConf))
{
$conf = Helper::array_merge_recursive_overrule($varsConf, $conf);
$conf = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($varsConf, $conf);
}
$this->conf = $conf;
// Set default plugin variables.

22
Classes/Common/Helper.php

@ -53,28 +53,6 @@ class Helper
}
/**
* Implements array_merge_recursive_overrule() in a cross-version way
* This code is a copy from realurl, written by Dmitry Dulepov <dmitry.dulepov@gmail.com>.
*
* @access public
*
* @param array $array1: First array
* @param array $array2: Second array
*
* @return array Merged array with second array overruling first one
*/
static public function array_merge_recursive_overrule($array1, $array2)
{
if (class_exists('\\TYPO3\\CMS\\Core\\Utility\\ArrayUtility'))
{
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($array1, $array2);
} else {
$array1 = \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($array1, $array2);
}
return $array1;
}
/**
* Check if given identifier is a valid identifier of the German National Library
* @see http://support.d-nb.de/iltis/onlineRoutinen/Pruefziffernberechnung.htm
*

2
Classes/Plugins/Collection.php

@ -238,7 +238,7 @@ class Collection extends \Kitodo\Dlf\Common\AbstractPlugin {
unset($piVars['DATA']);
$additionalParams = Helper::array_merge_recursive_overrule($piVars, $additionalParams);
$additionalParams = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($piVars, $additionalParams);
}

2
Classes/Plugins/Navigation.php

@ -309,7 +309,7 @@ class Navigation extends \Kitodo\Dlf\Common\AbstractPlugin {
unset($piVars['DATA']);
$overrulePIvars = Helper::array_merge_recursive_overrule($piVars, $overrulePIvars);
$overrulePIvars = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($piVars, $overrulePIvars);
}

2
Classes/Plugins/Search.php

@ -288,7 +288,7 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin {
$TSconfig['special.']['limit'] = max(intval($this->conf['limitFacets']), 1);
$TSconfig = Helper::array_merge_recursive_overrule($this->conf['facetsConf.'], $TSconfig);
$TSconfig = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->conf['facetsConf.'], $TSconfig);
return $this->cObj->HMENU($TSconfig);

2
Classes/Plugins/TableOfContents.php

@ -182,7 +182,7 @@ class TableOfContents extends \Kitodo\Dlf\Common\AbstractPlugin {
$TSconfig['special.']['userFunc'] = 'Kitodo\\Dlf\\Plugins\\TableOfContents->makeMenuArray';
$TSconfig = Helper::array_merge_recursive_overrule($this->conf['menuConf.'], $TSconfig);
$TSconfig = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->conf['menuConf.'], $TSconfig);
$markerArray['###TOCMENU###'] = $this->cObj->HMENU($TSconfig);

2
Classes/Plugins/Tools/FulltextTool.php

@ -41,7 +41,7 @@ class FulltextTool extends \Kitodo\Dlf\Common\AbstractPlugin {
$this->init($conf);
// Merge configuration with conf array of toolbox.
$this->conf = Helper::array_merge_recursive_overrule($this->cObj->data['conf'], $this->conf);
$this->conf = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->cObj->data['conf'], $this->conf);
// Load current document.
$this->loadDocument();

2
Classes/Plugins/Tools/ImageDownloadTool.php

@ -40,7 +40,7 @@ class ImageDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin {
$this->init($conf);
// Merge configuration with conf array of toolbox.
$this->conf = Helper::array_merge_recursive_overrule($this->cObj->data['conf'], $this->conf);
$this->conf = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->cObj->data['conf'], $this->conf);
// Load current document.
$this->loadDocument();

2
Classes/Plugins/Tools/ImageManipulationTool.php

@ -40,7 +40,7 @@ class ImageManipulationTool extends \Kitodo\Dlf\Common\AbstractPlugin {
$this->init($conf);
// Merge configuration with conf array of toolbox.
$this->conf = Helper::array_merge_recursive_overrule($this->cObj->data['conf'], $this->conf);
$this->conf = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->cObj->data['conf'], $this->conf);
// Load current document.
$this->loadDocument();

2
Classes/Plugins/Tools/PdfDownloadTool.php

@ -41,7 +41,7 @@ class PdfDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin {
$this->init($conf);
// Merge configuration with conf array of toolbox.
$this->conf = Helper::array_merge_recursive_overrule($this->cObj->data['conf'], $this->conf);
$this->conf = \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->cObj->data['conf'], $this->conf);
// Load current document.
$this->loadDocument();

Loading…
Cancel
Save