function textDetailsOut($response, $nameresponse, $wikipediaresponse, $langs = "en", $offset = 0) { global $lang, $ptdb, $id, $type, $addressformats; if ($response) { // setting header header("Content-Type: text/html; charset=UTF-8"); $output = "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">"; // translation of name if ($nameresponse) { $name = getNameDetail($langs, $nameresponse); } // if no name is set, use the poi type as name instead if ($name[0] == "") { $tags = getTags($db, $id, $type); foreach ($tags as $key => $value) { $tag = $key . "=" . $value; if (dgettext("tags", $tag) != "") { $name[0] = dgettext("tags", $tag); } if ($name[0] != $tag) { break; } } } $website = getWebsiteDetail(array($response['website'], $response['url'], $response['url:official'], $response['contact:website'])); // get wikipedia link and make translation if ($wikipediaresponse) { $wikipedia = getWikipediaDetail($langs, $wikipediaresponse); } $departures = parse_url(urldecode($response['departures'])); // printing popup details // image, only images from domains listed on a whitelist are displayed if (imageDomainAllowed($response['image'])) { $url = getImageUrl($response['image']); $tmp = parse_url($url); if (substr_count($tmp['host'], ".") > 1) { $domain = substr($tmp['host'], strpos($tmp['host'], ".") + 1); } else { $domain = $tmp['host']; } // image from wikimedia commons if ($domain == "wikimedia.org") { // creating url to Wikimedia Commons page of this image $attribution = explode("/", $url); if (substr($url, 34, 16) == "special:filepath") { $attribution = $attribution[5]; } else { $attribution = $attribution[7]; } $output .= "<div id=\"loadingImage\"><img id=\"image\" title=\"" . _("Fullscreen") . "\" src=\"" . getWikipediaThumbnailUrl($url) . "\" /></div><div class=\"attribution\"><a target=\"_blank\" href=\"http://commons.wikimedia.org/wiki/File:" . $attribution . "\">" . _("attribution-wikimedia.org") . "</a></div>\n"; } else { if ($domain == "openstreetmap.org") { // creating url to OpenStreetMap Wiki page of this image $attribution = explode("/", $url); if (substr($url, 35, 16) == "special:filepath") { $attribution = $attribution[5]; } else { $attribution = $attribution[7]; } $output .= "<div id=\"loadingImage\"><img id=\"image\" title=\"" . _("Fullscreen") . "\" src=\"" . getOsmWikiThumbnailUrl($url) . "\" /></div><div class=\"attribution\"><a target=\"_blank\" href=\"http://wiki.openstreetmap.org/wiki/File:" . $attribution . "\">" . _("attribution-openstreetmap.org") . "</a></div>\n"; } else { $output .= "<div id=\"loadingImage\"><img id=\"image\" title=\"" . _("Fullscreen") . "\" src=\"" . $url . "\" /></div><div class=\"attribution\"><a target=\"_blank\" href=\"" . _("attribution-url-" . $domain) . "\">" . _("attribution-" . $domain) . "</a></div>\n"; } } } else { if (getWikipediaImage($wikipedia[1])) { // creating url to Wikimedia Commons page of this image $attribution = explode("/", $url); if (substr($url, 34, 16) == "special:filepath") { $attribution = $attribution[5]; } else { $attribution = $attribution[7]; } $image = getWikipediaImage($wikipedia[1]); $output .= "<div id=\"loadingImage\"><img id=\"image\" title=\"" . _("Fullscreen") . "\" src=\"" . getWikipediaThumbnailUrl($image) . "\" /></div><div class=\"attribution\"><a target=\"_blank\" href=\"http://commons.wikimedia.org/wiki/File:" . $attribution . "\">" . _("attribution-wikimedia.org") . "</a></div>\n"; } } if ($name) { $output .= "<div class=\"container hcard vcard\"><div class=\"header\">\n"; $output .= "<strong class=\"name\">" . $name[0] . "</strong>\n"; $output .= "</div>\n"; } // operator if ($response['operator']) { $output .= "<div class=\"operator\">" . _("Operator") . ": " . $response['operator'] . "</div>\n"; } // shelter if ($response['shelter'] == "yes") { $output .= "<div class=\"shelter\"><small>" . _("With shelter") . "</small></div>\n"; } else { if ($response['shelter'] == "no") { $output .= "<div class=\"shelter\"><small>" . _("Without shelter") . "</small></div>\n"; } } // bench if ($response['bench'] == "yes") { $output .= "<div class=\"bench\"><small>" . _("With bench") . "</small></div>\n"; } else { if ($response['shelter'] == "no") { $output .= "<div class=\"bench\"><small>" . _("Without bench") . "</small></div>\n"; } } // bin if ($response['bin'] == "yes") { $output .= "<div class=\"bin\"><small>" . _("With wastebasket") . "</small></div>\n"; } else { if ($response['bin'] == "no") { $output .= "<div class=\"bin\"><small>" . _("Without wastebasket") . "</small></div>\n"; } } // tactile paving if ($response['tactile_paving'] == "yes") { $output .= "<div class=\"tactilepaving\"><small>" . _("Tactile paving") . "</small></div>\n"; } else { if ($response['tactile_paving'] == "no") { $output .= "<div class=\"tactilepaving\"><small>" . _("No tactile paving") . "</small></div>\n"; } else { if ($response['tactile_paving'] == "incorrect") { $output .= "<div class=\"tactilepaving\"><small>" . _("Incorrect tactile paving") . "</small></div>\n"; } } } // wheelchair if ($response['wheelchair']) { if ($response['wheelchair'] == "yes") { $output .= "<div class=\"wheelchair\"><small>" . _("Accessible for wheelchairs") . "</small></div>\n"; } else { if ($response['wheelchair'] == "no") { $output .= "<div class=\"wheelchair\"><small>" . _("Not accessible for wheelchairs") . "</small></div>\n"; } else { if ($response['wheelchair'] == "limited") { $output .= "<div class=\"wheelchair\"><small>" . _("Limited accessible for wheelchairs") . "</small></div>\n"; } } } } // website and wikipedia links if ($website[0] || $wikipedia[0] || $response['departures']) { $output .= "<div class=\"web\">\n"; if ($website[0]) { if (($caption = strlen($website[1]) > 37) && strlen($website[1]) > 40) { $caption = substr($website[1], 0, 37) . "..."; } else { $caption = $website[1]; } $output .= "<div>" . _("Homepage") . ": <a class=\"url\" target=\"_blank\" href=\"" . $website[0] . "\">" . $caption . "</a></div>\n"; } if ($wikipedia[1]) { $output .= "<div class=\"wikipedia\">" . _("Wikipedia") . ": <a target=\"_blank\" href=\"" . $wikipedia[1] . "\">" . urldecode($wikipedia[2]) . "</a></div>\n"; } if ($response['departures']) { $output .= "<div class=\"departures\">" . _("Realtime departures") . ": <a target=\"_blank\" href=\"" . $response['departures'] . "\">" . $departures['host'] . "</a></div>\n"; } $output .= "</div>\n"; } $output .= "</div>\n"; return $output; } else { return false; } }
function textDetailsOut($response, $nameresponse, $wikipediaresponse, $langs = "en", $offset = 0) { global $db, $id, $type; if ($response) { // setting header header("Content-Type: text/html; charset=UTF-8"); $output = "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">"; // translation of name if ($nameresponse) { $name = getNameDetail($langs, $nameresponse); } // if no name is set, use the poi type as name instead if ($name[0] == "") { $tags = getTags($db, $id, $type); foreach ($tags as $key => $value) { $tag = $key . "=" . $value; if (dgettext("tags", $tag) != "") { $name[0] = dgettext("tags", $tag); } if ($name[0] != $tag) { break; } } } $phone = getPhoneFaxDetail(array($response['phone1'], $response['phone2'], $response['phone3'])); $fax = getPhoneFaxDetail(array($response['fax1'], $response['fax2'], $response['fax3'])); $mobilephone = getPhoneFaxDetail(array($response['mobilephone1'], $response['mobilephone2'])); $website = getWebsiteDetail(array($response['website1'], $response['website2'], $response['website3'], $response['website4'])); $email = getMailDetail(array($response['email1'], $response['email2'], $response['email3'])); // get wikipedia link and make translation if ($wikipediaresponse) { $wikipedia = getWikipediaDetail($langs, $wikipediaresponse); } $openinghours = getOpeninghoursDetail($response['openinghours']); $servicetimes = getOpeninghoursDetail($response['servicetimes']); // printing popup details // image, only images from domains listed on a whitelist are displayed if (imageDomainAllowed($response['image'])) { $url = getImageUrl($response['image']); $tmp = parse_url($url); if (substr_count($tmp['host'], ".") > 1) { $domain = substr($tmp['host'], strpos($tmp['host'], ".") + 1); } else { $domain = $tmp['host']; } // image from wikimedia commons if ($domain == "wikimedia.org") { // creating url to Wikimedia Commons page of this image $attribution = explode("/", $url); if (substr($url, 34, 16) == "special:filepath") { $attribution = $attribution[5]; } else { $attribution = $attribution[7]; } $output .= "<div id=\"loadingImage\"><img id=\"image\" title=\"" . _("Fullscreen") . "\" src=\"" . getWikipediaThumbnailUrl($url) . "\" /></div><div class=\"attribution\"><a target=\"_blank\" href=\"http://commons.wikimedia.org/wiki/File:" . $attribution . "\">" . _("attribution-wikimedia.org") . "</a></div>\n"; } else { if ($domain == "openstreetmap.org") { // creating url to OpenStreetMap Wiki page of this image $attribution = explode("/", $url); if (substr($url, 35, 16) == "special:filepath") { $attribution = $attribution[5]; } else { $attribution = $attribution[7]; } $output .= "<div id=\"loadingImage\"><img id=\"image\" title=\"" . _("Fullscreen") . "\" src=\"" . getOsmWikiThumbnailUrl($url) . "\" /></div><div class=\"attribution\"><a target=\"_blank\" href=\"http://wiki.openstreetmap.org/wiki/File:" . $attribution . "\">" . _("attribution-openstreetmap.org") . "</a></div>\n"; } else { $output .= "<div id=\"loadingImage\"><img id=\"image\" title=\"" . _("Fullscreen") . "\" src=\"" . $url . "\" /></div><div class=\"attribution\"><a target=\"_blank\" href=\"" . _("attribution-url-" . $domain) . "\">" . _("attribution-" . $domain) . "</a></div>\n"; } } } else { if (getWikipediaImage($wikipedia[1])) { // creating url to Wikimedia Commons page of this image $attribution = explode("/", $url); if (substr($url, 34, 16) == "special:filepath") { $attribution = $attribution[5]; } else { $attribution = $attribution[7]; } $image = getWikipediaImage($wikipedia[1]); $output .= "<div id=\"loadingImage\"><img id=\"image\" title=\"" . _("Fullscreen") . "\" src=\"" . getWikipediaThumbnailUrl($image) . "\" /></div><div class=\"attribution\"><a target=\"_blank\" href=\"http://commons.wikimedia.org/wiki/File:" . $attribution . "\">" . _("attribution-wikimedia.org") . "</a></div>\n"; } } if ($name) { $output .= "<div class=\"container hcard vcard\"><div class=\"header\">\n"; $output .= "<strong class=\"name\">" . $name[0] . "</strong>\n"; $output .= "</div>\n"; } // address information if ($response['street'] || $response['housenumber'] || $response['country'] || $response['city'] || $response['postcode']) { $output .= "<div class=\"adr\">\n"; // country-dependend format of address $output .= formatAddress($response, $response['country']); $output .= "</div>\n"; } // contact information if ($phone || $fax || $mobilephone || $email) { $output .= "<div class=\"contact\">\n"; if ($phone) { $output .= "<div class=\"tel\"><span class=\"type\">" . _("Phone") . "</span>:"; foreach ($phone as $phonenumber) { $output .= " <a class=\"value\" href=\"tel:" . $phonenumber[0] . "\">" . $phonenumber[1] . "</a>"; } $output .= "</div>\n"; } if ($fax) { $output .= "<div class=\"tel\"><span class=\"type\">" . _("Fax") . "</span>:"; foreach ($fax as $faxnumber) { $output .= " <span class=\"value\">" . $faxnumber[1] . "</span>"; } $output .= "</div>\n"; } if ($mobilephone) { $output .= "<div class=\"tel\"><span class=\"type\">" . _("Mobile phone") . "</span>:"; foreach ($mobilephone as $mobilephonenumber) { $output .= " <span class=\"value\" href=\"tel:" . $mobilephonenumber[0] . "\">" . $mobilephonenumber[1] . "</span>"; } $output .= "</div>\n"; } if ($email) { $output .= "<div>" . _("Email") . ":"; foreach ($email as $emailaddress) { $output .= " <a class=\"email\" href=\"mailto:" . $emailaddress . "\">" . $emailaddress . "</a>"; } $output .= "</div>\n"; } $output .= "</div>\n"; } // website and wikipedia links if ($website || $wikipedia[0]) { $output .= "<div class=\"web\">\n"; if ($website) { $output .= "<div>" . _("Homepage") . ":"; foreach ($website as $webaddress) { if (($caption = strlen($webaddress[1]) > 37) && strlen($webaddress[1]) > 40) { $caption = substr($webaddress[1], 0, 37) . "..."; } else { $caption = $webaddress[1]; } $output .= " <a class=\"url\" target=\"_blank\" href=\"" . $webaddress[0] . "\">" . $caption . "</a>\n"; } $output .= "</div>\n"; } if ($wikipedia[1]) { $output .= "<div class=\"wikipedia\">" . _("Wikipedia") . ": <a target=\"_blank\" href=\"" . $wikipedia[1] . "\">" . urldecode($wikipedia[2]) . "</a></div>\n"; } $output .= "</div>\n"; } // operator if ($response['operator']) { $output .= "<div class=\"operator\">" . _("Operator") . ": " . $response['operator'] . "</div>\n"; } // opening hours if ($openinghours) { $output .= "<div class=\"openinghours\">" . _("Opening hours") . ":<br />" . $openinghours; if (isOpen247($response['openinghours'])) { $output .= "<br /><b class=\"open\">" . _("Open 24/7") . "</b>"; } else { if (isPoiOpen($response['openinghours'], $offset)) { $output .= "<br /><b class=\"open\">" . _("Now open") . "</b>"; } else { if (isInHoliday($response['openinghours'], $offset)) { $output .= "<br /><b class=\"maybeopen\">" . _("Open on holiday") . "</b>"; } else { $output .= "<br /><b class=\"closed\">" . _("Now closed") . "</b>"; } } } $output .= "</div>\n"; } // service times if ($servicetimes) { $output .= "<div class=\"servicetimes\">" . _("Service hours") . ":<br />" . $servicetimes; if (isPoiOpen($response['openinghours'], $offset)) { $output .= "<br /><b class=\"open\">" . _("Now open") . "</b>"; } else { if (isInHoliday($response['servicetimes'], $offset)) { $output .= "<br /><b class=\"maybeopen\">" . _("Open on holiday") . "</b>"; } else { $output .= "<br /><b class=\"closed\">" . _("Now closed") . "</b>"; } } $output .= "</div>\n"; } $output .= "</div>\n"; return $output; } else { return false; } }
function textMoredetailsOut($response, $nameresponse, $wikipediaresponse, $langs, $offset = 0) { global $db, $id, $type; if ($response) { // setting header header("Content-Type: text/html; charset=UTF-8"); $output = "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">"; // translation of name if ($nameresponse) { $name = getNameDetail($langs, $nameresponse); } // if no name is set, use the poi type as name instead if ($name[0] == "") { $tags = getTags($db, $id, $type); foreach ($tags as $key => $value) { $tag = $key . "=" . $value; if (dgettext("tags", $tag) != "") { $name[0] = dgettext("tags", $tag); } if ($name[0] != $tag) { break; } } } $phone = getPhoneFaxDetail(array($response['phone1'], $response['phone2'], $response['phone3'])); $mobilephone = getPhoneFaxDetail(array($response['mobilephone1'], $response['mobilephone2'])); $fax = getPhoneFaxDetail(array($response['fax1'], $response['fax2'], $response['fax3'])); $website = getWebsiteDetail(array($response['website1'], $response['website2'], $response['website3'], $response['website4'])); $email = getMailDetail(array($response['email1'], $response['email2'], $response['email3'])); // get wikipedia link and make translation if ($wikipediaresponse) { $wikipedia = getWikipediaDetail($langs, $wikipediaresponse); } $openinghours = getOpeninghoursDetail($response['openinghours']); $servicetimes = getOpeninghoursDetail($response['servicetimes']); // title and description if ($name || $response['description']) { $output .= "<div class=\"moreInfoBox\">\n"; $output .= "<center>"; $output .= "<dfn><b>" . $name[0] . "</b></dfn><br />\n"; if ($response['description']) { $output .= "<dfn>" . $response['description'] . "</dfn><br />\n"; } $output .= "</center>\n"; $output .= "</div>\n"; } // address box if ($response['street'] || $response['housenumber'] || $response['country'] || $response['city'] || $response['postcode'] || $response['housename']) { $output .= "<div class=\"moreInfoBox\">\n"; $output .= "<strong>" . _("Address") . "</strong>\n"; $output .= "<table><tr><td>\n"; // country-dependend format of address $output .= formatAddress($response, $response['country']); $output .= "</td></tr></table>\n"; $output .= "</div>\n"; } // contact box if ($phone || $fax || $email || $mobilephone || $website[0]) { $output .= "<div class=\"moreInfoBox\">\n"; $output .= "<strong>" . _("Contact") . "</strong>\n"; $output .= "<table>\n"; if ($phone) { $output .= "<tr><td><u>" . _("Phone") . ":</u></td><td>"; foreach ($phone as $phonenumber) { $output .= " <a href=\"tel:" . $phonenumber[0] . "\">" . $phonenumber[1] . "</a>\n"; } $output .= "</td></tr>\n"; } if ($mobilephone) { $output .= "<tr><td><u>" . _("Mobile phone") . ":</u></td><td>"; foreach ($mobilephone as $mobilephonenumber) { $output .= " <a href=\"tel:" . $mobilephonenumber[0] . "\">" . $mobilephonenumber[1] . "</a>\n"; } $output .= "</td></tr>\n"; } if ($fax) { $output .= "<tr><td><u>" . _("Fax") . ":</u></td><td>"; foreach ($fax as $faxnumber) { $output .= " " . $faxnumber[1] . "\n"; } $output .= "</td></tr>\n"; } if ($email) { $output .= "<tr><td><u>" . _("Email") . ":</u> </td><td>"; foreach ($email as $emailaddress) { $output .= " <a href=\"mailto:" . $emailaddress . "\">" . $emailaddress . "</a>\n"; } $output .= "</td></tr>\n"; } if ($website) { $output .= "<tr><td><u>" . _("Homepage") . ":</u></td><td>"; foreach ($website as $webaddress) { if (($caption = strlen($webaddress[1]) > 31) && strlen($webaddress[1]) > 34) { $caption = substr($webaddress[1], 0, 31) . "..."; } else { $caption = $webaddress[1]; } $output .= "<a target=\"_blank\" href=\"" . $webaddress[0] . "\">" . $caption . "</a>\n"; } $output .= "</td></tr>\n"; } $output .= "</table>\n"; $output .= "</div>\n"; } // gastro box if ($response['cuisine'] || $response['stars'] || $response['smoking'] || $response['microbrewery'] || $response['beer']) { $output .= "<div class=\"moreInfoBox\">\n"; $output .= "<strong>" . _("Gastronomy") . "</strong>\n"; $output .= "<table>\n"; // cuisine if ($response['cuisine']) { $cuisinetag = "cuisine=" . str_replace(";", ", ", $response['cuisine']); $output .= "<tr><td><span><u>" . _("Cuisine") . ":</u> </td><td>" . (dgettext($lang . "-tags", $cuisinetag) != "" ? dgettext($lang . "-tags", $cuisinetag) : str_replace(";", ", ", $response['cuisine'])) . "</td></tr>\n"; } // stars if ($response['stars']) { $output .= "<tr><td><span><u>" . _("Stars") . ":</u> </td><td>"; for ($response['stars']; $response['stars'] > 0; $response['stars']--) { $output .= "<img class=\"star\" src=\"../img/star.png\"/>"; } $output .= "</td></tr>\n"; } // smoking if ($response['smoking']) { $output .= "<tr><td><span><u>" . _("Smoking") . ":</u> </td>"; if ($response['smoking'] == "yes") { $output .= "<td>" . _("allowed") . "</td></tr>\n"; } else { if ($response['smoking'] == "no") { $output .= "<td>" . _("prohibited") . "</td></tr>\n"; } else { if ($response['smoking'] == "dedicated") { $output .= "<td>" . _("dedicated") . "</td></tr>\n"; } else { if ($response['smoking'] == "separated") { $output .= "<td>" . _("separated smoking area") . "</td></tr>\n"; } else { if ($response['smoking'] == "isolated") { $output .= "<td>" . _("Isolated area") . "</td></tr>\n"; } } } } } } // beer sorts if ($response['beer']) { $output .= "<tr><td><span><u>" . _("Beer") . ":</u> </td><td>" . str_replace(";", ", ", $response['beer']) . "</td></tr>\n"; } // microbrewery if ($response['microbrewery'] == "yes") { $output .= "<tr><td><span>" . _("with microbrewery") . "</td></tr>\n"; } // biergarten if ($response['biergarten'] == "yes" || $response['beer_garden'] == "yes") { $output .= "<tr><td><span>" . _("Beergarden") . "</td></tr>\n"; } $output .= "</table>\n"; $output .= "</div>\n"; } // fuel box if ($response['carwash'] || $response['carrepair'] || $response['kiosk'] || $response['diesel'] == "yes" || $response['gtldiesel'] == "yes" || $response['hgvdiesel'] == "yes" || $response['biodiesel'] == "yes" || $response['octane91'] == "yes" || $response['octane95'] == "yes" || $response['octane98'] == "yes" || $response['octane100'] == "yes" || $response['octane98l'] == "yes" || $response['fuel25'] == "yes" || $response['fuel50'] == "yes" || $response['alcohol'] == "yes" || $response['ethanol'] == "yes" || $response['methanol'] == "yes" || $response['svo'] == "yes" || $response['e85'] == "yes" || $response['biogas'] == "yes" || $response['lpg'] == "yes" || $response['cng'] == "yes" || $response['lh2'] == "yes" || $response['electro'] == "yes" || $response['adblue'] == "yes") { $output .= "<div class=\"moreInfoBox\">\n"; $output .= "<strong>" . _("Fuel") . "</strong>\n"; $output .= "<table>\n"; // fuel sorts if ($response['diesel'] == "yes") { $output .= "<tr><td><span>" . _("Diesel") . "</span></td></tr>\n"; } if ($response['gtldiesel'] == "yes") { $output .= "<tr><td><span>" . _("High quality synthetic Diesel") . "</span></td></tr>\n"; } if ($response['hgvdiesel'] == "yes") { $output .= "<tr><td><span>" . _("HGV Diesel") . "</span></td></tr>\n"; } if ($response['biodiesel'] == "yes") { $output .= "<tr><td><span>" . _("Biodiesel") . "</span></td></tr>\n"; } if ($response['octane91'] == "yes") { $output .= "<tr><td><span>" . _("Octane 91") . "</span></td></tr>\n"; } if ($response['octane95'] == "yes") { $output .= "<tr><td><span>" . _("Octane 95") . "</span></td></tr>\n"; } if ($response['octane98'] == "yes") { $output .= "<tr><td><span>" . _("Octane 98") . "</span></td></tr>\n"; } if ($response['octane100'] == "yes") { $output .= "<tr><td><span>" . _("Octane 100") . "</span></td></tr>\n"; } if ($response['octane98l'] == "yes") { $output .= "<tr><td><span>" . _("Octane 98, leaded") . "</span></td></tr>\n"; } if ($response['fuel25'] == "yes") { $output .= "<tr><td><span>" . _("Mixture 1:25") . "</span></td></tr>\n"; } if ($response['fuel50'] == "yes") { $output .= "<tr><td><span>" . _("Mixture 1:50") . "</span></td></tr>\n"; } if ($response['alcohol'] == "yes") { $output .= "<tr><td><span>" . _("Alcohol") . "</span></td></tr>\n"; } if ($response['ethanol'] == "yes") { $output .= "<tr><td><span>" . _("Ethanol") . "</span></td></tr>\n"; } if ($response['methanol'] == "yes") { $output .= "<tr><td><span>" . _("Methanol") . "</span></td></tr>\n"; } if ($response['svo'] == "yes") { $output .= "<tr><td><span>" . _("Vegetable oil") . "</span></td></tr>\n"; } if ($response['e10'] == "yes") { $output .= "<tr><td><span>" . _("Ethanol-Mixture E10 (10% Ethanol)") . "</span></td></tr>\n"; } if ($response['e85'] == "yes") { $output .= "<tr><td><span>" . _("Ethanol-Mixture E85 (85% Ethanol)") . "</span></td></tr>\n"; } if ($response['biogas'] == "yes") { $output .= "<tr><td><span>" . _("Biogas") . "</span></td></tr>\n"; } if ($response['lpg'] == "yes") { $output .= "<tr><td><span>" . _("LPG") . "</span></td></tr>\n"; } if ($response['cng'] == "yes") { $output .= "<tr><td><span>" . _("CNG") . "</span></td></tr>\n"; } if ($response['lh2'] == "yes") { $output .= "<tr><td><span>" . _("Liquid hydrogen") . "</span></td></tr>\n"; } if ($response['electro'] == "yes") { $output .= "<tr><td><span>" . _("Electricity") . "</span></td></tr>\n"; } if ($response['adblue'] == "yes") { $output .= "<tr><td><span>" . _("AdBlue") . "</span></td></tr>\n"; } $output .= "<br/>"; // other properties of fuel station if ($response['carwash'] == "yes") { $output .= "<tr><td><i>" . _("Car wash") . "</i></td></tr>\n"; } if ($response['carrepair'] == "yes") { $output .= "<tr><td><i>" . _("Car repair") . "</i></td></tr>\n"; } if ($response['shop'] == "kiosk" || $response['kiosk'] == "yes") { $output .= "<tr><td><i>" . _("Shop") . "</i></td></tr>\n"; } $output .= "</table>\n"; $output .= "</div>\n"; } // other box if ($response['operator'] || $response['capacity'] || $response['fee'] || $openinghours || $response['fee'] || $response['internet_access'] || $response['toll'] || $response['ref']) { $output .= "<div class=\"moreInfoBox\">\n"; $output .= "<strong>" . _("Other") . "</strong>\n"; $output .= "<table>\n"; // opening hours if ($openinghours) { $output .= "<tr><td><span><u>" . _("Opening hours") . ":</u><br />" . $openinghours . "</span></td></tr>\n"; if (isOpen247($response['openinghours'])) { $output .= "<tr><td> <span class=\"open\">" . _("Open 24/7") . "</span></td></tr>\n"; } else { if (isPoiOpen($response['openinghours'], $offset)) { $output .= "<tr><td> <span class=\"open\">" . _("Now open") . "</span></td></tr>\n"; } else { if (isInHoliday($response['openinghours'], $offset)) { $output .= "<tr><td> <span class=\"maybeopen\">" . _("Open on holiday") . "</span></td></tr>\n"; } else { $output .= "<tr><td> <span class=\"closed\">" . _("Now closed") . "</span></td></tr>\n"; } } } } // service times if ($servicetimes) { $output .= "<tr><td><span><u>" . _("Service hours") . ":</u><br />" . $servicetimes . "</span></td></tr>\n"; if (isPoiOpen($response['servicetimes'], $offset)) { $output .= "<tr><td> <span class=\"open\">" . _("Now open") . "</span></td></tr>\n"; } else { if (isInHoliday($response['servicetimes'], $offset)) { $output .= "<tr><td> <span class=\"maybeopen\">" . _("Open on holiday") . "</span></td></tr>\n"; } else { $output .= "<tr><td> <span class=\"closed\">" . _("Now closed") . "</span></td></tr>\n"; } } } // operator if ($response['operator']) { $output .= "<tr><td><span><u>" . _("Operator") . ":</u> " . $response['operator'] . "</span></td></tr>\n"; } // capacity if ($response['capacity']) { $output .= "<tr><td><span><u>" . _("Capacity") . ":</u> " . $response['capacity'] . "</span></td></tr>\n"; } // ref if ($response['ref']) { $output .= "<tr><td><span><u>" . _("Reference") . "</u>: " . $response['ref'] . "</span></td></tr>\n"; } // internet access if ($response['internet_access']) { if ($response['internet_access'] == "terminal") { $output .= "<tr><td><span>" . _("Internet terminal") . "</span></td></tr>\n"; } else { if ($response['internet_access'] == "wlan") { $output .= "<tr><td><span>" . _("WLAN hotspot") . "</span></td></tr>\n"; } else { if ($response['internet_access'] == "wired") { $output .= "<tr><td><span>" . _("Wired internet access") . "</span></td></tr>\n"; } else { if ($response['internet_access'] == "service") { $output .= "<tr><td><span>" . _("Internet access via service") . "</span></td></tr>\n"; } } } } } // fee if ($response['fee'] == "yes") { $output .= "<tr><td><span>" . _("With costs") . "</span></td></tr>\n"; } else { if ($response['fee'] == "no") { $output .= "<tr><td><span>" . _("For free") . "</span></td></tr>\n"; } else { if ($response['fee'] == "interval") { $output .= "<tr><td><span>" . _("Partly with costs") . "</span></td></tr>\n"; } } } // toll if ($response['toll'] == "yes") { $output .= "<tr><td><span>" . _("Toll") . "</span></td></tr>\n"; } // disused if ($response['disused'] == "yes") { $output .= "<tr><td><span>" . _("Disused") . "</span></td></tr>\n"; } $output .= "</table>\n"; $output .= "</div>\n"; } // geographic box if ($response['ele'] || $response['population'] || $response['iata'] || $response['icao']) { $output .= "<div class=\"moreInfoBox\">\n"; $output .= "<strong>" . _("Geographic") . "</strong>\n"; $output .= "<table>\n"; if ($response['ele']) { $output .= "<tr><td><span><u>" . _("Height about sea level") . ":</u> " . $response['ele'] . "m</span></td></tr>\n"; } if ($response['population']) { $output .= "<tr><td><span><u>" . _("Population") . ":</u> " . number_format($response['population'], 0, ',', '.') . "</span></td></tr>\n"; } if ($response['iata']) { $output .= "<tr><td><span><u>" . _("IATA") . ":</u> " . $response['iata'] . "</span></td></tr>\n"; } if ($response['icao']) { $output .= "<tr><td><span><u>" . _("ICAO") . ":</u> " . $response['icao'] . "</span></td></tr>\n"; } $output .= "</table>\n"; $output .= "</div>\n"; } // wheelchair box if ($response['wheelchair'] || $response['wheelchair:toilets'] || $response['wheelchair:rooms'] || $response['wheelchair:access'] || $response['wheelchair:places']) { $output .= "<div class=\"moreInfoBox\">\n"; $output .= "<strong>" . _("Wheelchair") . "</strong>\n"; $output .= "<table>\n"; if ($response['wheelchair']) { if ($response['wheelchair'] == "yes") { $output .= "<tr><td><span>" . _("Accessible for wheelchairs") . "</span></td></tr>\n"; } else { if ($response['wheelchair'] == "no") { $output .= "<tr><td><span>" . _("Not accessible for wheelchairs") . "</span></td></tr>\n"; } else { if ($response['wheelchair'] == "limited") { $output .= "<tr><td><span>" . _("Limited accessible for wheelchairs") . "</span></td></tr>\n"; } } } } if ($response['wheelchair:toilets']) { if ($response['wheelchair:toilets'] == "yes") { $output .= "<tr><td><span>" . _("Toilets accessible") . "</span></td></tr>\n"; } else { if ($response['wheelchair:toilets'] == "no") { $output .= "<tr><td><span>" . _("Toilets not accessible") . "</span></td></tr>\n"; } else { if ($response['wheelchair:toilets'] == "limited") { $output .= "<tr><td><span>" . _("Toilets limited accessible") . "</span></td></tr>\n"; } } } } if ($response['wheelchair:rooms']) { if ($response['wheelchair:rooms'] == "yes" || $response['wheelchair:rooms'] != "no" || $response['wheelchair:rooms'] != "limited") { $output .= "<tr><td><span>" . _("All rooms accessible") . "</span></td></tr>\n"; } else { if ($response['wheelchair:rooms'] == "no") { $output .= "<tr><td><span>" . _("Rooms not accessible") . "</span></td></tr>\n"; } else { if ($response['wheelchair:rooms'] == "limited") { $output .= "<tr><td><span>" . _("Most rooms accessible") . "</span></td></tr>\n"; } } } } if ($response['wheelchair:access']) { if ($response['wheelchair:access'] == "yes" || $response['wheelchair:access'] != "no" || $response['wheelchair:access'] != "limited") { $output .= "<tr><td><span>" . _("Building accessible") . "</span></td></tr>\n"; } else { if ($response['wheelchair:access'] == "no") { $output .= "<tr><td><span>" . _("Building not accessible") . "</span></td></tr>\n"; } else { if ($response['wheelchair:access'] == "limited") { $output .= "<tr><td><span>" . _("Building limited accessible") . "</span></td></tr>\n"; } } } } if ($response['wheelchair:places']) { if ($response['wheelchair:places'] == "yes" || $response['wheelchair:places'] != "no" || $response['wheelchair:places'] != "limited") { $output .= "<tr><td><span>" . _("Places for wheelchairs") . "</span></td></tr>\n"; } else { if ($response['wheelchair:places'] == "no") { $output .= "<tr><td><span>" . _("No places for wheelchairs") . "</span></td></tr>\n"; } else { if ($response['wheelchair:places'] == "limited") { $output .= "<tr><td><span>" . _("Limited places for wheelchairs") . "</span></td></tr>\n"; } } } } $output .= "</table>\n"; $output .= "</div>\n"; } // wikipedia box if ($wikipedia) { $output .= "<div class=\"moreInfoBox\">\n"; $output .= "<table>\n"; $output .= "<tr><td><strong>" . _("Wikipedia") . "</strong> <i><a target=\"_blank\" id=\"moreWikipediaFull\" href=\"" . $wikipedia[1] . "\">" . _("Full article...") . "</a></i></td></tr>\n"; // request first lines $output .= "<tr><td>" . getWikipediaBeginning($wikipedia[1]) . "</td></tr>\n"; $output .= "</table>\n"; $output .= "</div>\n"; } // image box, only images from domains listed on a whitelist are displayed if (imageDomainAllowed($response['image'])) { $url = getImageUrl($response['image']); $tmp = parse_url($url); if (substr_count($tmp['host'], ".") > 1) { $domain = substr($tmp['host'], strpos($tmp['host'], ".") + 1); } else { $domain = $tmp['host']; } $output .= "<div class=\"moreInfoBox\">\n"; $output .= "<table>\n"; // image from wikimedia commons if ($domain == "wikimedia.org") { // creating url to Wikimedia Commons page of this image $attribution = explode("/", $url); if (substr($url, 34, 16) == "special:filepath") { $attribution = $attribution[5]; } else { $attribution = $attribution[7]; } if ($wikipedia) { $search = urldecode($wikipedia[2]); } else { $search = $name[0]; } $output .= "<tr><td><strong>" . _("Image") . "</strong> <i id=\"moreWikipediaFull\"><a target=\"_blank\" href=\"http://commons.wikimedia.org/w/index.php?title=Special%3ASearch&search=" . $search . "\">" . _("More images") . "</a></i></td></tr>\n"; $output .= "<tr><td id=\"loadingImage\"><img id=\"moreImage\" title=\"" . _("Fullscreen") . "\" src=\"" . getWikipediaThumbnailUrl($url) . "\" /></td></tr>\n"; $output .= "<tr><td><a target=\"_blank\" href=\"http://commons.wikimedia.org/wiki/File:" . $attribution . "\">" . _("attribution-wikimedia.org") . "</a></td></tr>\n"; } else { if ($domain == "openstreetmap.org") { // creating url to Wikimedia Commons page of this image $attribution = explode("/", $url); if (substr($url, 35, 16) == "special:filepath") { $attribution = $attribution[5]; } else { $attribution = $attribution[7]; } if ($wikipedia) { $search = urldecode($wikipedia[2]); } else { $search = $name[0]; } $output .= "<tr><td><strong>" . _("Image") . "</strong> <i id=\"moreWikipediaFull\"><a target=\"_blank\" href=\"http://commons.wikimedia.org/w/index.php?title=Special%3ASearch&search=" . $search . "\">" . _("More images") . "</a></i></td></tr>\n"; $output .= "<tr><td id=\"loadingImage\"><img id=\"moreImage\" title=\"" . _("Fullscreen") . "\" src=\"" . getOsmWikiThumbnailUrl($url) . "\" /></td></tr>\n"; $output .= "<tr><td><a target=\"_blank\" href=\"http://commons.wikimedia.org/wiki/File:" . $attribution . "\">" . _("attribution-openstreetmap.org") . "</a></td></tr>\n"; } else { $output .= "<tr><td><strong>" . _("Image") . "</strong></td></tr>\n"; $output .= "<tr><td id=\"loadingImage\"><img id=\"moreImage\" title=\"" . _("Fullscreen") . "\" src=\"" . $url . "\" /></td></tr>\n"; $output .= "<tr><td><a target=\"_blank\" href=\"" . _("attribution-url-" . $domain) . "\">" . _("attribution-" . $domain) . "</a></td></tr>\n"; } } $output .= "</table>\n"; $output .= "</div>\n"; } else { if (getWikipediaImage($wikipedia[1])) { $image = getWikipediaImage($wikipedia[1]); $output .= "<div class=\"moreInfoBox\">\n"; $output .= "<table>\n"; $output .= "<tr><td><strong>" . _("Image") . "</strong> <i id=\"moreWikipediaFull\"><a target=\"_blank\" href=\"http://commons.wikimedia.org/w/index.php?title=Special%3ASearch&search=" . urldecode($wikipedia[2]) . "\">" . _("More images") . "</a></i></td></tr>\n"; $output .= "<tr><td id=\"loadingImage\"><img id=\"moreImage\" title=\"" . _("Fullscreen") . "\" src=\"" . getWikipediaThumbnailUrl($image) . "\" /></a></td></tr>\n"; $output .= "<tr><td><a target=\"_blank\" href=\"" . $image . "\">" . _("License, author, original page...") . "</a></td></tr>\n"; $output .= "</table>\n"; $output .= "</div>\n"; } } /* // panorama, only images from domains listed on a whitelist are supported if (imageDomainAllowed($response['panorama'])) { $attribution = explode("/", $response['panorama']); $output .= "<div class=\"moreInfoBox\">\n"; $output .= "<table>\n"; $output .= "<tr><td><strong>"._("Panorama")."</strong></td></tr>\n"; $output .= "<tr><td><img id=\"morePanorama\" title=\""._("Fullscreen")."\" src=\"".getWikipediaThumbnailUrl($response['panorama'])."\" /></a></td></tr>\n"; $output .= "<tr><td><a target=\"_blank\" href=\"http://commons.wikimedia.org/wiki/File:".$attribution[7]."\">"._("License, author, original page...")."</a></td></tr>\n"; $output .= "</table>\n"; $output .= "</div>\n"; } */ $output .= "</div>\n"; return $output; } else { return false; } }