@param       $sTpl
@param array $aVars
@param array $aOpts

@return array
423682
public function renderTemplate($sTpl, array $aVars, array $aOpts)
    {
        $aMailData = $this->getMailData($sTpl, $aVars);

        // Add Footer
        if (isset($aOpts['add_footer']) && $aOpts['add_footer']) {
            $templateNameData = explode('/', $sTpl);
            $sFooterTpl = sprintf('%s/email/_footer', $templateNameData[0]);

            $aFooterData = $this->getMailData($sFooterTpl, $aVars);

            $aMailData['html'] .= $aFooterData['html'];
            $aMailData['plain'] .= $aFooterData['plain'];
        }

        return $aMailData;
    }
498188
public function parseLines(array $lines, string $vcsType = ''): Changeset
    {
        $parser = $this->getParser($vcsType);

        return $parser->parse($lines);
    }
548706
public static function convertFromOpml( $opml, $labelRoot, $rootClass = NULL )
	{
		$parser		= new XML_OPML_Parser();
		$parser->parse( $opml );
		$lines		= $parser->getOutlines();
		$list		= new ADT_Tree_Menu_List( $labelRoot, array( 'class' => $rootClass ) );

		self::buildMenuListFromOutlines( $lines, $list );
		return $list;
	}
232667
private function _setControllerInfo($oEmos, $aParams, $oSmarty)
    {
        $sControllerName = $this->_getEmosCl();
        $aContent = $this->_getPagesContent();
        $aOrderSteps = $this->_getOrderStepNames();

        $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $oCurrentView = $oConfig->getActiveView();
        $sFunction = $oCurrentView->getFncName();
        /** @var \OxidEsales\Eshop\Core\StrRegular $oStr */
        $oStr = getStr();
        $sTplName = $this->_getTplName();
        /** @var \OxidEsales\Eshop\Application\Model\User $oUser */
        $oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
        if (!$oUser->loadActiveUser()) {
            $oUser = false;
        }
        $oProduct = (isset($aParams['product']) && $aParams['product']) ? $aParams['product'] : null;

        switch ($sControllerName) {
            case 'user':
                $sOption = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('option');
                $sOption = (isset($sOption)) ? $sOption : $this->getSession()->getVariable('option');

                if (isset($sOption) && array_key_exists('user_' . $sOption, $aContent)) {
                    $aContent['user'] = $aContent['user_' . $sOption];
                }

                if (isset($sOption) && array_key_exists('user_' . $sOption, $aOrderSteps)) {
                    $aOrderSteps['user'] = $aOrderSteps['user_' . $sOption];
                }
                break;
            case 'payment':
                if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('new_user')) {
                    $this->_setUserRegistration($oEmos, $oUser);
                }
                break;
            case 'thankyou':
                /** @var \OxidEsales\Eshop\Application\Controller\ThankYouController $oCurrentView */
                $this->_setBasketInformation($oEmos, $oUser, $oCurrentView->getOrder(), $oCurrentView->getBasket());
                break;
            case 'oxwarticledetails':
                if ($oProduct) {
                    $sPath = $this->_getBasketProductCatPath($oProduct);
                    $sTitle = $this->_prepareProductTitle($oProduct);
                    $aContent['oxwarticledetails'] = "Shop/{$sPath}/" . strip_tags($sTitle);
                    $oEmos->addDetailView($this->_convProd2EmosItem($oProduct, $sPath, 1));
                }
                break;
            case 'search':
                $this->_setSearchInformation($oEmos, $oSmarty);
                break;
            case 'alist':
                $aContent['alist'] = 'Shop/' . $this->_getEmosCatPath();
                break;
            case 'account':
                if ($sFunction) {
                    $aContent['account'] = ($sFunction != 'logout') ? $aContent['account_login'] : $aContent['account_logout'];
                } else {
                    $aContent['account'] = $aContent['account_needlogin'];
                }
                break;
            case 'contact':
                /** @var \OxidEsales\Eshop\Application\Controller\ContactController $oCurrentView */
                if ($oCurrentView->getContactSendStatus()) {
                    $aContent['contact'] = $aContent['contact_success'];
                    $oEmos->addContact('Kontakt');
                } else {
                    $aContent['contact'] = $aContent['contact_failure'];
                }
                break;
            case 'newsletter':
                /** @var \OxidEsales\Eshop\Application\Controller\NewsletterController $oCurrentView */
                $aContent['newsletter'] = $oCurrentView->getNewsletterStatus() ? $aContent['newsletter_success'] : $aContent['newsletter_failure'];
                break;
            case 'info':
                if (array_key_exists('info_' . $sTplName, $aContent)) {
                    $aContent['info'] = $aContent['info_' . $sTplName];
                } else {
                    $aContent['info'] = 'Content/' . $oStr->preg_replace('/\.tpl$/', '', $sTplName);
                }
                break;
            case 'content':
                // backwards compatibility
                $oContent = ($oCurrentView instanceof \OxidEsales\Eshop\Application\Controller\ContentController) ? $oCurrentView->getContent() : null;
                $sContentId = $oContent ? $oContent->oxcontents__oxloadid->value : null;

                if (array_key_exists('content_' . $sContentId, $aContent)) {
                    $aContent['content'] = $aContent['content_' . $sContentId];
                } else {
                    $aContent['content'] = 'Content/' . $this->_getEmosPageTitle($aParams);
                }
                break;
            case 'register':
                $this->_setUserRegistration($oEmos, $oUser);
                break;
        }

        if (is_string($sControllerName) && array_key_exists($sControllerName, $aContent)) {
            $oEmos->addContent($aContent[$sControllerName]);
        } else {
            $oEmos->addContent('Content/' . $oStr->preg_replace('/\.tpl$/', '', $sTplName));
        }

        if (is_string($sControllerName) && array_key_exists($sControllerName, $aOrderSteps)) {
            $oEmos->addOrderProcess($aOrderSteps[$sControllerName]);
        }

        // track logins
        if ('login_noredirect' == $sFunction) {
            $oEmos->addLogin($oConfig->getRequestParameter('lgn_usr'), $oUser ? '0' : '1');
        }
    }
