Files
2024-12-17 13:43:22 +01:00

61 lines
2.1 KiB
PHP

<?php
/**
* 2007-2021 ETS-Soft
*
* NOTICE OF LICENSE
*
* This file is not open source! Each license that you purchased is only available for 1 wesite only.
* If you want to use this file on more websites (or projects), you need to purchase additional licenses.
* You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please contact us for extra customization service at an affordable price
*
* @author ETS-Soft <etssoft.jsc@gmail.com>
* @copyright 2007-2021 ETS-Soft
* @license Valid for 1 website (or project) for each purchase of license
* International Registered Trademark & Property of ETS-Soft
*/
if (!defined('_PS_VERSION_'))
exit;
class ETS_CFU_Link extends LinkCore
{
public function getLangLinkFriendly($id_lang = null, Context $context = null, $id_shop = null)
{
if (!$context)
$context = Context::getContext();
if ((!$this->allow && in_array($id_shop, array($context->shop->id, null))) || !Language::isMultiLanguageActivated($id_shop) || !(int)Configuration::get('PS_REWRITING_SETTINGS', null, null, $id_shop))
return '';
if (!$id_lang)
$id_lang = $context->language->id;
return Language::getIsoById($id_lang) . '/';
}
public function getBaseLinkFriendly($id_shop = null, $ssl = null)
{
static $force_ssl = null;
if ($ssl === null) {
if ($force_ssl === null)
$force_ssl = (Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE'));
$ssl = $force_ssl;
}
if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && $id_shop !== null)
$shop = new Shop($id_shop);
else
$shop = Context::getContext()->shop;
$base = (($ssl && $this->ssl_enable) ? 'https://' . $shop->domain_ssl : 'http://' . $shop->domain);
return $base . $shop->getBaseURI();
}
}