Elgg  Version 2.3
dropdown.php
Go to the documentation of this file.
1 <?php
13 $class = "elgg-input-dropdown";
14 
15 ?>
16 <select name="<?php echo $vars['name']; ?>" class="<?php echo $class; ?>">
17 <?php
18 if (isset($vars['options_values'])) {
19  foreach ($vars['options_values'] as $value => $option) {
20  if ($value != $vars['value']) {
21  echo "<option value=\"$value\">{$option}</option>";
22  } else {
23  echo "<option value=\"$value\" selected=\"selected\">{$option}</option>";
24  }
25  }
26 } else {
27  foreach ($vars['options'] as $option) {
28  if ($option != $vars['value']) {
29  echo "<option>{$option}</option>";
30  } else {
31  echo "<option selected=\"selected\">{$option}</option>";
32  }
33  }
34 }
35 ?>
36 </select>
$value
Definition: longtext.php:42
$vars['entity']
elgg echo
Translates a string.
Definition: languages.js:48
select
Definition: admin.css.php:528
$site name
$class
Elgg dropdown input Displays a dropdown input field.
Definition: dropdown.php:13