parent::_bootstrap($resource);
}
- public function run()
- {
+ public function run() {
$sessionConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/session.ini', APPLICATION_ENV);
Zend_Session::setOptions($sessionConfig->toArray());
Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer')->initView(APPLICATION_PATH . '/views/', 'Syj_View');
return;
}
- $dirpath = implode('/', array_map('strtolower', array_slice($segments, 1, -1)));
+ $isinterface = false;
+ if (strtolower(end($segments)) == "interface") {
+ $isinterface = true;
+ array_pop($segments);
+ }
+
+ $dirpath = implode(DIRECTORY_SEPARATOR, array_map('strtolower', array_slice($segments, 1, -1)));
+ if ($isinterface) {
+ $dirpath = "interface" . DIRECTORY_SEPARATOR . $dirpath;
+ }
$filename = APPLICATION_PATH . '/' . ($dirpath ? $dirpath . '/' : '') . end($segments) . '.php';
if (Zend_Loader::isReadable($filename)) {
include_once $filename;
if ($error_code == 400 and $error->request->isXmlHttpRequest()) {
return $this->_helper->json(array('message' => $error->exception->getMessage()));
+ } else if ($error->exception instanceof Syj_Exception_InvalidGeomUpload) {
+ // invalid file upload: we will redirect to main page
+ $this->_helper->SyjReset->resetPlaceHolders();
+ $this->_request->setControllerName('idx')->setActionName('error')->setDispatched(false);
+ return;
}
// conditionally display exceptions
}
public function indexAction() {
- $url = $this->getRequest()->getUserParam('url');
-
- $geomform = new Syj_Form_Geom(array('name' => 'geomform'));
- $loginform = new Syj_Form_Login(array('name' => 'loginform', 'action' => 'login'));
- $userform = new Syj_Form_User(array('name' => 'userform', 'action' => 'user'));
- $newpwdform = new Syj_Form_Newpwd(array('name' => 'newpwdform', 'action' => 'newpwd'));
+ $this->_initForms();
+ $url = $this->getRequest()->getUserParam('url');
if (isset($url)) {
+ $this->view->geomform->setAction("");
$pathMapper = new Syj_Model_PathMapper();
$path = new Syj_Model_Path();
if (!$pathMapper->findByUrl($url, $path)) {
$this->view->path = $path;
$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);
+ $this->view->loginform->login_geom_id->setValue((string)$path->id);
+ $this->view->geomform->geom_title->setValue($path->title);
} else {
- $geomform->setAction('path');
-
- $lat = $this->getRequest()->getQuery('lat');
- $lon = $this->getRequest()->getQuery('lon');
- $zoom = $this->getRequest()->getQuery('zoom');
- if (is_numeric ($lat) and is_numeric ($lon) and is_numeric ($zoom)) {
- $initialpos = array('lat' => (float)$lat, 'lon' => (float)$lon, 'zoom' => (int)$zoom);
- } else {
- $initialpos = $this->_helper->syjGeoip($this->getRequest()->getClientIp(true));
- }
-
- $this->view->headScript()->prependScript((string) new phptojs\JsObject('gInitialPos', $initialpos));
+ $this->_setInitialPos();
$title = "Show your journey";
}
}
$this->view->headTitle($title);
$this->view->headMeta()->appendName('description', $this->view->translate('website to share routes'));
- $this->view->geomform = $geomform;
- $this->view->loginform = $loginform;
- $this->view->userform = $userform;
- $this->view->newpwdform = $newpwdform;
+
+ $this->view->loggedUser = $this->_helper->SyjSession->user();
+ }
+
+ protected function _initForms() {
+ $this->view->geomform = new Syj_Form_Geom(array('name' => 'geomform', 'action' => 'path'));
+ $this->view->loginform = new Syj_Form_Login(array('name' => 'loginform', 'action' => 'login'));
+ $this->view->userform = new Syj_Form_User(array('name' => 'userform', 'action' => 'user'));
+ $this->view->newpwdform = new Syj_Form_Newpwd(array('name' => 'newpwdform', 'action' => 'newpwd'));
+ }
+
+ protected function _setInitialPos() {
+ $lat = $this->getRequest()->getQuery('lat');
+ $lon = $this->getRequest()->getQuery('lon');
+ $zoom = $this->getRequest()->getQuery('zoom');
+ if (is_numeric ($lat) and is_numeric ($lon) and is_numeric ($zoom)) {
+ $initialpos = array('lat' => (float)$lat, 'lon' => (float)$lon, 'zoom' => (int)$zoom);
+ } else {
+ $initialpos = $this->_helper->syjGeoip($this->getRequest()->getClientIp(true));
+ }
+ $this->view->headScript()->prependScript((string) new phptojs\JsObject('gInitialPos', $initialpos));
+ }
+
+ public function errorAction() {
+ Zend_Controller_Front::getInstance()->getRequest()->setRequestUri($this->_request->getBaseUrl());
+ $this->_initForms();
+ $this->_setInitialPos();
+
+ $this->_jsLoggedInfo(null);
+ $this->_jsLocaleStrings();
+
+ $this->view->headTitle("Show your journey");
+ $this->view->headMeta()->appendName('description', $this->view->translate('website to share routes'));
$this->view->loggedUser = $this->_helper->SyjSession->user();
+ $this->_helper->ViewRenderer->setViewScriptPathSpec(':controller/index.:suffix');
+
+ $error = $this->_getParam('error_handler');
+ if ($error) {
+ if ($error->exception instanceof Syj_Exception_ToolargeGeomUpload) {
+ $maxsize = $this->_bytesToString(min($this->_strToBytes(ini_get('upload_max_filesize')),
+ $this->_strToBytes(ini_get('upload_max_filesize'))));
+ $this->view->errorMsg = $this->view->translate('File too large. File size must not exceed %s', $maxsize);
+ } else if ($error->exception instanceof Syj_Exception_InvalidGeomUpload) {
+ $this->view->errorMsg = $this->view->translate("Invalid file");
+ }
+ }
}
protected function _jsLoggedInfo(Syj_Model_Path $path = null) {
);
}
+ private function _strToBytes($value) {
+ $value = trim($value);
+ if (is_numeric($value)) {
+ return (integer) $value;
+ }
+ $last = strtolower($value[strlen($value)-1]);
+ $value = (int)$value;
+ switch ($last) {
+ case 'k' :
+ $value *= 1024;
+ break;
+ case 'm' :
+ $value *= 1024 * 1024;
+ break;
+ case 'g' :
+ $value *= 1024 * 1024 * 1024;
+ break;
+ default :
+ break;
+ }
+ return $value;
+ }
+
+ private function _bytesToString($size) {
+ $sizes = array('B', 'kB', 'MB', 'GB');
+ for ($c=0; $c < (count ($sizes) - 1) && $size >= 1024; $c++) {
+ $size = $size / 1024;
+ }
+ return round($size) . $sizes[$c];
+ }
+
}
$path->creatorIp = $this->getRequest()->getClientIp(true);
$this->save($path, $formData);
- $data = array('redirect' => "idx/" . (string)$path->id);
- $this->_helper->SyjApi->setCode(201)->setBodyJson($data);
+
+ $redirecturl = "idx/" . (string)$path->id;
+ if ($this->getRequest()->isXmlHttpRequest()) {
+ $data = array('redirect' => $redirecturl);
+ $this->_helper->SyjApi->setCode(201)->setBodyJson($data);
+ } else {
+ $this->_helper->SyjApi->setRedirect($redirecturl, 303);
+ }
}
public function updateAction() {
public function save(Syj_Model_Path $path, $formData) {
/* setting geom property */
- $decoder = new gisconverter\WKT();
- try {
- $geom = $decoder->geomFromText($formData["geom_data"]);
- } catch (gisconverter\CustomException $e) {
- throw new Syj_Exception_Request();
+ $geom = null;
+ foreach (array("WKT", "KML", "GPX", "geoJSON") as $dectype) {
+ $classname = 'gisconverter\\' . $dectype;
+ $decoder = new $classname();
+ try {
+ $geom = $decoder->geomFromText($formData["geom_data"]);
+ } catch (Exception $e) {
+ }
+ if ($geom) {
+ break;
+ }
}
+ if (!$geom) {
+ throw new Syj_Exception_InvalidGeomUpload();
+ }
+
if ($geom::name != "LineString") {
throw new Syj_Exception_Request();
}
protected $_checkIfNoneMatch = false;
protected $_body = '';
protected $_code = 200;
+ protected $_redirect = '';
public function init() {
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
return $this->_code;
}
+ public function setRedirect($url, $code = 0) {
+ $this->_redirect = (string)$url;
+ if (is_numeric($code) && (int)$code >= 300 && (int)$code < 400) {
+ $this->_code;
+ } else if (!isset($this->_code)) {
+ $this->code = 301;
+ }
+ return $this;
+ }
+
+ public function getRedirect() {
+ return $this->_redirect;
+ }
+
public function setCheckIfNoneMatch($check) {
$this->_checkIfNoneMatch = (boolean)$check;
return $this;
$response->setHeader ('Etag', $etag);
}
+ if ($this->_redirect) {
+ $response->setHeader ('Location', $this->_redirect);
+ }
+
$response->setHttpResponseCode($this->_code)
->setBody($this->_body);
}
throw new Syj_Exception_Request();
}
$data = $this->getRequest()->getPost();
+
+ if ($form instanceof Syj_Processor_Interface) {
+ $form->process($data);
+ }
+
if (!$form->isValid($data)) {
throw new Syj_Exception_Request();
}
--- /dev/null
+<?php
+/* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
+ and is published under the AGPL license. */
+
+class Syj_Exception_InvalidGeomUpload extends Syj_Exception_Request
+{
+ protected $_message = 'invalidgeomupload';
+}
+?>
--- /dev/null
+<?php
+/* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
+ and is published under the AGPL license. */
+
+class Syj_Exception_ToolargeGeomUpload extends Syj_Exception_InvalidGeomUpload
+{
+ protected $_message = 'toolargegeomupload';
+}
+?>
/* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
and is published under the AGPL license. */
-class Syj_Form_Geom extends Zend_Form
+class Syj_Form_Geom extends Zend_Form implements Syj_Processor_Interface
{
- protected $_elementDecorators = array( 'ViewHelper', 'Errors',);
-
protected $_decorators = array(
'FormElements' => array('decorator' => 'FormElements', 'options' => null),
'Form' => array('decorator' => 'Form', 'options' => null)
);
- public function init() {
- $data = array('Hidden', 'geom_data', array('required' => true));
+ public function __construct($options = null) {
+ $translator = $this->getTranslator();
+
+ $data = array('Hidden', 'geom_data', array('required' => true, 'decorators' => array('ViewHelper', 'Errors')));
+
+ $upload = array('File', 'geom_upload', array("label" => $translator->translate("choose route from a file"),
+ 'validators' => array(),
+ 'ignoreNoFile' => true,
+ 'decorators' => array(
+ 'File',
+ 'Errors',
+ array('Label', array('separator' => '<br>')),
+ array('HtmlTag', array('tag' => 'div', 'id' => 'geom_upload_container')),
+ )));
$title = array('Text', 'geom_title', array(
'label' => __("optional title for this journey"),
'attribs' => array('maxlength' => '40', 'size' => '20'),
- 'validators' => array(new Zend_Validate_StringLength(0, 40))
- ));
+ 'validators' => array(new Zend_Validate_StringLength(0, 40)),
+ 'decorators' => array(
+ 'ViewHelper',
+ 'Errors',
+ array('Label', array('separator' => '<br>')),
+ array('HtmlTag', array('tag' => 'div', 'id' => 'geom_title_container')),
+ )));
- $translator = $this->getTranslator();
$anchor = $this->getView()->Anchor("termsofuse?format=raw",
$translator->translate("terms of use"),
array('id' => 'geom_termsofuse_anchor'));
'label',
array('HtmlTag', array('tag' => 'div', 'id' => 'geom_accept_container', 'class' => 'logged-hide')))));
- $submit = array('Submit', 'geom_submit', array('label' => __("save")));
-
- $this->addElements(array($data, $title, $touaccept, $submit));
+ $submit = array('Submit', 'geom_submit', array('label' => __("save"), 'decorators' => array(
+ 'ViewHelper',
+ 'Errors',
+ array('HtmlTag', array('tag' => 'br', 'openOnly' => true)))));
+ $this->addElements(array($data, $upload, $title, $touaccept, $submit));
$decorator = $this->geom_accept->getDecorator('Zend_Form_Decorator_Label');
$decorator->setOption('escape', false);
- $this->geom_title->addDecorator('HtmlTag', array('tag' => 'br', 'openOnly' => true))->
- addDecorator('label');
- $this->geom_submit->addDecorator('HtmlTag', array('tag' => 'br', 'openOnly' => true));
+ parent::__construct($options);
+ }
+
+ public function process(&$data) {
+ $upload = null;
+ if ($this->getValue("geom_upload")) {
+ $file = $this->geom_upload;
+ $upload = $file->getDestination() . DIRECTORY_SEPARATOR . $file->getValue();
+ if (!isset($data["geom_data"]) || !$data["geom_data"]) {
+ if (!file_exists($upload)) {
+ throw new Zend_Exception();
+ }
+ if (!@filesize($upload)) {
+ throw new Syj_Exception_InvalidGeomUpload();
+ }
+ $content = @file_get_contents ($upload);
+ if ($content == false) {
+ throw new Zend_Exception();
+ }
+ $data['geom_data'] = $content;
+ }
+ @unlink ($upload);
+ } else if (isset($_FILES['geom_upload']) and ($_FILES['geom_upload']['error']) == UPLOAD_ERR_INI_SIZE) {
+ throw new Syj_Exception_ToolargeGeomUpload();
+ } else {
+ $this->removeElement("geom_upload");
+ }
+ return $this;
}
+
}
--- /dev/null
+<?php
+/* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
+ and is published under the AGPL license. */
+
+interface Syj_Processor_Interface {
+ public function process(&$data);
+}
msgstr ""
"Project-Id-Version: syj\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-03-14 15:01+0100\n"
+"POT-Creation-Date: 2011-03-18 17:25+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: arno <arno@renevier.net>\n"
"Language-Team: arno <arno@renevier.net>\n"
msgid "SYJ needs javascript. Please activate scripts in your browser."
msgstr "SYJ needs javascript. Please activate scripts in your browser."
-#: application/views/scripts/idx/index.phtml:15
+#: application/views/scripts/idx/index.phtml:21
msgid "Welcome on Syj."
msgstr "Welcome on Syj."
-#: application/views/scripts/idx/index.phtml:17
+#: application/views/scripts/idx/index.phtml:23
msgid "To create a journey, just press <strong>\"start a route\"</strong> button, then click on the map to add points to your route. You can zoom and move the map with the controls in the top left corner"
msgstr "To create a journey, just press <strong>\"start a route\"</strong> button, then click on the map to add points to your route. You can zoom and move the map with the controls in the top left corner"
-#: application/views/scripts/idx/index.phtml:19
+#: application/views/scripts/idx/index.phtml:25
msgid "When you have finished a path, press \"create\", button."
msgstr "When you have finished a path, press \"create\", button."
-#: application/views/scripts/idx/index.phtml:25
+#: application/views/scripts/idx/index.phtml:35
msgid "route length"
msgstr "route length"
-#: application/views/scripts/idx/index.phtml:38
+#: application/views/scripts/idx/index.phtml:48
#: application/controllers/LoginController.php:8
#: application/layouts/scripts/footer.phtml:74
-#: application/forms/Login.php:26
+#: application/forms/Login.php:23
msgid "login"
msgstr "login"
-#: application/views/scripts/idx/index.phtml:40
-#: application/views/scripts/idx/index.phtml:158
+#: application/views/scripts/idx/index.phtml:50
+#: application/views/scripts/idx/index.phtml:168
msgid "create an account"
msgstr "create an account"
-#: application/views/scripts/idx/index.phtml:41
+#: application/views/scripts/idx/index.phtml:51
msgid "Whith an account, you can manage and modify your routes"
msgstr "Whith an account, you can manage and modify your routes"
-#: application/views/scripts/idx/index.phtml:58
+#: application/views/scripts/idx/index.phtml:68
msgid "route infos"
msgstr "route infos"
-#: application/views/scripts/idx/index.phtml:62
-#: application/views/scripts/idx/index.phtml:71
+#: application/views/scripts/idx/index.phtml:72
+#: application/views/scripts/idx/index.phtml:81
msgid "direct link"
msgstr "direct link"
-#: application/views/scripts/idx/index.phtml:75
+#: application/views/scripts/idx/index.phtml:85
msgid "export"
msgstr "export"
-#: application/views/scripts/idx/index.phtml:80
-#: application/views/scripts/idx/index.phtml:81
+#: application/views/scripts/idx/index.phtml:90
+#: application/views/scripts/idx/index.phtml:91
msgid "kml export"
msgstr "kml export"
-#: application/views/scripts/idx/index.phtml:87
-#: application/views/scripts/idx/index.phtml:88
+#: application/views/scripts/idx/index.phtml:97
+#: application/views/scripts/idx/index.phtml:98
msgid "gpx export"
msgstr "gpx export"
-#: application/views/scripts/idx/index.phtml:101
-#: application/controllers/IdxController.php:143
+#: application/views/scripts/idx/index.phtml:111
+#: application/controllers/IdxController.php:179
msgid "duplicate"
msgstr "duplicate"
-#: application/views/scripts/idx/index.phtml:103
-#: application/controllers/IdxController.php:141
+#: application/views/scripts/idx/index.phtml:113
+#: application/controllers/IdxController.php:177
msgid "edit"
msgstr "edit"
-#: application/views/scripts/idx/index.phtml:107
+#: application/views/scripts/idx/index.phtml:117
msgid "Search a place"
msgstr "Search a place"
-#: application/views/scripts/idx/index.phtml:111
+#: application/views/scripts/idx/index.phtml:121
msgid "Ok"
msgstr "Ok"
-#: application/views/scripts/idx/index.phtml:117
+#: application/views/scripts/idx/index.phtml:127
msgid "start a route"
msgstr "start a route"
-#: application/views/scripts/idx/index.phtml:129
+#: application/views/scripts/idx/index.phtml:139
msgid "more results"
msgstr "more results"
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:134
+#: application/controllers/IdxController.php:170
msgid "A link to reset your password has been emailed to you"
msgstr "A link to reset your password has been emailed to you"
msgid "When you create a route with syj, you must draw each point on the map. If your route follows an existing path, you still need to draw the layer manually: syj will not try to attach nearby existing paths. There are three main reasons. One bad reason: it would a lot of work to implement. And two good reasons: syj uses OpenStreetMap as a background map, and the map is still unfinished in many areas. Also, depending on your route, you may wish to attach to motorways, footways, biycle lanes, railways, …. If you are in a place with lot of differents routes, it would be nearly impossible to always choose the right way."
msgstr "When you create a route with syj, you must draw each point on the map. If your route follows an existing path, you still need to draw the layer manually: syj will not try to attach nearby existing paths. There are three main reasons. One bad reason: it would a lot of work to implement. And two good reasons: syj uses OpenStreetMap as a background map, and the map is still unfinished in many areas. Also, depending on your route, you may wish to attach to motorways, footways, biycle lanes, railways, …. If you are in a place with lot of differents routes, it would be nearly impossible to always choose the right way."
-#: application/views/helpers/LogoutLink.php:10
+#: application/views/helpers/LogoutLink.php:9
#: application/layouts/scripts/footer.phtml:67
msgid "logout"
msgstr "logout"
"Syj team"
#: application/controllers/LoginController.php:99
-#: application/controllers/IdxController.php:124
+#: application/controllers/IdxController.php:160
msgid "you must enter a login name"
msgstr "you must enter a login name"
#: application/controllers/ContactController.php:121
#: application/controllers/NewpwdController.php:68
#: application/controllers/AccountController.php:70
-#: application/controllers/IdxController.php:145
+#: application/controllers/IdxController.php:181
msgid "Value is required"
msgstr "Value is required"
msgid "Invalid email"
msgstr "Invalid email"
-#: application/controllers/ErrorController.php:55
+#: application/controllers/ErrorController.php:59
msgid "Oups, something went wrong"
msgstr "Oups, something went wrong"
#: application/controllers/TermsofuseController.php:10
#: application/layouts/scripts/footer.phtml:87
-#: application/forms/Geom.php:25
+#: application/forms/Geom.php:39
#: application/forms/User.php:44
msgid "terms of use"
msgstr "terms of use"
msgstr "There is no undo. Delete this route definitively ?"
#: application/controllers/ListController.php:33
-#: application/controllers/IdxController.php:121
+#: application/controllers/IdxController.php:157
msgid "server could not be reached"
msgstr "server could not be reached"
#: application/controllers/ListController.php:34
-#: application/controllers/IdxController.php:118
+#: application/controllers/IdxController.php:154
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:35
-#: application/controllers/IdxController.php:119
+#: application/controllers/IdxController.php:155
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:36
-#: application/controllers/IdxController.php:122
+#: application/controllers/IdxController.php:158
msgid "there was a server error"
msgstr "there was a server error"
#: application/controllers/ListController.php:37
-#: application/controllers/IdxController.php:123
+#: application/controllers/IdxController.php:159
msgid "there was an unknown error"
msgstr "there was an unknown error"
msgstr "Wrong password"
#: application/controllers/AccountController.php:43
-#: application/controllers/IdxController.php:132
+#: application/controllers/IdxController.php:168
msgid "an user is already registered with this email"
msgstr "an user is already registered with this email"
#: application/controllers/AccountController.php:71
-#: application/controllers/IdxController.php:128
+#: application/controllers/IdxController.php:164
#: application/forms/Account.php:40
msgid "Password do not match"
msgstr "Password do not match"
msgstr "You have made no change"
#: application/controllers/IdxController.php:26
-#: application/controllers/IdxController.php:78
+#: application/controllers/IdxController.php:73
#, php-format
msgid "route by <strong>%s</strong>"
msgstr "route by <strong>%s</strong>"
-#: application/controllers/IdxController.php:48
+#: application/controllers/IdxController.php:45
msgid "route has been deleted"
msgstr "route has been deleted"
-#: application/controllers/IdxController.php:51
+#: application/controllers/IdxController.php:48
msgid "route does not exist"
msgstr "route does not exist"
-#: application/controllers/IdxController.php:81
+#: application/controllers/IdxController.php:76
+#: application/controllers/IdxController.php:109
msgid "website to share routes"
msgstr "website to share routes"
-#: application/controllers/IdxController.php:111
-#: application/controllers/IdxController.php:137
+#: application/controllers/IdxController.php:118
+#, php-format
+msgid "File too large. File size must not exceed %s"
+msgstr "File too large. File size must not exceed %s"
+
+#: application/controllers/IdxController.php:120
+msgid "Invalid file"
+msgstr "Invalid file"
+
+#: application/controllers/IdxController.php:147
+#: application/controllers/IdxController.php:173
msgid "Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
msgstr "Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
-#: application/controllers/IdxController.php:117
+#: application/controllers/IdxController.php:153
msgid "save took place successfully"
msgstr "save took place successfully"
-#: application/controllers/IdxController.php:120
+#: application/controllers/IdxController.php:156
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:125
+#: application/controllers/IdxController.php:161
msgid "Login correct"
msgstr "Login correct"
-#: application/controllers/IdxController.php:126
+#: application/controllers/IdxController.php:162
msgid "Wrong login/password"
msgstr "Wrong login/password"
-#: application/controllers/IdxController.php:127
+#: application/controllers/IdxController.php:163
msgid "you must enter a password"
msgstr "you must enter a password"
-#: application/controllers/IdxController.php:129
+#: application/controllers/IdxController.php:165
msgid "You must accept terms of use"
msgstr "You must accept terms of use"
-#: application/controllers/IdxController.php:130
+#: application/controllers/IdxController.php:166
msgid "you must enter an email"
msgstr "you must enter an email"
-#: application/controllers/IdxController.php:131
+#: application/controllers/IdxController.php:167
msgid "invalid email"
msgstr "invalid email"
-#: application/controllers/IdxController.php:133
+#: application/controllers/IdxController.php:169
msgid "Account created"
msgstr "Account created"
-#: application/controllers/IdxController.php:135
+#: application/controllers/IdxController.php:171
msgid "Now, you can retry to save"
msgstr "Now, you can retry to save"
-#: application/controllers/IdxController.php:136
+#: application/controllers/IdxController.php:172
msgid "route by"
msgstr "route by"
-#: application/controllers/IdxController.php:138
+#: application/controllers/IdxController.php:174
msgid "checking availibilty"
msgstr "checking availibilty"
-#: application/controllers/IdxController.php:139
+#: application/controllers/IdxController.php:175
msgid "available pseudo"
msgstr "available pseudo"
-#: application/controllers/IdxController.php:140
+#: application/controllers/IdxController.php:176
msgid "unavailable pseudo"
msgstr "unavailable pseudo"
-#: application/controllers/IdxController.php:142
+#: application/controllers/IdxController.php:178
msgid "create"
msgstr "create"
-#: application/controllers/IdxController.php:144
+#: application/controllers/IdxController.php:180
msgid "You have an unsaved route"
msgstr "You have an unsaved route"
-#: application/controllers/IdxController.php:146
+#: application/controllers/IdxController.php:182
msgid "no result"
msgstr "no result"
-#: application/controllers/IdxController.php:147
+#: application/controllers/IdxController.php:183
msgid "could not analyze file content"
msgstr "could not analyze file content"
msgid "password"
msgstr "password"
-#: application/forms/Login.php:23
+#: application/forms/Login.php:20
msgid "I forgot my password"
msgstr "I forgot my password"
msgid "Send a message"
msgstr "Send a message"
-#: application/forms/Geom.php:18
+#: application/forms/Geom.php:17
+msgid "choose route from a file"
+msgstr "choose route from a file"
+
+#: application/forms/Geom.php:28
msgid "optional title for this journey"
msgstr "optional title for this journey"
-#: application/forms/Geom.php:27
+#: application/forms/Geom.php:41
#: application/forms/User.php:46
#, php-format
msgid "I've read and accepted %s"
msgstr "I've read and accepted %s"
-#: application/forms/Geom.php:36
+#: application/forms/Geom.php:50
#: application/forms/Pending/ValidateCreation.php:17
msgid "save"
msgstr "save"
msgstr ""
"Project-Id-Version: syj\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-03-14 15:01+0100\n"
+"POT-Creation-Date: 2011-03-18 17:25+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: arno <arno@renevier.net>\n"
"Language-Team: arno <arno@renevier.net>\n"
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."
-#: application/views/scripts/idx/index.phtml:15
+#: application/views/scripts/idx/index.phtml:21
msgid "Welcome on Syj."
msgstr "Bienvenue sur Syj."
-#: application/views/scripts/idx/index.phtml:17
+#: application/views/scripts/idx/index.phtml:23
msgid "To create a journey, just press <strong>\"start a route\"</strong> button, then click on the map to add points to your route. You can zoom and move the map with the controls in the top left corner"
msgstr "Pour créer un trajet, pressez simplement le bouton <strong>\"commencer un itinéraire\"</strong> puis cliquez sur la carte pour ajouter des points à votre tracé. Vous pouvez zoomer et bouger la carte avec les boutons en haut à gauche."
-#: application/views/scripts/idx/index.phtml:19
+#: application/views/scripts/idx/index.phtml:25
msgid "When you have finished a path, press \"create\", button."
msgstr "Lorsque vous avez fini votre tracé, pressez le bouton \"créer\"."
-#: application/views/scripts/idx/index.phtml:25
+#: application/views/scripts/idx/index.phtml:35
msgid "route length"
msgstr "longueur du tracé"
-#: application/views/scripts/idx/index.phtml:38
+#: application/views/scripts/idx/index.phtml:48
#: application/controllers/LoginController.php:8
#: application/layouts/scripts/footer.phtml:74
-#: application/forms/Login.php:26
+#: application/forms/Login.php:23
msgid "login"
msgstr "connexion"
-#: application/views/scripts/idx/index.phtml:40
-#: application/views/scripts/idx/index.phtml:158
+#: application/views/scripts/idx/index.phtml:50
+#: application/views/scripts/idx/index.phtml:168
msgid "create an account"
msgstr "créer un compte"
-#: application/views/scripts/idx/index.phtml:41
+#: application/views/scripts/idx/index.phtml:51
msgid "Whith an account, you can manage and modify your routes"
msgstr "Avec un compte, vous pourrez gérer et modifier vos itinéraires"
-#: application/views/scripts/idx/index.phtml:58
+#: application/views/scripts/idx/index.phtml:68
msgid "route infos"
msgstr "informations sur le tracé"
-#: application/views/scripts/idx/index.phtml:62
-#: application/views/scripts/idx/index.phtml:71
+#: application/views/scripts/idx/index.phtml:72
+#: application/views/scripts/idx/index.phtml:81
msgid "direct link"
msgstr "lien direct"
-#: application/views/scripts/idx/index.phtml:75
+#: application/views/scripts/idx/index.phtml:85
msgid "export"
msgstr "export"
-#: application/views/scripts/idx/index.phtml:80
-#: application/views/scripts/idx/index.phtml:81
+#: application/views/scripts/idx/index.phtml:90
+#: application/views/scripts/idx/index.phtml:91
msgid "kml export"
msgstr "export kml"
-#: application/views/scripts/idx/index.phtml:87
-#: application/views/scripts/idx/index.phtml:88
+#: application/views/scripts/idx/index.phtml:97
+#: application/views/scripts/idx/index.phtml:98
msgid "gpx export"
msgstr "export gpx"
-#: application/views/scripts/idx/index.phtml:101
-#: application/controllers/IdxController.php:143
+#: application/views/scripts/idx/index.phtml:111
+#: application/controllers/IdxController.php:179
msgid "duplicate"
msgstr "dupliquer"
-#: application/views/scripts/idx/index.phtml:103
-#: application/controllers/IdxController.php:141
+#: application/views/scripts/idx/index.phtml:113
+#: application/controllers/IdxController.php:177
msgid "edit"
msgstr "modifier"
-#: application/views/scripts/idx/index.phtml:107
+#: application/views/scripts/idx/index.phtml:117
msgid "Search a place"
msgstr "Rechercher un lieu"
-#: application/views/scripts/idx/index.phtml:111
+#: application/views/scripts/idx/index.phtml:121
msgid "Ok"
msgstr "Ok"
-#: application/views/scripts/idx/index.phtml:117
+#: application/views/scripts/idx/index.phtml:127
msgid "start a route"
msgstr "commencer un itinéraire"
-#: application/views/scripts/idx/index.phtml:129
+#: application/views/scripts/idx/index.phtml:139
msgid "more results"
msgstr "plus de résultats"
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:134
+#: application/controllers/IdxController.php:170
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é"
msgid "When you create a route with syj, you must draw each point on the map. If your route follows an existing path, you still need to draw the layer manually: syj will not try to attach nearby existing paths. There are three main reasons. One bad reason: it would a lot of work to implement. And two good reasons: syj uses OpenStreetMap as a background map, and the map is still unfinished in many areas. Also, depending on your route, you may wish to attach to motorways, footways, biycle lanes, railways, …. If you are in a place with lot of differents routes, it would be nearly impossible to always choose the right way."
msgstr "Lorsque vous créez un itinéraire avec syj, vous devez placer chaque point sur la carte. Si votre itinéraire suit un chemin, vous devez quand même dessiner la surcouche à la main : syj ne va pas chercher à accrocher les chemins proches. Il y a trois raisons principales à cela. Une mauvaise raison : cela demanderait beaucoup de travail à mettre en place. Et deux bonnes raisons : syj utilise OpenStreetMap comme fond de carte. Or, il y a beaucoup d'endroits où cette carte est incomplète. D'autre part, selon l'itinéraire, vous voudriez accrocher l'autoroute, ou bien les chemins piétons, ou les pistes cyclables, ou les rails de tramway, …. Si vous êtes dans un endroit avec différents types de routes, syj n'arrivera probablement pas à choisir la bonne route."
-#: application/views/helpers/LogoutLink.php:10
+#: application/views/helpers/LogoutLink.php:9
#: application/layouts/scripts/footer.phtml:67
msgid "logout"
msgstr "déconnexion"
"L'équipe de Syj"
#: application/controllers/LoginController.php:99
-#: application/controllers/IdxController.php:124
+#: application/controllers/IdxController.php:160
msgid "you must enter a login name"
msgstr "vous devez entrer un nom d'utilisateur"
#: application/controllers/ContactController.php:121
#: application/controllers/NewpwdController.php:68
#: application/controllers/AccountController.php:70
-#: application/controllers/IdxController.php:145
+#: application/controllers/IdxController.php:181
msgid "Value is required"
msgstr "Le champ est requis"
msgid "Invalid email"
msgstr "Email invalide"
-#: application/controllers/ErrorController.php:55
+#: application/controllers/ErrorController.php:59
msgid "Oups, something went wrong"
msgstr "Oups, il y a eu un souci"
#: application/controllers/TermsofuseController.php:10
#: application/layouts/scripts/footer.phtml:87
-#: application/forms/Geom.php:25
+#: application/forms/Geom.php:39
#: application/forms/User.php:44
msgid "terms of use"
msgstr "conditions d'utilisation"
msgstr "Vous ne pourrez pas annuler. Supprimer l'itinéraire définitivement ?"
#: application/controllers/ListController.php:33
-#: application/controllers/IdxController.php:121
+#: application/controllers/IdxController.php:157
msgid "server could not be reached"
msgstr "serveur inaccessible"
#: application/controllers/ListController.php:34
-#: application/controllers/IdxController.php:118
+#: application/controllers/IdxController.php:154
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:35
-#: application/controllers/IdxController.php:119
+#: application/controllers/IdxController.php:155
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:36
-#: application/controllers/IdxController.php:122
+#: application/controllers/IdxController.php:158
msgid "there was a server error"
msgstr "Il s'est produit une erreur serveur"
#: application/controllers/ListController.php:37
-#: application/controllers/IdxController.php:123
+#: application/controllers/IdxController.php:159
msgid "there was an unknown error"
msgstr "Il s'est produit une erreur inconnue"
msgstr "Mauvais mot de passe"
#: application/controllers/AccountController.php:43
-#: application/controllers/IdxController.php:132
+#: application/controllers/IdxController.php:168
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:71
-#: application/controllers/IdxController.php:128
+#: application/controllers/IdxController.php:164
#: application/forms/Account.php:40
msgid "Password do not match"
msgstr "Les mots de passe ne correspondent pas"
msgstr "Vous n'avez fait aucun changement"
#: application/controllers/IdxController.php:26
-#: application/controllers/IdxController.php:78
+#: application/controllers/IdxController.php:73
#, php-format
msgid "route by <strong>%s</strong>"
msgstr "tracé par <strong>%s</strong>"
-#: application/controllers/IdxController.php:48
+#: application/controllers/IdxController.php:45
msgid "route has been deleted"
msgstr "l'itinéraire a été supprimé"
-#: application/controllers/IdxController.php:51
+#: application/controllers/IdxController.php:48
msgid "route does not exist"
msgstr "L'itinéraire n'existe pas"
-#: application/controllers/IdxController.php:81
+#: application/controllers/IdxController.php:76
+#: application/controllers/IdxController.php:109
msgid "website to share routes"
msgstr "site de partage d'itinéraires"
-#: application/controllers/IdxController.php:111
-#: application/controllers/IdxController.php:137
+#: application/controllers/IdxController.php:118
+#, php-format
+msgid "File too large. File size must not exceed %s"
+msgstr "Fichier trop gros. La taille ne doit pas dépasser %s"
+
+#: application/controllers/IdxController.php:120
+msgid "Invalid file"
+msgstr "Fichier invalide"
+
+#: application/controllers/IdxController.php:147
+#: application/controllers/IdxController.php:173
msgid "Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
msgstr "Carte par <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
-#: application/controllers/IdxController.php:117
+#: application/controllers/IdxController.php:153
msgid "save took place successfully"
msgstr "La sauvegarde s'est déroulée correctement"
-#: application/controllers/IdxController.php:120
+#: application/controllers/IdxController.php:156
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:125
+#: application/controllers/IdxController.php:161
msgid "Login correct"
msgstr "Vous êtes connecté"
-#: application/controllers/IdxController.php:126
+#: application/controllers/IdxController.php:162
msgid "Wrong login/password"
msgstr "Mauvais nom d'utilisateur ou mot de passe"
-#: application/controllers/IdxController.php:127
+#: application/controllers/IdxController.php:163
msgid "you must enter a password"
msgstr "vous devez entrer un mot de passe"
-#: application/controllers/IdxController.php:129
+#: application/controllers/IdxController.php:165
msgid "You must accept terms of use"
msgstr "Vous devez accepter les conditions d'utilisation"
-#: application/controllers/IdxController.php:130
+#: application/controllers/IdxController.php:166
msgid "you must enter an email"
msgstr "vous devez entrer un email"
-#: application/controllers/IdxController.php:131
+#: application/controllers/IdxController.php:167
msgid "invalid email"
msgstr "email invalide"
-#: application/controllers/IdxController.php:133
+#: application/controllers/IdxController.php:169
msgid "Account created"
msgstr "Compte créé"
-#: application/controllers/IdxController.php:135
+#: application/controllers/IdxController.php:171
msgid "Now, you can retry to save"
msgstr "Maintenant, vous pouvez réessayer de sauvegarder"
-#: application/controllers/IdxController.php:136
+#: application/controllers/IdxController.php:172
msgid "route by"
msgstr "tracé par"
-#: application/controllers/IdxController.php:138
+#: application/controllers/IdxController.php:174
msgid "checking availibilty"
msgstr "vérification de la disponibilité"
-#: application/controllers/IdxController.php:139
+#: application/controllers/IdxController.php:175
msgid "available pseudo"
msgstr "pseudo disponible"
-#: application/controllers/IdxController.php:140
+#: application/controllers/IdxController.php:176
msgid "unavailable pseudo"
msgstr "pseudo non disponible"
-#: application/controllers/IdxController.php:142
+#: application/controllers/IdxController.php:178
msgid "create"
msgstr "créér"
-#: application/controllers/IdxController.php:144
+#: application/controllers/IdxController.php:180
msgid "You have an unsaved route"
msgstr "Vous avez un itinéraire non sauvegardé"
-#: application/controllers/IdxController.php:146
+#: application/controllers/IdxController.php:182
msgid "no result"
msgstr "pas de résultat"
-#: application/controllers/IdxController.php:147
+#: application/controllers/IdxController.php:183
msgid "could not analyze file content"
msgstr "impossible d'analyser le contenu du fichier"
msgid "password"
msgstr "mot de passe"
-#: application/forms/Login.php:23
+#: application/forms/Login.php:20
msgid "I forgot my password"
msgstr "J'ai oublié mon mot de passe"
msgid "Send a message"
msgstr "Envoyer un message"
-#: application/forms/Geom.php:18
+#: application/forms/Geom.php:17
+msgid "choose route from a file"
+msgstr "choisir un itinéraire à partir d'un fichier"
+
+#: application/forms/Geom.php:28
msgid "optional title for this journey"
msgstr "titre facultatif pour ce trajet"
-#: application/forms/Geom.php:27
+#: application/forms/Geom.php:41
#: application/forms/User.php:46
#, php-format
msgid "I've read and accepted %s"
msgstr "J'ai lu et accepté les %s"
-#: application/forms/Geom.php:36
+#: application/forms/Geom.php:50
#: application/forms/Pending/ValidateCreation.php:17
msgid "save"
msgstr "enregistrer"
msgstr ""
"Project-Id-Version: syj\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-03-14 15:01+0100\n"
+"POT-Creation-Date: 2011-03-18 17:25+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: S.Higashi <s_higash@mua.biglobe.ne.jp>\n"
"Language: \n"
"SYJはjavascriptを使用します。あなたのブラウザでjavascriptを使えるように設定し"
"てください"
-#: application/views/scripts/idx/index.phtml:15
+#: application/views/scripts/idx/index.phtml:21
msgid "Welcome on Syj."
msgstr "Syjへようこそ。"
-#: application/views/scripts/idx/index.phtml:17
+#: application/views/scripts/idx/index.phtml:23
msgid ""
"To create a journey, just press <strong>\"start a route\"</strong> button, "
"then click on the map to add points to your route. You can zoom and move the "
"ださい。そしてマップをクリックしながらルートに沿ってポイントを追加してくださ"
"い。画面左上のコントロールでマップのズームや移動ができます"
-#: application/views/scripts/idx/index.phtml:19
+#: application/views/scripts/idx/index.phtml:25
msgid "When you have finished a path, press \"create\", button."
msgstr "パスを描き終わったら、\"作成\"ボタンを押してください"
-#: application/views/scripts/idx/index.phtml:25
+#: application/views/scripts/idx/index.phtml:35
msgid "route length"
msgstr "ルート長"
-#: application/views/scripts/idx/index.phtml:38
+#: application/views/scripts/idx/index.phtml:48
#: application/controllers/LoginController.php:8
-#: application/layouts/scripts/footer.phtml:74 application/forms/Login.php:26
+#: application/layouts/scripts/footer.phtml:74 application/forms/Login.php:23
msgid "login"
msgstr "ログイン"
-#: application/views/scripts/idx/index.phtml:40
-#: application/views/scripts/idx/index.phtml:158
+#: application/views/scripts/idx/index.phtml:50
+#: application/views/scripts/idx/index.phtml:168
msgid "create an account"
msgstr "アカウントを作成"
-#: application/views/scripts/idx/index.phtml:41
+#: application/views/scripts/idx/index.phtml:51
msgid "Whith an account, you can manage and modify your routes"
msgstr "アカウントがあれば、自分のルートを管理、変更できます"
-#: application/views/scripts/idx/index.phtml:58
+#: application/views/scripts/idx/index.phtml:68
msgid "route infos"
msgstr "ルート情報"
-#: application/views/scripts/idx/index.phtml:62
-#: application/views/scripts/idx/index.phtml:71
+#: application/views/scripts/idx/index.phtml:72
+#: application/views/scripts/idx/index.phtml:81
msgid "direct link"
msgstr "ダイレクトリンク"
-#: application/views/scripts/idx/index.phtml:75
+#: application/views/scripts/idx/index.phtml:85
msgid "export"
msgstr "エクスポート"
-#: application/views/scripts/idx/index.phtml:80
-#: application/views/scripts/idx/index.phtml:81
+#: application/views/scripts/idx/index.phtml:90
+#: application/views/scripts/idx/index.phtml:91
msgid "kml export"
msgstr "kmlにエクスポート"
-#: application/views/scripts/idx/index.phtml:87
-#: application/views/scripts/idx/index.phtml:88
+#: application/views/scripts/idx/index.phtml:97
+#: application/views/scripts/idx/index.phtml:98
msgid "gpx export"
msgstr "gpxにエクスポート"
-#: application/views/scripts/idx/index.phtml:101
-#: application/controllers/IdxController.php:143
+#: application/views/scripts/idx/index.phtml:111
+#: application/controllers/IdxController.php:179
msgid "duplicate"
msgstr "複製"
-#: application/views/scripts/idx/index.phtml:103
-#: application/controllers/IdxController.php:141
+#: application/views/scripts/idx/index.phtml:113
+#: application/controllers/IdxController.php:177
msgid "edit"
msgstr "編集"
-#: application/views/scripts/idx/index.phtml:107
+#: application/views/scripts/idx/index.phtml:117
msgid "Search a place"
msgstr "場所をさがす"
-#: application/views/scripts/idx/index.phtml:111
+#: application/views/scripts/idx/index.phtml:121
msgid "Ok"
msgstr "OK"
-#: application/views/scripts/idx/index.phtml:117
+#: application/views/scripts/idx/index.phtml:127
msgid "start a route"
msgstr "ルート開始"
-#: application/views/scripts/idx/index.phtml:129
+#: application/views/scripts/idx/index.phtml:139
msgid "more results"
msgstr "もっと"
"\">openstreetmap</a>です。"
#: application/views/scripts/newpwd/success.phtml:4
-#: application/controllers/IdxController.php:134
+#: application/controllers/IdxController.php:170
msgid "A link to reset your password has been emailed to you"
msgstr "パスワードをリセットするためのURLがあなた宛に送られました"
"用レーン、鉄道…などを添付したいと思うでしょう。あなたが多くの異なるルートがあ"
"る場所にいるなら、常に正しい道を選ぶのは不可能に近いでしょう。"
-#: application/views/helpers/LogoutLink.php:10
+#: application/views/helpers/LogoutLink.php:9
#: application/layouts/scripts/footer.phtml:67
msgid "logout"
msgstr "ログアウト"
"Syj チーム"
#: application/controllers/LoginController.php:99
-#: application/controllers/IdxController.php:124
+#: application/controllers/IdxController.php:160
msgid "you must enter a login name"
msgstr "ログイン名を入力してください"
#: application/controllers/ContactController.php:121
#: application/controllers/NewpwdController.php:68
#: application/controllers/AccountController.php:70
-#: application/controllers/IdxController.php:145
+#: application/controllers/IdxController.php:181
msgid "Value is required"
msgstr "値が必要です"
msgid "Invalid email"
msgstr "不正なメールアドレス"
-#: application/controllers/ErrorController.php:55
+#: application/controllers/ErrorController.php:59
msgid "Oups, something went wrong"
msgstr "おや、何かがおかしいですね"
#: application/controllers/TermsofuseController.php:10
-#: application/layouts/scripts/footer.phtml:87 application/forms/Geom.php:25
+#: application/layouts/scripts/footer.phtml:87 application/forms/Geom.php:39
#: application/forms/User.php:44
msgid "terms of use"
msgstr "利用条件"
msgstr "やり直しはできません。本当にこのルートを削除しますか?"
#: application/controllers/ListController.php:33
-#: application/controllers/IdxController.php:121
+#: application/controllers/IdxController.php:157
msgid "server could not be reached"
msgstr "サーバに届かなかったようです"
#: application/controllers/ListController.php:34
-#: application/controllers/IdxController.php:118
+#: application/controllers/IdxController.php:154
msgid ""
"server did not understood request. That's probably caused by a bug in SYJ"
msgstr "サーバはリクエストを理解できませんでした。おそらくSYJのバグでしょう"
#: application/controllers/ListController.php:35
-#: application/controllers/IdxController.php:119
+#: application/controllers/IdxController.php:155
msgid "route not referenced on the server. It has probably been deleted."
msgstr "ルートはサーバ上で参照できませんでした。おそらく削除されています。"
#: application/controllers/ListController.php:36
-#: application/controllers/IdxController.php:122
+#: application/controllers/IdxController.php:158
msgid "there was a server error"
msgstr "サーバのエラーがありました"
#: application/controllers/ListController.php:37
-#: application/controllers/IdxController.php:123
+#: application/controllers/IdxController.php:159
msgid "there was an unknown error"
msgstr "不明なエラーがありました"
msgstr "間違ったパスワード"
#: application/controllers/AccountController.php:43
-#: application/controllers/IdxController.php:132
+#: application/controllers/IdxController.php:168
msgid "an user is already registered with this email"
msgstr "このメールアドレスのユーザが既に登録されています"
#: application/controllers/AccountController.php:71
-#: application/controllers/IdxController.php:128
+#: application/controllers/IdxController.php:164
#: application/forms/Account.php:40
msgid "Password do not match"
msgstr "パスワードが一致しません"
msgstr "変更していません"
#: application/controllers/IdxController.php:26
-#: application/controllers/IdxController.php:78
+#: application/controllers/IdxController.php:73
#, php-format
msgid "route by <strong>%s</strong>"
msgstr "<strong>%s</strong>のルート"
-#: application/controllers/IdxController.php:48
+#: application/controllers/IdxController.php:45
msgid "route has been deleted"
msgstr "ルートは削除されました"
-#: application/controllers/IdxController.php:51
+#: application/controllers/IdxController.php:48
msgid "route does not exist"
msgstr "ルートはありません"
-#: application/controllers/IdxController.php:81
+#: application/controllers/IdxController.php:76
+#: application/controllers/IdxController.php:109
#, fuzzy
msgid "website to share routes"
msgstr "ルート開始"
-#: application/controllers/IdxController.php:111
-#: application/controllers/IdxController.php:137
+#: application/controllers/IdxController.php:118
+#, php-format
+msgid "File too large. File size must not exceed %s"
+msgstr ""
+
+#: application/controllers/IdxController.php:120
+#, fuzzy
+msgid "Invalid file"
+msgstr "不正なメールアドレス"
+
+#: application/controllers/IdxController.php:147
+#: application/controllers/IdxController.php:173
msgid "Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
msgstr "Map by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
-#: application/controllers/IdxController.php:117
+#: application/controllers/IdxController.php:153
msgid "save took place successfully"
msgstr "保存されました"
-#: application/controllers/IdxController.php:120
+#: application/controllers/IdxController.php:156
msgid ""
"similar path seems to already exist. Please do not create two exactly "
"identical paths"
msgstr "類似のパスが既に存在します。全く同じパスをふたつ作成しないでください"
-#: application/controllers/IdxController.php:125
+#: application/controllers/IdxController.php:161
msgid "Login correct"
msgstr "正常ログイン"
-#: application/controllers/IdxController.php:126
+#: application/controllers/IdxController.php:162
msgid "Wrong login/password"
msgstr "誤ったログイン/パスワード"
-#: application/controllers/IdxController.php:127
+#: application/controllers/IdxController.php:163
msgid "you must enter a password"
msgstr "パスワードを入力してください"
-#: application/controllers/IdxController.php:129
+#: application/controllers/IdxController.php:165
msgid "You must accept terms of use"
msgstr "利用条件を承諾してください"
-#: application/controllers/IdxController.php:130
+#: application/controllers/IdxController.php:166
msgid "you must enter an email"
msgstr "メールアドレスを入力してください"
-#: application/controllers/IdxController.php:131
+#: application/controllers/IdxController.php:167
msgid "invalid email"
msgstr "不正なメールアドレス"
-#: application/controllers/IdxController.php:133
+#: application/controllers/IdxController.php:169
msgid "Account created"
msgstr "アカウントを作成しました"
-#: application/controllers/IdxController.php:135
+#: application/controllers/IdxController.php:171
msgid "Now, you can retry to save"
msgstr "今は、保存をやり直すことができます"
-#: application/controllers/IdxController.php:136
+#: application/controllers/IdxController.php:172
msgid "route by"
msgstr "ルート作成者"
-#: application/controllers/IdxController.php:138
+#: application/controllers/IdxController.php:174
msgid "checking availibilty"
msgstr "利用可能かチェック中"
-#: application/controllers/IdxController.php:139
+#: application/controllers/IdxController.php:175
msgid "available pseudo"
msgstr "利用出来るID"
-#: application/controllers/IdxController.php:140
+#: application/controllers/IdxController.php:176
msgid "unavailable pseudo"
msgstr "利用できないID"
-#: application/controllers/IdxController.php:142
+#: application/controllers/IdxController.php:178
msgid "create"
msgstr "作成"
-#: application/controllers/IdxController.php:144
+#: application/controllers/IdxController.php:180
msgid "You have an unsaved route"
msgstr "保存されていないルートがあります"
-#: application/controllers/IdxController.php:146
+#: application/controllers/IdxController.php:182
msgid "no result"
msgstr "結果がありません"
-#: application/controllers/IdxController.php:147
+#: application/controllers/IdxController.php:183
msgid "could not analyze file content"
msgstr "ファイル内容を分析できませんでした"
msgid "password"
msgstr "パスワード"
-#: application/forms/Login.php:23
+#: application/forms/Login.php:20
msgid "I forgot my password"
msgstr "パスワードを忘れた"
msgid "Send a message"
msgstr "メッセージを送信"
-#: application/forms/Geom.php:18
+#: application/forms/Geom.php:17
+msgid "choose route from a file"
+msgstr ""
+
+#: application/forms/Geom.php:28
msgid "optional title for this journey"
msgstr "この旅の任意の見出し"
-#: application/forms/Geom.php:27 application/forms/User.php:46
+#: application/forms/Geom.php:41 application/forms/User.php:46
#, php-format
msgid "I've read and accepted %s"
msgstr "私は %s を読んで承諾しました"
-#: application/forms/Geom.php:36
+#: application/forms/Geom.php:50
#: application/forms/Pending/ValidateCreation.php:17
msgid "save"
msgstr "保存"
} else {
$href = $page->getHRef();
if ($redirect) {
- $currentUri = $this->view->url();
+ $currentUri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
+ if (($pos = strpos($currentUri, '?')) !== false) {
+ $currentUri = substr($currentUri, 0, $pos);
+ }
$href = $this->view->addParamToUrl($href, 'redirect', $currentUri, true);
}
$link = $this->view->anchor($href, $text, array('class' => 'footer-anchor'));
</noscript>
<div id="map"></div>
+<div id="map-overlay"></div>
-<div id="message" class="message info">
-<?php if (!$this->path and !$this->loggedUser) {?>
-<?php echo $this->translate('Welcome on Syj.')?>
-<br>
-<?php echo $this->translate('To create a journey, just press <strong>"start a route"</strong> button, then click on the map to add points to your route. You can zoom and move the map with the controls in the top left corner')?>
-<br>
-<?php echo $this->translate('When you have finished a path, press "create", button.')?>
-<?php }?>
+<?php
+$message = "";
+$msgclass = "info";
+if ($this->errorMsg) {
+ $message .= $this->errorMsg;
+ $msgclass = "error";
+} else if (!$this->path and !$this->loggedUser) {
+ $message .= $this->translate('Welcome on Syj.');
+ $message .= "<br>";
+ $message .= $this->translate('To create a journey, just press <strong>"start a route"</strong> button, then click on the map to add points to your route. You can zoom and move the map with the controls in the top left corner');
+ $message .= "<br>";
+ $message .= $this->translate('When you have finished a path, press "create", button.');
+}
+?>
+
+<div id="message" class="message <?php echo $msgclass?>">
+ <?php echo $message ?>
</div>
-Subproject commit 4ca90e650fc302a04e4f4d2459dbef5a650033e1
+Subproject commit e36e873f93eed1db2c5905e6aed46719b9bcd304
/*
* map rules
*/
-#map {
+#map, #map-overlay {
position: absolute;
top: 0; left: 0; right: 0;
bottom: 2em;
*width: 100%;
*height: 100%;
}
+#map-overlay {
+ background-color: gray;
+ opacity: 0.2;
+ filter:alpha(opacity=0.2);
+}
.olControlAttribution {
bottom: 0.5em;
this.enableSubmit();
$("geom_title").disabled = false;
$("geom_title").activate();
- $("geomform").removeClassName("disabled");
+ $$("#geom_accept_container, #geom_title_container").invoke('removeClassName', "disabled");
this.status = "enabled";
return this;
},
this.disableSubmit();
$("geom_title").blur();
$("geom_title").disabled = true;
- $("geomform").addClassName("disabled");
+ $$("#geom_accept_container, #geom_title_container").invoke('addClassName', "disabled");
this.status = "disabled";
return this;
},
this.initMaPos(gInitialPos);
}
+ $("map-overlay").hide();
+ $("geom_upload").observe('change', function() {
+ $("map-overlay").show();
+ SyjSaveUI.enable();
+ this.editControl.deactivate();
+ }.bind(this));
+
document.observe('simplebox:shown', this.observer.bindAsEventListener(this));
SYJPathLength.update();
-
- if (window.FileList && window.FileReader) {
- $("map").observe("dragenter", function(evt) { evt.stop();});
- $("map").observe("dragover", function(evt) { evt.stop();});
- $("map").observe("drop", function(evt) {
- evt.stop();
- if (this.mode !== "view" || this.viewLayer.features.length) {
- return;
- }
- if (!evt.dataTransfer.files.length) {
- return;
- }
- var file = evt.dataTransfer.files[0];
- var reader = new FileReader();
- var readerror = function() {
- this.messenger.setMessage(SyjStrings.dragFileError, "warn");
- }.bind(this);
- reader.onload = function(evt) {
- if (evt.error) {
- readerror();
- return;
- }
-
- var results = null;
- var content = evt.target.result;
-
- var engine, i;
- var formats = ['KML', 'GPX'];
-
- for (i = 0; i < formats.length; i++) {
- engine = new OpenLayers.Format[formats[i]]({ internalProjection: Mercator, externalProjection: WGS84 });
- try {
- results = engine.read(content);
- } catch(e) {
- }
- if (results || results.length) {
- continue;
- }
- }
- if (!results || !results.length) {
- readerror();
- return;
- }
-
-
- var vector = results[0];
- if (vector.geometry.CLASS_NAME !== "OpenLayers.Geometry.LineString") {
- readerror();
- return;
- }
- this.viewLayer.addFeatures([vector]);
- this.map.zoomToExtent(this.viewLayer.getDataExtent());
-
- if ($("edit-btn")) {
- $("edit-btn").click();
- } else if ($("create-btn")) {
- $("create-btn").click();
- }
-
- if (this.editControl.handler.realPoints.length < 2) {
- SyjSaveUI.disable();
- } else {
- SyjSaveUI.enable();
- }
-
-
- if (vector.data && vector.data.name) {
- $("geom_title").value = vector.data.name;
- }
- }.bind(this);
- reader.readAsText(file);
- }.bind(this));
- }
},
initMaPos: function (aPos) {
this.viewMode();
- $("geom_data").value = this.wkt.write(new OpenLayers.Feature.Vector(line));
+ if (line.components.length) {
+ $("geom_data").value = this.wkt.write(new OpenLayers.Feature.Vector(line));
+ } else {
+ $("geom_data").value = "";
+ }
+
if (this.mode === "edit" && typeof gLoggedInfo.pathid !== "undefined") {
$("geomform").setAttribute("action", "path/" + gLoggedInfo.pathid.toString() + '/update');
} else {
callbacks: {
modify: function(f, line) {
SYJPathLength.update();
- if (!SYJView.unsavedRoute) {
- SYJView.unsavedRoute = {};
+
+ var npoints = this.handler.realPoints.length;
+ if (npoints === 0) {
+ $("geom_upload_container").show();
+ SYJView.unsavedRoute = null;
+ } else {
+ if (!SYJView.unsavedRoute) {
+ SYJView.unsavedRoute = {};
+ }
}
- if (this.handler.realPoints.length < 2) {
+
+ if (npoints < 2) {
SyjSaveUI.disable();
} else {
SyjSaveUI.enable();
}
+ },
+ create: function(f, line) {
+ $("geom_upload_container").hide();
}
},
// wrapper around Form.request that sets up the submit listener, stops the
// submit event, calls presubmit function, calls Form.request and calls a
-// postsubmit function
+// postsubmit function. If form has some visible and activated file inputs,
+// execute presubmit, but do not send the file with ajax.
Element.addMethods('form', {
ajaxize : function(form, options) {
var reqoptions;
options = Object.clone(options || {});
$(form).observe('submit', function(evt) {
- evt.stop(); // cancel form submission
reqoptions = Object.clone(options);
delete(reqoptions.presubmit);
if (Object.isFunction(options.presubmit)) {
if (options.presubmit(this) === false) {
+ evt.stop(); // cancel form submission
return;
}
}
+ // get list of input file not disabled, and not hidden
+ if (this.getInputs('file').find(function(elt) {
+ if (elt.disabled) {
+ return false;
+ }
+ while (elt && $(elt).identify() !== this.identify()) {
+ if (!elt.visible()) {
+ return false;
+ }
+ elt = elt.parentNode;
+ }
+ return true;
+ }.bind(this))) {
+ // form has some file inputs. Do not manage on our own.
+ return;
+ }
+
+ evt.stop(); // cancel form submission
+
var params = reqoptions.parameters, action = this.readAttribute('action') || '';
if (action.blank()) {
-Subproject commit 0d60e74985d83f97299179bdbe61e1dbf7b81971
+Subproject commit 46b219eaa9f256817614f6277009c65edb2c6b82