if (!isset($fields[$idField]['delete'])) { $field = new Model\FieldDo(); $newId = $fields[$idField]['id'] === '' || $fields[$idField]['id'] === $field::EMPTY_ID ? $field->generateId($fields[$idField]['name']) : $fields[$idField]['id']; $field->setId($newId); $field->setType($fields[$idField]['type']); $field->setName($fields[$idField]['name']); $modified_structure->addField($field); } } if ($new_field_type) { $field = new Model\FieldDo(); $field->setType($new_field_type); $modified_structure->addField($field); } $structures->set($modified_structure, $id); $structures->save(); $returnUrl = 'index.php?a=edit&r=ok&id=' . urlencode($id); } else { $returnUrl = 'index.php?a=' . $accion . '&r=ko&id=' . urlencode($id) . '&name=' . urlencode($name) . '&storage=' . urlencode($storage); } break; case 'clone': $returnUrl = 'index.php?a=clone&id=' . urlencode($id); break; case 'delete': try { $structures->remove($id); $structures->save(); $result = 'ok'; } catch (\Exception $e) { d($e);