--- a/include/common-template.inc.php
+++ b/include/common-template.inc.php
@@ -1,4 +1,20 @@
@@ -38,14 +54,19 @@
';
+ $jqmVersion = "1.0";
if (isDebugServer()) {
- $jqmcss = $basePath . 'css/jquery.mobile-1.0b2.css';
- $jqjs = $basePath . 'js/jquery-1.6.2.min.js';
- $jqmjs = $basePath . 'js/jquery.mobile-1.0b2.js';
+ $jqmcss = $basePath . "css/jquery.mobile-$jqmVersion.css";
+ $jqjs = $basePath . "js/jquery-1.6.4.min.js";
+ $jqmjs = $basePath . "js/jquery.mobile-$jqmVersion.js";
+
+ $jqmcss = $basePath . "css/jquery.mobile-b90eab4935.css";
+ $jqmjs = $basePath . "js/jquery.mobile-b90eab4935.js";
} else {
- $jqmcss = "//code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.css";
- $jqjs = "//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js";
- $jqmjs = "//code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.js";
+ $jqmcss = "//code.jquery.com/mobile/$jqmVersion/jquery.mobile-$jqmVersion.min.css";
+ $jqjs = "//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js";
+ $jqmjs = "//code.jquery.com/mobile/$jqmVersion/jquery.mobile-$jqmVersion.min.js";
+
}
echo '
@@ -87,7 +108,7 @@
}';
echo '';
echo '';
- if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
+ if (isIOSDevice()){
echo '
@@ -152,6 +173,7 @@
';
+ if ($GTFSREnabled) {
$overrides = getServiceOverride();
if ($overrides['service_id']) {
if ($overrides['service_id'] == "noservice") {
@@ -161,11 +183,12 @@
echo '
';
}
}
- if ($GTFSREnabled) {
$serviceAlerts = getServiceAlertsAsArray("agency", "0");
- foreach ($serviceAlerts['entity'] as $entity) {
- echo "
" . date("F j, g:i a", strtotime($entity['alert']['active_period'][0]['start'])) . " to " . date("F j, g:i a", strtotime($entity['alert']['active_period'][0]['end'])) . "{$entity['alert']['header_text']['translation'][0]['text']}
Warning: {$entity['alert']['description_text']['translation'][0]['text']}
-
Source ";
+ if (isset($serviceAlerts['entity']) && sizeof($serviceAlerts['entity']) > 0) {
+ foreach ($serviceAlerts['entity'] as $entity) {
+ echo "
" . date("F j, g:i a", strtotime($entity['alert']['active_period'][0]['start'])) . " to " . date("F j, g:i a", strtotime($entity['alert']['active_period'][0]['end'])) . "{$entity['alert']['header_text']['translation'][0]['text']}
Warning: {$entity['alert']['description_text']['translation'][0]['text']}
+
Source ";
+ }
}
}
}
@@ -222,5 +245,36 @@
}
}
+//stop list collapsing
+function stopCompare($stopName) {
+ return substr(trim(preg_replace("/\(Platform.*/", "", $stopName)),0,9);
+}
+function stopGroupTitle($stopName,$stopdesc) {
+ if (preg_match("/Dr |Cct |Cir |Av |St |Cr |Parade |Way |Bank /",$stopName)) {
+ $descParts = explode("
",$stopdesc);
+ return trim(str_replace("Street: ","",$descParts[0]));
+ } else {
+ return trim(preg_replace("/\(Platform.*/", "",$stopName));
+ }
+}
+
+function viaPointNames($tripid, $stop_sequence = "") {
+ $viaPointNames = Array();
+ foreach (viaPoints($tripid, $stop_sequence) as $point) {
+ if (strstr($point['stop_name'], "Station")
+ || strstr($point['stop_name'], "Shops")
+ || strstr($point['stop_name'], "CIT")
+ || strstr($point['stop_name'], "School")
+ || strstr($point['stop_name'], "University")
+ ) {
+ $viaPointNames[] = $point['stop_name'];
+ }
+ }
+ if (sizeof($viaPointNames) > 0) {
+ return r_implode(", ", $viaPointNames);
+ } else {
+ return "";
+ }
+}
?>