Current File : /home/pacjaorg/public_html/km/components/com_djclassifieds/layouts/selectregion.php |
<?php
/**
* @package DJ-Classifieds
* @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
* @license http://www.gnu.org/licenses GNU/GPL
* @author url: http://dj-extensions.com
* @author email contact@dj-extensions.com
*/
defined('_JEXEC') or die;
$regions = $displayData['regions'];
$cl = $displayData['cl'];
$reg_id = $displayData['reg_id'];
$parent_reg = $displayData['parent_reg'];
$par = $displayData['par'];
echo '<select autocomplete="off" class="reg_sel '.$cl.'" name="regions[]" id="reg_'.$reg_id.'" onchange="new_reg('.$reg_id.',this.value,new Array());">';
echo '<option value="'.($reg_id ? '0' : ($par->get('regions_required','1') ? '' : '0')).'">'.($reg_id ? (JText::sprintf((!empty($parent_reg->header_text) ? $parent_reg->header_text : 'COM_DJCLASSIFIEDS_LOCATION_SELECTOR_EMPTY_VALUE'), JText::_($parent_reg->name))) : JText::_('COM_DJCLASSIFIEDS_SELECT_LOCALIZATION')).'</option>';
foreach($regions as $reg){
if($reg->parent_id != $reg_id){
continue;
}
echo '<option value="'.$reg->id.'" data-geoloc="'.(($reg->city || $reg->country) ? '1' : '0').'"'.(!empty($reg->country_iso) ? ' data-country-iso="'.$reg->country_iso.'"' : '').(!empty($reg->disable) ? ' disabled': '').'>'.str_ireplace("'", "'", JText::_($reg->name)).'</option>';
}
echo '</select>';
echo '<div class="clear_both"></div>';
?>