2 /* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
5 require_once ("./inc/settings.php");
6 require_once ("./inc/db/mysql.php");
7 require_once ("./inc/utils.php");
11 $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
12 $usrtblexists = $connection->users_table_exists ();
13 $itemstblexists = $connection->items_table_exists ();
14 } catch (Exception $e) {
17 if (!$usrtblexists || !$itemstblexists) {
22 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
23 "http://www.w3.org/TR/html4/loose.dtd">
26 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
27 <title><?php ptrans('SYP admin')?></title>
28 <link rel="stylesheet" href="./media/admin.css" type="text/css">
31 <p class="error center"><?php ptrans('SYP is not correctly installed. Please follow README.txt instructions
32 and go to <a href="wizard.en.php">wizard</a>.')?></p>
39 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
40 "http://www.w3.org/TR/html4/loose.dtd">
43 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
44 <title><?php ptrans('SYP admin');?></title>
46 <link rel="stylesheet" href="./media/admin.css" type="text/css">
47 <link rel="stylesheet" href="./openlayers/theme/default/style.css" type="text/css">
49 <script type="text/javascript">
51 AddItem: "<?php ptrans('add a place')?>",
52 DragDropHowto: "<?php ptrans('You can move an item by drag & droping it.')?>",
53 SelectHowto: "<?php ptrans('To modify an item data, select matching marker.')?>",
54 AddHowto: "<?php ptrans('Click on the map to add a marker.')?>",
55 ServerError: "<?php ptrans('There was a server error.')?>",
56 UnreferencedError: "<?php ptrans('Item was not registered on the server.')?>",
57 NochangeError: "<?php ptrans('No change was made.')?>",
58 RequestError: "<?php ptrans('Server did not understood request. That\'s probably caused by a bug in SYP.')?>",
59 ToobigError: "<?php ptrans('Image was too big and was not accepted by server.')?>",
60 UnauthorizedError: "<?php ptrans('Password is not correct.')?>",
61 NotimageError: "<?php ptrans('File does not look like an image.')?>",
62 UnconsistentError: "<?php ptrans('Server reply was inconsistent.')?>",
63 UnknownError: "<?php ptrans('There was an unknown error.')?>",
64 DelSucces: "<?php ptrans('Removal took place correctly.')?>",
65 UpdateSucces: "<?php ptrans('Save took place correctly.')?>"
69 $bbox = $connection->mbr ();
70 printf ("var sypOrig = [%.18F, %.18F, %.18F, %.18F];\n",
71 $bbox [0], $bbox [1], $bbox [2], $bbox [3]);
75 <script src="./js/jquery-1.3.2.js" type="text/javascript"></script>
76 <script src="./openlayers/OpenLayers.js" type="text/javascript"></script>
77 <script src="./js/admin.js" type="text/javascript"></script>
80 <style type="text/css">
81 #map, #editor, #admin, #login_area {
92 <p><?php ptrans('SYP needs javascript. Please activate scripts in your browser.')?></p>
96 <?php other_languages($lang) ?>
97 <p id="logout"><a href="logout.php"><?php ptrans('Logout')?></a></p>
103 <div id="admin" class="center">
104 <input id="newfeature_button" type="button" value="<?php ptrans('add a place')?>">
105 <p id="server_comm"></p>
106 <p id="instructions"></p>
109 <div id="editor" class="center">
110 <input id="editor_close" type="image" src="openlayers/theme/default/img/close.gif"
111 title="<?php ptrans('close without saving')?>" alt="<?php ptrans('close')?>">
112 <form id="feature_update" method="post" enctype="multipart/form-data">
113 <label for="title"><?php ptrans('title:')?></label><br>
114 <input id="title" name="title"><br>
115 <label for="description"><?php ptrans('description:')?></label><br>
116 <textarea id="description" name="description" rows="4"></textarea><br>
117 <div><img id="img"></div>
118 <input id="image_delete" type="button" value="<?php ptrans('delete image')?>">
120 <label for="image_file"><?php ptrans('add an image:')?></label>
121 <input id="image_file" type="file" name="image_file">
125 <input id="validate_editor" type="submit" value="<?php ptrans('Validate changes')?>">
127 <input type="hidden" name="request">
128 <input type="hidden" name="lon">
129 <input type="hidden" name="lat">
130 <input type="hidden" name="fid">
131 <input type="hidden" name="keep_img">
133 <form id="feature_delete" method="post">
134 <input id="delete" type="submit" value="<?php ptrans('Delete item')?>">
135 <input type="hidden" name="request" value="del">
136 <input type="hidden" name="fid">
142 if ($connection->checkpwdmd5 ("admin",
143 $_COOKIE [sprintf ("%sauth", DBPREFIX)])) {
144 echo ' class="hidden"';
147 <div id="login_transparency"></div>
148 <div id="login_padding"></div>
149 <div id="login_content">
150 <form id="login_form" method="post">
151 <div id="cookie_warning" class="center warn"><?php ptrans('You need to have cookies enabled to administrate SYP')?></div>
154 <td><label for="password"><?php ptrans('password')?></label></td>
155 <td style="width: 100%"><input id="password" name="password" type="password"></td>
159 <input id="login_submit" type="submit" value="<?php ptrans('Connection')?>">
160 <input type="hidden" name="request" value="auth">
162 <p id="pwd_throbber" class="throbber center">
163 <?php ptrans('Connecting')?>
164 <img src="media/pwd_throbber.gif" alt="throbber">
166 <p class="error center" id="login_error"></p>
171 <iframe id="api_frame" name="api_frame" src="" frameborder="0" width="0" height="0"></iframe>