/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
license. */
-require ("./inc/settings.php");
-require ("./inc/db/mysql.php");
+require_once ("./inc/settings.php");
+require_once ("./inc/db/mysql.php");
+require_once ("./inc/utils.php");
$error = false;
try {
<noscript>
<style type="text/css">
- #map, #editor, #newimage, #global_admin, #login_area {
+ #map, #editor, #admin, #login_area {
display: none;
}
</style>
<div id="map"></div>
- <p id="logout"><a href="auth.php?logout=true">Déconnexion</a></p>
+ <div id="admin" class="center">
+ <input id="newfeature_button" type="button" value="ajouter un emplacement">
+ <p id="server_comm"></p>
+ <p id="instructions"></p>
+ </div>
- <!-- we need to set some random content to give some height to
- #features_success -->
- <p class="success center" id="features_success">.</p>
+ <p id="logout"><a href="logout.php">Déconnexion</a></p>
<div id="editor" class="center">
- <label for="title_input">titre :</label><br>
- <input id="title_input" class="input" size="50"><br>
- <label for="desc_input">description :</label><br>
- <textarea id="desc_input" class="input" cols="45" rows="4"></textarea><br>
- <img id="img"><br>
- <input id="deletephoto_button" type="button" class="center" value="supprimer cette photo">
+ <input id="editor_close" type="image" src="openlayers/theme/default/img/close.gif"
+ title="fermer sans enregistrer" alt="fermer">
+ <form id="feature_update" method="post" enctype="multipart/form-data">
+ <label for="title">titre :</label><br>
+ <input id="title" name="title"><br>
+ <label for="description">description :</label><br>
+ <textarea id="description" name="description" rows="4"></textarea><br>
+ <div><img id="img"></div>
+ <input id="image_delete" type="button" value="supprimer l'image">
+ <div>
+ <label for="image_file">ajouter une image :</label>
+ <input id="image_file" type="file" name="image_file">
+ </div>
+ <br>
+ <div class="center">
+ <input id="validate_editor" type="submit" value="Valider les changements">
+ </div>
+ <input type="hidden" name="request">
+ <input type="hidden" name="lon">
+ <input type="hidden" name="lat">
+ <input type="hidden" name="fid">
+ <input type="hidden" name="keep_img">
+ </form>
+ <form id="feature_delete" method="post">
+ <input id="delete" type="submit" value="Supprimer la fiche">
+ <input type="hidden" name="request" value="del">
+ <input type="hidden" name="fid">
+ </form>
</div>
- <div id="newimage">
- <img id="newimage_close" src="openlayers/theme/default/img/close.gif" alt="fermer">
- <form id="file_form"
- action="changes.php"
- method="POST"
- enctype="multipart/form-data"
- target="fileframe"
- accept="image/gif image/jpeg image/jpg image/png"
- >
- <label for="newimage_input">sélectionnez une image</label>
- <input id="newimage_input" name="newimage_input" type="file">
- </form>
- <p id="newimage_throbber" class="throbber center">
- Upload en cours
- <img src="media/newimage_throbber.gif" alt="throbber">
- </p>
- <img id="newimage_preview" src="">
- <p class="warn center" id="newimage_warn"></p>
- <p class="error center" id="newimage_error"></p>
- </div>
-
- <div id="global_admin" class="center">
- <p id="modify_howto">Pour modifier les données d'une photo, sélectionnez le marqueur correspondant</p>
- <p id="dragdrop_howto">Vous pouvez déplacer le marqueur en effectuant un glisser-déposer</p>
- <input id="addphoto_button" type="button" class="center" value="ajouter une image">
- <p class="error" id="features_connect_error"></p>
- </div>
-
-
- <div id="login_area"<?php
- $cookie_name = sprintf ("%sauth", DBPREFIX);
- if (isset ($_COOKIE [$cookie_name])) {
- if ($connection->checkpwdmd5 ("admin", $_COOKIE [$cookie_name])) {
- echo ' class="hidden"';
- }
+ <div id="login_area"
+ <?php
+ if ($connection->checkpwdmd5 ("admin",
+ $_COOKIE [sprintf ("%sauth", DBPREFIX)])) {
+ echo ' class="hidden"';
}
?>>
<div id="login_transparency"></div>
<div id="login_padding"></div>
<div id="login_content">
- <form id="login_form" method="post" action="auth.php">
+ <form id="login_form" method="post">
<table>
<tr>
- <td><label for="user_pwd">mot de passe</label></td>
- <td style="width: 100%"><input id="user_pwd" name="user_pwd" type="password"></td>
+ <td><label for="password">mot de passe</label></td>
+ <td style="width: 100%"><input id="password" name="password" type="password"></td>
</tr>
</table>
<p class="center">
- <input id="login_submit" type="submit">
+ <input id="login_submit" type="submit" value="Connexion">
+ <input type="hidden" name="request" value="auth">
</p>
<p id="pwd_throbber" class="throbber center">
Connexion en cours
<img src="media/pwd_throbber.gif" alt="throbber">
</p>
- <p class="error center" id="login_connect_error"></p>
- <p class="error center" id="login_password_error">Le mot de passe n'est pas correct</p>
+ <p class="error center" id="login_error"></p>
</form>
</div>
</div>
- <iframe id="fileframe" name="fileframe" src="" frameborder="0" width="0" height="0"></iframe>
+ <iframe id="api_frame" name="api_frame" src="" frameborder="0" width="0" height="0"></iframe>
+
</body>
</html>