| @@ 168-179 (lines=12) @@ | ||
| 165 | * @param string $preset (optional) |
|
| 166 | * @return string |
|
| 167 | */ |
|
| 168 | public function dropdown_add($class, $name, $name2, $rel, array $options, $textmore, $selected = null, $preset = null) |
|
| 169 | { |
|
| 170 | $dropdown = '<span id="' . $name . '"><input type="text" name="' . $name2 . '[]" value="' . $preset . '">'; |
|
| 171 | $dropdown .= '<select class="smallworld_select" name="' . $name . '[]" id="' . $name . '">' . '<br>'; |
|
| 172 | foreach ($options as $key => $option) { |
|
| 173 | $select = $selected == $key ? ' selected' : null; |
|
| 174 | $dropdown .= '<option value="' . $key . '"' . $select . '>' . $option . '</option>' . '<br>'; |
|
| 175 | } |
|
| 176 | $dropdown .= '</select></span>'; |
|
| 177 | ||
| 178 | return $dropdown; |
|
| 179 | } |
|
| 180 | ||
| 181 | /** |
|
| 182 | * @param string $class |
|
| @@ 131-141 (lines=11) @@ | ||
| 128 | * @param string $preset (optional) |
|
| 129 | * @return as|string |
|
| 130 | */ |
|
| 131 | public function dropdown_add($class, $name, $name2, $rel, array $options, $textmore, $selected = null, $preset = null) |
|
| 132 | { |
|
| 133 | $dropdown = '<span id="' . $name . '"><input type="text" name="' . $name2 . '[]" value="' . $preset . '">'; |
|
| 134 | $dropdown .= '<select class="smallworld_select" name="' . $name . '[]" id="' . $name . '"></p>' . '<br>'; |
|
| 135 | foreach ($options as $key => $option) { |
|
| 136 | $select = $selected == $key ? ' selected' : null; |
|
| 137 | $dropdown .= '<option value="' . $key . '"' . $select . '>' . $option . '</option>' . '<br>'; |
|
| 138 | } |
|
| 139 | $dropdown .= '</select></span>'; |
|
| 140 | return $dropdown; |
|
| 141 | } |
|
| 142 | ||
| 143 | /** |
|
| 144 | * |
|