original_string: public function validateSubmitValue($value) {
  
          if (!$this->allowall) {
              // Assert that there is an actual list provided.
              $normalized = $this->util->normalize_file_types($value['filetypes']);
              if (empty($normalized) || $normalized == ['*']) {
                  return get_string('filetypesnotall', 'core_form');
              }
          }
  
          if (!$this->allowunknown) {
              // Assert that all file types are known.
              $unknown = $this->util->get_unknown_file_types($value['filetypes']);
  
              if ($unknown) {
                  return get_string('filetypesunknown', 'core_form', implode(', ', $unknown));
              }
          }
  
          if ($this->onlytypes) {
              // Assert that all file types are allowed here.
              $notwhitelisted = $this->util->get_not_whitelisted($value['filetypes'], $this->onlytypes);
  
              if ($notwhitelisted) {
                  return get_string('filetypesnotwhitelisted', 'core_form', implode(', ', $notwhitelisted));
              }
          }
  
          return;
      }
code: public function validateSubmitValue($value) {
  
          if (!$this->allowall) {
              // Assert that there is an actual list provided.
              $normalized = $this->util->normalize_file_types($value['filetypes']);
              if (empty($normalized) || $normalized == ['*']) {
                  return get_string('filetypesnotall', 'core_form');
              }
          }
  
          if (!$this->allowunknown) {
              // Assert that all file types are known.
              $unknown = $this->util->get_unknown_file_types($value['filetypes']);
  
              if ($unknown) {
                  return get_string('filetypesunknown', 'core_form', implode(', ', $unknown));
              }
          }
  
          if ($this->onlytypes) {
              // Assert that all file types are allowed here.
              $notwhitelisted = $this->util->get_not_whitelisted($value['filetypes'], $this->onlytypes);
  
              if ($notwhitelisted) {
                  return get_string('filetypesnotwhitelisted', 'core_form', implode(', ', $notwhitelisted));
              }
          }
  
          return;
      }
code_tokens: public function validateSubmitValue ( $ value ) { if ( ! $ this -> allowall ) { // Assert that there is an actual list provided. $ normalized = $ this -> util -> normalize_file_types ( $ value [ 'filetypes' ] ) ; if ( empty ( $ normalized ) || $ normalized == [ '*' ] ) { return get_string ( 'filetypesnotall' , 'core_form' ) ; } } if ( ! $ this -> allowunknown ) { // Assert that all file types are known. $ unknown = $ this -> util -> get_unknown_file_types ( $ value [ 'filetypes' ] ) ; if ( $ unknown ) { return get_string ( 'filetypesunknown' , 'core_form' , implode ( ', ' , $ unknown ) ) ; } } if ( $ this -> onlytypes ) { // Assert that all file types are allowed here. $ notwhitelisted = $ this -> util -> get_not_whitelisted ( $ value [ 'filetypes' ] , $ this -> onlytypes ) ; if ( $ notwhitelisted ) { return get_string ( 'filetypesnotwhitelisted' , 'core_form' , implode ( ', ' , $ notwhitelisted ) ) ; } } return ; }
docstring: Check that the submitted list contains only known and allowed file types.
  
  The validation obeys the element options 'allowall', 'allowunknown' and
  'onlytypes' passed when creating the element.
  
  @param array $value Submitted value.
  @return string|null Validation error message or null.
docstring_tokens: Check that the submitted list contains only known and allowed file types .