60 lines
2.1 KiB
PHP
60 lines
2.1 KiB
PHP
<?php
|
|
/**
|
|
* Copyright ETS Software Technology Co., Ltd
|
|
*
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* This file is not open source! Each license that you purchased is only available for 1 website 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.
|
|
*
|
|
* @author ETS Software Technology Co., Ltd
|
|
* @copyright ETS Software Technology Co., Ltd
|
|
* @license Valid for 1 website (or project) for each purchase of license
|
|
*/
|
|
|
|
if (!defined('_PS_VERSION_'))
|
|
exit;
|
|
class Ets_blog_link_class 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(Module::isEnabled('ets_seo') && Language::isMultiLanguageActivated($id_shop) && (int)Configuration::get('ETS_SEO_ENABLE_REMOVE_LANG_CODE_IN_URL') && $id_lang == (int)Configuration::get('PS_LANG_DEFAULT')){
|
|
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();
|
|
}
|
|
} |