Joomla group access kodunu public static function altında kullanmaya çalışıyorum.
Hiçbir hata almıyorum ama sayfada da çağırdığım alan ile ilgili hiçbir görüntü gelmiyor.
Eklemeye çalıştığım kod şu
--------------------------------------------
$user = JFactory::getUser();
if ($user->get('Commercial') == 1) {
Kodun bulunduğu dosyanın tamamı şu şekilde
--------------------------------------------
public static function DisplayFieldsHtml_Div($flist)
{
if (!count($flist)) return NULL;
$html = '';
foreach ($flist as $f) {
$tooltip = '';
if ($f->field->help) $tooltip = JHtml::_('tooltip', $f->field->help, NULL, JUri::root() . 'components/com_rbids/images/tooltip.png');
$html .= '';
} else {
$html .= '">';
}
// Kodu burada kullanmaya çalışıyorum
$user = JFactory::getUser();
if ($user->get('Commercial') == 1)
{
if($f->field->css_class == 'commercialclass')
{
$html .= '' . JText::_($f->field->name) . '
' . $f->html . $tooltip;
if ($f->field->compulsory) {
$html .= ' ' . JHtml::image(JUri::root() . 'components/com_rbids/images/requiredfield.gif', 'Required');
}
$html .= '
';
}
}
}
$html .= '';
return $html;
}