/** * Returns the finish template. * * The return have: * <pre> * - type => The type of the message (error or success). * - message => The message. * - template => The template to show. * </pre> * * The return is in JSON format. * * @return void */ public function jsonFinishAction() { $this->view->message = array(); $this->view->success = array(); if (null !== $this->_setup) { ob_start(); $this->_setup->finish(); $error = $this->_setup->getError(); if (!empty($error)) { $message = array_shift($error); $type = 'notice'; } else { $message = ob_get_contents(); $type = 'success'; } ob_end_clean(); } else { $this->getResponse()->setHttpResponseCode(403); $this->sendResponse(); } $template = $this->view->render('finish.phtml'); $this->returnContent($type, $message, $template); }