441596
protected function getResultsStrictTyped(\PDOStatement $stmt, int $fetchStyle = \PDO::FETCH_ASSOC)
    {
        /**
         * @var array|object|bool $results
         */
        $results = $stmt->fetchAll($fetchStyle);
        if (\is_array($results)) {
            return $results;
        } elseif (\is_object($results)) {
            return $results;
        }
        throw new \TypeError('Unexpected return type: ' . $this->getValueType($results));
    }
836178
public function execXMLStoredProcedure($conn, $stmt, $bindArray)
    {
        $crsr = odbc_prepare($conn, $stmt);
        
        if (!$crsr) { 
            $this->setError($conn);
            return false;
        }
        
        // extension problem: sends warning message into the php_log or stdout 
        // about number of result sets. (switch on return code of SQLExecute() 
        // SQL_SUCCESS_WITH_INFO
        if (!@odbc_execute($crsr , array($bindArray['internalKey'], $bindArray['controlKey'], $bindArray['inputXml']))) {
            $this->setError($conn);
            return "ODBC error code: " . $this->getErrorCode() . ' msg: ' . $this->getErrorMsg();
        }
        
        // disconnect operation cause crush in fetch, nothing appears as sql script.
        $row='';
        $outputXML = '';
        if (!$bindArray['disconnect']) {
            while (odbc_fetch_row($crsr)) {
                $tmp = odbc_result($crsr, 1);
                
                if ($tmp) {
                    // because of ODBC problem blob transferring should execute some "clean" on returned data
                    if (strstr($tmp , "</script>")) {
                        $pos = strpos($tmp, "</script>");
                        $pos += strlen("</script>"); // @todo why append this value?
                        $row .= substr($tmp, 0, $pos);
                        break;
                    } else {
                        $row .= $tmp;
                    }
                }
            }
            $outputXML = $row;
        }
        
        return $outputXML;
    }
