From 40c5b17f932873b4d84ce1a46853e7a12b0ad434 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sat, 25 Aug 2012 17:00:11 +0200 Subject: [PATCH] Removed export of hidden options --- .../files/lib/acp/action/OptionExportAction.class.php | 6 ++++-- wcfsetup/install/files/lib/data/option/Option.class.php | 6 +++--- .../install/files/lib/data/option/OptionEditor.class.php | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/action/OptionExportAction.class.php b/wcfsetup/install/files/lib/acp/action/OptionExportAction.class.php index 5ca6e50f85..fce9c7bd6d 100644 --- a/wcfsetup/install/files/lib/acp/action/OptionExportAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/OptionExportAction.class.php @@ -41,9 +41,11 @@ class OptionExportAction extends AbstractAction { $options = Option::getOptions(); foreach ($options as $option) { + if ($option->hidden) continue; // ignore hidden options + echo "\t\n"; } diff --git a/wcfsetup/install/files/lib/data/option/Option.class.php b/wcfsetup/install/files/lib/data/option/Option.class.php index 1498d2b4b1..f31a2b2ae4 100644 --- a/wcfsetup/install/files/lib/data/option/Option.class.php +++ b/wcfsetup/install/files/lib/data/option/Option.class.php @@ -51,7 +51,7 @@ class Option extends DatabaseObject { * Returns a list of options. * * @param integer $packageID - * @return array + * @return array */ public static function getOptions($packageID = PACKAGE_ID) { $sql = "SELECT optionName, optionID @@ -74,14 +74,14 @@ class Option extends DatabaseObject { $conditions = new PreparedStatementConditionBuilder(); $conditions->add("optionID IN (?)", array($optionIDs)); - $sql = "SELECT optionName, optionValue, optionType + $sql = "SELECT * FROM wcf".WCF_N."_option ".$conditions." ORDER BY optionName"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); while ($row = $statement->fetchArray()) { - $options[StringUtil::toUpperCase($row['optionName'])] = $row; + $options[StringUtil::toUpperCase($row['optionName'])] = new Option(null, $row); } } diff --git a/wcfsetup/install/files/lib/data/option/OptionEditor.class.php b/wcfsetup/install/files/lib/data/option/OptionEditor.class.php index d40f81f69c..2f094f025f 100644 --- a/wcfsetup/install/files/lib/data/option/OptionEditor.class.php +++ b/wcfsetup/install/files/lib/data/option/OptionEditor.class.php @@ -120,7 +120,7 @@ class OptionEditor extends DatabaseObjectEditor implements IEditableCachedObject // get all options $options = Option::getOptions($packageID); foreach ($options as $optionName => $option) { - $buffer .= "if (!defined('".$optionName."')) define('".$optionName."', ".(($option['optionType'] == 'boolean' || $option['optionType'] == 'integer') ? intval($option['optionValue']) : "'".addcslashes($option['optionValue'], "'\\")."'").");\n"; + $buffer .= "if (!defined('".$optionName."')) define('".$optionName."', ".(($option->optionType == 'boolean' || $option->optionType == 'integer') ? intval($option->optionValue) : "'".addcslashes($option->optionValue, "'\\")."'").");\n"; } unset($options); -- 2.20.1