first commit

This commit is contained in:
2025-03-12 17:06:23 +01:00
commit 2241f7131f
13185 changed files with 1692479 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
<?php
/**
* SOTESHOP/stCurrencyPlugin
*
* Ten plik należy do aplikacji stCurrencyPlugin opartej na licencji (Open License SOTE) Otwarta Licencja SOTE.
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
*
* @package stCurrencyPlugin
* @subpackage actions
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Otwarta Licencja SOTE
* @version $Id: actions.class.php 97 2009-08-26 08:04:10Z marcin $
* @author Marcin Olejniczak <marcin.olejniczak@sote.pl>
*/
/**
* stCurrencyFrontend actions.
*
* @package stCurrencyPlugin
* @subpackage actions
*/
class stCurrencyFrontendActions extends stActions
{
public function initialize($context)
{
$ret = parent::initialize($context);
stLanguage::disablePath();
return $ret;
}
public function executeChange()
{
$this->executeAddCurrency();
}
/**
* Funkcja zapisujaca wybrana walute
*/
public function executeAddCurrency()
{
$referer = $this->getRequest()->getReferer();
$currency = stCurrency::getInstance($this->getContext());
$currency->set($this->getRequestParameter('currency'));
// disable Fast Cache for this session if currency is different that default
stFastCacheController::disable();
$filters = $this->getUser()->getAttribute('filters', array(), 'soteshop/stProduct');
if (isset($filters['price']))
{
unset($filters['price']);
}
$this->getUser()->setAttribute('filters', $filters, 'soteshop/stProduct');
$this->postExecute();
return $this->redirect($referer);
}
}

View File

@@ -0,0 +1,80 @@
<?php
/**
* SOTESHOP/stCurrencyPlugin
*
* Ten plik należy do aplikacji stCurrencyPlugin opartej na licencji (Open License SOTE) Otwarta Licencja SOTE.
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
*
* @package stCurrencyPlugin
* @subpackage actions
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/open (Open License SOTE) Otwarta Licencja SOTE
* @version $Id: components.class.php 97 2009-08-26 08:04:10Z marcin $
* @author Marcin Olejniczak <marcin.olejniczak@sote.pl>
*/
/**
* Akcje komponentu currency
*
* @package stCurrencyPlugin
* @subpackage actions
*/
class stCurrencyFrontendComponents extends sfComponents
{
/**
* Funkcja wyświetlenia componentu do zmiany waluty
*/
public function executePickCurrency()
{
if ($this->getUser()->getParameter('hide', false, 'soteshop/stCurrencyPlugin'))
{
return sfView::NONE;
}
$config = stConfig::getInstance('stProduct');
if ($config->get('hide_price') || $this->hasFlash('stCurrency-hide_list'))
{
return sfView::NONE;
}
$currencies = CurrencyPeer::doSelectActive();
if (!$currencies || count($currencies) == 1)
{
return sfView::NONE;
}
$smarty = new stSmarty('stCurrencyFrontend');
$selected = stCurrency::getInstance($this->getContext())->get();
if ($this->getController()->getTheme()->getVersion() < 7)
{
$this->currencies = array();
foreach ($currencies as $currency)
{
$this->currencies[$currency->getId()] = $currency->getShortcut();
}
$this->selected = $selected->getId();
$this->smarty = $smarty;
}
else
{
sfLoader::loadHelpers(array('Helper', 'stUrl'));
$smarty->assign('currencies', $currencies);
$smarty->assign('selected', $selected);
$smarty->register_function('url_for_currency', array('stCurrencyFrontendComponents', 'urlForCurrency'));
return $smarty;
}
}
public static function urlForCurrency($params)
{
return st_url_for('@stCurrencyFrontend?action=change&currency='.$params['currency']->getId());
}
}

View File

@@ -0,0 +1,2 @@
_pickCurrency:
enabled: off

View File

@@ -0,0 +1,7 @@
<?php
st_theme_use_stylesheet('stCurrencyPlugin.css');
$smarty->assign("form_start", form_tag('currency/addCurrency'));
$smarty->assign("select_currency", select_tag("currency", options_for_select($currencies, $selected), array('onchange' => 'this.form.submit()')));
$smarty->assign("save_button");
$smarty->display("currency_pick.html");
?>

View File

@@ -0,0 +1,6 @@
<div id="st_component-st_currency_plugin-pick_currency">
{$form_start}
{$select_currency}
<noscript>{$save_button}</noscript>
</form>
</div>

View File

@@ -0,0 +1,6 @@
<div id="pick">
{$form_start}
{$select_currency}
<noscript>{$save_button}</noscript>
</form>
</div>

View File

@@ -0,0 +1,6 @@
<ul class="pick-currency">
<li>{__ text="Waluta" }</li>
{foreach item=currency from=$currencies}
<li{if $selected == $currency} class="active"{/if}><a href="{url_for_currency currency=$currency}" rel="nofollow">{$currency->getShortcut()}</a></li>
{/foreach}
</ul>