openlayers-plus-legend.tpl.php 675 B

12345678910111213141516171819
  1. <?php
  2. // $Id$
  3. /**
  4. * @param $layer_id The layer's id
  5. * @param $layer layer array
  6. * @param $legend an array of legend items
  7. */
  8. ?>
  9. <div class='legend legend-count-<?php print count($legend) ?> clear-block' id='openlayers-legend-<?php print $layer_id ?>'>
  10. <?php if (!empty($layer['title'])): ?>
  11. <h2 class='legend-title'><?php print check_plain($layer['title']) ?></h2>
  12. <?php endif; ?>
  13. <?php foreach ($legend as $key => $item): ?>
  14. <div class='legend-item clear-block'>
  15. <span class='swatch' style='background-color:<?php print check_plain($item['color']) ?>'></span>
  16. <?php print check_plain($item['title']) ?>
  17. </div>
  18. <?php endforeach; ?>
  19. </div>