public static function GetSelectForm($params) { $html = '<select'; foreach ($params['form'] as $fItem => $fValue) { $html .= sprintf(' %s="%s"', $fItem, $fValue); } $html .= '>'; $filter_value = WoW::GetFilterValueByKey($params['filter']['filter_key']); foreach ($params['options']['data'] as $option) { if ($option === '{SKIP}') { $html .= '<option></option>'; continue; } $selectedOption = false; // Check current filter if (is_array($filter_value) && in_array($option, $filter_value)) { $selectedOption = true; } $html .= sprintf('<option value="%d"%s%s>%s</option>', $option, isset($params['options']['class']) ? sprintf(' class="%s"', sprintf($params['options']['class'], $option)) : null, $selectedOption ? ' selected="selected"' : null, WoW_Locale::GetString(sprintf($params['locale']['string_key'], $option))); } $html .= '</select>'; return $html; }
$minLevelFilter = $minLeVal[0]; } if ($maxLeVal && is_array($maxLeVal)) { $maxLevelFilter = $maxLeVal[0]; } ?> <td class="padded">Level: </td><td class="padded"> <input type="text" name="minle" maxlength="3" class="smalltextbox2"<?php echo $minLevelFilter !== null ? ' value="' . $minLevelFilter . '"' : null; ?> /> - <input type="text" name="maxle" maxlength="3" class="smalltextbox2"<?php echo $maxLevelFilter !== null ? ' value="' . $maxLevelFilter . '"' : null; ?> /></td> <?php $minReqLeVal = WoW::GetFilterValueByKey('minrl'); $maxReqLeVal = WoW::GetFilterValueByKey('maxrl'); $minReqLevelFilter = null; $maxReqLevelFilter = null; if ($minReqLeVal && is_array($minReqLeVal)) { $minReqLevelFilter = $minReqLeVal[0]; } if ($maxReqLeVal && is_array($maxReqLeVal)) { $maxReqLevelFilter = $maxReqLeVal[0]; } ?> <td class="padded"><table><tr><td>Required level: </td><td> <input type="text" name="minrl" maxlength="2" class="smalltextbox"<?php echo $minReqLevelFilter !== null ? ' value="' . $minReqLevelFilter . '"' : null; ?> /> - <input type="text" name="maxrl" maxlength="2" class="smalltextbox"<?php echo $maxReqLevelFilter !== null ? ' value="' . $maxReqLevelFilter . '"' : null; ?>