本文整理汇总了PHP中Lang::l_方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::l_方法的具体用法?PHP Lang::l_怎么用?PHP Lang::l_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lang
的用法示例。
在下文中一共展示了Lang::l_方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendRequest
/**
* function to send request
* @param String $query query for overpass api
* @return boolean true when request successful
*/
static function sendRequest($query)
{
$link = "http://overpass-api.de/api/interpreter?data=" . urlencode($query);
// get data from overpass api
$content = @file_get_contents($link);
// explanation about status codes of the overpass api can be found here: http://overpass-api.de/command_line.html
if (isset($http_response_header[0])) {
$status_code = self::getStatusCode($http_response_header[0]);
if ($status_code != 200) {
if ($status_code == 400) {
self::$error = Lang::l_("Invalid Overpass API query.");
//log error to send a correct query next time:
$msg = "Invalid Overpass API request. Query: " . $query;
log_error($msg);
} elseif ($status_code == 429) {
self::$error = Lang::l_("Too many requests to Overpass API at the same time.");
} elseif ($status_code == 504) {
self::$error = Lang::l_("Overpass API currently overcrowded.");
} else {
self::$error = Lang::l_("Unknown Error.");
//log error to show a proper error message next time:
$msg = "Unknown Error when requesting overpass api: " . $http_response_header[0] . " | URI: " . $link;
log_error($msg);
}
return false;
}
} else {
self::$error = Lang::l_("Connection failed.");
return false;
}
if (!$content) {
self::$error = Lang::l_("Empty result.");
return false;
}
self::$result = $content;
return true;
}
示例2: showDescription
/**
* returns description of the signals
* @param $tags array tags of the signal
*/
public static function showDescription()
{
return Lang::l_("Unknown");
}
示例3: showSearchResult
/**
* HTML Output for Search Result Box
*/
static function showSearchResult()
{
?>
<!-- Modal -->
<div class="modal fade" id="search" tabindex="-1" role="dialog" aria-labelledby="searchLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="searchLabel"><?php
echo Lang::l_("Search Results");
?>
</h4>
</div>
<div class="modal-body list-group" id="searchcontent">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php
}
示例4: getRouteType
/**
* Function to get route type
* @param string $route route type
* @param string $service service type
*/
static function getRouteType($route, $service = "")
{
$route_type_lang = array("high_speed" => Lang::l_('Highspeed Train'), "long_distance" => Lang::l_('Long Distance Train'), "car" => Lang::l_('Motorail Train'), "car_shuttle" => Lang::l_('Car Shuttle Train'), "night" => Lang::l_('Night Train'), "regional" => Lang::l_('Regional Train'), "commuter" => Lang::l_('Commuter Train'), "train" => Lang::l_('Unspecified Train'), "light_rail" => Lang::l_('Light Rail'), "tram" => Lang::l_('Tram'), "subway" => Lang::l_('Subway'), "tourism" => Lang::l_('Tourist Train'), "tourism_tram" => Lang::l_('Tourist Tram'), "unknown" => Lang::l_('N/A'));
if ($route == "train") {
$route_type = "train";
if ($service == "high_speed") {
$route_type = "high_speed";
} elseif ($service == "long_distance") {
$route_type = "long_distance";
} elseif ($service == "night") {
$route_type = "night";
} elseif ($service == "car") {
$route_type = "car";
} elseif ($service == "car_shuttle") {
$route_type = "car_shuttle";
} elseif ($service == "regional") {
$route_type = "regional";
} elseif ($service == "commuter") {
$route_type = "commuter";
} elseif ($service == "tourism") {
$route_type = "tourism";
}
} elseif ($route == "tram") {
$route_type = "tram";
if ($service == "tourism") {
$route_type = "tourism_tram";
}
} elseif ($service == "tourism") {
$route_type = "tourism";
} elseif ($route == "light_rail") {
$route_type = "light_rail";
} elseif ($route == "subway") {
$route_type = "subway";
}
return $route_type_lang[$route_type];
}
示例5: showAbout
function showAbout()
{
?>
<!-- Modal -->
<div class="modal fade" id="about" tabindex="-1" role="dialog" aria-labelledby="aboutLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="aboutLabel"><?php
echo Lang::l_("About This Service");
?>
</h4>
</div>
<div class="modal-body">
<h5><?php
echo Lang::l_("What is this?");
?>
</h5>
<p><?php
echo Lang::l_("What is this? text");
?>
</p>
<h5><?php
echo Lang::l_("How do I choose a route?");
?>
</h5>
<p><?php
echo Lang::l_("How do I choose a route? text");
?>
</p>
<h5><?php
echo Lang::l_("Where does the data come from and is it up to date?");
?>
</h5>
<p><?php
echo Lang::l_("Where does the data come from and is it up to date? text");
?>
</p>
<h5><?php
echo Lang::l_("Which data is used?");
?>
</h5>
<p><?php
echo Lang::l_("used_data_relations");
?>
</p>
<ul>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Train_Route">ref</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Train_Route">operator</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Train_Route">network</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Train_Route">route=rail|train|light_rail|tram|subway</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Train_Route">service=high_speed|long_distance|night|car|car_shuttle|regional|commuter|tourism</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Train_Route">color|colour</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Train_Route">text_color|text_colour|colour:text</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Train_Route">from</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Train_Route">to</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Train_Route">via</a></li>
</ul>
<p><?php
echo Lang::l_("used_data_ways");
?>
</p>
<ul>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">railway=rail|light_rail|tram|narrow_gauge|subway|miniature</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">maxspeed</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">maxspeed:forward</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">maxspeed:backward</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">operator</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">railway:traffic_mode</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">electrified</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">voltage</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">frequency</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">bridge</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">tunnel</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">embankment</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">cutting</a></li>
</ul>
<p><?php
echo Lang::l_("used_data_maxspeed");
?>
</p>
<ul>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">service</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">railway:pzb</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">railway:lzb</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">railway:imu</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">railway:ects</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">railway:selcab</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">highspeed</a></li>
<li><a href="http://wiki.openstreetmap.org/wiki/OpenRailwayMap/Tagging#Tracks">usage=main|branch</a></li>
</ul>
<p><?php
echo Lang::l_("used_data_stops");
?>
</p>
<ul>
<li>name</li>
<li>ref_name</li>
<li>description</li>
//.........这里部分代码省略.........
示例6: getSignal
public static function getSignal($id, $tags, $maxspeed_array, $distance)
{
//find out speed for speed signal
$next_speed_distant = "";
if (isset(self::$signal_property[$id]["next_speed"])) {
$next_speed = self::$signal_property[$id]["next_speed"];
}
if (isset(self::$signal_property[$id]["main"])) {
if (isset(self::$signal_property[self::$signal_property[$id]["main"]]["next_speed"])) {
$next_speed_distant = self::$signal_property[self::$signal_property[$id]["main"]]["next_speed"];
}
}
//find distance to main signal
$distant_distance = "";
if (isset($tags["railway:signal:distant"]) || isset($tags["railway:signal:combined"])) {
if (isset(self::$signal_property[$id]["main"])) {
$distant_distance = round(self::$signal_property[self::$signal_property[$id]["main"]]["distance"] - self::$signal_property[$id]["distance"], 2) * 1000;
}
}
//find distance between main signals
$main_distance = "";
if (isset($tags["railway:signal:main"]) || isset($tags["railway:signal:combined"]) || isset($tags["railway:signal:train_protection:type"]) && $tags["railway:signal:train_protection:type"] == "block_marker") {
if (isset(self::$signal_property[$id]["next_main"])) {
$main_distance = round(self::$signal_property[self::$signal_property[$id]["next_main"]]["distance"] - self::$signal_property[$id]["distance"], 2) * 1000;
}
}
//find state of speed limit signal
if (isset($tags["railway:signal:speed_limit"])) {
if ($tags["railway:signal:speed_limit"] == "DE-ESO:zs3") {
$speed = Speedlimit_zs3::findState($tags, $next_speed);
}
}
//find speed for distant speed limit signals
if (isset($tags["railway:signal:speed_limit_distant"])) {
if ($tags["railway:signal:speed_limit_distant"] == "DE-ESO:zs3v") {
$speed_distant = Speedlimit_zs3v::findState($tags, $next_speed_distant);
}
}
//find state for main signals
if (isset($tags["railway:signal:main"])) {
//German Hp signals
if ($tags["railway:signal:main"] == "DE-ESO:hp") {
$state_main = HV_main::findState($tags, $next_speed, $main_distance);
} elseif ($tags["railway:signal:main"] == "DE-ESO:ks") {
$state_main = KS_main::findState($tags, $next_speed, $main_distance);
} elseif ($tags["railway:signal:main"] == "DE-ESO:hl") {
$state_main = HL_main::findState($tags, $next_speed, $main_distance);
}
}
//German combined ks signals
if (isset($tags["railway:signal:combined"])) {
if ($tags["railway:signal:combined"] == "DE-ESO:ks") {
$state_combined = KS_combined::findState($tags, $next_speed, $next_speed_distant, $main_distance);
}
if ($tags["railway:signal:combined"] == "DE-ESO:hl") {
$state_combined = HL_combined::findState($tags, $next_speed, $next_speed_distant, $main_distance);
}
}
//Find state for distant signals
if (isset($tags["railway:signal:distant"])) {
//German vr signals
if ($tags["railway:signal:distant"] == "DE-ESO:vr") {
$state_distant = HV_distant::findState($tags, $next_speed_distant, $main_distance);
} elseif ($tags["railway:signal:distant"] == "DE-ESO:ks") {
$state_distant = KS_distant::findState($tags, $next_speed_distant, $main_distance);
} elseif ($tags["railway:signal:distant"] == "DE-ESO:hl") {
$state_distant = HL_distant::findState($tags, $next_speed_distant, $main_distance);
}
}
if (!isset($tags["railway:signal:main"]) && !isset($tags["railway:signal:combined"]) && !isset($tags["railway:signal:distant"]) && !isset($tags["railway:signal:speed"]) && !isset($tags["railway:signal:speed_distant"]) && !(isset($tags["railway:signal:train_protection:type"]) && $tags["railway:signal:train_protection:type"] == "block_marker")) {
return;
}
$result = "\n\t\t\t<tr>\n\t\t\t\t<td> km " . round($distance, 2) . "</td>\n\t\t\t\t<td> ";
//write query for svg file
$get = "?";
$get_ref = $get_position = false;
foreach ($tags as $k => $v) {
if ($k == "railway:signal:main" || $k == "railway:signal:main:states" || $k == "railway:signal:main:substitute_signal" || $k == "railway:signal:main:form" || $k == "railway:signal:combined" || $k == "railway:signal:combined:states" || $k == "railway:signal:combined:substitute_signal" || $k == "railway:signal:combined:shortened" || $k == "railway:signal:combined:form" || $k == "railway:signal:distant" || $k == "railway:signal:distant:states" || $k == "railway:signal:distant:repeated" || $k == "railway:signal:distant:form" || $k == "railway:signal:distant:shortened" || $k == "railway:signal:speed_limit" || $k == "railway:signal:speed_limit:form" || $k == "railway:signal:speed_limit:speed" || $k == "railway:signal:speed_limit_distant" || $k == "railway:signal:speed_limit_distant:form" || $k == "railway:signal:speed_limit_distant:speed" || $k == "railway:signal:train_protection" || $k == "railway:signal:minor") {
$get .= urlencode($k) . "=" . urlencode($v) . "&";
}
// ref only needed for train_protection sign "blockkennzeichen"
if ($k == "ref") {
$ref = $v;
}
if ($k == "railway:signal:train_protection" && $v == "DE-ESO:blockkennzeichen") {
$get_ref = true;
}
// position only needed for train_protection sign "ETCS marker board"
if ($k == "railway:signal:position") {
$position = $v;
}
if ($k == "railway:signal:train_protection" && $v == "DE-ESO:ne14") {
$get_position = true;
}
}
if ($get_ref && isset($ref)) {
$get .= "ref=" . urlencode($ref) . "&";
}
if ($get_position && isset($position)) {
$get .= "railway:signal:position=" . urlencode($position) . "&";
//.........这里部分代码省略.........
示例7: define
// define path to home directory
define("PATH", "");
//define version numbers of external software
$v_bootstrap = "3.3.4";
$v_leaflet = "0.7.3";
$v_jquery = "1.11.2";
// load language
Lang::defineLanguage();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name="description" content="<?php
echo Lang::l_('Analysis of Train Routes Based on OpenStreetMap Data');
?>
">
<!-- include leaflet -->
<script src="http://cdn.leafletjs.com/leaflet-<?php
echo $v_leaflet;
?>
/leaflet.js"></script>
<!-- include bootstrap -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/<?php
echo $v_bootstrap;
?>
/css/bootstrap.min.css">
示例8: changeTrain
/**
* generates form to change the train
*/
static function changeTrain($trainref = "", $train_def = "", $formid = "train")
{
include "train_details.php";
$type = "";
?>
<select name="train" style="max-width:100%" id="<?php
echo $formid;
?>
" required>
<option<?php
if (!$trainref) {
?>
selected="selected"<?php
}
?>
value=""><?php
echo Lang::l_('Please choose a train');
?>
</option>
<?php
foreach ($tr_name as $ref => $name) {
if ($tr_type[$ref] != $type) {
if ($type) {
?>
</optgroup>
<?php
}
?>
<optgroup label="<?php
echo Lang::l_(self::$train_type[$tr_type[$ref]]);
?>
">
<?php
$type = $tr_type[$ref];
}
?>
<option <?php
if ($ref == $trainref) {
echo 'selected="selected"';
}
?>
<?php
if ($ref == $train_def) {
echo 'class="bg-info"';
}
?>
value="<?php
echo $ref;
?>
"><?php
echo $name;
?>
</option>
<?php
}
?>
</optgroup>
</select>
<?php
}