function pref_validate($input) { $css_default = quality_colours_prefs(1); foreach ($css_default as $quality => $val) { if (ctype_xdigit($input['css'][$quality]['bg'])) { $css[$quality]['bg'] = (string) $input['css'][$quality]['bg']; } else { $css[$quality]['bg'] = (string) $val['bg']; } if (ctype_xdigit($input['css'][$quality]['border'])) { $css[$quality]['border'] = (string) $input['css'][$quality]['border']; } else { $css[$quality]['border'] = (string) $val['border']; } } $numeric = $input['numeric']; arrayToNumeric($numeric); $res['css'] = $css; $res['numeric'] = $numeric; return $res; }
echo '</select><br>'; echo 'Backpack <img src ="img/BPIcon.png" alt="Viewer" height="16" width="16"> 2: ' . '<select name="numeric[bp][2]">'; foreach ($viewers as $key => $val) { echo '<option value="' . $key . '"'; if (isset($_SESSION['pref']['numeric']['bp'][2]) && $_SESSION['pref']['numeric']['bp'][2] === $key) { echo ' selected="selected"'; } echo '>' . $val . '</option>'; } echo '</select><br><br>'; //echo 'clicking an item will copy the following to your clipboard:<br><input type="text" style="width: 304px;" name="string[itemnote]" value="Would you be willing to trade your ##itemname##?"><br><br>'; echo 'Show warnings for hard-to-trade-for items: '; echo '<select name="numeric[warn]">' . '<option value="1"' . (!isset($_SESSION['pref']['numeric']['warn']) || $_SESSION['pref']['numeric']['warn'] == 1 ? ' selected="selected"' : '') . '>On</option>' . '<option value="0"' . (isset($_SESSION['pref']['numeric']['warn']) && $_SESSION['pref']['numeric']['warn'] == 0 ? ' selected="selected"' : '') . '>Off</option></select><br>'; echo '<img src="/img/w3.png">Traded for/painted/named/described/gifted.<br><img src="/img/w2.png">Equipped.'; echo '</div>'; echo '<div class="col2 rt">'; $quality_colours = quality_colours_prefs(1); echo '<h2 class="cf">Colour settings</h2>'; echo 'These colour settings will be used in all scans.<br>Colours can be reset to their original values with the "Delete Preferences" button.'; echo '<table class="preftable"><tr><th>quality</th><th>colour</th><th>border</th></tr>'; $x = 0; $qualityNames = json_decode(file_get_contents(json_directory() . '/qualities.json'), true); foreach ($quality_colours as $colour => $value) { $name = $qualityNames[$x]['display_name']; echo '<tr><td>' . $name . '</td><td><input class="color" name="css[' . $colour . '][bg]" maxlength="6" size="6" value="' . (isset($_SESSION['pref']['css'][$colour]['bg']) ? $_SESSION['pref']['css'][$colour]['bg'] : $quality_colours[$colour]['bg']) . '"/></td><td>' . '<input type="text" class="color" name="css[' . $colour . '][border]" maxlength="6" size="6" value="' . (isset($_SESSION['pref']['css'][$colour]['border']) ? $_SESSION['pref']['css'][$colour]['border'] : $quality_colours[$colour]['border']) . '"/></td></tr>'; $x++; } echo '</table>'; echo '</div>'; echo '<div class="col2 lt"><h2 class="cf">Update/Delete</h2><input name="Update" value="Update Preferences" type="submit"><input name="Delete" value="Delete Preferences" type="submit"></form><br></div>'; createFooter(440);