original_string: public function validation($data, $files) {
  
          $pluginman = core_plugin_manager::instance();
          $errors = parent::validation($data, $files);
  
          if (!empty($data['plugintype'])) {
              if (!$pluginman->is_plugintype_writable($data['plugintype'])) {
                  $path = $pluginman->get_plugintype_root($data['plugintype']);
                  $errors['plugintype'] = get_string('permcheckresultno', 'tool_installaddon', array('path' => $path));
              }
          }
  
          return $errors;
      }
code: public function validation($data, $files) {
  
          $pluginman = core_plugin_manager::instance();
          $errors = parent::validation($data, $files);
  
          if (!empty($data['plugintype'])) {
              if (!$pluginman->is_plugintype_writable($data['plugintype'])) {
                  $path = $pluginman->get_plugintype_root($data['plugintype']);
                  $errors['plugintype'] = get_string('permcheckresultno', 'tool_installaddon', array('path' => $path));
              }
          }
  
          return $errors;
      }
code_tokens: public function validation ( $ data , $ files ) { $ pluginman = core_plugin_manager :: instance ( ) ; $ errors = parent :: validation ( $ data , $ files ) ; if ( ! empty ( $ data [ 'plugintype' ] ) ) { if ( ! $ pluginman -> is_plugintype_writable ( $ data [ 'plugintype' ] ) ) { $ path = $ pluginman -> get_plugintype_root ( $ data [ 'plugintype' ] ) ; $ errors [ 'plugintype' ] = get_string ( 'permcheckresultno' , 'tool_installaddon' , array ( 'path' => $ path ) ) ; } } return $ errors ; }
docstring: Validate the form fields
  
  @param array $data
  @param array $files
  @return array (string)field name => (string)validation error text
docstring_tokens: Validate the form fields