}
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');
}
$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');
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)));
$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;
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;
$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"),
--- /dev/null
+<?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());
+ }
+}
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"
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."
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"
#: 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"
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"
msgstr "delete"
#: application/views/helpers/LogoutLink.php:10
-#: application/layouts/scripts/footer.phtml:65
+#: application/layouts/scripts/footer.phtml:67
msgid "logout"
msgstr "logout"
"\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"
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"
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"
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"
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"
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"
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."
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"
#: 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"
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é"
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"
"\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"
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"
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"
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"
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é"
</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>
--- /dev/null
+<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>
--- /dev/null
+/* 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;
+}
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]);
--- /dev/null
+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);
+}