<fieldset>
<legend>{lang}wcf.acp.user.search.display.columns{/lang}</legend>
-
- {if $optionTree|count}
+
+ {* TODO: Do we still want all this columns supported? *}
+ {*if $optionTree|count}
<dl>
<dt>
<label>{lang}wcf.acp.user.search.display.columns.profile{/lang}</label>
</fieldset>
</dd>
</dl>
- {/if}
+ {/if*}
<dl>
<dt><label>{lang}wcf.acp.user.search.display.columns.other{/lang}</label></dt>
*/
public $maxResults = 0;
+ /**
+ * list of option values
+ * @var array
+ */
+ public $values = array();
+
/**
* @see wcf\form\IForm::readFormParameters()
*/
if (isset($_POST['sortField'])) $this->sortField = $_POST['sortField'];
if (isset($_POST['sortOrder'])) $this->sortOrder = $_POST['sortOrder'];
if (isset($_POST['columns']) && is_array($_POST['columns'])) $this->columns = $_POST['columns'];
+
+ if (isset($_POST['values']) && is_array($_POST['values'])) $this->values = $_POST['values'];
}
/**
* Builds the dynamic conditions.
*/
protected function buildDynamicConditions() {
- foreach ($this->optionTree as $option) {
+ foreach ($this->optionHandler->getCategoryOptions('profile') as $option) {
+ $option = $option['object'];
+
$value = isset($this->values[$option->optionName]) ? $this->values[$option->optionName] : null;
- $condition = $this->getTypeObject($option->optionType)->getCondition($option, $value);
- if ($condition !== false) $this->conditions->add($condition);
+ $this->optionHandler->getTypeObject($option->optionType)->getCondition($this->conditions, $option->getDecoratedObject(), $value);
}
}
$conditions->add("user_table.userID IN (?)", array($userIDs));
$sql = "SELECT userID, groupID
- FROM wcf".WCF_N."_user_to_group user_table
+ FROM wcf".WCF_N."_user_to_group
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
* @param string $type
* @return wcf\system\option\IOptionType
*/
- protected function getTypeObject($type) {
+ public function getTypeObject($type) {
if (!isset($this->typeObjects[$type])) {
$className = $this->getClassName($type);
if ($className === null) {