} } else { if (isset($_POST['label'])) { // New location $location = new \Pasteque\Location($_POST['label']); $id = $srv->create($location); if ($id !== false) { $message = \i18n("Location saved. <a href=\"%s\">Go to the location page</a>.", PLUGIN_NAME, \Pasteque\get_module_url_action(PLUGIN_NAME, 'location_edit', array('id' => $id))); } else { $error = \i18n("Unable to save changes"); } } } $location = null; if (isset($_GET['id'])) { $location = $srv->get($_GET['id']); } ?> <h1><?php \pi18n("Edit a location", PLUGIN_NAME); ?> </h1> <?php \Pasteque\tpl_msg_box($message, $error); ?> <form class="edit" action="<?php echo \Pasteque\get_current_url(); ?> " method="post" enctype="multipart/form-data">