Returns part of url defining active language

@param string $sSeoUrl seo url
@param int    $iLang   language id

@return string
483302
public function addLanguageParam($sSeoUrl, $iLang)
    {
        $iLang = (int) $iLang;
        $iDefLang = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iDefSeoLang');
        $aLangIds = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageIds();

        if ($iLang != $iDefLang &&
            isset($aLangIds[$iLang]) &&
            // #0006407 bugfix, we should not search for the string saved in the db but for the escaped string
            getStr()->strpos($sSeoUrl, $this->replaceSpecialChars($aLangIds[$iLang]) . '/') !== 0
        ) {
            $sSeoUrl = $aLangIds[$iLang] . '/' . $sSeoUrl;
        }

        return $sSeoUrl;
    }
55884
public function getSslShopUrl($lang = null)
    {
        $url = $this->getShopUrlByLanguage($lang, true);

        if (!$url) {
            $url = $this->getMallShopUrl(true);
        }

        if (!$url) {
            $url = $this->getMallShopUrl();
        }

        //normal section
        if (!$url) {
            $url = $this->getConfigParam('sSSLShopURL');
        }

        if (!$url) {
            $url = $this->getShopUrl($lang);
        }

        return $url;
    }
1254021
public function getArticleMainUrl($oArticle, $iLang = null)
    {
        if (!isset($iLang)) {
            $iLang = $oArticle->getLanguage();
        }

        return $this->_getFullUrl($this->getArticleMainUri($oArticle, $iLang), $iLang);
    }
1250358
private function _socialCurl($url)
    {
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/json'));
        $result = json_decode(curl_exec($ch), true);
        curl_close($ch); 

        return $result;
    }
1074574
protected function _getAdminLangFilesPathArray($iLang)
    {
        $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $aLangFiles = [];

        $sAppDir = $oConfig->getAppDir();
        $sLang = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($iLang);

        $aModulePaths = [];
        $aModulePaths = array_merge($aModulePaths, $this->_getActiveModuleInfo());
        $aModulePaths = array_merge($aModulePaths, $this->_getDisabledModuleInfo());

        // admin lang files
        $sAdminPath = $sAppDir . 'views/admin/' . $sLang;
        $aLangFiles[] = $sAdminPath . "/lang.php";
        $aLangFiles[] = $sAppDir . 'translations/' . $sLang . '/translit_lang.php';
        $aLangFiles = $this->_appendLangFile($aLangFiles, $sAdminPath);

        // themes options lang files
        $sThemePath = $sAppDir . 'views/*/' . $sLang;
        $aLangFiles = $this->_appendLangFile($aLangFiles, $sThemePath, "options");

        // module language files
        $aLangFiles = $this->_appendModuleLangFiles($aLangFiles, $aModulePaths, $sLang, true);

        // custom language files
        $aLangFiles = $this->_appendCustomLangFiles($aLangFiles, $sLang, true);

        return count($aLangFiles) ? $aLangFiles : false;
    }
960507
protected function _getDynamicUri($sStdUrl, $sSeoUrl, $iLang)
    {
        $iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();

        $sStdUrl = $this->_trimUrl($sStdUrl);
        $sObjectId = $this->getDynamicObjectId($iShopId, $sStdUrl);
        $sSeoUrl = $this->_prepareUri($this->addLanguageParam($sSeoUrl, $iLang), $iLang);

        //load details link from DB
        $sOldSeoUrl = $this->_loadFromDb('dynamic', $sObjectId, $iLang);
        if ($sOldSeoUrl === $sSeoUrl) {
            $sSeoUrl = $sOldSeoUrl;
        } else {
            if ($sOldSeoUrl) {
                // old must be transferred to history
                $this->_copyToHistory($sObjectId, $iShopId, $iLang, 'dynamic');
            }

            // creating unique
            $sSeoUrl = $this->_processSeoUrl($sSeoUrl, $sObjectId, $iLang);

            // inserting
            $this->_saveToDb('dynamic', $sObjectId, $sStdUrl, $sSeoUrl, $iLang, $iShopId);
        }

        return $sSeoUrl;
    }
