public function __construct()
{
parent::__construct('xnet', 'xnetgrp', 'xnetlists', 'xnetevents',
- 'payment', 'bandeau', 'xnetnl');
+ 'payment', 'bandeau', 'xnetnl', 'geoloc');
}
public function hook_map($name)
'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()
--- /dev/null
+/***************************************************************************
+ * 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:
--- /dev/null
+<?php
+/***************************************************************************
+ * 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 *
+ ***************************************************************************/
+
+class GeolocModule extends PLModule
+{
+ function handlers()
+ {
+ return array(
+ 'map' => $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', '<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />');
+
+ $page->assign('latitude', 0);
+ $page->assign('longitude', 0);
+ }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
--- /dev/null
+{**************************************************************************}
+{* *}
+{* 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 *}
+{* *}
+{**************************************************************************}
+
+<div id="map_canvas" style="width: 100%; height: 600px"></div>
+
+<script type="text/javascript">
+ map_initialize("{$latitude}", "{$longitude}");
+</script>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
<div class="menu_title">Communauté X</div>
<div class="menu_item"><a href="search">Annuaire</a></div>
+{if hasPerm('directory_private,edit_directory')}
+<div class="menu_item"><a href="map">Planisphère</a></div>
+{/if}
{if hasPerm('directory_private')}
<div class="menu_item"><a href="jobs">Emploi & Carrières</a></div>
{/if}