From 922f654939ef6dc834a678b0ee56e0c045cbdf12 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 18 Oct 2015 18:28:14 +0200 Subject: [PATCH] Removed option import/export --- com.woltlab.wcf/acpMenu.xml | 5 - .../files/acp/templates/optionImport.tpl | 81 ------------- .../acp/action/OptionExportAction.class.php | 56 --------- .../lib/acp/form/OptionImportForm.class.php | 106 ------------------ wcfsetup/install/lang/de.xml | 9 -- wcfsetup/install/lang/en.xml | 9 -- 6 files changed, 266 deletions(-) delete mode 100644 wcfsetup/install/files/acp/templates/optionImport.tpl delete mode 100644 wcfsetup/install/files/lib/acp/action/OptionExportAction.class.php delete mode 100755 wcfsetup/install/files/lib/acp/form/OptionImportForm.class.php diff --git a/com.woltlab.wcf/acpMenu.xml b/com.woltlab.wcf/acpMenu.xml index 9ad6cf5105..6771881814 100644 --- a/com.woltlab.wcf/acpMenu.xml +++ b/com.woltlab.wcf/acpMenu.xml @@ -21,11 +21,6 @@ wcf.acp.menu.link.option 2 - - - wcf.acp.menu.link.option.management - - diff --git a/wcfsetup/install/files/acp/templates/optionImport.tpl b/wcfsetup/install/files/acp/templates/optionImport.tpl deleted file mode 100644 index 3a6d91509c..0000000000 --- a/wcfsetup/install/files/acp/templates/optionImport.tpl +++ /dev/null @@ -1,81 +0,0 @@ -{include file='header' pageTitle='wcf.acp.option.import'} - -
-

{lang}wcf.acp.option.import{/lang}

-
- -{include file='formError'} - -{if $success|isset} -

{lang}wcf.acp.option.import.success{/lang}

-{/if} - -
- {hascontent} - - {/hascontent} -
- -
-
-
- {lang}wcf.acp.option.import{/lang} - - -
-
- - {if $errorField == 'optionImport'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {else} - {lang}wcf.acp.option.import.error.{@$errorType}{/lang} - {/if} - - {/if} - {lang}wcf.acp.option.import.upload.description{/lang} -
- - - {event name='importFields'} -
- - {event name='importFieldsets'} -
- -
- - {@SECURITY_TOKEN_INPUT_TAG} -
-
- -
-

{lang}wcf.acp.option.export{/lang}

-
- -
-
- {lang}wcf.acp.option.export{/lang} - -
-
-
-

{lang}wcf.acp.option.export{/lang}

- {lang}wcf.acp.option.export.download.description{/lang} -
-
- - {event name='exportFields'} -
- - {event name='exportFieldsets'} -
- -{include file='footer'} diff --git a/wcfsetup/install/files/lib/acp/action/OptionExportAction.class.php b/wcfsetup/install/files/lib/acp/action/OptionExportAction.class.php deleted file mode 100644 index bb107ba82c..0000000000 --- a/wcfsetup/install/files/lib/acp/action/OptionExportAction.class.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage acp.action - * @category Community Framework - */ -class OptionExportAction extends AbstractAction { - /** - * @see \wcf\action\AbstractAction::$neededPermissions - */ - public $neededPermissions = array('admin.system.canEditOption'); - - /** - * @see \wcf\action\IAction::execute(); - */ - public function execute() { - parent::execute(); - - // header - @header('Content-type: text/xml'); - - // file name - @header('Content-disposition: attachment; filename="options.xml"'); - - // no cache headers - @header('Pragma: no-cache'); - @header('Expires: 0'); - - // content - echo "\n\n"; - - $options = Option::getOptions(); - foreach ($options as $option) { - if ($option->hidden) continue; // ignore hidden options - - echo "\t\n"; - } - - echo ''; - $this->executed(); - exit; - } -} diff --git a/wcfsetup/install/files/lib/acp/form/OptionImportForm.class.php b/wcfsetup/install/files/lib/acp/form/OptionImportForm.class.php deleted file mode 100755 index f3312048c8..0000000000 --- a/wcfsetup/install/files/lib/acp/form/OptionImportForm.class.php +++ /dev/null @@ -1,106 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage acp.form - * @category Community Framework - */ -class OptionImportForm extends AbstractForm { - /** - * @see \wcf\page\AbstractPage::$activeMenuItem - */ - public $activeMenuItem = 'wcf.acp.menu.link.option.importAndExport'; - - /** - * @see \wcf\page\AbstractPage::$neededPermissions - */ - public $neededPermissions = array('admin.system.canEditOption'); - - /** - * upload file data - * @var array - */ - public $optionImport = null; - - /** - * list of options - * @var array - */ - public $options = array(); - - /** - * @see \wcf\form\IForm::readFormParameters() - */ - public function readFormParameters() { - parent::readFormParameters(); - - if (isset($_FILES['optionImport'])) $this->optionImport = $_FILES['optionImport']; - } - - /** - * @see \wcf\form\IForm::validate() - */ - public function validate() { - parent::validate(); - - // upload - if ($this->optionImport && $this->optionImport['error'] != 4) { - if ($this->optionImport['error'] != 0) { - throw new UserInputException('optionImport', 'uploadFailed'); - } - - try { - $xml = new XML(); - $xml->load($this->optionImport['tmp_name']); - $xpath = $xml->xpath(); - foreach ($xpath->query('/options/option') as $option) { - $this->options[$xpath->query('name', $option)->item(0)->nodeValue] = $xpath->query('value', $option)->item(0)->nodeValue; - } - } - catch (SystemException $e) { - throw new UserInputException('optionImport', 'importFailed'); - } - } - else { - throw new UserInputException('optionImport'); - } - } - - /** - * @see \wcf\form\IForm::save() - */ - public function save() { - parent::save(); - - // save - $this->objectAction = new OptionAction(array(), 'import', array('data' => $this->options)); - $this->objectAction->executeAction(); - $this->saved(); - - // show success message - WCF::getTPL()->assign('success', true); - } - - /** - * @see \wcf\page\IPage::show() - */ - public function show() { - // check master password - WCFACP::checkMasterPassword(); - - parent::show(); - } -} diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 75230e1a9a..d42232bfd0 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -752,9 +752,6 @@ maxvalue !== null} Der maximale Wert ist {#$option->maxvalue}.{/if}]]> minvalue !== null} Der minimale Wert ist {#$option->minvalue}.{/if}]]> - - - @@ -765,12 +762,6 @@ - - - - - - diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 00c469f166..40e0abe87b 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -751,9 +751,6 @@ Examples for medium ID detection: maxvalue !== null} of {#$option->maxvalue}{/if}.]]> minvalue !== null} of {#$option->minvalue}{/if}.]]> - - - @@ -764,12 +761,6 @@ Examples for medium ID detection: - - - - - - -- 2.20.1