]> dev.renevier.net Git - syj.git/commitdiff
raw mode to display map
authorarno <arno@renevier.net>
Sun, 15 Aug 2010 13:06:40 +0000 (15:06 +0200)
committerarno <arno@renevier.net>
Sun, 15 Aug 2010 13:07:01 +0000 (15:07 +0200)
application/controllers/ErrorController.php
application/controllers/IdxController.php
application/controllers/helpers/SyjReset.php [new file with mode: 0644]
application/languages/lang_en.po
application/languages/lang_fr.po
application/layouts/scripts/layout.phtml
application/views/scripts/idx/raw.phtml [new file with mode: 0644]
public/css/syjraw.css [new file with mode: 0644]
public/js/syj.js
public/js/syjraw.js [new file with mode: 0644]

index db283ab86d48844a3983f55316c0c0a0a0ccd695..7e0301539129575891f1c6ae7c3e1e26c3d82b7a 100644 (file)
@@ -10,12 +10,7 @@ class ErrorController extends Zend_Controller_Action
     }
 
     public function init() {
-        $this->view->jslocales = null;
-        $this->view->headScript()->exchangeArray(array());
-        $this->view->headLink()->exchangeArray(array());
-        $this->view->headTitle()->exchangeArray(array());
-        $this->view->headStyle()->exchangeArray(array());
-
+        $this->_helper->SyjReset->resetPlaceHolders();
         $this->view->headLink()->appendStylesheet('css/generic.css');
         $this->view->headLink()->appendStylesheet('css/error.css');
     }
index d3c4bcb20238c6f7727d6b1392cdb806fb3f4664..0817fe65c973250a0bc04d6bd5d81f8bcd6436aa 100644 (file)
@@ -17,6 +17,27 @@ class IdxController extends Zend_Controller_Action
         $this->view->headLink()->appendStylesheet('css/syj.css');
     }
 
+    public function rawmode(Syj_Model_Path $path) {
+        $this->_helper->SyjReset->resetPlaceHolders();
+
+        $this->view->headLink()->appendStylesheet('css/generic.css');
+        $this->view->headLink()->appendStylesheet('css/syjraw.css');
+        $this->view->headScript()->appendFile('js/OpenLayers.js');
+        $this->view->headScript()->appendFile('js/syjraw.js');
+        $this->view->headTitle($path->displayTitle);
+
+        $this->_jsRawLocaleStrings();
+        if ($path->creator) {
+            $this->view->jslocales['geomAttribution'] =
+                        $this->view->translate('route by <strong>%s</strong>', (string)$path->creator->pseudo);
+        }
+        $jsgeom = new phptojs\JsObject('gInitialGeom', array('data' => (string) $path->geom));
+        $this->view->headScript()->prependScript((string) $jsgeom);
+
+        $this->view->rawmode = true;
+        $this->_helper->ViewRenderer->setViewScriptPathSpec(':controller/raw.:suffix');
+    }
+
     public function indexAction() {
         $url = $this->getRequest()->getUserParam('url');
 
@@ -35,13 +56,18 @@ class IdxController extends Zend_Controller_Action
                     throw new Syj_Exception_NotFound('Not Found', 404);
                 }
             }
-            $geomform->setAction('path/' . (string)$path->id . '/update');
+
+            if ($this->getRequest()->getQuery('format') == 'raw') {
+                $this->rawmode($path);
+                return;
+            }
+
             $title = $path->displayTitle;
             $this->view->path = $path;
-            $geomform->geom_title->setValue($path->title);
-            $loginform->login_geom_id->setValue((string)$path->id);
             $jsgeom = new phptojs\JsObject('gInitialGeom', array('data' => (string) $path->geom));
             $this->view->headScript()->prependScript((string) $jsgeom);
