function customOptions($optionHandler, $indent = "", $album = NULL, $showhide = false, $supportedOptions = NULL, $theme = false, $initial = 'none', $extension = NULL) { if (is_null($supportedOptions)) { $supportedOptions = $optionHandler->getOptionsSupported(); } if (count($supportedOptions) > 0) { $whom = get_class($optionHandler); $options = $supportedOptions; $option = array_shift($options); if (array_key_exists('order', $option)) { $options = sortMultiArray($supportedOptions, 'order', false, true, false, true); $options = array_keys($options); } else { $options = array_keys($supportedOptions); natcasesort($options); } if (method_exists($optionHandler, 'handleOptionSave')) { ?> <input type="hidden" name="<?php echo CUSTOM_OPTION_PREFIX; ?> save-<?php echo $whom; ?> " value="<?php echo $extension; ?> " /> <?php } foreach ($options as $option) { $descending = NULL; $row = $supportedOptions[$option]; if (false !== ($i = stripos($option, chr(0)))) { $option = substr($option, 0, $i); } $type = $row['type']; $desc = $row['desc']; $key = @$row['key']; $postkey = postIndexEncode($key); $optionID = $whom . '_' . $key; if (isset($row['multilingual'])) { $multilingual = $row['multilingual']; } else { $multilingual = $type == OPTION_TYPE_TEXTAREA; } if ($type == OPTION_TYPE_RICHTEXT || isset($row['texteditor']) && $row['texteditor']) { $editor = 'texteditor'; } else { $editor = ''; } if (isset($row['disabled']) && $row['disabled']) { $disabled = ' disabled="disabled"'; } else { $disabled = ''; } if (isset($row['deprecated']) && $option) { $deprecated = $row['deprecated']; if (!$deprecated) { $deprecatedd = gettext('Deprecated.'); } $option = '<div class="warningbox">' . $option . '<br /><em>' . $deprecated . '</em></div>'; } if ($theme) { $v = getThemeOption($key, $album, $theme); } else { $sql = "SELECT `value` FROM " . prefix('options') . " WHERE `name`=" . db_quote($key); $db = query_single_row($sql); if ($db) { $v = $db['value']; } else { $v = NULL; } } if ($showhide) { ?> <tr id="tr_<?php echo $optionID; ?> " class="<?php echo $showhide; ?> extrainfo" style="display:<?php echo $initial; ?> "> <?php } else { ?> <tr id="tr_<?php echo $optionID; ?> "> <?php } if ($type != OPTION_TYPE_NOTE) { ?> <td width="175"><?php if ($option) { echo $indent . $option; } ?> </td> <?php } switch ($type) { case OPTION_TYPE_NOTE: ?> <td colspan="3"><?php echo $desc; ?> </td> <?php break; case OPTION_TYPE_NUMBER: case OPTION_TYPE_CLEARTEXT: case OPTION_TYPE_PASSWORD: case OPTION_TYPE_TEXTBOX: case OPTION_TYPE_TEXTAREA: case OPTION_TYPE_RICHTEXT: $clear = ''; $wide = '338px'; switch ($type) { case OPTION_TYPE_CLEARTEXT: $clear = 'clear'; $multilingual = false; default: $inputtype = 'text'; break; case OPTION_TYPE_PASSWORD: $inputtype = 'password" autocomplete="off'; $multilingual = false; break; case OPTION_TYPE_NUMBER: $multilingual = false; $clear = 'numeric'; if (!is_numeric($v)) { $v = 0; } $wide = '100px'; if (isset($row['limits'])) { $inputtype = 'number'; if (isset($row['limits']['min'])) { $inputtype .= '" min="' . $row['limits']['min']; } if (isset($row['limits']['max'])) { $inputtype .= '" max="' . $row['limits']['max']; } if (isset($row['limits']['step'])) { $inputtype .= '" step="' . $row['limits']['step']; } else { $inputtype .= '" step="1'; } } else { $inputtype = 'number" min="0" step="1'; } break; } ?> <td width="350"> <input type="hidden" name="<?php echo CUSTOM_OPTION_PREFIX . $clear . 'text-' . $postkey; ?> " value="1" /> <?php if ($multilingual) { print_language_string_list($v, $postkey, $type, NULL, $editor); } else { if ($type == OPTION_TYPE_TEXTAREA || $type == OPTION_TYPE_RICHTEXT) { $v = get_language_string($v); // just in case.... ?> <textarea id="<?php echo $key; ?> "<?php if ($type == OPTION_TYPE_RICHTEXT) { echo ' class="texteditor"'; } ?> name="<?php echo $postkey; ?> " cols="<?php echo TEXTAREA_COLUMNS; ?> " style="width: 320px" rows="6"<?php echo $disabled; ?> ><?php echo html_encode($v); ?> </textarea> <?php } else { ?> <input type="<?php echo $inputtype; ?> " id="<?php echo $key; ?> " name="<?php echo $postkey; ?> " style="width: <?php echo $wide; ?> " value="<?php echo html_encode($v); ?> "<?php echo $disabled; ?> /> <?php } } ?> </td> <?php break; case OPTION_TYPE_CHECKBOX: ?> <td width="350"> <input type="hidden" name="<?php echo CUSTOM_OPTION_PREFIX . 'chkbox-' . $postkey; ?> " value="1" /> <input type="checkbox" id="<?php echo $key; ?> " name="<?php echo $postkey; ?> " value="1" <?php checked('1', $v); echo $disabled; ?> /> </td> <?php break; case OPTION_TYPE_CUSTOM: ?> <td width="350"> <input type="hidden" name="<?php echo CUSTOM_OPTION_PREFIX . 'custom-' . $postkey; ?> " value="0" /> <?php $optionHandler->handleOption($key, $v); ?> </td> <?php break; case OPTION_TYPE_RADIO: $behind = isset($row['behind']) && $row['behind']; ?> <td width="350"> <input type="hidden" name="<?php echo CUSTOM_OPTION_PREFIX . 'radio-' . $postkey; ?> " value="1"<?php echo $disabled; ?> /> <?php generateRadiobuttonsFromArray($v, $row['buttons'], $postkey, $behind, 'checkboxlabel', $disabled); ?> </td> <?php break; case OPTION_TYPE_SELECTOR: $descending = false; case OPTION_TYPE_ORDERED_SELECTOR: ?> <td width="350"> <input type="hidden" name="<?php echo CUSTOM_OPTION_PREFIX . 'selector-' . $postkey; ?> " value="1" /> <select id="<?php echo $key; ?> " name="<?php echo $postkey; ?> "<?php echo $disabled; ?> > <?php if (array_key_exists('null_selection', $row)) { ?> <option value=""<?php if (empty($v)) { echo ' selected="selected"'; } ?> style="background-color:LightGray;"><?php echo $row['null_selection']; ?> </option> <?php } $list = array(); foreach ($row['selections'] as $rowkey => $rowvalue) { $list[$rowkey] = $rowvalue; } generateListFromArray(array($v), $list, $descending, true); ?> </select> </td> <?php break; case OPTION_TYPE_CHECKBOX_ARRAY: $behind = isset($row['behind']) && $row['behind']; ?> <td width="350"> <?php foreach ($row['checkboxes'] as $display => $checkbox) { if ($theme) { $v = getThemeOption($checkbox, $album, $theme); } else { $sql = "SELECT `value` FROM " . prefix('options') . " WHERE `name`=" . db_quote($checkbox); $db = query_single_row($sql); if ($db) { $v = $db['value']; } else { $v = 0; } } $display = str_replace(' ', ' ', $display); ?> <input type="hidden" name="<?php echo CUSTOM_OPTION_PREFIX . 'chkbox-' . postIndexEncode($checkbox); ?> " value="1" /> <label class="checkboxlabel"> <?php if ($behind) { echo $display; } ?> <input type="checkbox" id="<?php echo $checkbox; ?> " name="<?php echo postIndexEncode($checkbox); ?> " value="1"<?php checked('1', $v); echo $disabled; ?> /> <?php if (!$behind) { echo $display; } ?> </label> <?php } ?> </td> <?php break; case OPTION_TYPE_CHECKBOX_UL: ?> <td width="350"> <?php $all = true; $cvarray = array(); foreach ($row['checkboxes'] as $display => $checkbox) { ?> <input type="hidden" name="<?php echo CUSTOM_OPTION_PREFIX . 'chkbox-' . postIndexEncode($checkbox); ?> " value="1" /> <?php if ($theme) { $v = getThemeOption($checkbox, $album, $theme); } else { $sql = "SELECT `value` FROM " . prefix('options') . " WHERE `name`=" . db_quote($checkbox); $db = query_single_row($sql); if ($db) { $v = $db['value']; } else { $v = 0; } } if ($v) { $cvarray[] = $checkbox; } else { $all = false; } } ?> <ul class="customchecklist"> <?php generateUnorderedListFromArray($cvarray, $row['checkboxes'], '', '', true, true, 'all_' . $key); ?> </ul> <script type="text/javascript"> // <!-- <![CDATA[ function <?php echo $key; ?> _all() { var check = $('#all_<?php echo $key; ?> ').prop('checked'); $('.all_<?php echo $key; ?> ').prop('checked', check); } // ]]> --> </script> <label> <input type="checkbox" name="all_<?php echo $key; ?> " id="all_<?php echo $key; ?> " class="all_<?php echo $key; ?> " onclick="<?php echo $key; ?> _all();" <?php if ($all) { echo ' checked="checked"'; } ?> /> <?php echo gettext('all'); ?> </label> </td> <?php break; case OPTION_TYPE_COLOR_PICKER: if (empty($v)) { $v = '#000000'; } ?> <td width="350" style="margin:0; padding:0"> <input type="hidden" name="<?php echo CUSTOM_OPTION_PREFIX . 'text-' . $postkey; ?> " value="1" /> <script type="text/javascript"> // <!-- <![CDATA[ $(document).ready(function () { $('#<?php echo $key; ?> _colorpicker').farbtastic('#<?php echo $key; ?> '); }); // ]]> --> </script> <table style="margin:0; padding:0" > <tr> <td><input type="text" id="<?php echo $key; ?> " name="<?php echo $postkey; ?> " value="<?php echo $v; ?> " style="height:100px; width:100px; float:right;" /></td> <td><div id="<?php echo $key; ?> _colorpicker"></div></td> </tr> </table> </td> <?php break; case OPTION_TYPE_SLIDER: $min = $row['min']; $max = $row['max']; ?> <td width="350" style="margin:0; padding:0"> <input type="hidden" name="<?php echo CUSTOM_OPTION_PREFIX . 'slider-' . $postkey; ?> " value="1" /> <?php putSlider('', $postkey, $min, $max, $v); ?> </td> <?php break; } if ($type != OPTION_TYPE_NOTE) { ?> <td><?php echo $desc; ?> </td> <?php } ?> </tr> <?php } } }
?> </p> <?php } ?> </td> </tr> <tr> <td><?php echo gettext("Caching concurrency:"); ?> </td> <td> <p> <?php putSlider(gettext('Limit'), 'imageProcessorConcurrency', 1, 60, getOption('imageProcessorConcurrency')); ?> </td> <td> <?php echo gettext('Cache processing worker limit.') . '<p class="notebox">' . gettext('More workers will get the job done faster so long as your server does not get swamped or run out of memory.') . '</p>'; ?> </td> </tr> <tr> <td><?php echo gettext("Cache as:"); ?> </td> <td> <?php