/**
* Add tab in session
*
* @return \Zend\View\Model\JsonModel
*/
public function importTabAction()
{
if (!$this->getRequest()->isPost()) {
return $this->returnJson(array('success' => false, 'message' => 'Error'));
}
$tabId = $this->getRequest()->getPost()->get('tab_id');
$tabModel = Tab\Model::fromId($tabId);
$propertiesList = $tabModel->getProperties();
$properties = array();
foreach ($propertiesList as $property) {
$properties[] = array('name' => $property->getName(), 'identifier' => $property->getIdentifier(), 'description' => $property->getDescription(), 'datatype' => $property->getDatatypeId(), 'isRequired' => $property->isRequired());
}
$tab = array('name' => $tabModel->getName(), 'description' => $tabModel->getDescription(), 'properties' => $properties);
return $this->returnJson(array('success' => true, 'tab' => $tab));
}