*/ /** * Klasa stBoxFrontendComponents * * @package stBoxPlugin * @subpackage actions */ class stBoxFrontendComponents extends sfComponents { public function executeBoxes() { $c = new Criteria(); $c->add(BoxPeer::ACTIVE,1); $this->boxes = BoxPeer::doSelect($c); if (!$this->boxes) { return sfView::NONE; } $this->smarty = new stSmarty('stBoxFrontend'); } public function executeBoxSingle() { if ($this->webmaster_id || $this->id) { $c = new Criteria(); if ($this->webmaster_id) { $c->add(BoxPeer::WEBMASTER_ID, $this->webmaster_id); } elseif ($this->id) { $c->add(BoxPeer::ID, $this->id); } $c->add(BoxPeer::ACTIVE, 1); stEventDispatcher::getInstance()->notify(new sfEvent($this, 'stBoxFrontendComponents.preBoxQuery', array('criteria' => $c))); $this->box = BoxPeer::doSelectOne($c); } if (!$this->box) { return sfView::NONE; } $this->smarty = new stSmarty('stBoxFrontend'); } public function executeBoxGroup() { if (!$this->box_group) { return sfView::NONE; } $c = new Criteria(); $c->add(BoxGroupPeer::BOX_GROUP,$this->box_group); $c->addJoin(BoxGroupPeer::ID, BoxPeer::BOX_GROUP_ID); $c->add(BoxPeer::ACTIVE, 1); stEventDispatcher::getInstance()->notify(new sfEvent($this, 'stBoxFrontendComponents.preBoxQuery', array('criteria' => $c))); $this->boxes = BoxPeer::doSelect($c); if (!$this->boxes) { return sfView::NONE; } $this->smarty = new stSmarty('stBoxFrontend'); } }