element['context']; $states = $this->element['state'] ?: '0,1'; $states = ArrayHelper::toInteger(explode(',', $states)); $user = JFactory::getUser(); $viewlevels = ArrayHelper::toInteger($user->getAuthorisedViewLevels()); $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('title AS text, id AS value, state'); $query->from('#__fields_groups'); $query->where('state IN (' . implode(',', $states) . ')'); $query->where('context = ' . $db->quote($context)); $query->where('access IN (' . implode(',', $viewlevels) . ')'); $query->order('ordering asc, id asc'); $db->setQuery($query); $options = $db->loadObjectList(); foreach ($options AS $option) { if ($option->state == 0) { $option->text = '[' . $option->text . ']'; } if ($option->state == 2) { $option->text = '{' . $option->text . '}'; } } return array_merge(parent::getOptions(), $options); } }