You are here

weather.tpl.php in Weather 7

Same filename and directory in other branches
  1. 6.5 weather.tpl.php
  2. 7.3 weather.tpl.php
  3. 7.2 weather.tpl.php

Template for the weather module.

File

weather.tpl.php
View source
<?php

/**
 * @file
 * Template for the weather module.
 */
?>
<div class="weather">
  <p><strong><?php

print $weather->real_name;
?></strong></p>
  <div style="text-align:center;">
    <?php

print $weather->image;
?>
  </div>
  <ul>
    <li><?php

print $weather->condition;
?></li>
    <?php

if (isset($weather->temperature)) {
  ?>
      <?php

  if (isset($weather->apparent_temperature)) {
    ?>
        <li><?php

    print t("Temperature: !temperature1, feels like !temperature2", array(
      '!temperature1' => $weather->temperature,
      '!temperature2' => $weather->apparent_temperature,
    ));
    ?></li>
      <?php

  }
  else {
    ?>
        <li><?php

    print t("Temperature: !temperature", array(
      '!temperature' => $weather->temperature,
    ));
    ?></li>
      <?php

  }
  ?>
    <?php

}
?>
    <?php

if (isset($weather->wind)) {
  ?>
      <li><?php

  print t('Wind: !wind', array(
    '!wind' => $weather->wind,
  ));
  ?></li>
    <?php

}
?>
    <?php

if (isset($weather->pressure)) {
  ?>
      <li><?php

  print t('Pressure: !pressure', array(
    '!pressure' => $weather->pressure,
  ));
  ?></li>
    <?php

}
?>
    <?php

if (isset($weather->rel_humidity)) {
  ?>
      <li><?php

  print t('Rel. Humidity: !rel_humidity', array(
    '!rel_humidity' => $weather->rel_humidity,
  ));
  ?></li>
    <?php

}
?>
    <?php

if (isset($weather->visibility)) {
  ?>
      <li><?php

  print t('Visibility: !visibility', array(
    '!visibility' => $weather->visibility,
  ));
  ?></li>
    <?php

}
?>
    <?php

if (isset($weather->sunrise)) {
  ?>
      <li><?php

  print $weather->sunrise;
  ?></li>
    <?php

}
?>
    <?php

if (isset($weather->sunset)) {
  ?>
      <li><?php

  print $weather->sunset;
  ?></li>
    <?php

}
?>
    <?php

if (isset($weather->metar)) {
  ?>
      <li><?php

  print t('METAR data: !metar', array(
    '!metar' => '<pre>' . wordwrap($weather->metar, 20) . '</pre>',
  ));
  ?></li>
    <?php

}
?>
  </ul>
  <?php

if (isset($weather->station)) {
  ?>
    <small>
      <?php

  print t('Location of this weather station:');
  ?><br />
      <?php

  print $weather->station;
  ?>
    </small>
    <br />
  <?php

}
?>
  <?php

if (isset($weather->reported_on)) {
  ?>
    <small>
      <?php

  print t('Reported on:');
  ?><br />
      <?php

  print $weather->reported_on;
  ?>
    </small>
  <?php

}
?>
</div>