$options = Option::getOptions();
foreach ($options as $option) {
+ if ($option->hidden) continue; // ignore hidden options
+
echo "\t<option>\n";
- echo "\t\t<name><![CDATA[".StringUtil::escapeCDATA($option['optionName'])."]]></name>\n";
- echo "\t\t<value><![CDATA[".StringUtil::escapeCDATA($option['optionValue'])."]]></value>\n";
+ echo "\t\t<name><![CDATA[".StringUtil::escapeCDATA($option->optionName)."]]></name>\n";
+ echo "\t\t<value><![CDATA[".StringUtil::escapeCDATA($option->optionValue)."]]></value>\n";
echo "\t</option>\n";
}
* Returns a list of options.
*
* @param integer $packageID
- * @return array
+ * @return array<wcf\data\option\Option>
*/
public static function getOptions($packageID = PACKAGE_ID) {
$sql = "SELECT optionName, optionID
$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);
}
}
// 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);