Objet : devel-adl
Archives de la liste
- From: thomas AT lolut.utbm.info
- To: devel AT agendadulibre.org
- Subject: [Devel] r112 - trunk
- Date: Tue, 1 Nov 2005 19:46:50 +0100 (CET)
- List-archive: <http://lolut.utbm.info/pipermail/devel>
- List-id: Developpement de l'Agenda du Libre <devel.agendadulibre.org>
Author: thomas
Date: 2005-11-01 19:46:48 +0100 (Tue, 01 Nov 2005)
New Revision: 112
Added:
trunk/adl-regions.png
trunk/adl.js
trunk/map.php
Modified:
trunk/calendar.css
trunk/funcs.inc.php
Log:
This commit adds http://www.agendadulibre.org/map.php, which contains
a clickable map of french regions.
- adl-regions.png: Map of french regions.
- calendar.css: Add CSS attributes for the clickable map.
- map.php: The region map page.
- adl.js: Some JavaScript code for the region map page.
- funcs.inc.php: Add a new parameter "jsonload" to the put_header()
function.
Added: trunk/adl-regions.png
===================================================================
(Binary files differ)
Property changes on: trunk/adl-regions.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/adl.js
===================================================================
--- trunk/adl.js 2005-10-15 15:12:31 UTC (rev 111)
+++ trunk/adl.js 2005-11-01 18:46:48 UTC (rev 112)
@@ -0,0 +1,32 @@
+/* Copyright 2005
+ * - M�lanie Bats <melanie POINT bats CHEZ utbm POINT fr>
+ * - Thomas Petazzoni <thomas POINT petazzoni CHEZ enix 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
+ * 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.
+ */
+
+function toggleRegionBoxes (region)
+{
+ for (i = 0; i <= 22; i++) {
+ var regionStr = "region-" + i;
+ if (i == region) {
+ document.getElementById(regionStr).style.visibility = 'visible';
+ }
+ else {
+ document.getElementById(regionStr).style.visibility = 'hidden';
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/calendar.css
===================================================================
--- trunk/calendar.css 2005-10-15 15:12:31 UTC (rev 111)
+++ trunk/calendar.css 2005-11-01 18:46:48 UTC (rev 112)
@@ -181,3 +181,52 @@
color: red;
text-decoration: bold;
}
+
+/*
+ * Region map
+ */
+
+#region-map
+{
+ text-align: center;
+ border: 0;
+/*
+ * Alternative solution
+ * margin-left: 8em;
+ */
+}
+
+dl.region-map-event
+{
+ border: 1px #364970 solid;
+ background: #dfedff;
+/* position: absolute; */
+ position: fixed;
+ text-align: left;
+ padding: 3px;
+ width: 15em;
+ z-index: 2;
+ margin: 0.5em 0 0 0;
+ overflow: hidden;
+ list-style: none;
+ visibility: hidden;
+}
+
+dl.region-map-event dt
+{
+ font-size: 13px;
+ border: none;
+ padding: 0;
+ margin: 0;
+ margin-bottom: 0.2em;
+}
+
+dl.region-map-event dd
+{
+ border: none;
+ padding: 0;
+ margin: 0;
+ font-weight: normal;
+ margin-bottom: 0.3em;
+ font-size: 12px;
+}
\ No newline at end of file
Modified: trunk/funcs.inc.php
===================================================================
--- trunk/funcs.inc.php 2005-10-15 15:12:31 UTC (rev 111)
+++ trunk/funcs.inc.php 2005-11-01 18:46:48 UTC (rev 112)
@@ -45,7 +45,7 @@
echo "<link rel=\"alternate\" href=\"" . $href . "\" title=\"" . $title .
"\" type=\"application/rss+xml\">";
}
-function put_header ($title)
+function put_header ($title, $jsonload="")
{
calendar_setlocale();
@@ -70,6 +70,7 @@
<title><?php echo $title;?></title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"/>
<link rel="stylesheet" type="text/css" href="calendar.css" />
+ <script type="text/javascript" src="./adl.js"></script>
<?php
rss_feed_header ("rss.php?region=all", "Agenda du Libre, toutes les
r�gions");
@@ -82,7 +83,7 @@
</head>
-<body>
+<body <?php echo ($jsonload ? "onload=\"" . $jsonload . "\"" : ""); ?> >
<div class="main">
<div id="important">
<p>Pour rester inform� des �v�nements de l'agenda, utilisez les <a
href="rsslist.php">flux RSS</a> ou les <a
href="icallist.php">calendriers</a> !</p>
Added: trunk/map.php
===================================================================
--- trunk/map.php 2005-10-15 15:12:31 UTC (rev 111)
+++ trunk/map.php 2005-11-01 18:46:48 UTC (rev 112)
@@ -0,0 +1,122 @@
+<?php
+
+/* Copyright 2004
+ * - M�lanie Bats <melanie POINT bats CHEZ utbm POINT fr>
+ * - Thomas Petazzoni <thomas POINT petazzoni CHEZ enix 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
+ * 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.
+ */
+
+include("bd.inc.php");
+include("bd-private.inc.php");
+include("funcs.inc.php");
+
+function generate_event_description ($db)
+{
+ $start = mktime();
+ $end = mktime() + (30 * 24 * 60 * 60);
+
+ echo "<dl class=\"region-map-event\" id=\"region-0\">\n";
+ echo " <dt><b>Carte des r�gions</b></dt>\n";
+ echo " <dd>Cliquez sur une r�gion pour voir les �v�nements !</dd>\n";
+ echo "</dl>\n";
+
+ $regions = $db->query ("select * from regions");
+ if ($regions == FALSE)
+ return FALSE;
+
+ while ($region = mysql_fetch_object ($regions))
+ {
+ echo "<dl class=\"region-map-event\" id=\"region-" . $region->id .
"\">";
+
+ echo "<dt>";
+
+ echo "<b>" . $region->name . "</b><br/>";
+
+ echo "<a href=\"" . calendar_absolute_url ("rss.php?region=" .
$region->id) . "\"><i>rss</i></a> - \n";
+ echo "<a href=\"" . calendar_absolute_url ("ical.php?region=" .
$region->id) . "\"><i>ical</i></a>\n";
+
+ echo "</dt>\n";
+
+ echo " <dd>\n <ul>\n";
+
+ $events = $db->query ("select * from events where " .
+ "(start_time <= '" . date_timestamp2mysql($end)
. "') AND " .
+ "(end_time >= '" . date_timestamp2mysql($start)
. "') AND " .
+ "((region=" . $region->id . ")) AND (moderated=1)
order by start_time");
+
+ while ($event = mysql_fetch_object ($events))
+ {
+ echo "<li><i>" . strftime ("%A %d %B", date_mysql2timestamp
($event->start_time)) . "</i> <a href=\"" .
calendar_absolute_url("showevent.php?id=" . $event->id) . "\">" .
$event->title . "</a> � " . $event->city . "</li>";
+ }
+
+ echo " </ul>\n";
+
+
+ echo "</dd>\n</dl>\n";
+ }
+}
+
+$db = new db();
+
+calendar_setlocale();
+
+put_header("Agenda du Libre - Carte", "toggleRegionBoxes(0);");
+
+echo "<h2>Carte des r�gions</h2>\n";
+
+generate_event_description ($db);
+
+?>
+
+<p id="region-map">
+ <img id="region-map" src="adl-regions.png" width="519" height="516"
usemap="map" />
+ <map name="map">
+ <area shape="poly"
+
coords="86,202,90,202,94,199,99,197,99,191,106,191,119,188,125,183,135,186,141,177,144,170,141,158,145,151,143,144,136,144,132,146,126,143,124,136,117,136,114,131,106,133,100,136,96,132,81,140,68,119,50,120,46,127,38,125,36,129,32,123,23,127,16,125,4,128,1,142,14,143,13,147,4,146,7,152,14,151,18,160,1,161,15,175,27,173,35,179,47,182,59,194,75,193,69,197,88,202"
+ alt="Bretagne" onclick="toggleRegionBoxes(6);" />
+ <area shape="poly"
+
coords="145,145,145,155,142,160,144,172,135,186,124,182,114,190,99,191,95,201,83,209,88,215,97,211,111,216,97,215,94,221,102,228,96,240,106,254,105,259,120,271,134,275,138,271,154,273,157,270,154,265,156,259,153,251,153,245,147,235,156,235,163,229,176,230,184,226,192,199,194,203,202,198,213,186,217,183,214,176,219,169,201,159,198,148,182,155,177,142,172,148,167,146,158,150,145,145"
+ alt="Pays de la Loire"
onclick="javascript:toggleRegionBoxes(18);" />
+ <area shape="poly"
+
coords="115,72,118,79,117,91,126,103,126,131,131,136,126,137,127,144,131,146,140,143,157,150,167,147,173,148,175,142,180,147,184,153,186,155,191,150,197,149,200,152,200,160,206,162,214,165,216,165,222,150,218,137,209,125,202,126,204,106,198,93,175,101,154,94,144,95,138,84,141,78,140,75,128,77,123,76"
+ alt="Basse Normandie" onclick="toggleRegionBoxes(4);" />
+<area shape="poly"
coords="241,59,228,66,203,73,194,78,191,89,197,91,202,92,199,100,203,125,210,127,218,139,226,132,237,134,244,126,244,116,249,115,252,107,254,94,252,78,255,67,240,59"
alt="Haute Normandie" onclick="toggleRegionBoxes(11);" />
+<area shape="poly"
coords="247,49,242,57,253,68,256,77,253,82,255,91,254,99,255,105,252,108,259,111,269,107,269,111,277,110,285,116,294,114,297,112,319,130,328,122,323,118,324,112,329,112,329,109,326,106,326,102,341,98,339,83,347,79,346,65,331,59,322,60,313,62,301,59,292,58,291,54,282,56,282,48,272,51,268,50,262,43,250,41,248,45,252,51,249,50,247,49"
alt="Picardie" onclick="toggleRegionBoxes(19);" />
+<area shape="poly"
coords="250,41,250,6,253,8,280,0,285,1,287,6,288,14,296,21,304,17,311,17,313,32,325,35,328,45,344,43,345,53,347,58,347,63,345,64,329,60,308,63,291,57,280,53,283,50,273,49,266,48,260,41,250,40,251,40,251,39"
alt="Nord Pas de Calais" onclick="toggleRegionBoxes(17);" />
+<area shape="poly"
coords="348,66,348,79,340,85,341,97,326,103,327,109,330,108,329,113,325,113,323,118,326,122,320,130,317,135,322,146,318,150,317,155,320,161,326,170,333,170,335,178,342,183,348,180,353,183,359,181,364,176,374,180,373,184,379,187,377,196,391,201,392,203,395,200,397,197,407,196,407,190,413,183,406,175,406,164,394,156,393,149,378,143,377,135,373,130,376,124,379,120,375,116,376,106,381,99,380,88,391,88,390,82,372,71,370,64,372,56,366,56,367,62,360,66,348,66"
alt="Champagne Ardenne" onclick="toggleRegionBoxes(8);" />
+<area shape="poly"
coords="251,109,248,116,243,117,244,124,248,131,249,144,255,149,259,155,262,162,270,160,272,163,280,163,282,168,282,175,290,172,300,170,302,161,307,158,316,156,317,149,322,145,318,136,317,134,320,130,314,127,308,120,301,116,295,112,293,117,283,114,277,109,268,109,262,111,253,109,252,108"
alt="Ile de France" onclick="toggleRegionBoxes(12);" />
+<area shape="poly"
coords="392,86,389,89,381,88,378,91,381,102,377,107,375,114,378,121,378,125,375,128,377,137,379,143,395,152,397,160,406,164,406,172,405,174,414,183,421,176,427,181,435,181,439,182,448,183,453,185,455,172,459,163,461,158,458,154,460,150,458,145,463,144,467,139,465,133,467,128,457,126,452,124,455,119,458,112,465,119,476,121,479,115,477,109,470,107,465,111,457,109,452,106,447,108,446,110,431,90,423,89,418,94,412,94,410,89,399,88,398,92,393,86,392,86"
alt="Lorraine" onclick="toggleRegionBoxes(15);" />
+<area shape="poly"
coords="501,118,490,136,485,154,480,167,480,178,479,194,480,203,476,208,467,208,461,201,459,194,454,188,454,179,463,158,460,152,462,150,461,145,468,141,464,134,467,129,462,126,460,127,452,123,459,115,467,122,476,123,481,113,502,116"
alt="Alsace" onclick="toggleRegionBoxes(1);" />
+<area shape="poly"
coords="424,269,424,264,438,249,439,238,462,217,456,213,455,207,462,203,462,199,458,199,458,192,452,190,453,186,443,182,437,183,428,181,423,177,415,183,410,187,408,189,405,197,399,198,395,200,399,204,397,208,396,208,400,218,398,229,394,237,390,240,395,242,398,245,394,248,397,253,399,261,394,265,397,267,395,273,402,279,407,276,413,280,420,275,423,268"
alt="Franche Comt�" onclick="toggleRegionBoxes(10);" />
+<area shape="poly"
coords="305,158,301,165,301,171,303,175,307,181,303,186,298,194,294,196,298,203,296,207,299,213,297,218,300,223,301,251,307,257,317,257,324,256,328,255,329,265,334,265,342,272,344,276,339,277,336,280,339,285,354,285,358,277,363,281,369,280,371,284,374,283,378,264,382,267,388,265,394,269,397,268,396,261,397,253,394,248,397,244,395,241,392,241,391,237,397,234,399,224,399,216,395,208,398,204,398,201,393,203,388,202,387,198,376,194,380,186,373,184,371,178,363,176,361,179,352,180,345,181,341,183,335,183,330,169,326,171,325,162,317,156,303,158,305,159"
alt="Bourgnogne" onclick="toggleRegionBoxes(5);" />
+<area shape="poly"
coords="336,280,331,284,332,293,335,295,330,298,328,301,332,304,329,308,337,323,342,326,338,331,339,334,347,336,355,331,357,338,362,342,359,346,356,344,357,350,352,355,348,362,342,361,335,369,338,376,343,387,346,394,352,397,358,392,360,396,365,393,368,396,372,394,379,397,382,397,381,394,379,391,381,387,385,388,387,391,385,395,389,396,391,394,392,399,402,401,405,404,411,400,412,394,400,390,400,381,411,384,409,379,408,376,415,374,419,369,431,360,437,361,440,357,434,351,431,349,435,346,442,348,462,341,468,336,470,327,463,321,462,313,454,307,464,297,454,282,456,275,451,271,431,274,434,280,431,286,421,287,420,283,428,277,427,271,420,272,419,279,413,279,408,275,404,279,388,265,379,266,372,284,368,279,357,277,356,285,336,287,336,279"
alt="Rhone Alpes" onclick="toggleRegionBoxes(22);" />
+<area shape="poly"
coords="301,251,295,255,286,255,286,264,276,267,271,271,277,278,285,285,285,295,284,301,276,308,282,317,279,334,274,333,270,345,263,355,265,364,267,372,278,371,286,358,295,362,302,373,303,375,318,359,325,369,335,370,347,357,355,353,357,342,353,332,339,337,336,328,341,325,326,308,332,281,341,274,330,265,326,255,321,260,306,258,302,251"
alt="Auvergne" onclick="toggleRegionBoxes(3);" />
+<area shape="poly"
coords="230,271,215,278,211,284,213,290,217,297,212,297,211,304,206,308,203,313,211,312,211,319,219,317,228,328,233,327,231,332,229,334,230,339,227,341,231,344,235,346,236,353,243,352,249,357,264,356,266,350,269,339,273,336,273,330,280,333,280,312,279,306,275,307,285,296,283,290,282,279,271,274,272,268,259,270,255,266,251,272,244,269,238,272,228,271,229,271"
alt="Limousin" onclick="toggleRegionBoxes(14);" />
+<area shape="poly"
coords="244,125,249,128,249,143,253,149,257,156,262,163,275,162,282,165,279,172,303,170,305,179,301,185,300,191,294,194,295,220,300,222,302,250,295,254,285,254,284,262,269,271,256,270,254,268,231,272,219,259,207,235,194,240,185,225,192,199,196,202,217,184,216,173,219,169,214,166,222,152,219,139,227,132,238,134,244,124,244,125"
alt="Centre" onclick="toggleRegionBoxes(7);" />
+<area shape="poly"
coords="148,235,154,245,153,251,156,259,154,266,157,272,153,274,140,270,132,275,131,282,136,288,135,297,128,302,128,309,143,319,148,332,154,329,160,335,161,341,176,344,177,339,187,335,190,325,197,319,207,308,212,301,209,295,217,295,212,290,212,279,228,273,221,262,217,258,207,235,203,240,193,238,190,230,186,228,176,229,160,230,155,235,147,235"
alt="Poitou Charentes" onclick="toggleRegionBoxes(20);" />
+<area shape="poly"
coords="131,318,124,365,130,363,133,369,125,371,111,432,97,443,99,446,112,448,113,454,109,459,110,463,120,456,119,464,142,471,145,476,156,475,158,471,173,447,167,433,162,433,160,428,165,423,165,412,174,410,176,414,182,408,198,407,203,408,213,396,210,389,219,388,216,380,237,356,234,346,228,342,230,336,228,333,230,329,219,318,210,319,206,312,202,313,197,322,190,327,188,335,181,341,179,339,176,342,177,345,162,344,159,340,160,336,154,331,149,333,155,353,150,352,144,330,131,318"
alt="Aquitaine" onclick="toggleRegionBoxes(2);" />
+<area shape="poly"
coords="236,354,237,359,217,379,217,380,220,389,212,389,215,395,210,402,207,406,201,411,197,409,186,412,178,411,180,415,171,414,169,412,164,414,167,425,160,428,162,432,172,435,174,443,170,456,159,470,160,477,168,486,177,485,184,486,192,483,197,486,203,479,219,482,221,487,229,488,231,492,245,494,248,495,260,490,258,486,251,483,254,477,255,470,257,468,252,463,246,460,245,451,252,444,257,446,265,447,270,444,275,445,284,445,283,432,291,433,297,430,303,428,301,423,310,423,313,418,318,415,313,410,315,403,305,399,302,378,294,363,286,359,279,374,273,373,266,375,264,373,266,365,262,358,252,358,245,356,242,351,235,352"
alt="Midi-Pyr�n�es" onclick="toggleRegionBoxes(16);" />
+<area shape="poly"
coords="305,500,300,494,308,457,319,455,339,440,349,439,352,444,361,436,360,430,369,428,371,418,375,413,373,407,370,394,365,392,363,395,355,392,353,396,345,394,343,386,340,383,335,370,322,370,318,361,301,379,306,398,310,401,317,403,311,409,319,413,292,435,283,434,285,447,269,444,267,448,252,446,244,454,247,460,254,463,259,469,256,474,252,481,253,486,264,483,262,489,248,495,246,501,260,510,270,503,279,510,291,504,304,500,304,499,303,500,302,500"
alt="Languedoc Rousillon" onclick="toggleRegionBoxes(13);" />
+<area shape="poly"
coords="370,394,372,407,379,411,367,432,361,432,360,437,351,445,367,445,374,451,382,448,384,439,391,440,393,444,385,451,400,450,401,458,418,462,423,468,432,464,435,468,438,463,457,456,451,451,491,420,489,414,498,400,492,398,487,404,462,390,463,376,471,367,446,345,442,349,438,345,432,348,439,355,439,361,428,361,415,373,408,374,410,382,409,384,403,381,401,390,412,396,410,403,401,403,393,399,389,393,385,397,385,387,379,388,382,398,375,397,373,393,370,394"
alt="Paca" onclick="toggleRegionBoxes(21);" />
+<area shape="poly"
coords="518,447,513,442,515,420,511,419,510,439,504,436,490,443,482,444,481,451,474,456,480,460,477,465,479,471,484,474,479,479,476,483,479,486,486,482,484,488,480,492,483,496,490,498,485,502,489,509,494,509,501,515,508,513,509,504,512,496,512,485,518,474,518,472"
alt="Corse" onclick="toggleRegionBoxes(9);" />
+</map>
+
+ </p>
+
+<?php
+put_footer();
+?>
\ No newline at end of file
- [Devel] r112 - trunk, thomas, 01/11/2005
- Re: [Devel] r112 - trunk, David MENTRE, 01/11/2005
- Re: [Devel] r112 - trunk, Thomas Petazzoni, 01/11/2005
- Re: [Devel] r112 - trunk, David MENTRE, 02/11/2005
- Re: [Devel] r112 - trunk, Thomas Petazzoni, 01/11/2005
- Re: [Devel] r112 - trunk, David MENTRE, 01/11/2005
Archives gérées par MHonArc 2.6.16.