/**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // check permission
     WCF::getUser()->checkPermission('admin.language.canEditLanguage');
     // delete language
     require_once WCF_DIR . 'lib/system/language/LanguageEditor.class.php';
     $language = new LanguageEditor($this->languageID);
     if (!$language->getLanguageID() || $language->isDefault()) {
         throw new IllegalLinkException();
     }
     $language->makeDefault();
     $this->executed();
     // forward to list page
     HeaderUtil::redirect('index.php?page=LanguageList&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // check permission
     WCF::getUser()->checkPermission('admin.language.canEditLanguage');
     // export language
     require_once WCF_DIR . 'lib/system/language/LanguageEditor.class.php';
     $language = new LanguageEditor($this->languageID);
     if (!$language->getLanguageID()) {
         throw new IllegalLinkException();
     }
     // send headers
     header('Content-Type: text/xml; charset=' . CHARSET);
     header('Content-Disposition: attachment; filename="' . $language->getLanguageCode() . '.xml"');
     // export
     $language->export();
     $this->executed();
 }
 /**
  * @see Form::validate()
  */
 public function validate()
 {
     parent::validate();
     // action
     if (!in_array($this->action, $this->availableActions)) {
         throw new UserInputException('action');
     }
     // move to
     if ($this->action == 'move') {
         try {
             $board = Board::getBoard($this->moveTo);
         } catch (IllegalLinkException $e) {
             throw new UserInputException('moveTo');
         }
         if (!$board->isBoard()) {
             throw new UserInputException('moveTo');
         }
     }
     // validate new language
     if ($this->action == 'changeLanguage') {
         require_once WCF_DIR . 'lib/system/language/LanguageEditor.class.php';
         $language = new LanguageEditor($this->newLanguageID);
         if (!$language->getLanguageID()) {
             throw new UserInputException('newLanguageID');
         }
     }
 }