<?php

$metros = MetroStations::getMetrosArray(isset($this->selectedCity) ? $this->selectedCity : '', 0, 0, 0);

?>
<div <?php echo ($divClass) ? 'class="' . $divClass . '' : ''; ?> id="metro-block" style="display: <?= $metros ? 'block' : 'none'; ?>; ">
    <div class="<?php echo $formgroup; ?>">
        <?php $opacityClass = ((!isset($this->selectedMetroStations) || empty($this->selectedMetroStations)) && empty($metros)) ? ' less-opacity-control' : ''; ?>

        <div class="<?php echo $controlClass; ?> <?php echo $opacityClass; ?>">
            <?php if ($this->searchShowLabel) { ?>
                <div class="<?php echo $textClass; ?>"><?php echo Yii::t('common', 'Subway stations') ?>:</div>
            <?php } ?>
            <?php
            echo CHtml::dropDownList('metro[]', isset($this->selectedMetroStations) ? $this->selectedMetroStations : '', $metros, array('id' => 'metro', 'class' => ' searchField', 'multiple' => 'multiple')
            );
            echo "<script>$('#metro').SumoSelect({captionFormat: '" . tc('{0} Selected') . "', selectAlltext: '" . tc('check all') . "', csvDispCount:1, placeholder: '" . tt('Select metro stations', 'metroStations') . "', filter: true, filterText: '" . tc('enter initial letters') . "'});</script>";

            ?>
        </div>
    </div>
</div>