+            $loginform->login_geom_id->setValue((string)$path->id);
+            $geomform->geom_title->setValue($path->title);
         } else {
             $geomform->setAction('path');
             $extent = new phptojs\JsObject('gMaxExtent', $this->_helper->syjGeoip($this->getRequest()->getClientIp(true)));
@@ -51,6 +77,10 @@ class IdxController extends Zend_Controller_Action
 
         $this->_jsLoggedInfo(isset($url) ? $path: null);
         $this->_jsLocaleStrings();
+        if (isset ($url) and $path->creator) {
+            $this->view->jslocales['geomAttribution'] =
+                        $this->view->translate('route by <strong>%s</strong>', (string)$path->creator->pseudo);
+        }
         $this->view->headTitle($title);
         $this->view->geomform = $geomform;
         $this->view->loginform = $loginform;
@@ -71,9 +101,6 @@ class IdxController extends Zend_Controller_Action
 
         if (isset($path)) {
             $loggedinfo->iscreator = $path->isCreator($user);
-            if ($path->creator) {
-                $loggedinfo->creatorname = $this->view->escape((string)$path->creator->pseudo);
-            }
             $loggedinfo->pathid = (string)$path->id;
         } else {
             $loggedinfo->iscreator = true;
@@ -82,6 +109,12 @@ class IdxController extends Zend_Controller_Action
         $this->view->headScript()->prependScript((string) $loggedinfo);
     }
 
+    protected function _jsRawLocaleStrings() {
+        $this->view->jslocales = array(
+            'osmAttribution' => __("Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"),
+            );
+    }
+
     protected function _jsLocaleStrings() {
         $this->view->jslocales = array(
             'saveSuccess' => __("save took place successfully"),
diff --git a/application/controllers/helpers/SyjReset.php b/application/controllers/helpers/SyjReset.php
new file mode 100644 (file)
index 0000000..15a138e
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+/*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
+    and is published under the AGPL license. */
+
+class Syj_Controller_Action_Helper_SyjReset extends Zend_Controller_Action_Helper_Abstract
+{
+    public function resetPlaceHolders() {
+        $controller = $this->getActionController();
+        $controller->view->jslocales = null;
+        $controller->view->headScript()->exchangeArray(array());
+        $controller->view->headLink()->exchangeArray(array());
+        $controller->view->headTitle()->exchangeArray(array());
+        $controller->view->headStyle()->exchangeArray(array());
+    }
+}
index 092d66b4735bdc64db601ff98165ca434adf7c7b..6e87cc996a4b214a25ed863d14cc34cd55f1ea00 100644 (file)
@@ -2,7 +2,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: syj\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-08-13 15:47+0200\n"
+"POT-Creation-Date: 2010-08-15 15:04+0200\n"
 "PO-Revision-Date: \n"
 "Last-Translator: arno <arno@renevier.net>\n"
 "Language-Team: arno <arno@renevier.net>\n"
@@ -45,6 +45,7 @@ msgid "Email was send successfully"
 msgstr "Email was send successfully"
 
 #: application/views/scripts/idx/index.phtml:8
+#: application/views/scripts/idx/raw.phtml:8
 #: application/views/scripts/list/index.phtml:8
 msgid "SYJ needs javascript. Please activate scripts in your browser."
 msgstr "SYJ needs javascript. Please activate scripts in your browser."
@@ -62,12 +63,12 @@ msgid "When you have finished a path, press \"save\", button."
 msgstr "When you have finished a path, press \"save\", button."
 
 #: application/views/scripts/idx/index.phtml:26
-#: application/controllers/IdxController.php:112
+#: application/controllers/IdxController.php:146
 msgid "duplicate"
 msgstr "duplicate"
 
 #: application/views/scripts/idx/index.phtml:28
-#: application/controllers/IdxController.php:110
+#: application/controllers/IdxController.php:144
 msgid "edit"
 msgstr "edit"
 
@@ -77,7 +78,7 @@ msgstr "start a route"
 
 #: application/views/scripts/idx/index.phtml:43
 #: application/controllers/LoginController.php:8
-#: application/layouts/scripts/footer.phtml:72
+#: application/layouts/scripts/footer.phtml:74
 #: application/forms/Login.php:26
 msgid "login"
 msgstr "login"
@@ -116,7 +117,7 @@ msgid "Sources of the software running the website are <a href=\"http://dev.rene
 msgstr "Sources of the software running the website are <a href=\"http://dev.renevier.net/?p=syj.git\">publicly available</a> under a agpl license. The map used to display the routes comes from <a href=\"http://www.openstreetmap.org/\">openstreetmap</a>."
 
 #: application/views/scripts/newpwd/success.phtml:4
-#: application/controllers/IdxController.php:103
+#: application/controllers/IdxController.php:137
 msgid "A link to reset your password has been emailed to you"
 msgstr "A link to reset your password has been emailed to you"
 
@@ -198,7 +199,7 @@ msgid "delete"
 msgstr "delete"
 
 #: application/views/helpers/LogoutLink.php:10
-#: application/layouts/scripts/footer.phtml:65
+#: application/layouts/scripts/footer.phtml:67
 msgid "logout"
 msgstr "logout"
 
@@ -360,8 +361,8 @@ msgstr ""
 "\n"
 "Syj team"
 
-#: application/controllers/LoginController.php:101
-#: application/controllers/IdxController.php:93
+#: application/controllers/LoginController.php:100
+#: application/controllers/IdxController.php:127
 msgid "you must enter a login name"
 msgstr "you must enter a login name"
 
@@ -410,19 +411,19 @@ msgstr "Value is required and can't be empty"
 msgid "Invalid email"
 msgstr "Invalid email"
 
-#: application/controllers/ErrorController.php:61
+#: application/controllers/ErrorController.php:56
 msgid "Oups, something went wrong"
 msgstr "Oups, something went wrong"
 
 #: application/controllers/TermsofuseController.php:12
-#: application/layouts/scripts/footer.phtml:85
+#: application/layouts/scripts/footer.phtml:87
 #: application/forms/Geom.php:24
 #: application/forms/User.php:43
 msgid "terms of use"
 msgstr "terms of use"
 
 #: application/controllers/ListController.php:18
-#: application/layouts/scripts/footer.phtml:51
+#: application/layouts/scripts/footer.phtml:53
 msgid "my routes"
 msgstr "my routes"
 
@@ -431,27 +432,27 @@ msgid "There is no undo. Delete this route definitively ?"
 msgstr "There is no undo. Delete this route definitively ?"
 
 #: application/controllers/ListController.php:36
-#: application/controllers/IdxController.php:90
+#: application/controllers/IdxController.php:124
 msgid "server could not be reached"
 msgstr "server could not be reached"
 
 #: application/controllers/ListController.php:37
-#: application/controllers/IdxController.php:87
+#: application/controllers/IdxController.php:121
 msgid "server did not understood request. That's probably caused by a bug in SYJ"
 msgstr "server did not understood request. That's probably caused by a bug in SYJ"
 
 #: application/controllers/ListController.php:38
-#: application/controllers/IdxController.php:88
+#: application/controllers/IdxController.php:122
 msgid "route not referenced on the server. It has probably been deleted."
 msgstr "route not referenced on the server. It has probably been deleted."
 
 #: application/controllers/ListController.php:39
-#: application/controllers/IdxController.php:91
+#: application/controllers/IdxController.php:125
 msgid "there was a server error"
 msgstr "there was a server error"
 
 #: application/controllers/ListController.php:40
-#: application/controllers/IdxController.php:92
+#: application/controllers/IdxController.php:126
 msgid "there was an unknown error"
 msgstr "there was an unknown error"
 
@@ -469,12 +470,12 @@ msgid "Wrong password"
 msgstr "Wrong password"
 
 #: application/controllers/AccountController.php:44
-#: application/controllers/IdxController.php:101
+#: application/controllers/IdxController.php:135
 msgid "an user is already registered with this email"
 msgstr "an user is already registered with this email"
 
 #: application/controllers/AccountController.php:72
-#: application/controllers/IdxController.php:97
+#: application/controllers/IdxController.php:131
 #: application/forms/Account.php:40
 msgid "Password do not match"
 msgstr "Password do not match"
@@ -490,71 +491,78 @@ msgstr "At least %d characters"
 msgid "You have made no change"
 msgstr "You have made no change"
 
-#: application/controllers/IdxController.php:86
+#: application/controllers/IdxController.php:32
+#: application/controllers/IdxController.php:82
+#, php-format
+msgid "route by <strong>%s</strong>"
+msgstr "route by <strong>%s</strong>"
+
+#: application/controllers/IdxController.php:114
+#: application/controllers/IdxController.php:140
+msgid "Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
+msgstr "Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
+
+#: application/controllers/IdxController.php:120
 msgid "save took place successfully"
 msgstr "save took place successfully"
 
-#: application/controllers/IdxController.php:89
+#: application/controllers/IdxController.php:123
 msgid "similar path seems to already exist. Please do not create two exactly identical paths"
 msgstr "similar path seems to already exist. Please do not create two exactly identical paths"
 
-#: application/controllers/IdxController.php:94
+#: application/controllers/IdxController.php:128
 msgid "Login correct"
 msgstr "Login correct"
 
-#: application/controllers/IdxController.php:95
+#: application/controllers/IdxController.php:129
 msgid "Wrong login/password"
 msgstr "Wrong login/password"
 
-#: application/controllers/IdxController.php:96
+#: application/controllers/IdxController.php:130
 msgid "you must enter a password"
 msgstr "you must enter a password"
 
-#: application/controllers/IdxController.php:98
+#: application/controllers/IdxController.php:132
 msgid "You must accept terms of use"
 msgstr "You must accept terms of use"
 
-#: application/controllers/IdxController.php:99
+#: application/controllers/IdxController.php:133
 msgid "you must enter an email"
 msgstr "you must enter an email"
 
-#: application/controllers/IdxController.php:100
+#: application/controllers/IdxController.php:134
 msgid "invalid email"
 msgstr "invalid email"
 
-#: application/controllers/IdxController.php:102
+#: application/controllers/IdxController.php:136
 msgid "Account created"
 msgstr "Account created"
 
-#: application/controllers/IdxController.php:104
+#: application/controllers/IdxController.php:138
 msgid "Now, you can retry to save"
 msgstr "Now, you can retry to save"
 
-#: application/controllers/IdxController.php:105
+#: application/controllers/IdxController.php:139
 msgid "route by"
 msgstr "route by"
 
-#: application/controllers/IdxController.php:106
-msgid "Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
-msgstr "Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
-
-#: application/controllers/IdxController.php:107
+#: application/controllers/IdxController.php:141
 msgid "checking availibilty"
 msgstr "checking availibilty"
 
-#: application/controllers/IdxController.php:108
+#: application/controllers/IdxController.php:142
 msgid "available pseudo"
 msgstr "available pseudo"
 
-#: application/controllers/IdxController.php:109
+#: application/controllers/IdxController.php:143
 msgid "unavailable pseudo"
 msgstr "unavailable pseudo"
 
-#: application/controllers/IdxController.php:111
+#: application/controllers/IdxController.php:145
 msgid "create"
 msgstr "create"
 
-#: application/controllers/IdxController.php:113
+#: application/controllers/IdxController.php:147
 msgid "You have an unsaved route"
 msgstr "You have an unsaved route"
 
index e593e8f29f343d0416b18d0f3023bea6860952fb..cc221a994e0200c674106b0481468825d96dc2f7 100644 (file)
@@ -2,7 +2,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: syj\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-08-13 15:47+0200\n"
+"POT-Creation-Date: 2010-08-15 15:04+0200\n"
 "PO-Revision-Date: \n"
 "Last-Translator: arno <arno@renevier.net>\n"
 "Language-Team: arno <arno@renevier.net>\n"
@@ -45,6 +45,7 @@ msgid "Email was send successfully"
 msgstr "L'email a été envoyé avec succès"
 
 #: application/views/scripts/idx/index.phtml:8
+#: application/views/scripts/idx/raw.phtml:8
 #: application/views/scripts/list/index.phtml:8
 msgid "SYJ needs javascript. Please activate scripts in your browser."
 msgstr "SYJ a besoin de javascript pour fonctionner. Veuillez activer les scripts dans votre navigateur."
@@ -62,12 +63,12 @@ msgid "When you have finished a path, press \"save\", button."
 msgstr "Lorsque vous avez fini votre tracé, pressez le bouton \"enregistrer\"."
 
 #: application/views/scripts/idx/index.phtml:26
-#: application/controllers/IdxController.php:112
+#: application/controllers/IdxController.php:146
 msgid "duplicate"
 msgstr "dupliquer"
 
 #: application/views/scripts/idx/index.phtml:28
-#: application/controllers/IdxController.php:110
+#: application/controllers/IdxController.php:144
 msgid "edit"
 msgstr "modifier"
 
@@ -77,7 +78,7 @@ msgstr "commencer un itinéraire"
 
 #: application/views/scripts/idx/index.phtml:43
 #: application/controllers/LoginController.php:8
-#: application/layouts/scripts/footer.phtml:72
+#: application/layouts/scripts/footer.phtml:74
 #: application/forms/Login.php:26
 msgid "login"
 msgstr "connexion"
@@ -116,7 +117,7 @@ msgid "Sources of the software running the website are <a href=\"http://dev.rene
 msgstr "Les sources du logiciel qui fait tourner le site web sont <a href=\"http://dev.renevier.net/?p=syj.git\">disponibles publiquement</a> sous une licence agpl. La carte utilisée pour l'affichage des itinéraires vient d'<a href=\"http://www.openstreetmap.org/\">openstreetmap</a>."
 
 #: application/views/scripts/newpwd/success.phtml:4
-#: application/controllers/IdxController.php:103
+#: application/controllers/IdxController.php:137
 msgid "A link to reset your password has been emailed to you"
 msgstr "Un email contenant un lien pour réinitialiser votre mot de passe vous a été envoyé"
 
@@ -198,7 +199,7 @@ msgid "delete"
 msgstr "supprimer"
 
 #: application/views/helpers/LogoutLink.php:10
-#: application/layouts/scripts/footer.phtml:65
+#: application/layouts/scripts/footer.phtml:67
 msgid "logout"
 msgstr "déconnexion"
 
@@ -362,8 +363,8 @@ msgstr ""
 "\n"
 "L'équipe de Syj"
 
-#: application/controllers/LoginController.php:101
-#: application/controllers/IdxController.php:93
+#: application/controllers/LoginController.php:100
+#: application/controllers/IdxController.php:127
 msgid "you must enter a login name"
 msgstr "vous devez entrer un nom d'utilisateur"
 
@@ -412,19 +413,19 @@ msgstr "Le champ est requis, et ne doit pas être vide"
 msgid "Invalid email"
 msgstr "Email invalide"
 
-#: application/controllers/ErrorController.php:61
+#: application/controllers/ErrorController.php:56
 msgid "Oups, something went wrong"
 msgstr "Oups, il y a eu un souci"
 
 #: application/controllers/TermsofuseController.php:12
-#: application/layouts/scripts/footer.phtml:85
+#: application/layouts/scripts/footer.phtml:87
 #: application/forms/Geom.php:24
 #: application/forms/User.php:43
 msgid "terms of use"
 msgstr "conditions d'utilisation"
 
 #: application/controllers/ListController.php:18
-#: application/layouts/scripts/footer.phtml:51
+#: application/layouts/scripts/footer.phtml:53
 msgid "my routes"
 msgstr "mes itinéraires"
 
@@ -433,27 +434,27 @@ msgid "There is no undo. Delete this route definitively ?"
 msgstr "Vous ne pourrez pas annuler. Supprimer l'itinéraire définitivement ?"
 
 #: application/controllers/ListController.php:36
-#: application/controllers/IdxController.php:90
+#: application/controllers/IdxController.php:124
 msgid "server could not be reached"
 msgstr "serveur inaccessible"
 
 #: application/controllers/ListController.php:37
-#: application/controllers/IdxController.php:87
+#: application/controllers/IdxController.php:121
 msgid "server did not understood request. That's probably caused by a bug in SYJ"
 msgstr "Le serveur n'a pas compris la requête. Il s'agit probablement d'un bug dans SYJ"
 
 #: application/controllers/ListController.php:38
-#: application/controllers/IdxController.php:88
+#: application/controllers/IdxController.php:122
 msgid "route not referenced on the server. It has probably been deleted."
 msgstr "chemin non référencé sur le serveur. Il a probablement été supprimé."
 
 #: application/controllers/ListController.php:39
-#: application/controllers/IdxController.php:91
+#: application/controllers/IdxController.php:125
 msgid "there was a server error"
 msgstr "Il s'est produit une erreur serveur"
 
 #: application/controllers/ListController.php:40
-#: application/controllers/IdxController.php:92
+#: application/controllers/IdxController.php:126
 msgid "there was an unknown error"
 msgstr "Il s'est produit une erreur inconnue"
 
@@ -471,12 +472,12 @@ msgid "Wrong password"
 msgstr "Mauvais mot de passe"
 
 #: application/controllers/AccountController.php:44
-#: application/controllers/IdxController.php:101
+#: application/controllers/IdxController.php:135
 msgid "an user is already registered with this email"
 msgstr "il y'a déjà un utilisateur enregistré avec cet email"
 
 #: application/controllers/AccountController.php:72
-#: application/controllers/IdxController.php:97
+#: application/controllers/IdxController.php:131
 #: application/forms/Account.php:40
 msgid "Password do not match"
 msgstr "Les mots de passe ne correspondent pas"
@@ -492,71 +493,78 @@ msgstr "Au moins %d caractères"
 msgid "You have made no change"
 msgstr "Vous n'avez fait aucun changement"
 
-#: application/controllers/IdxController.php:86
+#: application/controllers/IdxController.php:32
+#: application/controllers/IdxController.php:82
+#, php-format
+msgid "route by <strong>%s</strong>"
+msgstr "tracé par <strong>%s</strong>"
+
+#: application/controllers/IdxController.php:114
+#: application/controllers/IdxController.php:140
+msgid "Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
+msgstr "Carte par <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
+
+#: application/controllers/IdxController.php:120
 msgid "save took place successfully"
 msgstr "La sauvegarde s'est déroulée correctement"
 
-#: application/controllers/IdxController.php:89
+#: application/controllers/IdxController.php:123
 msgid "similar path seems to already exist. Please do not create two exactly identical paths"
 msgstr "Il semble qu'il y ait déjà un chemin similaire. Veuillez ne pas créer deux chemins exactement identiques"
 
-#: application/controllers/IdxController.php:94
+#: application/controllers/IdxController.php:128
 msgid "Login correct"
 msgstr "Vous êtes connectés"
 
-#: application/controllers/IdxController.php:95
+#: application/controllers/IdxController.php:129
 msgid "Wrong login/password"
 msgstr "Mauvais nom d'utilisateur ou mot de passe"
 
-#: application/controllers/IdxController.php:96
+#: application/controllers/IdxController.php:130
 msgid "you must enter a password"
 msgstr "vous devez entrer un mot de passe"
 
-#: application/controllers/IdxController.php:98
+#: application/controllers/IdxController.php:132
 msgid "You must accept terms of use"
 msgstr "Vous devez accepter les conditions d'utilisation"
 
-#: application/controllers/IdxController.php:99
+#: application/controllers/IdxController.php:133
 msgid "you must enter an email"
 msgstr "vous devez entrer un email"
 
-#: application/controllers/IdxController.php:100
+#: application/controllers/IdxController.php:134
 msgid "invalid email"
 msgstr "email invalide"
 
-#: application/controllers/IdxController.php:102
+#: application/controllers/IdxController.php:136
 msgid "Account created"
 msgstr "Compte créé"
 
-#: application/controllers/IdxController.php:104
+#: application/controllers/IdxController.php:138
 msgid "Now, you can retry to save"
 msgstr "Maintenant, vous pouvez réessayer de sauvegarder"
 
-#: application/controllers/IdxController.php:105
+#: application/controllers/IdxController.php:139
 msgid "route by"
 msgstr "tracé par"
 
-#: application/controllers/IdxController.php:106
-msgid "Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
-msgstr "Carte par <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
-
-#: application/controllers/IdxController.php:107
+#: application/controllers/IdxController.php:141
 msgid "checking availibilty"
 msgstr "vérification de la disponibilité"
 
-#: application/controllers/IdxController.php:108
+#: application/controllers/IdxController.php:142
 msgid "available pseudo"
 msgstr "pseudo disponible"
 
-#: application/controllers/IdxController.php:109
+#: application/controllers/IdxController.php:143
 msgid "unavailable pseudo"
 msgstr "pseudo non disponible"
 
-#: application/controllers/IdxController.php:111
+#: application/controllers/IdxController.php:145
 msgid "create"
 msgstr "créér"
 
-#: application/controllers/IdxController.php:113
+#: application/controllers/IdxController.php:147
 msgid "You have an unsaved route"
 msgstr "Vous avez un itinéraire non sauvegardé"
 
index 5736ac1eb908c11202644684b95b422375a187a3..dfbbaf51467506538d61f970046de72101100a59 100644 (file)
 </head>
 <body>
 <?php
-    echo $this->render('header.phtml');
-?>
+    if (!$this->rawmode) {
+        echo $this->render('header.phtml');
+    }
 
-<?php
     echo $this->layout()->content;
-?>
 
-<?php
-    echo $this->render('footer.phtml');
+    if (!$this->rawmode) {
+        echo $this->render('footer.phtml');
+    }
 ?>
 </body>
 </html>
diff --git a/application/views/scripts/idx/raw.phtml b/application/views/scripts/idx/raw.phtml
new file mode 100644 (file)
index 0000000..d6e2d14
--- /dev/null
@@ -0,0 +1,11 @@
+<noscript>
+    <style type="text/css">
+        #map {
+            display: none;
+        }
+    </style>
+
+    <p><?php echo $this->translate('SYJ needs javascript. Please activate scripts in your browser.');?></p>
+</noscript>
+
+<div id="map"></div>
diff --git a/public/css/syjraw.css b/public/css/syjraw.css
new file mode 100644 (file)
index 0000000..053c250
--- /dev/null
@@ -0,0 +1,22 @@
+/*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
+    and is published under the AGPL license. */
+body, html {
+    margin: 0; padding: 0;
+    width: 100%;
+    height: 100%;
+}
+
+/*
+ * map rules
+ */
+#map {
+    position: absolute;
+    top: 0; left: 0; right: 0; bottom: 0;
+    *width: 100%;
+    *height: 100%;
+}
+
+.olControlAttribution {
+    bottom: 0.5em;
+    left: 0.5em;
+}
index 9114646b43aed316cfdc3970f97270f1307ac614..923e93dc2b1896cf553ac428484978471065edf0 100644 (file)
@@ -227,10 +227,8 @@ var SYJView = {
 
         layerOptions = {format:     OpenLayers.Format.WKT,
                         projection: WGS84,
-                        styleMap:   styleMap.view};
-        if (gLoggedInfo.creatorname) {
-            layerOptions.attribution = SyjStrings.routeBy + ' ' + '<strong>' + gLoggedInfo.creatorname + '</strong>';
-        }
+                        styleMap:   styleMap.view,
+                        attribution: SyjStrings.geomAttribution };
 
         this.viewLayer = new OpenLayers.Layer.Vector("View Layer", layerOptions);
         this.map.addLayers([baseLayer, this.viewLayer]);
diff --git a/public/js/syjraw.js b/public/js/syjraw.js
new file mode 100644 (file)
index 0000000..ec783f4
--- /dev/null
@@ -0,0 +1,41 @@
+var WGS84 = new OpenLayers.Projection("EPSG:4326");
+var Mercator = new OpenLayers.Projection("EPSG:900913");
+
+var styleMap = {
+    view: new OpenLayers.StyleMap({
+        "default": new OpenLayers.Style({
+            strokeColor: "blue",
+            strokeWidth: 5,
+            strokeOpacity: 0.7
+        })
+    })
+};
+
+function init() {
+    var map = new OpenLayers.Map('map', {
+                controls: [ new OpenLayers.Control.Attribution() ],
+                theme: null}),
+
+         baseLayer = new OpenLayers.Layer.OSM("OSM", null, { attribution: SyjStrings.osmAttribution }),
+
+         layerOptions = {format:     OpenLayers.Format.WKT,
+                        projection: WGS84,
+                        styleMap:   styleMap.view,
+                        attribution: SyjStrings.geomAttribution },
+
+        viewLayer = new OpenLayers.Layer.Vector("View Layer", layerOptions),
+        wkt = new OpenLayers.Format.WKT({ internalProjection: Mercator, externalProjection: WGS84 });
+
+    map.addLayers([baseLayer, viewLayer]);
+    viewLayer.addFeatures([wkt.read(gInitialGeom.data)]);
+    extent = viewLayer.getDataExtent();
+    map.updateSize();
+    map.zoomToExtent(extent);
+
+}
+
+if (window.addEventListener) {
+    window.addEventListener("load", init, false);
+} else {
+    window.attachEvent("onload", init);
+}