1169439
public function read(array $opts) {

        $feedback = $this->parseFeedback($opts);

        return [array_merge(parent::read($opts)[0], [
            'recipe' => 'attempt_completed',
            'attempt_url' => $opts['attempt']->url,
            'attempt_type' => static::$xapiType.$opts['attempt']->type,
            'attempt_ext' => $opts['attempt'],
            'attempt_ext_key' => 'http://lrs.learninglocker.net/define/extensions/moodle_feedback_attempt',
            'attempt_name' => $opts['attempt']->name,
            'attempt_score_raw' => $feedback->score->raw,
            'attempt_score_min' => $feedback->score->min,
            'attempt_score_max' => $feedback->score->max,
            'attempt_score_scaled' => $feedback->score->scaled,
            'attempt_success' => null,
            'attempt_completed' => true,
            'attempt_duration' => null,
            'time' => date('c', $opts['attempt']->timemodified)
        ])];
    }
516168
protected function getVoucherList(TdbShopOrder $oOrder, $bSponsored = false, IMapperCacheTriggerRestricted $oCacheTriggerManager, $bCachingEnabled)
    {
        $aVoucherList = array();

        // get vouchers
        $oVoucherUseList = &$oOrder->GetFieldShopVoucherUseList();
        $oVoucherUseList->GoToStart();
        if (0 < $oVoucherUseList->Length()) {
            while ($oVoucherUse = &$oVoucherUseList->Next()) {
                if ($bCachingEnabled) {
                    $oCacheTriggerManager->addTrigger($oVoucherUse->table, $oVoucherUse->id);
                }
                $oVoucher = $oVoucherUse->GetFieldShopVoucher();
                if (null !== $oVoucher) {
                    if ($bCachingEnabled) {
                        $oCacheTriggerManager->addTrigger($oVoucher->table, $oVoucher->id);
                    }
                    if (false === $oVoucher->IsSponsored() && false === $bSponsored) {
                        $aVoucher = $this->getDataFromVoucher($oVoucherUse, $oVoucher, $oCacheTriggerManager, $bCachingEnabled);
                        $aVoucherList[] = $aVoucher;
                    } elseif (true === $oVoucher->IsSponsored() && true === $bSponsored) {
                        $aVoucher = $this->getDataFromVoucher($oVoucherUse, $oVoucher, $oCacheTriggerManager, $bCachingEnabled);
                        $aVoucherList[] = $aVoucher;
                    }
                } else {
                    $aVoucher = $this->getDataFromVoucher($oVoucherUse, null, $oCacheTriggerManager);
                    $aVoucherList[] = $aVoucher;
                }
            }
            $oVoucherUseList->GoToStart();
        }

        return $aVoucherList;
    }
