public function bookmarkAction() { if ($this->getRequest()->isPost() && $this->_ajaxRequest) { if ($resource = $this->getRequest()->getParam('resource', FALSE)) { $resourceService = new Service_Resource(); if (is_array($results = $resourceService->addBookmark($resource, $this->_user->id))) { $this->_response->appendBody('1'); return; } else { $this->_response->appendBody('0'); return; } } else { $this->_response->appendBody('0'); return; } } else { $this->_response->appendBody('0'); return; } }