original_string: protected function set_flag_options($enabled, $default, $shortname, $displayname) {
          if (empty($this->flags[$shortname])) {
              $this->flags[$shortname] = new admin_setting_flag($enabled, $default, $shortname, $displayname);
          } else {
              $this->flags[$shortname]->set_options($enabled, $default);
          }
      }
code: protected function set_flag_options($enabled, $default, $shortname, $displayname) {
          if (empty($this->flags[$shortname])) {
              $this->flags[$shortname] = new admin_setting_flag($enabled, $default, $shortname, $displayname);
          } else {
              $this->flags[$shortname]->set_options($enabled, $default);
          }
      }
code_tokens: protected function set_flag_options ( $ enabled , $ default , $ shortname , $ displayname ) { if ( empty ( $ this -> flags [ $ shortname ] ) ) { $ this -> flags [ $ shortname ] = new admin_setting_flag ( $ enabled , $ default , $ shortname , $ displayname ) ; } else { $ this -> flags [ $ shortname ] -> set_options ( $ enabled , $ default ) ; } }
docstring: Generic function to add a flag to this admin setting.
  
  @param bool $enabled - One of self::OPTION_ENABLED or self::OPTION_DISABLED
  @param bool $default - The default for the flag
  @param string $shortname - The shortname for this flag. Used as a suffix for the setting name.
  @param string $displayname - The display name for this flag. Used as a label next to the checkbox.
docstring_tokens: Generic function to add a flag to this admin setting .