--- a/include/common-template.inc.php +++ b/include/common-template.inc.php @@ -42,7 +42,7 @@ } function include_header($pageTitle, $pageType, $opendiv = true, $geolocate = false, $datepicker = false) { - global $basePath, $serviceAlertsEnabled; + global $basePath, $GTFSREnabled; echo ' <!DOCTYPE html> <html lang="en"> @@ -54,14 +54,15 @@ <link rel="dns-prefetch" href="//code.jquery.com"> <link rel="dns-prefetch" href="//ajax.googleapis.com"> <link rel="stylesheet" href="' . $basePath . 'css/jquery-ui-1.8.12.custom.css" />'; + $jqmVersion = "1.0rc1"; if (isDebugServer()) { - $jqmcss = $basePath . 'css/jquery.mobile-1.0b3.css'; - $jqjs = $basePath . 'js/jquery-1.6.2.min.js'; - $jqmjs = $basePath . 'js/jquery.mobile-1.0b3.js'; + $jqmcss = $basePath . "css/jquery.mobile-$jqmVersion.css"; + $jqjs = $basePath . "js/jquery-1.6.2.min.js"; + $jqmjs = $basePath . "js/jquery.mobile-$jqmVersion.js"; } else { - $jqmcss = "//code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.css"; + $jqmcss = "//code.jquery.com/mobile/$jqmVersion/jquery.mobile-$jqmVersion.min.css"; $jqjs = "//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"; - $jqmjs = "//code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.js"; + $jqmjs = "//code.jquery.com/mobile/$jqmVersion/jquery.mobile-$jqmVersion.min.js"; } echo '<link rel="stylesheet" href="' . $jqmcss . '" /> <script src="' . $jqjs . '"></script> @@ -103,7 +104,7 @@ }'; echo '</style>'; echo '<link rel="stylesheet" href="' . $basePath . 'css/local.css.php" />'; - if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) { + if (isIOSDevice()){ echo '<meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black" /> <link rel="apple-touch-startup-image" href="startup.png" /> @@ -179,9 +180,11 @@ } if ($GTFSREnabled) { $serviceAlerts = getServiceAlertsAsArray("agency", "0"); - foreach ($serviceAlerts['entity'] as $entity) { - echo "<div id='servicewarning'>" . 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']}<br>Warning: {$entity['alert']['description_text']['translation'][0]['text']} - <br><a href='{$entity['alert']['url']['translation'][0]['text']}'>Source</a> </div>"; + if (isset($serviceAlerts['entity']) && sizeof($serviceAlerts['entity']) > 0) { + foreach ($serviceAlerts['entity'] as $entity) { + echo "<div id='servicewarning'>" . 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']}<br>Warning: {$entity['alert']['description_text']['translation'][0]['text']} + <br><a href='{$entity['alert']['url']['translation'][0]['text']}'>Source</a> </div>"; + } } } }