*/ /** * Akcje modułu akcesoria * * @author Krzysztof Bebło * * @package stAccessoriesPlugin * @subpackage actions */ class stAccessoriesFrontendActions extends stActions { /** * Pokazuje akcesoria dla danego produktu */ public function executeAccessoriesList() { if(!$this->getRequest()->isXmlHttpRequest() && $this->getController()->getRenderMode() != sfView::RENDER_VAR){ $this->getResponse()->setStatusCode(404); $this->getResponse()->setHttpHeader('Status', '404 Not Found'); return $this->forward('stErrorFrontend', 'error404'); } $this->smarty = new stSmarty($this->getModuleName()); $this->config = stConfig::getInstance(sfContext::getInstance(), 'stProduct'); $this->config_points = stConfig::getInstance(sfContext::getInstance(), 'stPointsBackend'); $this->config_points->setCulture($this->getRequestParameter('culture', stLanguage::getOptLanguage())); $this->setLayout(false); $product_id = $this->getRequestParameter('id'); $c = new Criteria(); $c->addJoin(ProductHasAccessoriesPeer::ACCESSORIES_ID, ProductPeer::ID); $c->add(ProductHasAccessoriesPeer::PRODUCT_ID, $product_id); $c->addAscendingOrderByColumn(ProductHasAccessoriesPeer::ID); ProductPeer::addFilterCriteria($this->getContext(), $c, false); $this->products = ProductPeer::doSelectForPager($c); } }