Accéder au contenu.
Menu Sympa

devel - [Devel] r429 - branches/dui

Objet : devel-adl

Archives de la liste

[Devel] r429 - branches/dui


Chronologique Discussions 
  • From: svn AT agendadulibre.org
  • To: devel AT agendadulibre.org
  • Subject: [Devel] r429 - branches/dui
  • Date: Sun, 1 Mar 2009 18:39:37 +0100 (CET)
  • List-archive: <http://agendadulibre.org/pipermail/devel>
  • List-id: Developpement de l'Agenda du Libre <devel.agendadulibre.org>

Author: ldayot
Date: Sun Mar 1 18:39:36 2009
New Revision: 429

Log:
Ajout d'un carte en bas de page des lugs et des evenements.

Modified:
branches/dui/showevent.php
branches/dui/showlug.php

Modified: branches/dui/showevent.php
==============================================================================
--- branches/dui/showevent.php Sun Mar 1 18:38:37 2009 (r428)
+++ branches/dui/showevent.php Sun Mar 1 18:39:36 2009 (r429)
@@ -1,8 +1,9 @@
<?php

-/* Copyright 2004-2007
+/* Copyright 2004-2009
* - Mélanie Bats <melanie POINT bats CHEZ utbm POINT fr>
* - Thomas Petazzoni <thomas POINT petazzoni CHEZ enix POINT org>
+ * - Loic Dayot <ldayot CHEZ ouvaton POINT org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -20,25 +21,92 @@
* 02111-1307, USA.
*/

-include("bd.inc.php");
+include("class.bd.inc.php");
include("funcs.inc.php");
-include("session.inc.php");
+include("class.session.inc.php");

$db = new db();
$session = new session();

-put_header("Informations sur un &eacute;v&egrave;nement");
+include("class.event.inc.php");

$event_id = get_safe_integer('id', 0);
-$event = fetch_event ($db, $event_id);
-
-if (! $event)
+$event = new event($db, $event_id);
+if ($event->error || $event_id==0)
{
- echo "<p class=\"error\">Pas d'&eacute;v&egrave;nement avec cet
identifiant.</p>";
+ put_header("Informations sur un &eacute;v&egrave;nement");
+ error ($event->message);
put_footer();
exit;
}

