original_string: public function validation($data, $files) {
          global $DB;
  
          $errors = array();
          if ($DB->count_records('portfolio_instance', array('name' => $data['name'], 'plugin' => $data['plugin'])) > 1) {
              $errors = array('name' => get_string('err_uniquename', 'portfolio'));
          }
  
          $pluginerrors = array();
          $pluginerrors = portfolio_static_function($this->plugin, 'admin_config_validation', $data);
          if (is_array($pluginerrors)) {
              $errors = array_merge($errors, $pluginerrors);
          }
          return $errors;
      }
code: public function validation($data, $files) {
          global $DB;
  
          $errors = array();
          if ($DB->count_records('portfolio_instance', array('name' => $data['name'], 'plugin' => $data['plugin'])) > 1) {
              $errors = array('name' => get_string('err_uniquename', 'portfolio'));
          }
  
          $pluginerrors = array();
          $pluginerrors = portfolio_static_function($this->plugin, 'admin_config_validation', $data);
          if (is_array($pluginerrors)) {
              $errors = array_merge($errors, $pluginerrors);
          }
          return $errors;
      }
code_tokens: public function validation ( $ data , $ files ) { global $ DB ; $ errors = array ( ) ; if ( $ DB -> count_records ( 'portfolio_instance' , array ( 'name' => $ data [ 'name' ] , 'plugin' => $ data [ 'plugin' ] ) ) > 1 ) { $ errors = array ( 'name' => get_string ( 'err_uniquename' , 'portfolio' ) ) ; } $ pluginerrors = array ( ) ; $ pluginerrors = portfolio_static_function ( $ this -> plugin , 'admin_config_validation' , $ data ) ; if ( is_array ( $ pluginerrors ) ) { $ errors = array_merge ( $ errors , $ pluginerrors ) ; } return $ errors ; }
docstring: Validate admin config form
  
  @param stdObject $data form data
  @return array
docstring_tokens: Validate admin config form