]> dev.renevier.net Git - syp.git/blobdiff - inc/templates_admin.php
i18n and english translation
[syp.git] / inc / templates_admin.php
diff --git a/inc/templates_admin.php b/inc/templates_admin.php
new file mode 100644 (file)
index 0000000..eda657d
--- /dev/null
@@ -0,0 +1,173 @@
+<?php
+/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
+   license. */
+
+require_once ("./inc/settings.php");
+require_once ("./inc/db/mysql.php");
+require_once ("./inc/utils.php");
+
+$error = false;
+try {
+    $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
+    $usrtblexists = $connection->users_table_exists ();
+    $itemstblexists = $connection->items_table_exists ();
+} catch (Exception $e) {
+    $error = true;
+}
+if (!$usrtblexists || !$itemstblexists) {
+    $error = true;
+}
+    if ($error) {
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd">  
+<html>
+<head>
+      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
+      <title><?php ptrans('SYP admin')?></title>
+      <link rel="stylesheet" href="./media/admin.css" type="text/css">
+</head>
+<body>
+    <p class="error center"><?php ptrans('SYP is not correctly installed. Please read README.txt file and follow
+       installation instructions.')?></p>
+</body>
+</html>
+<?php
+    exit ();
+    } // if ($error)
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd">  
+<html>
+<head>
+      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
+      <title><?php ptrans('SYP admin');?></title>
+
+      <link rel="stylesheet" href="./media/admin.css" type="text/css">
+      <link rel="stylesheet" href="./openlayers/theme/default/style.css" type="text/css">
+
+      <script type="text/javascript">
+        var SypStrings = {
+            AddItem: "<?php ptrans('add a place')?>",
+            DragDropHowto: "<?php ptrans('You can move an item by drag & droping it.')?>",
+            SelectHowto: "<?php ptrans('To modify an item data, select matching marker.')?>",
+            AddHowto: "<?php ptrans('Click on the map to add a marker.')?>",
+            ServerError: "<?php ptrans('There was a server error.')?>",
+            UnreferencedError: "<?php ptrans('Item was not registered on the server.')?>",
+            NochangeError: "<?php ptrans('No change was made.')?>",
+            RequestError: "<?php ptrans('Server did not understood request. That\'s probably caused by a bug in SYP.')?>",
+            ToobigError: "<?php ptrans('Image was too big and was not accepted by server.')?>",
+            UnauthorizedError: "<?php ptrans('Password is not correct.')?>",
+            NotimageError: "<?php ptrans('File does not look like an image.')?>",
+            UnconsistentError: "<?php ptrans('Server reply was inconsistent.')?>",
+            UnknownError: "<?php ptrans('There was an unknown error.')?>",
+            DelSucces: "<?php ptrans('Removal took place correctly.')?>",
+            UpdateSucces: "<?php ptrans('Save took place correctly.')?>"
+        };
+
+        <?php 
+            $bbox = $connection->mbr ();
+            printf ("var sypOrig = [%.18F, %.18F, %.18F, %.18F];\n",
+                    $bbox [0], $bbox [1], $bbox [2], $bbox [3]); 
+        ?>
+
+      </script>
+      <script src="./js/jquery-1.3.2.js" type="text/javascript"></script>
+      <script src="./openlayers/OpenLayers.js" type="text/javascript"></script>
+      <script src="./js/admin.js" type="text/javascript"></script>
+
+    <noscript>
+    <style type="text/css">
+        #map, #editor, #admin, #login_area {
+            display: none;
+        }
+    </style>
+    </noscript>
+
+</head>
+
+<body>
+
+    <noscript>
+    <p><?php ptrans('SYP needs javascript. Please activate scripts in your browser.')?></p>
+    </noscript>
+
+    <div id="header">
+    <?php other_languages($lang) ?>
+    <p id="logout"><a href="logout.php"><?php ptrans('Logout')?></a></p>
+    </div>
+
+
+    <div id="map"></div>
+
+    <div id="admin" class="center">
+        <input id="newfeature_button" type="button" value="<?php ptrans('add a place')?>">
+        <p id="server_comm"></p>
+        <p id="instructions"></p>
+    </div>
+
+    <div id="editor" class="center">
+        <input id="editor_close" type="image" src="openlayers/theme/default/img/close.gif"
+             title="<?php ptrans('close without saving')?>" alt="<?php ptrans('close')?>">
+        <form id="feature_update" method="post" enctype="multipart/form-data">
+            <label for="title"><?php ptrans('title:')?></label><br>
+            <input id="title" name="title"><br>
+            <label for="description"><?php ptrans('description:')?></label><br>
+            <textarea id="description" name="description" rows="4"></textarea><br>
+            <div><img id="img"></div>
+            <input id="image_delete" type="button" value="<?php ptrans('delete image')?>">
+            <div>
+                <label for="image_file"><?php ptrans('add an image:')?></label>
+                <input id="image_file" type="file" name="image_file">
+            </div>
+            <br>
+            <div class="center">
+            <input id="validate_editor" type="submit" value="<?php ptrans('Validate changes')?>">
+            </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="<?php ptrans('Delete item')?>">
+            <input type="hidden" name="request" value="del">
+            <input type="hidden" name="fid">
+        </form>
+    </div>
+
+      <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">
+            <table>
+                <tr>
+                    <td><label for="password"><?php ptrans('password')?></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" value="<?php ptrans('Connection')?>">
+                <input type="hidden" name="request" value="auth">
+            </p>
+            <p id="pwd_throbber" class="throbber center">
+                <?php ptrans('Connecting')?>
+                <img src="media/pwd_throbber.gif" alt="throbber">
+            </p>
+            <p class="error center" id="login_error"></p>
+        </form>
+     </div>
+     </div>
+
+     <iframe id="api_frame" name="api_frame" src="" frameborder="0" width="0" height="0"></iframe>
+
+</body>
+</html>