dropdown.php 364 B

1234567891011121314151617
  1. <?php
  2. global $context;
  3. if(!($context instanceof Arguments)){
  4. $context = new Arguments($context);
  5. }
  6. ?>
  7. <select name="<?=$context->name?>">
  8. <?php
  9. foreach($context->options as $id => $desc){
  10. echo "<option value=\"{$id}\"";
  11. if(intval($id) == intval($context->value)){
  12. echo " selected=\"selected\"";
  13. }
  14. echo ">{$desc}</option>";
  15. }
  16. ?>
  17. </select>