<?php

/**
 * Class d3_oxutilsview_heidelpay
 */
class d3_oxutilsview_heidelpay extends d3_oxutilsview_heidelpay_parent
{
    /**
     * @param smarty $oSmarty
     *
     * @return null|void
     */
    protected function _fillCommonSmartyProperties($oSmarty)
    {
        $sEdition = $this->getConfig()->getEdition();
        $sVersion = $this->getConfig()->getVersion();

        parent::_fillCommonSmartyProperties($oSmarty);

        if (in_array($sEdition, array('EE')) &&  version_compare('5.1.0', $sVersion, '<=')) {
            return null;
        }

        if (in_array($sEdition, array('CE', 'PE')) &&  version_compare('4.8.0', $sVersion, '<=')) {
            return null;
        }

        $oSmarty->plugins_dir[] = oxRegistry::getConfig()
                ->getActiveView()
                ->getViewConfig()
                ->getModulePath('d3heidelpay') . 'core/smarty/plugins';

        return null;
    }
}