echo '<div class="actions">'; echo '<a href="' . api_get_self() . '?type=' . $obj->type . '">' . Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM) . '</a>'; echo '</div>'; $form->addElement('hidden', 'sec_token'); $form->setConstants(array('sec_token' => $token)); $form->display(); } break; case 'edit': // Action handling: Editing $url = api_get_self() . '?type=' . $obj->type . '&action=' . Security::remove_XSS($_GET['action']) . '&id=' . intval($_GET['id']); $form = $obj->return_form($url, 'edit'); // The validation or display if ($form->validate()) { $values = $form->exportValues(); $res = $obj->update($values); Display::display_confirmation_message(sprintf(get_lang('ItemUpdated'), $values['variable']), false); $obj->display(); } else { echo '<div class="actions">'; echo '<a href="' . api_get_self() . '?type=' . $obj->type . '">' . Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM) . '</a>'; echo '</div>'; $form->addElement('hidden', 'sec_token'); $form->setConstants(array('sec_token' => $token)); $form->display(); } break; case 'delete': // Action handling: delete //if ($check) { $res = $obj->delete($_GET['id']);