From: Stéphane Jacob Date: Tue, 17 May 2011 19:56:42 +0000 (+0200) Subject: Map is back (but empty for now). X-Git-Tag: xorg/1.1.2~62^2~16 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=45dcbe4d0b623e195055d82543e3815d8b5419a4;p=platal.git Map is back (but empty for now). Signed-off-by: Stéphane Jacob --- diff --git a/classes/xnet.php b/classes/xnet.php index 8df2ae3..6dc2e23 100644 --- a/classes/xnet.php +++ b/classes/xnet.php @@ -24,7 +24,7 @@ class Xnet extends Platal public function __construct() { parent::__construct('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', - 'payment', 'bandeau', 'xnetnl'); + 'payment', 'bandeau', 'xnetnl', 'geoloc'); } public function hook_map($name) diff --git a/classes/xorg.php b/classes/xorg.php index 3930d7e..ec7aee9 100644 --- a/classes/xorg.php +++ b/classes/xorg.php @@ -28,7 +28,7 @@ class Xorg extends Platal 'profile', 'register', 'search', 'stats', 'admin', 'newsletter', 'axletter', 'epletter', 'bandeau', 'survey', 'fusionax', 'gadgets', 'googleapps', 'poison', - 'openid', 'reminder', 'api', 'urlshortener', 'deltaten'); + 'openid', 'reminder', 'api', 'urlshortener', 'deltaten', 'geoloc'); } public function find_hook() diff --git a/htdocs/javascript/maps.js b/htdocs/javascript/maps.js new file mode 100644 index 0000000..96cf94e --- /dev/null +++ b/htdocs/javascript/maps.js @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 2003-2011 Polytechnique.org * + * http://opensource.polytechnique.org/ * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + ***************************************************************************/ + +// http://code.google.com/apis/maps/documentation/javascript/ + +function map_initialize(latitude, longitude) +{ + var latlng = new google.maps.LatLng(latitude, longitude); + var myOptions = { + zoom: 1, + center: latlng, + mapTypeId: google.maps.MapTypeId.ROADMAP + }; + var map = new google.maps.Map($('#map_canvas').get(0), myOptions); +} + +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: diff --git a/modules/geoloc.php b/modules/geoloc.php new file mode 100644 index 0000000..b8b452d --- /dev/null +++ b/modules/geoloc.php @@ -0,0 +1,44 @@ + $this->make_hook('map', AUTH_COOKIE), + ); + } + + function handler_map($page) + { + $page->changeTpl('geoloc/index.tpl'); + $page->addJsLink('https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false', false); + $page->addJsLink('maps.js'); + $page->assign('pl_extra_header', ''); + + $page->assign('latitude', 0); + $page->assign('longitude', 0); + } +} + +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +?> diff --git a/templates/geoloc/index.tpl b/templates/geoloc/index.tpl new file mode 100644 index 0000000..a71228a --- /dev/null +++ b/templates/geoloc/index.tpl @@ -0,0 +1,29 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2011 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + +
+ + + +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/skin/common.menu.tpl b/templates/skin/common.menu.tpl index ebc782b..605526e 100644 --- a/templates/skin/common.menu.tpl +++ b/templates/skin/common.menu.tpl @@ -79,6 +79,9 @@ +{if hasPerm('directory_private,edit_directory')} + +{/if} {if hasPerm('directory_private')} {/if}