/**
  * @see Form::save()
  */
 public function save()
 {
     parent::save();
     // any numeric value is valid for $position thus we replace an empty value with null
     if (empty($this->position)) {
         $this->position = null;
     }
     // create source
     SourceEditor::create($this->name, $this->sourceDirectory, $this->buildDirectory, $this->scm, $this->url, $this->username, $this->password, $this->trustServerCert, $this->enableCheckout, $this->position);
     // call saved event
     $this->saved();
     // reset values
     $this->sourceDirectory = Source::getRandomDirectory('repository');
     $this->buildDirectory = Source::getRandomDirectory('build');
     $this->name = $this->scm = $this->url = $this->username = $this->password = '';
     $this->trustServerCert = 0;
     $this->enableCheckout = 1;
     $this->scm = 'none';
     WCF::getTPL()->assign('success', true);
 }