2 /* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
7 if (!@include_once ("./inc/settings.php")) {
10 require_once ("./inc/db/mysql.php");
11 require_once ("./inc/utils.php");
14 $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
15 $usrtblexists = $connection->users_table_exists ();
16 $itemstblexists = $connection->items_table_exists ();
17 } catch (Exception $e) {
20 if (!$usrtblexists || !$itemstblexists) {
25 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
26 "http://www.w3.org/TR/html4/loose.dtd">
27 <html lang="<?php echo $lang?>">
29 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
30 <title><?php ptrans('SYP admin')?></title>
31 <link rel="stylesheet" href="./media/admin.css" type="text/css">
34 <p class="error center"><?php ptrans('SYP is not correctly installed. Please follow README.txt instructions
35 and go to <a href="install.en.php">wizard</a>.')?></p>
42 $user = $_COOKIE [sprintf ("%suser", DBPREFIX)];
43 $pwd = $_COOKIE [sprintf ("%sauth", DBPREFIX)];
44 $logged = ($connection->checkpwdmd5 ($user, $pwd));
46 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
47 "http://www.w3.org/TR/html4/loose.dtd">
48 <html lang="<?php echo $lang?>">
50 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
51 <title><?php ptrans('SYP admin');?></title>
53 <link rel="stylesheet" href="./media/admin.css" type="text/css">
54 <link rel="stylesheet" href="./openlayers/theme/default/style.css" type="text/css">
56 <script type="text/javascript">
58 AddItem: "<?php ptrans('add a place')?>",
59 DragDropHowto: "<?php ptrans('You can move an item by drag & droping it.')?>",
60 SelectHowto: "<?php ptrans('To modify an item data, select matching marker.')?>",
61 AddHowto: "<?php ptrans('Click on the map to add a marker.')?>",
62 ServerError: "<?php ptrans('There was a server error.')?>",
63 UnreferencedError: "<?php ptrans('Item was not registered on the server.')?>",
64 NochangeError: "<?php ptrans('No change was made.')?>",
65 RequestError: "<?php ptrans('Server did not understood request. That\'s probably caused by a bug in SYP.')?>",
66 ToobigError: "<?php ptrans('Image was too big and was not accepted by server.')?>",
67 UnauthorizedError: "<?php ptrans('Password is not correct.')?>",
68 NotimageError: "<?php ptrans('File does not look like an image.')?>",
69 UnconsistentError: "<?php ptrans('Server reply was inconsistent.')?>",
70 UnknownError: "<?php ptrans('There was an unknown error.')?>",
71 DelSucces: "<?php ptrans('Removal took place correctly.')?>",
72 UpdateSucces: "<?php ptrans('Save took place correctly.')?>"
76 loggedUser: <?php printf ($logged ? "\"$user\"": "null")?>
80 <script src="./js/jquery-1.3.2.js" type="text/javascript"></script>
81 <script src="./openlayers/OpenLayers.js" type="text/javascript"></script>
82 <script src="./js/admin.js" type="text/javascript"></script>
85 <style type="text/css">
86 #map, #editor, #admin, #login_area {
97 <p><?php ptrans('SYP needs javascript. Please activate scripts in your browser.')?></p>
101 <?php other_languages($lang) ?>
102 <p id="logout"><a href="logout.php"><?php ptrans('Logout')?></a></p>
108 <div id="admin" class="center">
109 <input id="newfeature_button" type="button" value="<?php ptrans('add a place')?>">
110 <p id="server_comm"></p>
111 <p id="instructions"></p>
114 <div id="editor" class="center">
115 <input id="editor_close" type="image" src="openlayers/theme/default/img/close.gif"
116 title="<?php ptrans('close without saving')?>" alt="<?php ptrans('close')?>">
117 <form id="feature_update" method="post" enctype="multipart/form-data">
118 <label for="title"><?php ptrans('title:')?></label><br>
119 <input id="title" name="title"><br>
120 <label for="description"><?php ptrans('description:')?></label><br>
121 <textarea id="description" name="description" rows="4"></textarea><br>
122 <div><img id="img"></div>
123 <input id="image_delete" type="button" value="<?php ptrans('delete image')?>">
125 <label for="image_file"><?php ptrans('add an image:')?></label>
126 <input id="image_file" type="file" name="image_file">
130 <input id="validate_editor" type="submit" value="<?php ptrans('Validate changes')?>">
132 <input type="hidden" name="request">
133 <input type="hidden" name="lon">
134 <input type="hidden" name="lat">
135 <input type="hidden" name="fid">
136 <input type="hidden" name="keep_img">
138 <form id="feature_delete" method="post">
139 <input id="delete" type="submit" value="<?php ptrans('Delete item')?>">
140 <input type="hidden" name="request" value="del">
141 <input type="hidden" name="fid">
143 <p id="editor_throbber" class="throbber center">
144 <?php ptrans('Connecting')?>
145 <img src="media/editor-throbber.gif">
152 echo ' class="hidden"';
155 <div id="login_transparency"></div>
156 <div id="login_padding"></div>
157 <div id="login_content">
158 <form id="login_form" method="post">
159 <div id="cookie_warning" class="center warn"><?php ptrans('You need to have cookies enabled to administrate SYP')?></div>
162 <td><label for="user"><?php ptrans('user')?></label></td>
163 <td style="width: 100%"><input id="user" name="user"></td>
166 <td><label for="password"><?php ptrans('password')?></label></td>
167 <td style="width: 100%"><input id="password" name="password" type="password"></td>
171 <input id="login_submit" type="submit" value="<?php ptrans('Connection')?>">
172 <input type="hidden" name="request" value="auth">
174 <p id="pwd_throbber" class="throbber center">
175 <?php ptrans('Connecting')?>
176 <img src="media/pwd-throbber.gif" alt="throbber">
178 <p class="error center" id="login_error"></p>
183 <iframe id="api_frame" name="api_frame" src="" frameborder="0" width="0" height="0"></iframe>