Beispiel #1
0
function lamtech_preprocess_node(&$vars)
{
    // kpr($vars);
    if (isset($vars['content']['field_category']) && count($vars['content']['field_category'])) {
        $vars['category'] = $vars['content']['field_category'][0];
        unset($vars['content']['field_category']);
    }
    $helper = NULL;
    switch ($vars['type']) {
        case 'cta':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/cta/CTA.php';
            $helper = new CTA();
            $helper->preprocess($vars);
            break;
        case 'features_intro':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/fi/FeaturesIntro.php';
            $helper = new FeaturesIntro();
            $helper->preprocess($vars);
            break;
        case 'gallery':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/gallery/Gallery.php';
            $helper = new Gallery();
            $helper->preprocess($vars);
            break;
        case 'testimonials':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/testimonials/Testimonials.php';
            $helper = new Testimonials();
            $helper->preprocess($vars);
            break;
        case 'hero':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/hero/Hero.php';
            $helper = new Hero();
            $helper->preprocess($vars);
            break;
        case 'team':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/team/Team.php';
            $helper = new Team();
            $helper->preprocess($vars);
            break;
        case 'statistic':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/statistic/Statistic.php';
            $helper = new Statistic();
            $helper->preprocess($vars);
            break;
        case 'contact_info':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/contact-info/ContactInfo.php';
            $helper = new ContactInfo();
            $helper->preprocess($vars);
            break;
        case 'advanced_page':
            unset($vars['content']['field_hide_title']);
            break;
    }
    // kpr($vars);
}
<?php

require "cta.class.php";
new CTA();
$stops = json_decode(CTA::get_stops());
?>
<ul id="stops_" title="Stops">
<?php 
if (is_array($stops->items)) {
    foreach ($stops->items as $item) {
        ?>
		<li><a href="/app/get_eta.php?route=<?php 
        echo $item->route_id;
        ?>
&direction=<?php 
        echo $item->direction;
        ?>
&stop=<?php 
        echo $item->stop;
        ?>
&id=<?php 
        echo $item->id;
        ?>
"><?php 
        echo $item->name;
        ?>
</a></li>
<?php 
    }
}
?>
<?php

require "cta.class.php";
new CTA();
$directions = json_decode(CTA::get_direction());
print_r($directions);
?>
<ul id="route_<?php 
echo sha1($directions->route_id);
?>
" title="Route <?php 
echo $directions->route_id;
?>
">

<?php 
if (is_array($directions->items)) {
    foreach ($directions->items as $item) {
        ?>
		<li><a href="/app/get_stops.php?route=<?php 
        echo $item->route_id;
        ?>
&direction=<?php 
        echo $item->slug;
        ?>
"><?php 
        echo $item->name;
        ?>
</a></li>
<?php 
    }
Beispiel #4
0
<?php

require "cta.class.php";
new CTA();
$routes = json_decode(CTA::index());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CTA Bus Tracker</title>

<link rel="apple-touch-icon" href="/icon.png" /> 


<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<style type="text/css" media="screen">@import "/app/iui/iui.css?<?php 
echo filemtime($_SERVER['DOCUMENT_ROOT'] . "/app/iui/iui.css");
?>
";</style>
<script type="application/x-javascript" src="/app/iui/iui.js?<?php 
echo filemtime($_SERVER['DOCUMENT_ROOT'] . "/app/iui/iui.js");
?>
"></script>
</head>

<body>
    <div class="toolbar">
        <h1 id="pageTitle"></h1>
        <a id="backButton" class="button" href="#"></a>
Beispiel #5
0
<?php

require "cta.class.php";
new CTA();
$_ = CTA::get_eta();
//print_r($_);
?>
<div id="eta_<?php 
echo sha1($_GET['route'] . $_GET['direction'] . $_GET['stop'] . $_GET['id']);
?>
" title="<?php 
echo $_['title'];
?>
" class="panel">

	<h2>Currently</h2>
	
	<fieldset>
		<div class="row">
			<label><?php 
echo str_replace('°', "&deg;", $_['currently']);
?>
</label>
		</div>
	
	</fieldset>

<?php 
if (is_array($_['etas'])) {
    ?>
Beispiel #6
0
<?php

require "cta.class.php";
new CTA();
$_ = CTA::build_map_for_route($_GET['route'], $_GET['bus']);
?>
<div id="map_<?php 
echo sha1($_GET['route'] . $_GET['bus']);
?>
" title="Map" class="panel">
	
<?php 
if ($_['map_uri']) {
    ?>
	<div style="background: #f60; background: url(/iui/map_load.gif) no-repeat 50% 50%; width: 302px; height: 352px;"><div style="-webkit-border-radius: 10px; border: 1px solid #b4b4b4; background: url('<?php 
    echo $_['map_uri'];
    ?>
'); width: 300px; height: 350px;"></div></div>

<?php 
    if (is_array($_['plot'])) {
        ?>
	<br />
	<a class="whiteButton" href="http://maps.google.com/maps?f=q&hl=en&geocode=&q=<?php 
        echo $_['plot']['latitude'] . "," . $_['plot']['longitude'];
        ?>
">Plot on Maps</a>
	<br /><br />
<?php 
    }
    ?>