';
foreach ($data as $obj)
{
$html .= '
';
$k = $obj->$optKey;
$t = $translate ? Text::_($obj->$optText) : $obj->$optText;
$id = (isset($obj->id) ? $obj->id : null);
$extra = '';
$id = $id ? $obj->id : $id_text . $k;
if (is_array($selected))
{
foreach ($selected as $val)
{
$k2 = is_object($val) ? $val->$optKey : $val;
if ($k == $k2)
{
$extra .= ' selected="selected" ';
break;
}
}
}
else
{
$extra .= ((string) $k === (string) $selected ? ' checked="checked" ' : '');
}
$html .= '';
$html .= '';
$html .= '
';
}
$html .= '
';
return $html;
}
}