571017
function setRoundForcedLaps($laps, $multicall = false)
    {
        if (!is_int($laps)) {
            throw new InvalidArgumentException('laps = ' . print_r($laps, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($laps), $multicall);
    }
124236
protected function getSenderData(array $aOptions)
    {
        if (isset($aOptions['use_default_sender']) && $aOptions['use_default_sender']) {
            $sFromEmail = isset($this->aRendererConfig['mail_from_email'])
                ? $this->aRendererConfig['mail_from_email']
                : null;

            $sFromName = isset($this->aRendererConfig['mail_from_name'])
                ? $this->aRendererConfig['mail_from_name']
                : null;

            return [
                'email' => $sFromEmail,
                'name' => $sFromName,
            ];
        }

        $sFromEmail = isset($aOptions['sender_mail'])
            ? $aOptions['sender_mail']
            : null;

        $sFromName = isset($aOptions['sender_name'])
            ? $aOptions['sender_name']
            : null;

        return [
            'email' => $sFromEmail,
            'name' => $sFromName,
        ];
    }
160429
protected function _blockLoad($tpl, array $vars = array()) {
        $vars && \extract($vars);
        include "{$this->_template_dir}/{$tpl}.phtml";

        $this->_display_html .= \ob_get_contents();
        \ob_clean();
    }
1358302
function aabbToPoints(points, box) {
  vec4set4(points[0], box[0][0], box[0][1], box[0][2], 1)
  vec4set4(points[1], box[1][0], box[0][1], box[0][2], 1)
  vec4set4(points[2], box[1][0], box[0][1], box[1][2], 1)
  vec4set4(points[3], box[0][0], box[0][1], box[1][2], 1)
  vec4set4(points[4], box[0][0], box[1][1], box[0][2], 1)
  vec4set4(points[5], box[1][0], box[1][1], box[0][2], 1)
  vec4set4(points[6], box[1][0], box[1][1], box[1][2], 1)
  vec4set4(points[7], box[0][0], box[1][1], box[1][2], 1)
  return points
}
631608
protected function _getSelections($sTitle)
    {

        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blUseMultidimensionVariants')) {
            $aSelections = explode($this->_sMdSeparator, $sTitle);
        } else {
            $aSelections = [$sTitle];
        }

        return $aSelections;
    }
438389
private static function autoResolve($arsUrlValueList)
    {
        $sController = 'Index';
        $sAction = 'index';
        $arsParamList = array();
        foreach ($arsUrlValueList as $nIndexValue => $sUrlValue) {
            if ($nIndexValue == 0) {
                $sController = $sUrlValue;
            } elseif ($nIndexValue == 1) {
                $sAction = $sUrlValue;
            } else {
                if (isset($arsUrlValueList[$nIndexValue]) && $nIndexValue % 2 == 0) {
                    $sParamName = $arsUrlValueList[$nIndexValue];
                    $sParamValue = null;
                    if (isset($arsUrlValueList[$nIndexValue + 1])) {
                        $sParamValue = $arsUrlValueList[$nIndexValue + 1];
                    }
                    $arsParamList[$sParamName] = $sParamValue;
                }
            }
        }
        // Set controller
        self::setController($sController);
        // Set action to route action
        self::setAction($sAction);
        // Set param list
        self::setParameter($arsParamList);
    }
1207632
function GetAssoc($force_array = false, $first2cols = false)
	{
		$records = $this->_numOfRows;
		$results = array();
		for ( $i=0; $i < $records; $i++ ) {
			foreach ( $this->fields as $k=>$v ) {
				if ( is_array( $v ) ) {
					if ( $v['count'] == 1 ) {
						$results[$i][$k] = $v[0];
					} else {
						array_shift( $v );
						$results[$i][$k] = $v;
					}
				}
			}
		}

		return $results;
	}
233385
protected function _process( array $stmts )
	{
		$this->_msg( 'Adding constraint for table mshop_product_tag', 0 ); $this->_status( '' );

		if( $this->_schema->tableExists( 'mshop_product_tag' ) === true )
		{
			foreach ( $stmts as $constraint=>$stmt )
			{
				$this->_msg( sprintf( 'Checking constraint "%1$s": ', $constraint ), 1 );

				if( $this->_schema->constraintExists( 'mshop_product_tag', $constraint ) === false )
				{
					$this->_execute( $stmt );
					$this->_status( 'added' );
				}
				else
				{
					$this->_status( 'OK' );
				}
			}
		}
	}
769014
public function updateScope(Smarty_Internal_Template $tpl, $varName, $scope = Smarty::SCOPE_LOCAL)
    {
        if (!$scope && !$tpl->scope) {
            return;
        }
        foreach (array($scope, $tpl->scope) as $s) {
            $s = ($bubble_up = $s >= Smarty::SCOPE_BUBBLE_UP) ? $s - Smarty::SCOPE_BUBBLE_UP : $s;
            if ($bubble_up && $s) {
                $ptr = $tpl->parent;
                if (isset($ptr)) {
                    $ptr->tpl_vars[$varName] = $tpl->tpl_vars[$varName];
                    $ptr = $ptr->parent;
                }
                if ($s == Smarty::SCOPE_PARENT) {
                    continue;
                }
                while (isset($ptr) && $ptr->_objType == 2) {
                    $ptr->tpl_vars[$varName] = $tpl->tpl_vars[$varName];
                    $ptr = $ptr->parent;
                }
                if ($s == Smarty::SCOPE_TPL_ROOT) {
                    continue;
                } elseif ($s == Smarty::SCOPE_SMARTY) {
                    $tpl->smarty->tpl_vars[$varName] = $tpl->tpl_vars[$varName];
                } elseif ($s == Smarty::SCOPE_GLOBAL) {
                    Smarty::$global_tpl_vars[$varName] = $tpl->tpl_vars[$varName];
                } elseif ($s == Smarty::SCOPE_ROOT) {
                    while (isset($ptr->parent)) {
                        $ptr = $ptr->parent;
                    }
                    $ptr->tpl_vars[$varName] = $tpl->tpl_vars[$varName];
                }
            }
        }
    }