original_string: protected function add_plugin_settings(assign_plugin $plugin, MoodleQuickForm $mform, & $pluginsenabled) {
          global $CFG;
          if ($plugin->is_visible() && !$plugin->is_configurable() && $plugin->is_enabled()) {
              $name = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled';
              $pluginsenabled[] = $mform->createElement('hidden', $name, 1);
              $mform->setType($name, PARAM_BOOL);
              $plugin->get_settings($mform);
          } else if ($plugin->is_visible() && $plugin->is_configurable()) {
              $name = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled';
              $label = $plugin->get_name();
              $pluginsenabled[] = $mform->createElement('checkbox', $name, '', $label);
              $helpicon = $this->get_renderer()->help_icon('enabled', $plugin->get_subtype() . '_' . $plugin->get_type());
              $pluginsenabled[] = $mform->createElement('static', '', '', $helpicon);
  
              $default = get_config($plugin->get_subtype() . '_' . $plugin->get_type(), 'default');
              if ($plugin->get_config('enabled') !== false) {
                  $default = $plugin->is_enabled();
              }
              $mform->setDefault($plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled', $default);
  
              $plugin->get_settings($mform);
  
          }
      }
code: protected function add_plugin_settings(assign_plugin $plugin, MoodleQuickForm $mform, & $pluginsenabled) {
          global $CFG;
          if ($plugin->is_visible() && !$plugin->is_configurable() && $plugin->is_enabled()) {
              $name = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled';
              $pluginsenabled[] = $mform->createElement('hidden', $name, 1);
              $mform->setType($name, PARAM_BOOL);
              $plugin->get_settings($mform);
          } else if ($plugin->is_visible() && $plugin->is_configurable()) {
              $name = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled';
              $label = $plugin->get_name();
              $pluginsenabled[] = $mform->createElement('checkbox', $name, '', $label);
              $helpicon = $this->get_renderer()->help_icon('enabled', $plugin->get_subtype() . '_' . $plugin->get_type());
              $pluginsenabled[] = $mform->createElement('static', '', '', $helpicon);
  
              $default = get_config($plugin->get_subtype() . '_' . $plugin->get_type(), 'default');
              if ($plugin->get_config('enabled') !== false) {
                  $default = $plugin->is_enabled();
              }
              $mform->setDefault($plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled', $default);
  
              $plugin->get_settings($mform);
  
          }
      }
code_tokens: protected function add_plugin_settings ( assign_plugin $ plugin , MoodleQuickForm $ mform , & $ pluginsenabled ) { global $ CFG ; if ( $ plugin -> is_visible ( ) && ! $ plugin -> is_configurable ( ) && $ plugin -> is_enabled ( ) ) { $ name = $ plugin -> get_subtype ( ) . '_' . $ plugin -> get_type ( ) . '_enabled' ; $ pluginsenabled [ ] = $ mform -> createElement ( 'hidden' , $ name , 1 ) ; $ mform -> setType ( $ name , PARAM_BOOL ) ; $ plugin -> get_settings ( $ mform ) ; } else if ( $ plugin -> is_visible ( ) && $ plugin -> is_configurable ( ) ) { $ name = $ plugin -> get_subtype ( ) . '_' . $ plugin -> get_type ( ) . '_enabled' ; $ label = $ plugin -> get_name ( ) ; $ pluginsenabled [ ] = $ mform -> createElement ( 'checkbox' , $ name , '' , $ label ) ; $ helpicon = $ this -> get_renderer ( ) -> help_icon ( 'enabled' , $ plugin -> get_subtype ( ) . '_' . $ plugin -> get_type ( ) ) ; $ pluginsenabled [ ] = $ mform -> createElement ( 'static' , '' , '' , $ helpicon ) ; $ default = get_config ( $ plugin -> get_subtype ( ) . '_' . $ plugin -> get_type ( ) , 'default' ) ; if ( $ plugin -> get_config ( 'enabled' ) !== false ) { $ default = $ plugin -> is_enabled ( ) ; } $ mform -> setDefault ( $ plugin -> get_subtype ( ) . '_' . $ plugin -> get_type ( ) . '_enabled' , $ default ) ; $ plugin -> get_settings ( $ mform ) ; } }
docstring: Add one plugins settings to edit plugin form.
  
  @param assign_plugin $plugin The plugin to add the settings from
  @param MoodleQuickForm $mform The form to add the configuration settings to.
  This form is modified directly (not returned).
  @param array $pluginsenabled A list of form elements to be added to a group.
  The new element is added to this array by this function.
  @return void
docstring_tokens: Add one plugins settings to edit plugin form .