/**
  * @see Form::save()
  */
 public function save()
 {
     parent::save();
     // create user warning
     $expires = $this->expiresHour * 3600 + $this->expiresDay * 86400 + $this->expiresWeek * 86400 * 7;
     $userWarning = UserWarningEditor::create($this->userID, WCF::getUser()->userID, $this->warningID, $this->objectID, $this->objectType, $this->title, $this->points, $expires ? TIME_NOW + $expires : 0, $this->reason);
     // check suspensions
     UserWarningEditor::checkWarnings($this->userID);
     // get language
     $languages = array(WCF::getLanguage()->getLanguageID() => WCF::getLanguage(), 0 => WCF::getLanguage());
     if (!isset($languages[$this->user->languageID])) {
         $languages[$this->user->languageID] = new Language($this->user->languageID);
     }
     $languages[$this->user->languageID]->setLocale();
     // send pm
     require_once WCF_DIR . 'lib/data/message/pm/PMEditor.class.php';
     PMEditor::create(0, array($this->user->userID => array('userID' => $this->user->userID, 'username' => $this->user->username)), array(), $languages[$this->user->languageID]->get('wcf.user.infraction.userWarning.message.subject'), $languages[$this->user->languageID]->getDynamicVariable('wcf.user.infraction.userWarning.message.text', array('title' => $this->title, 'reason' => $this->reason)), WCF::getUser()->userID, WCF::getUser()->username);
     $this->saved();
     // reset language
     WCF::getLanguage()->setLocale();
     // show success message and forward user
     $url = ($this->object !== null ? $this->object->getURL() : 'index.php?page=User&userID=' . $this->userID) . SID_ARG_2ND_NOT_ENCODED;
     WCF::getTPL()->assign(array('url' => $url, 'message' => WCF::getLanguage()->get('wcf.user.infraction.userWarning.add.success'), 'wait' => 5));
     WCF::getTPL()->display('redirect');
     exit;
 }