Current File : /home/pacjaorg/public_html/km/components/com_djclassifieds/layouts/selectcategory.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;
$cats = $displayData['cats'];
$cl = $displayData['cl'];
$cat_id = $displayData['cat_id'];
$show_paid = $displayData['show_paid'];
$show_price = $displayData['show_price'];
$parent_cat = $displayData['parent_cat'];
$par = $displayData['par'];
echo '<select autocomplete="off" class="cat_sel '.$cl.'" name="cats[]" id="cat_'.$cat_id.'" onchange="new_cat('.$cat_id.',this.value,new Array());getFields(this.value);">';
echo '<option value="'.($cat_id ? 'p'.$cat_id : '').'">'.($cat_id ? JText::sprintf((!empty($parent_cat->header_text) ? $parent_cat->header_text : 'COM_DJCLASSIFIEDS_CATEGORY_SELECTOR_EMPTY_VALUE'), JText::_($parent_cat->name)) : JText::_('COM_DJCLASSIFIEDS_PLEASE_SELECT_CATEGORY')).'</option>';
foreach($cats as $cat){
if($cat->parent_id != $cat_id){
continue;
}
$cat->name = JText::_($cat->name);
$pricetext = DJClassifiedsPayment::getPriceText($cat->price/100, $cat->points, $par);
if($pricetext){
if(!$show_paid){
continue;
}
if($show_price){
$cat->name .= ' ('.$pricetext.')';
}
}
echo '<option value="'.$cat->id.'"'.(!empty($cat->disable) ? ' disabled': '').'>'.str_ireplace("'", "'", $cat->name).'</option>';
}
echo '</select>';
echo '<div class="clear_both"></div>';
?>