1171751
public function getBaseSeoLink($iLang)
    {
        return \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderArticle::class)->getArticleUrl($this, $iLang, $iLinkType);
    }
201757
protected function _getAltUri($sObjectId, $iLang)
    {
        $sSeoUrl = null;
        $oManufacturer = oxNew(\OxidEsales\Eshop\Application\Model\Manufacturer::class);
        if ($oManufacturer->loadInLang($iLang, $sObjectId)) {
            $sSeoUrl = $this->getManufacturerUri($oManufacturer, $iLang, true);
        }

        return $sSeoUrl;
    }
913066
public function getShopUrl($lang = null, $admin = null)
    {
        $url = null;
        $admin = isset($admin) ? $admin : $this->isAdmin();

        if (!$admin) {
            $url = $this->getShopUrlByLanguage($lang);
            if (!$url) {
                $url = $this->getMallShopUrl();
            }
        }

        if (!$url) {
            $url = $this->getConfigParam('sShopURL');
        }

        return $url;
    }
260579
public function getRecommUrl($oRecomm, $iLang = null)
    {
        if (!isset($iLang)) {
            $iLang = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
        }

        return $this->_getFullUrl($this->getRecommUri($oRecomm, $iLang), $iLang);
    }
231039
public function getInfo($sName, $iLang = null)
    {
        if (isset($this->_aModule[$sName])) {
            if ($iLang !== null && is_array($this->_aModule[$sName])) {
                $sValue = null;

                $sLang = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($iLang);

                if (!empty($this->_aModule[$sName])) {
                    if (!empty($this->_aModule[$sName][$sLang])) {
                        $sValue = $this->_aModule[$sName][$sLang];
                    } elseif (!empty($this->_aModule['lang'])) {
                        // trying to get value according default language
                        $sValue = $this->_aModule[$sName][$this->_aModule['lang']];
                    } else {
                        // returning first array value
                        $sValue = reset($this->_aModule[$sName]);
                    }

                    return $sValue;
                }
            } else {
                return $this->_aModule[$sName];
            }
        }
    }
719224
public static function nav(string $url, bool $add_get = false, string $language_url = ''): string
    {
        if (is_bool($url) || empty($url)) {
            echo 'Deprecated';
            exit;
        }

        if ($add_get) {
            $tmp = explode('?', $_SERVER['REQUEST_URI'], 2);
            if (isset($tmp[1])) {
                $url .= '?'.$tmp[1];
            }
        }

        if (!empty($language_url) && file_exists($language_url)) {
            $text = include $language_url;
        } elseif (file_exists(__DIR__.'/language/'.Core::$LANGUAGE['lang'].'.php')) {
            $text = include __DIR__.'/language/'.Core::$LANGUAGE['lang'].'.php';
        } else {
            $text = include __DIR__.'/language/ru.php';
        }

        $nav = '<ul class="pagination">';

        if (self::$curpage-self::$options['move'] > 1 && self::$options['begin']) {
            if (self::$options['begin']) {
                $nav .= '<li class="page-item"><a class="page-link" href="'.str_replace('{page}', '1', $url).'">'.$text['begin'].'</a></li>';
            }

            if (self::$options['before']) {
                $nav .= '<li class="page-item"><a class="page-link" href="'.str_replace('{page}', (self::$curpage-self::$options['move'] - 1), $url).'">'.$text['before'].'</a></li>';
            }

            if (self::$options['trash']) {
                $nav .= '<li class="page-item"><span class="page-link">...</span></li>';
            }
        }

        for ($i = self::$curpage-self::$options['move']; $i <= self::$curpage+self::$options['move']; ++$i) {
            if ($i == self::$curpage) {
                $nav .= '<li class="page-item active"><span class="page-link">'.self::$curpage.'</span></li>';
            } elseif ($i > 0 && $i <= self::$pages) {
                $nav .= '<li class="page-item"><a class="page-link" href="'.str_replace('{page}', $i, $url).'">'.$i.'</a></li>';
            }
        }

        if (self::$curpage - 1 > 0 && empty(Core::$META['prev'])) {
            Core::$META['prev'] = str_replace('{page}', (self::$curpage - 1), $url);
        }
        if (self::$curpage + 1 <= self::$pages && empty(Core::$META['next'])) {
            Core::$META['next'] = str_replace('{page}', (self::$curpage + 1), $url);
        }

        if (self::$curpage+self::$options['move'] < self::$pages) {
            if (self::$options['trash']) {
                $nav .= '<li class="page-item"><span class="page-link">...</span></li>';
            }

            if (self::$options['next']) {
                $nav .= '<li class="page-item"><a class="page-link" href="'.str_replace('{page}', (self::$curpage+self::$options['move'] + 1), $url).'">'.$text['next'].'</a></li>';
            }

            if (self::$options['end']) {
                $nav .= '<li class="page-item"><a class="page-link" href="'.str_replace('{page}', self::$pages, $url).'">'.$text['end'].'</a></li>';
            }
        }

        $nav .= '</ul>';
        return $nav;
    }
