function papercite_options_validate($input) { $options = get_option('papercite_options'); $options['file'] = trim($input['file']); $options['timeout'] = trim($input["timeout"]); papercite_set($options, $input, "bibshow_template"); papercite_set($options, $input, "bibtex_template"); papercite_set($options, $input, "format"); papercite_set($options, $input, "bibtex_parser"); return $options; }
function papercite_options_validate($input) { $options = get_option('papercite_options'); $options['use_db'] = $input['use_db'] == "yes"; $options['auto_bibshow'] = $input['auto_bibshow'] == "1"; $options['use_media'] = $input['use_media'] == "1"; $options['use_files'] = $input['use_files'] == "1"; $options['skip_for_post_lists'] = $input['skip_for_post_lists'] == "1"; $options['process_titles'] = $input['process_titles'] == "1"; $options['show_links'] = $input['show_links'] == "1"; $options['ssl_check'] = $input['ssl_check'] == "1"; $options['file'] = trim($input['file']); $options['timeout'] = trim($input["timeout"]); $options['highlight'] = trim($input["highlight"]); if (array_key_exists('form', $input)) { $a = array(); for ($i = 0; $i < sizeof($input["checked_files_ext"]); $i++) { $key = $input["checked_files_key"][$i]; $folder = $input["checked_files_folder"][$i]; $suffix = $input["checked_files_suffix"][$i]; $ext = $input["checked_files_ext"][$i]; $mime = $input["checked_files_mime"][$i]; if (!empty($key) && !empty($folder) && !empty($ext)) { $a[] = array($key, $folder, $suffix, $ext, $mime); } } $options['checked_files'] =& $a; } papercite_set($options, $input, "bibshow_template"); papercite_set($options, $input, "bibtex_template"); papercite_set($options, $input, "format"); papercite_set($options, $input, "bibtex_parser"); return $options; }