first commit

This commit is contained in:
2024-11-05 12:22:50 +01:00
commit e5682a3912
19641 changed files with 2948548 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "644f04b4083da30e4e16083e479ef457",
"packages": [],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.4"
},
"platform-dev": []
}

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>ps_languageselector</name>
<displayName><![CDATA[Language selector]]></displayName>
<version><![CDATA[2.1.0]]></version>
<description><![CDATA[Adds a block allowing customers to select a language for your store&#039;s content.]]></description>
<author><![CDATA[PrestaShop]]></author>
<is_configurable>0</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>ps_languageselector</name>
<displayName><![CDATA[Blok wyboru języka]]></displayName>
<version><![CDATA[2.1.0]]></version>
<description><![CDATA[Dodaje blok pozwalający klientom wybrać język zawartości Twojego sklepu.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[]]></tab>
<is_configurable>0</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2020 PrestaShop SA and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* 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 refer to https://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@@ -0,0 +1,108 @@
<?php
/**
* 2007-2020 PrestaShop SA and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* 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 refer to https://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PrestaShop\PrestaShop\Core\Module\WidgetInterface;
class Ps_Languageselector extends Module implements WidgetInterface
{
/**
* @var string Name of the module running on PS 1.6.x. Used for data migration.
*/
const PS_16_EQUIVALENT_MODULE = 'blocklanguages';
private $templateFile;
public function __construct()
{
$this->name = 'ps_languageselector';
$this->author = 'PrestaShop';
$this->version = '2.1.0';
$this->need_instance = 0;
parent::__construct();
$this->displayName = $this->trans('Language selector block', array(), 'Modules.Languageselector.Admin');
$this->description = $this->trans('Adds a block allowing customers to select a language for your store\'s content.', array(), 'Modules.Languageselector.Admin');
$this->ps_versions_compliancy = array('min' => '1.7.1.0', 'max' => _PS_VERSION_);
$this->templateFile = 'module:ps_languageselector/ps_languageselector.tpl';
}
public function install()
{
// Migrate data from 1.6 equivalent module (if applicable), then uninstall
if (Module::isInstalled(self::PS_16_EQUIVALENT_MODULE)) {
$oldModule = Module::getInstanceByName(self::PS_16_EQUIVALENT_MODULE);
if ($oldModule) {
$oldModule->uninstall();
}
}
return parent::install();
}
public function renderWidget($hookName = null, array $configuration = [])
{
$languages = Language::getLanguages(true, $this->context->shop->id);
if (1 < count($languages)) {
$this->smarty->assign($this->getWidgetVariables($hookName, $configuration));
return $this->fetch($this->templateFile);
}
return false;
}
public function getWidgetVariables($hookName = null, array $configuration = [])
{
$languages = Language::getLanguages(true, $this->context->shop->id);
foreach ($languages as &$lang) {
$lang['name_simple'] = $this->getNameSimple($lang['name']);
}
return array(
'languages' => $languages,
'current_language' => array(
'id_lang' => $this->context->language->id,
'name' => $this->context->language->name,
'name_simple' => $this->getNameSimple($this->context->language->name),
'iso_code' => $this->context->language->iso_code
)
);
}
private function getNameSimple($name)
{
return preg_replace('/\s\(.*\)$/', '', $name);
}
}

View File

@@ -0,0 +1,34 @@
{**
* 2007-2020 PrestaShop SA and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* 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 refer to https://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="language-selector">
<span>{$current_language.name_simple}</span>
<ul>
{foreach from=$languages item=language}
<li {if $language.id_lang == $current_language.id_lang} class="current" {/if}>
<a href="{$link->getLanguageLink($language.id_lang)}">{$language.name_simple}</a>
</li>
{/foreach}
</ul>
</div>

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2020 PrestaShop SA and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* 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 refer to https://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;