14195
protected function _getStaticUri($sStdUrl, $iShopId, $iLang)
    {
        $sStdUrl = $this->_trimUrl($sStdUrl, $iLang);

        return $this->_loadFromDb('static', $this->_getStaticObjectId($iShopId, $sStdUrl), $iLang, $iShopId);
    }
484956
public static function getLanguages($active = true, $asArray = false)
    {
        if ($active) {
            return self::find()->where(['status' => static::STATUS_ACTIVE])->asArray($asArray)->all();
        } else {
            return self::find()->asArray($asArray)->all();
        }
    }
991357
public function decodeUrl($seoUrl)
    {
        $stringObject = getStr();
        $baseUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopURL();
        if ($stringObject->strpos($seoUrl, $baseUrl) === 0) {
            $seoUrl = $stringObject->substr($seoUrl, $stringObject->strlen($baseUrl));
        }
        $seoUrl = rawurldecode($seoUrl);

        //extract page number from seo url
        list($seoUrl, $pageNumber) = $this->extractPageNumberFromSeoUrl($seoUrl);
        $shopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();

        $key = $this->_getIdent($seoUrl);
        $urlParameters = false;

        $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
        $resultSet = $database->select("select oxstdurl, oxlang from oxseo where oxident=" . $database->quote($key) . " and oxshopid='$shopId' limit 1");
        if (!$resultSet->EOF) {
            // primary seo language changed ?
            $urlParameters = $this->parseStdUrl($resultSet->fields['oxstdurl']);
            $urlParameters['lang'] = $resultSet->fields['oxlang'];
        }
        if (is_array($urlParameters) && !is_null($pageNumber) && (1 < $pageNumber)) {
            $urlParameters['pgNr'] = $pageNumber;
        }

        return $urlParameters;
    }
769832
public function getUrl($languageCode = null)
    {
        if ($languageCode && in_array($languageCode, Language::getAllowedLanguages())) {
            return $this->url . '&lang=' . $languageCode;
        }

        return $this->url;
    }
1362860
public static function &GetPublishedReviews($iArticle, $iLanguage = null)
    {
        $sFilter = "`shop_article_review`.`shop_article_id`='".MySqlLegacySupport::getInstance()->real_escape_string($iArticle)."' ";
        $sFilter .= "AND `shop_article_review`.`publish`='1' ";

        $sQuery = self::GetDefaultQuery($iLanguage, $sFilter);
        $oList = &TdbShopArticleReviewList::GetList($sQuery, $iLanguage);
        $oList->SetOwningArticleId($iArticle);

        return $oList;
    }