public function removeDetailAction()
 {
     Misc_Utils::removeFromFavorites($this->getRequest()->getParam("id"));
     echo '<a id="p' . $this->getRequest()->getParam("id") . '" href="#" onclick="return addToFavoritesDetail(' . $this->getRequest()->getParam("id") . ')"
         title="Add to favorites">Add to favorites</a>';
     exit;
 }
 public function testingAction()
 {
     $this->view->layout()->disableLayout();
     $this->_helper->viewRenderer->setNoRender(true);
     echo 'Testing <br/>';
     $session = new Zend_Session_Namespace('favorites');
     echo '<pre>' . print_r($session, true) . '</pre>';
     $session->setExpirationSeconds(2592000);
     $session->favorites = new ArrayObject(array());
     die('<pre>' . print_r($session->favorites, true) . '</pre>');
     $results = Misc_Utils::getFavorites();
     echo '<pre>' . print_r($results, true) . '</pre>';
     return true;
 }
Exemplo n.º 3
0
 public function init()
 {
     $this->view->controller = $this->getRequest()->getControllerName();
     $this->view->action = $this->getRequest()->getActionName();
     if ($this->getRequest()->getParam("removeFromFavorites") != null) {
         Misc_Utils::removeFromFavorites($this->getRequest()->getParam("removeFromFavorites"));
         $this->_redirect("/my-favorites");
         exit;
     } elseif ($this->getRequest()->getParam("addToFavorites") != null) {
         Misc_Utils::addToFavorites($this->getRequest()->getParam("addToFavorites"));
         $this->_redirect("/my-favorites");
         exit;
     }
 }