You are here

function form_select in TinyBrowser 7

4 calls to form_select()
edit.php in tinybrowser/edit.php
folders.php in tinybrowser/folders.php
tinybrowser.php in tinybrowser/tinybrowser.php
upload.php in tinybrowser/upload.php

File

tinybrowser/fns_tinybrowser.php, line 234

Code

function form_select($options, $name, $label, $current, $auto) {
  if ($label) {
    ?><label for="<?php

    echo $name;
    ?>"><?php

    echo $label;
    ?></label><?php

  }
  ?><select name="<?php

  echo $name;
  ?>" <?php

  if ($auto) {
    ?>onchange="this.form.submit();"<?php

  }
  ?>>
<?php

  $loopnum = count($options);
  for ($i = 0; $i < $loopnum; $i++) {
    $selected = $options[$i][0] == $current ? ' selected' : '';
    echo '<option value="' . $options[$i][0] . '"' . $selected . '>' . $options[$i][1] . '</option>';
  }
  ?></select><?php

}