| Current Path : /var/www/iplanru/data/www/iplan.5018.vps.agava.net/modules/mod_workfilter/ |
| Current File : /var/www/iplanru/data/www/iplan.5018.vps.agava.net/modules/mod_workfilter/helper.php |
<?php
// No direct access
defined( '_JEXEC' ) or die;
/**
* Class Module Helper
* @author kirdinyuri
*/
class modWorkfilterHelper
{
/**
* getData method
* @param $params
* @return array
*/
static function getCat( $cat,$name,$level ,$wfcat )
{
$m=array();
$selected="";
if ($cat==$wfcat) {$selected="selected";}
$level_separator=str_repeat("--", $level);
$m[]="<option {$selected} value=\"{$cat}\">{$level_separator}{$name}</option>";
$db = JFactory::getDbo();
$list = $db->setQuery(" SELECT id,name
FROM #__zoo_category
where
parent=\"{$cat}\"
and published=1
order by id")->loadObjectList();
foreach($list as $row)
{
$m = array_merge($m, modWorkfilterHelper::getCat($row->id, $row->name, $level+1,$wfcat ));
}
return $m;
}
}