original_string: protected function loadFormData()
      {
          parent::loadFormData();
          $this->loadMailer();
  
          if (isset($this->formData['gctt'])) {
              $multi = false;
              if (count($this->formData['gctt']) > 1) {
                  $multi = true;
                  $allLanguages = $this->util->getLocalized()->getLanguages();
              }
  
              $preview = $this->getPreview($this->formData['gctt']);
  
              $this->formData['preview_html'] = $preview['html'];
              $this->formData['preview_text'] = $preview['text'];
          }
          if (!isset($this->formData['to'])) {
              $organization = $this->mailer->getOrganization();
              $this->formData['to'] = $this->formData['from'] = $this->currentUser->getEmailAddress();
              if ($organization->getEmail()) {
                  $this->formData['from'] = $organization->getEmail();
              } elseif ($this->project->getSiteEmail ()) {
                  $this->formData['from'] = $this->project->getSiteEmail();
              }
          }
  
          $this->formData['available_fields'] = $this->mailElements->displayMailFields($this->mailer->getMailFields());
      }
code: protected function loadFormData()
      {
          parent::loadFormData();
          $this->loadMailer();
  
          if (isset($this->formData['gctt'])) {
              $multi = false;
              if (count($this->formData['gctt']) > 1) {
                  $multi = true;
                  $allLanguages = $this->util->getLocalized()->getLanguages();
              }
  
              $preview = $this->getPreview($this->formData['gctt']);
  
              $this->formData['preview_html'] = $preview['html'];
              $this->formData['preview_text'] = $preview['text'];
          }
          if (!isset($this->formData['to'])) {
              $organization = $this->mailer->getOrganization();
              $this->formData['to'] = $this->formData['from'] = $this->currentUser->getEmailAddress();
              if ($organization->getEmail()) {
                  $this->formData['from'] = $organization->getEmail();
              } elseif ($this->project->getSiteEmail ()) {
                  $this->formData['from'] = $this->project->getSiteEmail();
              }
          }
  
          $this->formData['available_fields'] = $this->mailElements->displayMailFields($this->mailer->getMailFields());
      }
code_tokens: protected function loadFormData ( ) { parent :: loadFormData ( ) ; $ this -> loadMailer ( ) ; if ( isset ( $ this -> formData [ 'gctt' ] ) ) { $ multi = false ; if ( count ( $ this -> formData [ 'gctt' ] ) > 1 ) { $ multi = true ; $ allLanguages = $ this -> util -> getLocalized ( ) -> getLanguages ( ) ; } $ preview = $ this -> getPreview ( $ this -> formData [ 'gctt' ] ) ; $ this -> formData [ 'preview_html' ] = $ preview [ 'html' ] ; $ this -> formData [ 'preview_text' ] = $ preview [ 'text' ] ; } if ( ! isset ( $ this -> formData [ 'to' ] ) ) { $ organization = $ this -> mailer -> getOrganization ( ) ; $ this -> formData [ 'to' ] = $ this -> formData [ 'from' ] = $ this -> currentUser -> getEmailAddress ( ) ; if ( $ organization -> getEmail ( ) ) { $ this -> formData [ 'from' ] = $ organization -> getEmail ( ) ; } elseif ( $ this -> project -> getSiteEmail ( ) ) { $ this -> formData [ 'from' ] = $ this -> project -> getSiteEmail ( ) ; } } $ this -> formData [ 'available_fields' ] = $ this -> mailElements -> displayMailFields ( $ this -> mailer -> getMailFields ( ) ) ; }
docstring: Load extra data not from the model into the form
docstring_tokens: Load extra data not from the model into the form