original_string: function get_file_content($elname) {
          global $USER;
  
          if (!$this->is_submitted() or !$this->is_validated()) {
              return false;
          }
  
          $element = $this->_form->getElement($elname);
  
          if ($element instanceof MoodleQuickForm_filepicker || $element instanceof MoodleQuickForm_filemanager) {
              $values = $this->_form->exportValues($elname);
              if (empty($values[$elname])) {
                  return false;
              }
              $draftid = $values[$elname];
              $fs = get_file_storage();
              $context = context_user::instance($USER->id);
              if (!$files = $fs->get_area_files($context->id, 'user', 'draft', $draftid, 'id DESC', false)) {
                  return false;
              }
              $file = reset($files);
  
              return $file->get_content();
  
          } else if (isset($_FILES[$elname])) {
              return file_get_contents($_FILES[$elname]['tmp_name']);
          }
  
          return false;
      }
code: function get_file_content($elname) {
          global $USER;
  
          if (!$this->is_submitted() or !$this->is_validated()) {
              return false;
          }
  
          $element = $this->_form->getElement($elname);
  
          if ($element instanceof MoodleQuickForm_filepicker || $element instanceof MoodleQuickForm_filemanager) {
              $values = $this->_form->exportValues($elname);
              if (empty($values[$elname])) {
                  return false;
              }
              $draftid = $values[$elname];
              $fs = get_file_storage();
              $context = context_user::instance($USER->id);
              if (!$files = $fs->get_area_files($context->id, 'user', 'draft', $draftid, 'id DESC', false)) {
                  return false;
              }
              $file = reset($files);
  
              return $file->get_content();
  
          } else if (isset($_FILES[$elname])) {
              return file_get_contents($_FILES[$elname]['tmp_name']);
          }
  
          return false;
      }
code_tokens: function get_file_content ( $ elname ) { global $ USER ; if ( ! $ this -> is_submitted ( ) or ! $ this -> is_validated ( ) ) { return false ; } $ element = $ this -> _form -> getElement ( $ elname ) ; if ( $ element instanceof MoodleQuickForm_filepicker || $ element instanceof MoodleQuickForm_filemanager ) { $ values = $ this -> _form -> exportValues ( $ elname ) ; if ( empty ( $ values [ $ elname ] ) ) { return false ; } $ draftid = $ values [ $ elname ] ; $ fs = get_file_storage ( ) ; $ context = context_user :: instance ( $ USER -> id ) ; if ( ! $ files = $ fs -> get_area_files ( $ context -> id , 'user' , 'draft' , $ draftid , 'id DESC' , false ) ) { return false ; } $ file = reset ( $ files ) ; return $ file -> get_content ( ) ; } else if ( isset ( $ _FILES [ $ elname ] ) ) { return file_get_contents ( $ _FILES [ $ elname ] [ 'tmp_name' ] ) ; } return false ; }
docstring: Get content of uploaded file.
  
  @param string $elname name of file upload element
  @return string|bool false in case of failure, string if ok
docstring_tokens: Get content of uploaded file .