Ejemplo n.º 1
0
 protected function getInput()
 {
     // JFormFieldUsergroup generates the value as an object e.g: (object(JObject)#247 (4) { ["_errors"rotected]=> array(0) {} [0] => 12, [1] => ,18)
     // we force the value to be an array
     $this->value = is_array($this->value) ? $this->value : explode(',', $this->value);
     $input = parent::getInput();
     if ($groups = self::getAdminGroups()) {
         $replacements = array();
         foreach ($groups as $group) {
             $replacements['value="' . $group . '"'] = 'value="" disabled="disabled"';
         }
         $input = str_replace(array_keys($replacements), array_values($replacements), $input);
     }
     return $input;
 }