+// end map
+if ($event->latitude>0)
+ {
+ // start map
+ $jcode = "
+ <script src=\"http://openlayers.org/api/OpenLayers.js\";></script>
+ <script
src=\"http://openstreetmap.org/openlayers/OpenStreetMap.js\";></script>
+ <script type=\"text/javascript\">
+ var lat={$event->latitude}
+ var lon={$event->longitude}
+ var zoom=11
+ var map;
+ function init() {
+ map = new OpenLayers.Map (\"map\", {
+ controls:[
+ new OpenLayers.Control.Navigation(),
+ new OpenLayers.Control.PanZoomBar(),
+ new OpenLayers.Control.Attribution()],
+ maxResolution: 156543.0399,
+ units: 'm',
+ } );
+
+ map.addControl(new OpenLayers.Control.LayerSwitcher());
+
+ layerTilesAtHome = new OpenLayers.Layer.OSM.Mapnik(\"Mapnik\");
+ map.addLayer(layerTilesAtHome);
+
+ var lonLat = new OpenLayers.LonLat(lon, lat).transform(new
OpenLayers.Projection(\"EPSG:4326\"), new
OpenLayers.Projection(\"EPSG:900913\"));
+
+ map.setCenter (lonLat, zoom);
+
+ var newl = new OpenLayers.Layer.GeoRSS('AdL', '" .
calendar_absolute_url("rss.php?map=1&id={$event_id}") . "');
+ map.addLayer(newl);
+
+ }
+
+ </script>\n";
+ put_header("Informations sur un &eacute;v&egrave;nement", $jcode,
"init();");
+ }
+else
+ put_header("Informations sur un &eacute;v&egrave;nement");
+
+echo "<div id=\"lug-list\">";
+
+if (in_array("libre-en-fete-2009", split(" ", $event->tags)))
+ {
+ echo "<hr/>";
+ echo "<h1>Libre en Fête 2009</h1>";
+ echo "<p>";
+ echo "<a href=\"http://www.libre-en-fete.net\";>";
+ echo "<img src=\"http://www.libre-en-fete.net/images/banniere-2.png\";
width=\"100\" style=\"float: right; margin-left: 5px; border: 0;\"/>";
+ echo "</a>";
+ echo "Cet évènement s'inscrit dans le cadre de la sixième édition du <a
href=\"http://www.libre-en-fete.net\";>Libre en Fête</a>.";
+ echo "</p>";
+ }
+if (in_array("fete-de-linternet", split(" ", $event->tags)))
+ {
+ echo "<hr/>";
+ echo "<h1>Fête de l'Internet</h1>";
+ echo "<p>";
+ echo "<a
href=\"http://www.villes-internet.net/UPLOAD/article/pages/2182_article.php\";>";
+ echo "<img
src=\"http://www.villes-internet.net/UPLOAD/image/imgPetite/227_fete_internet.jpg\";
width=\"100\" style=\"float: right; margin-left: 5px; border: 0;\"/>";
+ echo "</a>";
+ echo "Cet évènement s'inscrit dans le cadre de la <a
href=\"http://www.villes-internet.net/UPLOAD/article/pages/2182_article.php\";>Fête
de l'Internet</a>.";
+ echo "</p>";
+ }
+

// Display LUGS

@@ -53,7 +121,7 @@

if ($db->numRows ($lugs) > 0)
{
- echo "<div id=\"lug-list\"><h1>". $adl_lugs_around. "</h1>";
+ echo "<h1>". $adl_lugs_around. "</h1>";
echo " <ul>";
while ($lug = $db->fetchObject ($lugs))
{
@@ -79,45 +147,23 @@
echo " </ul>";
}

-$event->tags = eventTagsList($event->id);
+echo "</div>";

-if (in_array("libre-en-fete-2009", split(" ", $event->tags)))
- {
- echo "<hr/>";
- echo "<h1>Libre en Fête 2009</h1>";
- echo "<p>";
- echo "<a href=\"http://www.libre-en-fete.net\";>";
- echo "<img src=\"lef-2007.png\" width=\"100\" style=\"float: right;
margin-left: 5px; border: 0;\"/>";
- echo "</a>";
- echo "Cet évènement s'inscrit dans le cadre de la sixième édition du <a
href=\"http://www.libre-en-fete.net\";>Libre en Fête</a>.";
- echo "</p>";
- }
-
-if ($db->numRows ($lugs) > 0)
- echo "</div>";

if ($session->exists("agenda_libre_id"))
{ // moderateur
- echo "<h1>Actions</h1>";
- echo "<div id=\"lug-list\"><a href=\"editevent.php?id=" . $event_id .
"\">&Eacute;diter &eacute;v&egrave;nement</a><br/>";
+ echo "<div id=\"lug-list\"><h1>Actions</h1>";
+ echo "<a href=\"editevent.php?id=" . $event_id . "\">&Eacute;diter
&eacute;v&egrave;nement</a><br/>";
echo "<a href=\"cancelevent.php?id=" . $event_id . "\">Annuler
&eacute;v&egrave;nement</a>";
echo "</div>\n";
}

-echo format_event ($db,
- $event->title,
- date_mysql2timestamp($event->start_time),
- date_mysql2timestamp($event->end_time),
- $event->description,
- $event->city,
- $event->region,
- $event->locality,
- $event->url,
- $event->contact,
- $event->submitter,
- eventTagsList($event->id));
+echo $event->formatHTML();

-//echo return_map_event($event);
+// start map
+if ($event->latitude>0)
+ echo "<div style=\"margin: auto; width:500px; height:400px; border: 1px
solid black;\" id=\"map\"></div>\n";
+// end map

put_footer();


Modified: branches/dui/showlug.php
==============================================================================
--- branches/dui/showlug.php Sun Mar 1 18:38:37 2009 (r428)
+++ branches/dui/showlug.php Sun Mar 1 18:39:36 2009 (r429)
@@ -19,9 +19,9 @@
* 02111-1307, USA.
*/

-include("bd.inc.php");
+include("class.bd.inc.php");
include("funcs.inc.php");
-include("session.inc.php");
+include("class.session.inc.php");

calendar_setlocale();

@@ -34,14 +34,20 @@

if (! $lug)
{
+// end map
+if ($lug->latitude>0)
+ put_header($adl_lug_info);
echo "<p class=\"error\">Pas de GUL avec cet identifiant.</p>";
put_footer();
exit;
}


-// start map
-$jcode = "
+// end map
+if ($lug->latitude>0)
+ {
+ // start map
+ $jcode = "
<script src=\"http://openlayers.org/api/OpenLayers.js\";></script>
<script
src=\"http://openstreetmap.org/openlayers/OpenStreetMap.js\";></script>
<script type=\"text/javascript\">
@@ -74,10 +80,6 @@
}

</script>\n";
-
-// end map
-if ($lug->latitude>0)
- {
put_header($adl_lug_info, $jcode, "init();");
}
else




  • [Devel] r429 - branches/dui, svn, 01/03/2009

Archives gérées par MHonArc 2.6.16.

Haut de le page