Hide select town field when creating a new character if there is only one town to select.

This commit is contained in:
Znote 2015-11-03 20:21:10 +01:00
parent b4b3843abc
commit a29f3e93f5

View File

@ -128,6 +128,10 @@ if (isset($_GET['success']) && empty($_GET['success'])) {
<option value="0">Female(girl)</option> <option value="0">Female(girl)</option>
</select> </select>
</li> </li>
<?php
$available_towns = $config['available_towns'];
if (count($available_towns) > 1):
?>
<li> <li>
<!-- Available towns to select from when creating character --> <!-- Available towns to select from when creating character -->
Town:<br> Town:<br>
@ -138,6 +142,12 @@ if (isset($_GET['success']) && empty($_GET['success'])) {
</select> </select>
</li> </li>
<?php <?php
else:
?>
<input type="hidden" name="selected_town" value="<?php echo end($config['available_towns']); ?>">
<?php
endif;
/* Form file */ /* Form file */
Token::create(); Token::create();
?> ?>