setFile('main', 'options.html'); $opts = array_merge($lp_opts->critical, array_keys($lp_opts->base)); $tpl_vars = array(); if (isset($_POST['submit'])) { foreach ($opts as $opt) { if (isset($_POST["lp_opt_$opt"])) $lp_opts->updateOption("lp_opt_$opt", $_POST["lp_opt_$opt"]); } } else { $tpl->setBlock('main', 'message', 'MESSAGE'); $tpl_vars['MESSAGE'] = ''; } foreach ($opts as $opt) { $value = $lp_opts->getOption($opt); if (is_string($value)) { if ($opt != 'basedir') $value = htmlspecialchars(stripslashes($value)); else $value = htmlspecialchars($value); } $tpl_vars[$opt] = $value; } // set options for select lists $tpl_vars['lp_opt_mail_mailer_qmail'] = ''; if ($lp_opts->getOption('mail_mailer') == 'qmail') $tpl_vars['lp_opt_mail_mailer_qmail'] = ' selected'; $tpl_vars['lp_opt_comment_spam_kill_kill'] = ''; if ($lp_opts->getOption('comment_spam_kill') == '1') $tpl_vars['lp_opt_comment_spam_kill_kill'] = ' selected'; $tpl_vars['lp_opt_comment_spam_mail_ignore'] = ''; if ($lp_opts->getOption('comment_spam_mail') != '1') $tpl_vars['lp_opt_comment_spam_mail_ignore'] = ' selected'; $tpl->setVar($tpl_vars); $out =& $tpl->parse('MAIN', 'main'); echo $out; ?>