added dnf and child wps to map; new wp types 'stage' and 'final'

This commit is contained in:
following
2013-03-10 04:54:07 +01:00
parent 37dff3669d
commit 9bb0c30e9d
46 changed files with 336 additions and 60 deletions
+7
View File
@@ -160,3 +160,10 @@ List of third party components:
Path : htdocs/resource2/ocstyle/images/openicons/
URI : http://openiconlibrary.sourceforge.net/
License : Creative Commons BY-SA 3.0
26. 16x16 Icons 'flag-checker' and 'footprints'
Path : htdocs/resource2/ocstyle/images/misc/
htdocs/resource2/ocstyle/images/map/caches2/
URI : http://www.softicons.com/free-icons/toolbar-icons/fugue-16px-additional-icons-2-by-yusuke-kamiyamane
License : Creative Commons BY 3.0
Author : Yusuke Kamiyamane
+30 -10
View File
@@ -205,7 +205,10 @@ INSERT INTO `cache_logtype` (`cache_type_id`, `log_type_id`) VALUES ('10', '3');
SET NAMES 'utf8';
TRUNCATE TABLE `coordinates_type`;
INSERT INTO `coordinates_type` (`id`, `name`, `trans_id`, `image`) VALUES ('1', 'Parking', '1788', 'resource2/ocstyle/images/misc/wp_parking.png');
INSERT INTO `coordinates_type` (`id`, `name`, `trans_id`, `image`) VALUES ('2', 'Reference point', '1789', 'resource2/ocstyle/images/misc/wp_reference.png');
INSERT INTO `coordinates_type` (`id`, `name`, `trans_id`, `image`) VALUES ('2', 'Stage or reference point', '1789', 'resource2/ocstyle/images/misc/wp_reference.png');
INSERT INTO `coordinates_type` (`id`, `name`, `trans_id`, `image`) VALUES ('3', 'Path', '1926', 'resource2/ocstyle/images/misc/wp_path.png');
INSERT INTO `coordinates_type` (`id`, `name`, `trans_id`, `image`) VALUES ('4', 'Final', '1927', 'resource2/ocstyle/images/misc/wp_final.png');
INSERT INTO `coordinates_type` (`id`, `name`, `trans_id`, `image`) VALUES ('5', 'Point of interest', '1570', 'resource2/ocstyle/images/misc/wp_poi.png');
-- Table countries
SET NAMES 'utf8';
@@ -557,6 +560,8 @@ INSERT INTO `helppages` (`ocpage`, `language`, `helppage`) VALUES ('usertops', '
INSERT INTO `helppages` (`ocpage`, `language`, `helppage`) VALUES ('viewcache', 'DE', 'Listing');
INSERT INTO `helppages` (`ocpage`, `language`, `helppage`) VALUES ('viewlogs', 'DE', 'Das Onlinelog');
INSERT INTO `helppages` (`ocpage`, `language`, `helppage`) VALUES ('viewprofile', 'DE', 'Benutzerprofil');
INSERT INTO `helppages` (`ocpage`, `language`, `helppage`) VALUES ('additional_waypoints', 'DE', 'Zusätzliche Wegpunkte');
INSERT INTO `helppages` (`ocpage`, `language`, `helppage`) VALUES ('usernote', 'DE', 'Persönliche Notiz');
-- Table languages
SET NAMES 'utf8';
@@ -2269,12 +2274,12 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1781', 'Add new
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1782', 'Delete waypoint', '2011-07-10 18:55:33');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1783', 'Edit waypoint', '2011-07-10 18:55:33');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1788', 'Parking', '2011-07-15 20:08:12');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1789', 'Reference point', '2011-07-15 20:08:12');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1789', 'Stage or reference point', '2011-07-15 20:08:12');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1790', 'Additional waypoints', '2011-07-15 22:33:19');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1791', 'Add a waypoint', '2011-07-15 22:33:19');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1792', 'Additional waypoints can be entered to make searching easier, for example by pointing to a suitable parking location or start of a path (the waypoint\'s description may contain more information). The waypoints are included in GPX-file downloads and will be sent to the GPS device.', '2011-07-15 22:33:19');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1792', 'Additional waypoints can be entered to make searching easier, for example by pointing to a suitable parking location or start of a path (the waypoint\'s description may contain more information). They may also specify the stages of a multicache. The waypoints are shown on the map when the cache is selected, are included in GPX file downloads and will be sent to the GPS device.', '2011-07-15 22:33:19');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1793', 'No waypoints available', '2011-07-15 22:33:33');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1794', 'Additional waypoints can make searching easier, for example by pointing to a suitable parking location or start of a path. The waypoints are included in GPX-file downloads and will be sent to the GPS device.', '2011-07-15 22:34:44');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1794', 'The additional waypoints are shown on the map when the cache is selected, are included in GPX file downloads and will be sent to the GPS device.', '2011-07-15 22:34:44');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1795', 'Maps:', '2012-07-23 22:26:31');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1796', 'Published on', '2012-07-24 19:16:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1797', 'Changelog', '2012-08-08 14:16:00');
@@ -2357,6 +2362,11 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1878', 'Map dat
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1920', 'D', '2013-03-03 00:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1921', 'T', '2013-03-03 00:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1922', 'click on spoiler to display', '2013-03-03 00:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1923', 'for', '2013-03-03 00:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1924', 'The cache has %1 %2additional waypoints%3.', '2013-03-03 00:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1925', 'The cache has an %2additional waypoint%3.', '2013-03-03 00:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1926', 'Path', '2013-03-03 00:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1927', 'Final', '2013-03-03 00:00:00');
-- Table sys_trans_ref
SET NAMES 'utf8';
@@ -5853,12 +5863,12 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1782', 'DE', 'Wegpunkt Löschen', '2011-07-10 20:17:25');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1783', 'DE', 'Wegpunkt bearbeiten', '2011-07-10 20:18:43');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1788', 'DE', 'Parkplatz', '2011-07-15 20:13:26');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1789', 'DE', 'Referenzpunkt', '2011-07-15 20:12:55');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1789', 'DE', 'Station oder Referenzpunkt', '2011-07-15 20:12:55');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1790', 'DE', 'Zusätzliche Wegpunkte', '2011-07-17 20:52:34');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1791', 'DE', 'Wegpunkt hinzufügen', '2011-07-17 20:53:01');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1792', 'DE', 'Zusätzliche Wegpunkte können angelegt werden um die Suche zu erleichtern. Zum Beispiel ein Parkplatz oder Startpunkt für die Suche. Die Wegpunkte sind in heruntergeladenen GPX-Dateien enthalten und werden ans GPS-Gerät gesendet.', '2011-07-17 20:50:33');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1792', 'DE', 'Zusätzliche Wegpunkte können angelegt werden um die Suche zu erleichtern, zum Beispiel indem sie einen Parkplatz oder Startpunkt für die Suche angeben. Außerdem können hier die Stationen eines Multicaches eingetragen werden. Die Wegpunkte werden bei Auswahl des Caches auf der Karte angezeigt, sind in heruntergeladenen GPX-Dateien enthalten und werden an das GPS-Gerät gesendet.', '2011-07-17 20:50:33');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1793', 'DE', 'Keine zusätzlichen Wegpunkte angelegt', '2011-07-17 20:51:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1794', 'DE', 'Zusätzliche Wegpunkte können die Suche vereinfachen, indem sie z.B. auf einem Parkplatz oder den Anfang der Strecke zeigen. Die Wegpunkte sind in heruntergeladenen GPX-Dateien enthalten und werden ans GPS-Gerät gesendet.', '2011-07-17 20:52:52');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1794', 'DE', 'Die zusätzlichen Wegpunkte werden bei Auswahl des Caches auf der Karte angezeigt, sind in heruntergeladenen GPX-Dateien enthalten und werden an das GPS-Gerät gesendet.', '2011-07-17 20:52:52');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1795', 'DE', 'Karten:', '2012-07-23 22:26:38');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1796', 'DE', 'Veröffentlicht am', '2012-07-23 22:26:38');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1797', 'DE', 'Versionsgeschichte', '2012-07-08 14:50:00');
@@ -5941,6 +5951,11 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1920', 'DE', 'D', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1921', 'DE', 'T', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1922', 'DE', 'Spoiler anklicken zum Anzeigen', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1923', 'DE', 'für', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1924', 'DE', 'Der Cache hat %1 %2zusätzliche Wegpunkte%3.', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1925', 'DE', 'Der Cache hat einen %1zusätzlichen Wegpunkt%2.', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1926', 'DE', 'Pfad', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1927', 'DE', 'Ziel', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'EN', 'Reorder IDs \r', '2010-09-02 00:15:30');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'EN', 'The database could not be reconnected.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('3', 'EN', 'Testing please do not login', '2010-08-28 11:48:07');
@@ -7312,12 +7327,12 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1782', 'EN', 'Delete waypoint', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1783', 'EN', 'Edit waypoint', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1788', 'EN', 'Parking', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1789', 'EN', 'Reference point', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1789', 'EN', 'Stage or reference point', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1790', 'EN', 'Additional waypoints', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1791', 'EN', 'Add a waypoint', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1792', 'EN', 'Additional waypoints can be entered to make searching easier, for example by pointing to a suitable parking location or start of a path (the waypoint\'s description may contain more information). The waypoints are included in GPX-file downloads and will be sent to the GPS device.', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1792', 'EN', 'Additional waypoints can be entered to make searching easier, for example by pointing to a suitable parking location or start of a path (the waypoint\'s description may contain more information). They may also specify the stages of a multicache. The waypoints are shown on the map when the cache is selected, are included in GPX file downloads and will be sent to the GPS device.', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1793', 'EN', 'No waypoints available', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1794', 'EN', 'Additional waypoints can make searching easier, for example by pointing to a suitable parking location or start of a path. The waypoints are included in GPX-file downloads and will be sent to the GPS device.', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1794', 'EN', 'The additional waypoints are shown on the map when the cache is selected, are included in GPX file downloads and will be sent to the GPS device.', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1795', 'EN', 'Maps:', '2012-08-24 17:38:05');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1796', 'EN', 'Published on', '2012-08-24 17:38:05');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1797', 'EN', 'Changelog', '2012-08-24 17:38:05');
@@ -7400,6 +7415,11 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1920', 'EN', 'D', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1921', 'EN', 'T', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1922', 'EN', 'click on spoler to display', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1923', 'EN', 'for', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1924', 'EN', 'The cache has %1 %2additional waypoints%3.', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1925', 'EN', 'The cache has an %2additional waypoint%3.', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1926', 'EN', 'Path', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1927', 'EN', 'Final', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'ES', 'Reordenar ID', '2010-12-09 00:17:55');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'ES', 'La base de datos no se pudo conectar.', '2010-12-09 00:17:55');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('3', 'ES', 'En pruebas - por favor, no entre.', '2010-12-09 00:17:55');
+2 -2
View File
@@ -36,8 +36,8 @@
$picturelines = '{lines}<tr><td colspan="2">&nbsp;</td></tr>';
$nowaypoints = '<tr><td colspan="2">' . t('No waypoints available') . '</td></tr>';
$waypointline = '<tr bgcolor="#ffffff"><td><img src="{wp_image}" />&nbsp;{wp_type}</td><td><table><tr><td>{wp_coordinate}</td></tr></table></tp><td>{wp_description}</td><td>[<a href="childwp.php?cacheid={cacheid}&childid={childid}">' . t('Edit') . '</a>] [<a href="childwp.php?cacheid={cacheid}&deleteid={childid}">' . t('Delete') . '</a>]</td></tr>';
$waypointlines = '<tr><td colspan="2"><table bgcolor="#dddddd">{lines}</table></td></tr><tr><td colspan="2">&nbsp;</td></tr>';
$waypointline = '<tr bgcolor="#ffffff"><td><img src="{wp_image}" />&nbsp;{wp_type}&nbsp;</td><td><table class="narrowtable"><tr><td>{wp_coordinate}</td></tr></table></tp><td>{wp_description}</td><td>&nbsp;[<a href="childwp.php?cacheid={cacheid}&childid={childid}">' . t('Edit') . '</a>] [<a href="childwp.php?cacheid={cacheid}&deleteid={childid}">' . t('Delete') . '</a>]&nbsp;</td></tr>';
$waypointlines = '<tr><td colspan="2"><table class="edit_wptable">{lines}</table></td></tr><tr><td colspan="2">&nbsp;</td></tr>';
$cache_attrib_js = "new Array({id}, {selected}, '{img_undef}', '{img_large}')";
$cache_attrib_pic = '<img id="attr{attrib_id}" src="{attrib_pic}" border="0" onmousedown="toggleAttr({attrib_id})" onmouseover="Tip(\'{html_desc}\', TITLE, \'{name}\', TITLEBGCOLOR, \'{color}\', TITLEFONTCOLOR, \'#000000\', BGCOLOR, \'#FFFFFF\', BORDERCOLOR, \'{color}\', CLICKCLOSE, true, DELAY, 0, FADEIN, false, FADEOUT, false, FONTCOLOR, \'#000080\', WIDTH, 500)" onmouseout="UnTip()" />&nbsp;';
+1 -1
View File
@@ -307,7 +307,7 @@ function toggleAttr(id)
<tr>
<td class="help" colspan="2">
<img src="lang/de/ocstyle/images/misc/hint.gif" border="0" width="15" height="11" alt="{t}Notice{/t}" title="{t}Notice{/t}">
{t}Additional waypoints can be entered to make searching easier, for example by pointing to a suitable parking location or start of a path (the waypoint's description may contain more information). The waypoints are included in GPX-file downloads and will be sent to the GPS device.{/t}
{t}Additional waypoints can be entered to make searching easier, for example by pointing to a suitable parking location or start of a path (the waypoint's description may contain more information). They may also specify the stages of a multicache. The waypoints are shown on the map when the cache is selected, are included in GPX file downloads and will be sent to the GPS device.{/t}
</td>
</tr>
<tr><td class="spacer" colspan="2">&nbsp;</td></tr>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

After

Width:  |  Height:  |  Size: 863 B

+6 -2
View File
@@ -605,8 +605,12 @@
$thiswp = mb_ereg_replace('{desc}', $translate->t('Waypoint','','',0).' '.$n, $thiswp);
switch ($childWaypoint['type'])
{
case 1: $wp_typename = "Parking Area"; break;
default: $wp_typename = "Reference Point";
case 1: $wp_typename = "Parking Area"; break; // well-known garmin symbols
case 2: $wp_typename = "Flag, Green"; break; // stage / ref point
case 3: $wp_typename = "Flag, Blue"; break; // path
case 4: $wp_typename = "Circle with X"; break; // final
case 5: $wp_typename = "Diamond, Green"; break; // point of interest
default: $wp_typename = "Flag, Blue"; break; // for the case new types are forgotten here ..
}
$thiswp = mb_ereg_replace('{type}', $wp_typename, $thiswp);
$thiswp = mb_ereg_replace('{parent}', $r['waypoint'], $thiswp);
+30 -7
View File
@@ -248,6 +248,8 @@
$tpl->assign('help_oconly', helppagelink("OConly"));
$tpl->assign('help_map', helppagelink("*map2"));
$tpl->assign('help_wps', helppagelink("additional_waypoints"));
$tpl->assign('help_note', helppagelink("usernote"));
$tpl->display();
@@ -286,7 +288,7 @@ function output_cachexml($sWaypoint)
{
global $opt, $login;
$rsCache = sql_slave("SELECT `caches`.`name`, `caches`.`wp_oc`, `caches`.`cache_id`, `caches`.`type`,
$rsCache = sql_slave("SELECT `caches`.`cache_id`, `caches`.`name`, `caches`.`wp_oc`, `caches`.`cache_id`, `caches`.`type`,
`caches`.`longitude`, `caches`.`latitude`,
IF(`caches`.`status` IN (2,3,6), 1, 0) AS `tna`,
IFNULL(`trans_status_text`.`text`, `cache_status`.`name`) AS `statustext`,
@@ -331,6 +333,9 @@ function output_cachexml($sWaypoint)
if ($rCache['type'] == 6)
$nAttendedCount = sql_value_slave("SELECT COUNT(*) FROM `cache_logs` WHERE `user_id`='&1' AND `cache_id`='&2' AND `type`=7", 0, $login->userid, $rCache['cache_id']);
$wphandler = new ChildWp_Handler();
$waypoints = $wphandler->getChildWps($rCache['cache_id'],true);
echo '<caches>' . "\n";
echo ' <cache ';
echo 'name="' . xmlentities($rCache['name']) . '" ';
@@ -353,7 +358,22 @@ function output_cachexml($sWaypoint)
echo 'oconly="' . xmlentities($rCache['oconly']) . '" ';
echo 'owner="' . xmlentities($rCache['owner']) . '" ';
echo 'username="' . xmlentities($rCache['username']) . '" ';
echo 'userid="' . xmlentities($rCache['user_id']) . '" />' . "\n";
echo 'userid="' . xmlentities($rCache['user_id']) . '" >' . "\n";
foreach ($waypoints as $waypoint)
{
echo ' <wpt ';
echo 'typeid="' . xmlentities($waypoint['type']) . '" ';
echo 'typename="' . xmlentities($waypoint['name']) . '" ';
echo 'image="' . xmlentities($waypoint['image']) . '" ';
echo 'imagewidth="38" imageheight="38" ';
echo 'latitude="' . xmlentities($waypoint['latitude']) . '" ';
echo 'longitude="' . xmlentities($waypoint['longitude']) . '" ';
echo 'description="' . xmlentities($waypoint['description']) . '" />\n';
}
echo ' </cache>\n';
echo '</caches>';
exit;
@@ -421,16 +441,18 @@ function output_searchresult($nResultId, $compact, $nLon1, $nLon2, $nLat1, $nLat
`caches`.`type`,
`caches`.`status`>1 AS `inactive`,
`user`.`user_id`='&6' AS `owned`,
IF(`cache_logs`.`id` IS NULL, 0, 1) AS `found`,
IF(`found_logs`.`id` IS NULL, 0, 1) AS `found`,
IF(`found_logs`.`id` IS NULL AND `notfound_logs`.`id` IS NOT NULL, 1, 0) AS `notfound`,
IF(`caches_attributes`.`attrib_id` IS NULL, 0, 1) AS `oconly`" .
$namequery . "
FROM `map2_data`
INNER JOIN `caches` ON `map2_data`.`cache_id`=`caches`.`cache_id`
LEFT JOIN `user` ON `user`.`user_id`=`caches`.`user_id`
LEFT JOIN `cache_logs` ON `cache_logs`.`cache_id`=`caches`.`cache_id` AND `cache_logs`.`user_id`='&6' AND `cache_logs`.`type` IN (1,7)
LEFT JOIN `cache_logs` `found_logs` ON `found_logs`.`cache_id`=`caches`.`cache_id` AND `found_logs`.`user_id`='&6' AND `found_logs`.`type` IN (1,7)
LEFT JOIN `cache_logs` `notfound_logs` ON `notfound_logs`.`cache_id`=`caches`.`cache_id` AND `notfound_logs`.`user_id`='&6' AND `notfound_logs`.`type`=2
LEFT JOIN `caches_attributes` ON `caches_attributes`.`cache_id`=`caches`.`cache_id` AND `caches_attributes`.`attrib_id`=6
WHERE `map2_data`.`result_id`='&1' AND `caches`.`longitude`>'&2' AND `caches`.`longitude`<'&3' AND `caches`.`latitude`>'&4' AND `caches`.`latitude`<'&5'
ORDER BY `caches`.`status` DESC, `oconly` AND NOT `found`, NOT `found`, `caches`.`type`<>4, MD5(`caches`.`name`)
ORDER BY `caches`.`status` DESC, `oconly` AND NOT (`found` OR `notfound`), NOT (`found` OR `notfound`), `caches`.`type`<>4, MD5(`caches`.`name`)
LIMIT &7",
// sort in reverse order, because last are on top of map;
// fixed order avoids oscillations when panning;
@@ -442,8 +464,9 @@ function output_searchresult($nResultId, $compact, $nLon1, $nLon2, $nLat1, $nLat
$flags = 0;
if ($r['owned']) $flags |= 1;
if ($r['found']) $flags |= 2;
if ($r['inactive']) $flags |= 4;
if ($r['oconly']) $flags |= 8;
if ($r['notfound']) $flags |= 4;
if ($r['inactive']) $flags |= 8;
if ($r['oconly']) $flags |= 16;
if ($compact)
echo '<c d="' . xmlentities($r['wp_oc']) . '/' .
@@ -1223,7 +1223,6 @@ div.mapstat_fullscreen {
position:relative;
top:21px;
padding-right:5px;
background:none;
text-align:right;
}
@@ -1349,3 +1348,8 @@ div#havefound {
.jslink {
cursor:pointer;
}
.edit_wptable {
background-color:#dddddd;
font-size:0.85em;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 926 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

After

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

+5 -1
View File
@@ -15,8 +15,12 @@
<td></td>
<td colspan="2">
<input type="submit" name="submit_cache_note" value="{t}Save{/t}" class="formbutton" onclick="javascript:submitbutton('submit_cache_note')" >
</td>
</tr>
<tr>
<td colspan="3">
<img src="resource2/{$opt.template.style}/images/viewcache/16x16-info.png" class="icon16" alt="Info" />
<small>
<small style="line-height:1em">
{t}The note is not visible to other users. The note and the optional coordinate will be included in GPX-file downloads and sent to the GPS device.{/t}</td>
</small>
</td>
+8
View File
@@ -8,6 +8,14 @@
{$pagetitle|escape}
</div>
<table>
<tr>
{foreach from=$wpNameImages key=typeName item=typeImage}
<td><img src="{$typeImage}"></td><td>{$typeName}</td><td>&nbsp;&nbsp;&nbsp;</td>
{/foreach}
</tr>
</table>
<table class="table">
<tr>
<td valign="top">{t}Waypoint type:{/t}</td>
+201 -25
View File
@@ -104,6 +104,9 @@ var moMarkerList = new Array();
var msPopupMarkerWP = '';
var mhInfoWindowHackTimer = null;
var mhInfoWindowHackTries = 0;
var moWpInfoWindow = null;
var maWpWaypoints;
var moWaypointList = new Array();
var mnMapWidth = 770;
var mnMapHeight = 600;
@@ -357,6 +360,7 @@ function mapLoad()
setMapType("OCM", "OpenCycleMap", "http://tile.opencyclemap.org/cycle/", 18);
moInfoWindow = new google.maps.InfoWindow();
moWpInfoWindow = new google.maps.InfoWindow();
moSearchList = document.getElementById('mapselectlist');
moMapSearch = document.getElementById('mapsearch');
@@ -448,6 +452,7 @@ function map_clicked()
toggle_sidebar();
mapselectlist_hide(); // firefox needs this
moInfoWindow.close();
moWpInfoWindow.close();
permalinkbox_hide();
}
@@ -581,7 +586,10 @@ function queue_dataload(nMs)
function data_load()
{
if (bFilterChanged)
{
moInfoWindow.close();
clear_waypoints();
}
bResetFilterHeading = bFilterChanged;
bFilterChanged = false;
@@ -670,7 +678,8 @@ function data_mapreceive(data, responseCode)
var nFlags = aCacheData[4];
addCacheToMap(sWaypoint, nLon, nLat, nType, nFlags,
oCachesList[nIndex].getAttribute("n"), nIndex);
oCachesList[nIndex].getAttribute("n"),
sWaypoint == msPopupMarkerWP ? 999999 : nIndex);
}
}
@@ -731,12 +740,13 @@ function NewCacheMarker(nLat, nLon, sWaypoint, nType, nFlags, sName, nZindex)
{/if}
{literal}
if (nFlags & 1) image += 'owned';
else if (nFlags & 2) image += 'found';
else image += 'cachetype-' + nType;
if (nFlags & 1) image += 'owned';
else if (nFlags & 2) image += 'found';
else if (nFlags & 4) image += 'notfound';
else image += 'cachetype-' + nType;
if (nFlags & 4) image += '-inactive';
else if (nFlags & 8) image += '-oconly';
if (nFlags & 8) image += '-inactive';
else if (nFlags & 16) image += '-oconly';
var mi = new google.maps.MarkerImage(image + '.png');
mi.anchor = anchor;
@@ -754,7 +764,7 @@ function NewCacheMarker(nLat, nLon, sWaypoint, nType, nFlags, sName, nZindex)
function addCacheToMap(sWaypoint, nLon, nLat, nType, nFlags, sName, nZindex)
{
var oMarker = NewCacheMarker(nLat, nLon, sWaypoint, nType, nFlags, sName, nZindex);
google.maps.event.addListener(oMarker, "click", function(){CacheMarker_click(sWaypoint);});
google.maps.event.addListener(oMarker, "click", function(){show_cachepopup_wp(sWaypoint,false);});
moMarkerList[moMarkerList.length] = oMarker;
}
@@ -765,6 +775,7 @@ function data_clear()
for (var nIndex=0; nIndex<moMarkerList.length; nIndex++)
moMarkerList[nIndex].setMap(null);
moMarkerList = new Array();
clear_waypoints();
}
@@ -798,11 +809,6 @@ function data_clear_except(wpset)
return existing;
}
function CacheMarker_click(sWaypoint)
{
show_cachepopup_wp(sWaypoint, false);
}
/*=========================================================================
Cache-InfoWindow popup
@@ -837,11 +843,8 @@ function show_cachepopup_latlon(nLat, nLon, bAllowZoomChange)
function adjust_infowindow()
{
if (mhInfoWindowHackTries > 0 &&
document.getElementById('mapinfowindow') != null)
if (typeof document.getElementById('mapinfowindow').parentNode != null)
if (typeof document.getElementById('mapinfowindow').parentNode.parentNode != null)
if (typeof document.getElementById('mapinfowindow').parentNode.parentNode.style != null)
if (mhInfoWindowHackTries > 0)
try
{
var iw_frame = document.getElementById('mapinfowindow').parentNode.parentNode;
var iw_width = parseInt(iw_frame.style.width.substr(0, iw_frame.style.width.indexOf('px')));
@@ -850,32 +853,178 @@ function adjust_infowindow()
if (iw_width != "" && iw_height != "")
{
mhInfoWindowHackTries = 0;
// alert("Before: " + iw_frame.style.width + " / " + iw_frame.style.height);
iw_frame.style.width = String(iw_width + 25) + "px";
// alert("Before: " + iw_frame.style.width + " / " + iw_frame.style.height);
iw_frame.style.width = String(iw_width + 2) + "px";
// making it too wide would let additional wp text flow into the margin at MSIE
iw_frame.style.height = String(iw_height + 25) + "px";
// alert("After: " + iw_frame.style.width + " / " + iw_frame.style.height);
}
else
mhInfoWindowHackTries -= 1;
}
catch (e)
{
// we were too fast and will try again
}
if (mhInfoWindowHackTries <= 0)
clearInterval(mhInfoWindowHackTimer);
}
function reopen_infowindow(oCoords, sText)
function hack_infowindow()
{
mhInfoWindowHackTries = 150;
mhInfoWindowHackTimer = window.setInterval("adjust_infowindow()",10);
}
function show_infowindow(oCoords, sText, aWaypoints)
{
// close last info window, if open, and discard waypoin list
moInfoWindow.close();
clear_waypoints();
// open new info window
moInfoWindow = new google.maps.InfoWindow({ position: oCoords, content: sText });
moInfoWindow.open( moMap, null, true );
wid = document.getElementById('mapinfowindow');
mhInfoWindowHackTries = 150;
mhInfoWindowHackTimer = window.setInterval("adjust_infowindow()",10);
hack_infowindow();
// save waypoint list and create waypoint markers and handlers
maWpWaypoints = aWaypoints;
for (var nWp=0; nWp<aWaypoints.length; nWp++)
{
var imgparams = get_wp_imgparams(aWaypoints[nWp]);
var image = imgparams[0];
var anchorx = imgparams[3];
var anchory = imgparams[4];
var latitude = aWaypoints[nWp].getAttribute('latitude');
var longitude = aWaypoints[nWp].getAttribute('longitude');
var mi = new google.maps.MarkerImage(image);
mi.anchor = new google.maps.Point(anchorx, anchory);
var coords = new google.maps.LatLng(latitude, longitude);
marker = new google.maps.Marker(
{ position: coords,
map: moMap,
icon: mi,
zIndex: 99998 });
{/literal}
{*
* We cannot use the show_infowindow() loop variables in the event handler
* function - they would all use variable values after end of loop, i.e. sho
* all the last waypoint's infowindow. To solve this, the handler finds the
* clicked waypoint's data by the coordinates. GM passes the marker's
* coordinates here (with rounding differences), but to be sure we just look
* for the nearest marker.
*}
{literal}
google.maps.event.addListener(marker, "click",
function (event)
{
var distance = 360;
var reflat = event.latLng.lat();
var reflon = event.latLng.lng();
var nearestwp;
for (nWp=0; nWp<maWpWaypoints.length; nWp++)
{
var lat = maWpWaypoints[nWp].getAttribute('latitude');
var lon = maWpWaypoints[nWp].getAttribute('longitude');
var d = Math.sqrt((lat-reflat) * (lat-reflat) + (lon-reflon) * (lon-reflon));
if (d < distance)
{
nearestwp = nWp;
nearestlon = lon;
nearestlat = lat;
distance = d;
}
}
moInfoWindow.close();
moWpInfoWindow.close();
var imgparams = get_wp_imgparams(aWaypoints[nearestwp]);
var image = aWaypoints[nearestwp].getAttribute('image');
var imagewidth = aWaypoints[nearestwp].getAttribute('imagewidth');
var imageheight = aWaypoints[nearestwp].getAttribute('imageheight');
var wptype = maWpWaypoints[nearestwp].getAttribute('typeid');
var typename = maWpWaypoints[nearestwp].getAttribute('typename');
var description = maWpWaypoints[nearestwp].getAttribute('description');
{/literal}
var typetext;
if (wptype+0 == 0 && {if $help_note != ""}1{else}0{/if})
typetext = "{$help_note}";
else if ({if $help_wps != ""}1{else}0{/if})
typetext = "{$help_wps}";
if (typetext != "")
typetext += typename + "</a>";
else
typetext += typename;
var text = // MSIE needs max width to wrap long descriptions
"<div id='mapinfowindow' style='max-width:350px; max-height:350px'><table class='mappopup'>" +
"<tr><td><table cellspacing='0' cellpadding='0'><tr><td>" +
"<img src='" + image + "' width='" + imagewidth + "' height='" + imageheight + "' ></td>" +
"<td style='font-size:1.2em'>" + typetext + " {t}for{/t}" + "&nbsp;</td>" +
"<td style='font-weight:bold; font-size:1.2em'><a href='viewcache.php?wp=" + msPopupMarkerWP + "' target='_blank_'>" + msPopupMarkerWP + "</a></td>" +
"</tr></table></td></tr>";
if (description != "")
text += "<tr><td style='padding:8px; max-width:350px; white-space:normal' colspan='4'>" + description + "</td></tr>";
text += "</table></div>";
{literal}
moWpInfoWindow = new google.maps.InfoWindow({ position: event.latLng, content: text });
moWpInfoWindow.open( moMap, null, true );
hack_infowindow();
} );
moWaypointList[moWaypointList.length] = marker;
}
}
function get_wp_imgparams(wp)
{
{/literal}
{if $opt_cacheicons == 1}
return [wp.getAttribute('image'), wp.getAttribute('imagewidth'), wp.getAttribute('imageheight'),
wp.getAttribute('imagewidth')/2, wp.getAttribute('imageheight')/2];
{else}
var image;
{literal}
switch (wp.getAttribute('typeid'))
{
case '0': image = 'personal'; break;
case '2': image = 'parking'; break;
case '3': image = 'path'; break;
case '4': image = 'final'; break;
case '5': image = 'poi'; break;
default: image = 'reference'; break;
}
{/literal}
return ['resource2/ocstyle/images/map/caches2/wp_' + image + '.png', 32, 32, 13, 24];
{/if}
{literal}
}
function clear_waypoints()
{
moWpInfoWindow.close();
for (nOldWp = 0; nOldWp<moWaypointList.length; nOldWp++)
moWaypointList[nOldWp].setMap(null);
moWaypointList = new Array();
}
function show_cachepopup_url(sURL, sWaypoint, bAllowZoomChange)
{
moInfoWindow.close();
moWpInfoWindow.close();
ajaxLoad(sURL, function(data, responseCode) {
var oXML = xmlParse(data);
@@ -901,9 +1050,8 @@ function show_cachepopup_url(sURL, sWaypoint, bAllowZoomChange)
moMap.setZoom(nDefaultZoom);
}
reopen_infowindow(oCoords, parseXML_GetHTML(oXML));
show_infowindow(oCoords, parseXML_GetHTML(oXML), parseXML_GetWaypoints(oXML));
});
}
function parseXML_GetWaypoint(xmlobject)
@@ -942,6 +1090,8 @@ function parseXML_GetHTML(xmlobject)
var sUsername = aCaches[0].getAttribute("username");
var nUserId = aCaches[0].getAttribute("userid");
var oWaypoints = aCaches[0].getElementsByTagName("wpt");
{/literal}{*
// When changing any of the following HTML code, test the map popups carefully
// on many different browsers and zoom levels! Even trivial changes can cause
@@ -985,11 +1135,37 @@ function parseXML_GetHTML(xmlobject)
if (sAddHtml != "")
sHtml += "<tr><td colspan='3' height='3px'></td></tr>" + sAddHtml;
if (oWaypoints.length)
{
{/literal}
var sMsg;
if (oWaypoints.length > 1)
sMsg = "{t}The cache has %1 %2additional waypoints%3.{/t}";
else
sMsg = "{t}The cache has an %2additional waypoint%3.{/t}";
sMsg = sMsg.replace("%1",oWaypoints.length);
sMsg = sMsg.replace("%2","{$help_wps}");
sMsg = sMsg.replace("%3","{if $help_wps != ""}</a>{/if}");
sHtml += "<tr><td colspan='3'><img src='resource2/ocstyle/images/misc/16x16-wp_reference.png' alt='' /> " + sMsg + "</td></tr>";
{literal}
}
sHtml += "</table></div>";
return sHtml;
}
function parseXML_GetWaypoints(xmlobject)
{
var aCaches = xmlobject.documentElement.getElementsByTagName("cache");
if (aCaches.length<1)
return false;
else
return aCaches[0].getElementsByTagName("wpt");
}
function parseXML_GetPoint(oXMLObject)
{
var oCaches = oXMLObject.documentElement.getElementsByTagName("cache");
@@ -1233,7 +1409,7 @@ function searchlist_openitem(nIndex)
else
{
var oCoords = new google.maps.LatLng(nLat, nLon);
reopen_infowindow(oCoords, xmlentities(sText));
show_infowindow(oCoords, xmlentities(sText), new Array());
moMap.setCenter(oCoords);
moMap.setZoom(nDefaultZoom-1);
+2 -2
View File
@@ -308,7 +308,7 @@
</div>
<div class="content2-container" style="margin-left:10px;">
<table bgcolor="#dddddd" width="95%" cellpadding="5%">
<table bgcolor="#dddddd" width="95%" cellpadding="5%" style="margin-bottom:4px">
{foreach from=$childWaypoints item=childWaypoint}
<tr bgcolor="{cycle values="#ffffff,#eeeeee"}">
<td width="25%"><img src="{$childWaypoint.image}" />{$childWaypoint.name|escape}</td>
@@ -318,7 +318,7 @@
{/foreach}
</table>
<img src="resource2/{$opt.template.style}/images/viewcache/16x16-info.png" class="icon16" alt="Info" />
{t}Additional waypoints can make searching easier, for example by pointing to a suitable parking location or start of a path. The waypoints are included in GPX-file downloads and will be sent to the GPS device.{/t}
{t}The additional waypoints are shown on the map when the cache is selected, are included in GPX file downloads and will be sent to the GPS device.{/t}
</div>
{/if}
+1
View File
@@ -8,6 +8,7 @@ class CacheNote_Presenter
const tpl_note_id = 'noteid';
const tpl_note = 'note';
const tpl_incl_coord = 'inclCoord';
const image = 'resource2/ocstyle/images/misc/wp_note.png';
private $request;
private $translator;
+34 -9
View File
@@ -36,16 +36,20 @@ class ChildWp_Handler
public function getChildWp($childid)
{
$rs = sql("SELECT id, cache_id, subtype, latitude, longitude, description FROM coordinates WHERE id = &1", $childid);
$rs = sql("SELECT id, cache_id, type, subtype, latitude, longitude, description FROM coordinates WHERE id = &1", $childid);
$ret = $this->recordToArray(sql_fetch_array($rs));
mysql_free_result($rs);
return $ret;
}
public function getChildWps($cacheid)
public function getChildWps($cacheid, $include_usernote=false)
{
$rs = sql("SELECT id, cache_id, subtype, latitude, longitude, description FROM coordinates WHERE cache_id = &1 AND type = &2", $cacheid, Coordinate_Type::ChildWaypoint);
if ($include_usernote)
$type2 = Coordinate_Type::UserNote;
else
$type2 = 0;
$rs = sql("SELECT id, cache_id, type, subtype, latitude, longitude, description FROM coordinates WHERE cache_id = &1 AND type IN (&2,&3)", $cacheid, Coordinate_Type::ChildWaypoint, $type2);
$ret = array();
while ($r = sql_fetch_array($rs))
@@ -70,24 +74,45 @@ class ChildWp_Handler
return $idAndNames;
}
public function getChildNamesAndImages()
{
$nameAndTypes= array();
foreach ($this->childWpTypes as $type)
{
$nameAndTypes[$this->translator->translate($type->getName())] = $type->getImage();
}
return $nameAndTypes;
}
private function recordToArray($r)
{
$ret = array();
$ret['cacheid'] = $r['cache_id'];
$ret['childid'] = $r['id'];
$ret['type'] = $r['subtype'];
$ret['latitude'] = $r['latitude'];
$ret['longitude'] = $r['longitude'];
$ret['coordinate'] = new Coordinate_Coordinate($ret['latitude'], $ret['longitude']);
$ret['description'] = $r['description'];
$type = $this->childWpTypes[$ret['type']];
if ($type)
if ($r['type'] == Coordinate_Type::ChildWaypoint)
{
$ret['name'] = $this->translator->translate($type->getName());
$ret['image'] = $type->getImage();
$ret['type'] = $r['subtype'];
$type = $this->childWpTypes[$ret['type']];
if ($type)
{
$ret['name'] = $this->translator->translate($type->getName());
$ret['image'] = $type->getImage();
}
}
else
{
$ret['type'] = 0;
$ret['name'] = $this->translator->translate('Personal cache note');
$ret['image'] = CacheNote_Presenter::image;
}
return $ret;
+4
View File
@@ -14,6 +14,7 @@ abstract class ChildWp_Presenter
const tpl_wp_desc = 'wpDesc';
const tpl_wp_type_ids = 'wpTypeIds';
const tpl_wp_type_names = 'wpTypeNames';
const tpl_wp_name_images = 'wpNameImages';
const tpl_wp_type_error = 'wpTypeError';
const tpl_submit_button = 'submitButton';
const tpl_disabled = 'disabled';
@@ -23,6 +24,7 @@ abstract class ChildWp_Presenter
protected $coordinate;
private $waypointTypes = array();
private $waypointTypeValid = true;
private $typeImages = array();
protected $type = '0';
protected $description;
protected $cacheId;
@@ -58,6 +60,7 @@ abstract class ChildWp_Presenter
$this->childWpHandler = $childWpHandler;
$this->cacheId = $cacheId;
$this->waypointTypes = $childWpHandler->getChildWpIdAndNames();
$this->typeImages = $childWpHandler->getChildNamesAndImages();
}
public function initChildWp($childId, $childWp)
@@ -93,6 +96,7 @@ abstract class ChildWp_Presenter
{
$template->assign(self::tpl_wp_type_ids, $this->getWaypointTypeIds());
$template->assign(self::tpl_wp_type_names, $this->waypointTypes);
$template->assign(self::tpl_wp_name_images, $this->typeImages);
}
abstract protected function getTitle();