public function deleteTabAction()
{
if ($this->getRequest()->isPost()) {
$session = $this->getSession();
$id = $this->getRequest()->getPost()->get('tab');
$tabs = empty($session['document-type']) ? array() : $session['document-type']['tabs'];
if (array_key_exists($id, $tabs)) {
$documentTypeSession = $session['document-type'];
unset($documentTypeSession['tabs'][$id]);
$session->offsetSet('document-type', $documentTypeSession);
return $this->returnJson(array('success' => true, 'message' => 'This tab has been deleted'));
}
}
return $this->returnJson(array('success' => false, 'message' => 'Error'));
}