• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

ACP Option UsergroupChooser

R

ragtek

Guest
#1
I'm having a very strange problem.

I've created a new Option for the groups
Code:
PHP:
   public static function renderSelect(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
    {
    $return = '';
        $preparedOption['option_value'] = 3;
        $groupsArray = array (3,2);
        foreach ($groupsArray AS $group){

            $preparedOption['option_value'] = $group;
            $return .= self::_render('option_list_option_select', $view, $fieldPrefix, $preparedOption, $canEdit);
        }
        return $return;
    }

    protected static function _render($templateName, XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
    {
        $preparedOption['formatParams'] = self::getUserGroupOptions(
            $preparedOption['option_value']
            );
        return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal(
            $templateName, $view, $fieldPrefix, $preparedOption, $canEdit
        );
    }
When i call it, i get the 2 group select boxes but the selected option isn't working.
I checked the code and the "selected group" should be selected (check the screenshot), but it's always the first group selected.
 

Attachments