first commit
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
|
||||
class stProductObserveFrontendActions extends stActions
|
||||
{
|
||||
public function executeAddToObserve()
|
||||
{
|
||||
|
||||
$product_id = $this->getRequestParameter('product_id');
|
||||
|
||||
stProductObservePluginListener::addObserveProduct($product_id);
|
||||
|
||||
//return sfView::NONE;
|
||||
return $this->renderText("true");
|
||||
|
||||
}
|
||||
|
||||
public function executeRemoveFromObserve()
|
||||
{
|
||||
|
||||
$product_id = $this->getRequestParameter('product_id');
|
||||
|
||||
stProductObservePluginListener::delObserveProduct($product_id);
|
||||
|
||||
//return sfView::NONE;
|
||||
return $this->renderText("true");
|
||||
|
||||
}
|
||||
|
||||
public function executeRemoveAll()
|
||||
{
|
||||
|
||||
stProductObservePluginListener::removeAll();
|
||||
|
||||
//return sfView::NONE;
|
||||
return $this->renderText("true");
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function executeShowProductsSidebar()
|
||||
{
|
||||
$this->smarty = new stSmarty('stProductObserveFrontend');
|
||||
|
||||
$config_observe = stConfig::getInstance(sfContext::getInstance(), 'stProductObserveBackend');
|
||||
|
||||
|
||||
if($config_observe->get('enabled')!=1){
|
||||
return sfView::NONE;
|
||||
}
|
||||
|
||||
$i18n = $this->getContext()->getI18n();
|
||||
|
||||
|
||||
if(stProductObservePluginListener::getObserveProducts()){
|
||||
|
||||
$this->config = stConfig::getInstance(sfContext::getInstance(), 'stProduct');
|
||||
|
||||
$this->products = stProductObservePluginListener::getObserveProducts();
|
||||
|
||||
}else{
|
||||
return $this->renderText("<p>".$i18n->__('W tym miejscu pojawią się obserwowane produkty.')."</p>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function executeObserveProductsIds()
|
||||
{
|
||||
$products = stProductObservePluginListener::getObserveProductsIds();
|
||||
return $this->renderJSON($products);
|
||||
}
|
||||
|
||||
public function executeListShowProducts()
|
||||
{
|
||||
$this->smarty = new stSmarty('stProductObserveFrontend');
|
||||
|
||||
$config_observe = stConfig::getInstance(sfContext::getInstance(), 'stProductObserveBackend');
|
||||
|
||||
if(stProductObservePluginListener::getObserveProducts()){
|
||||
|
||||
$this->config = stConfig::getInstance(sfContext::getInstance(), 'stProduct');
|
||||
|
||||
$this->products = stProductObservePluginListener::getObserveProducts();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
|
||||
class stProductObserveFrontendComponents extends sfComponents
|
||||
{
|
||||
public function executeProductObserve()
|
||||
{
|
||||
|
||||
$this->smarty = new stSmarty('stProductObserveFrontend');
|
||||
|
||||
$config = stConfig::getInstance(sfContext::getInstance(), 'stProductObserveBackend');
|
||||
|
||||
if($config->get('enabled')!=1){
|
||||
return sfView::NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function executeObserveProductsSidebar()
|
||||
{
|
||||
$this->smarty = new stSmarty('stProductObserveFrontend');
|
||||
|
||||
$config = stConfig::getInstance(sfContext::getInstance(), 'stProductObserveBackend');
|
||||
|
||||
if($config->get('enabled')!=1){
|
||||
return sfView::NONE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function executeListProductObserve()
|
||||
{
|
||||
|
||||
$this->smarty = new stSmarty('stProductObserveFrontend');
|
||||
|
||||
$config = stConfig::getInstance(sfContext::getInstance(), 'stProductObserveBackend');
|
||||
|
||||
if($config->get('enabled')!=1){
|
||||
return sfView::NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user