public function addstoryAction() { if ($this->getRequest()->isPost() & $this->_ajaxRequest) { $story = $this->getRequest()->getParams(); if (isset($story['content'])) { $storyService = new Service_Userstory(); if (is_array($newStory = $storyService->addNew($this->_user->id, $story))) { $this->_response->appendBody('1'); return; } else { $this->_response->appendBody('0'); return; } } else { $this->_response->appendBody('0'); return; } } else { return $this->_redirect('/profile'); } }