function onsubmit() { global $fp_config; if ($_POST['wp-apikey']) { plugin_addoption('akismet', 'apikey', $_POST['wp-apikey']); plugin_saveoptions('akismet'); $this->smarty->assign('success', 1); } else { $this->smarty->assign('success', -1); } return 2; }
function dodisable($id) { $success = -2; $enabled =& $this->bp_enabled; if ($enabled && is_numeric($v = array_search($id, $enabled))) { unset($enabled[$v]); @sort($enabled); @plugin_addoption('blockparser', 'pages', $enabled); plugin_saveoptions(); $success = 2; } $this->smarty->assign('success', $success); return PANEL_REDIRECT_CURRENT; }
/** * Will be executed when the BBCode configuration is send. * * @return int */ function onsubmit($data = null) { if (isset($_POST['bb-conf'])) { $maxlen = isset($_POST['bb-maxlen']) && is_numeric($_POST['bb-maxlen']) ? (int) $_POST['bb-maxlen'] : 40; plugin_addoption('bbcode', 'escape-html', isset($_POST['bb-allow-html'])); plugin_addoption('bbcode', 'comments', isset($_POST['bb-comments'])); plugin_addoption('bbcode', 'editor', isset($_POST['bb-toolbar'])); plugin_addoption('bbcode', 'url-maxlen', $maxlen); plugin_saveoptions('bbcode'); $this->smarty->assign('success', 1); } else { $this->smarty->assign('success', -1); } return 2; }
/** * Will be executed when the QSF configuration is send. * * @return int */ function onsubmit($data = null) { if ($_POST['qs-wordlist']) { $wordlist = isset($_POST['qs-wordlist']) ? stripslashes($_POST['qs-wordlist']) : ''; $wordlist = str_replace("\r", "\n", $wordlist); // DMKE: Works neither recursive correct nor in a loop... *grrr* #$wordlist = str_replace("\n\n", "\n", $wordlist); $wordlist = explode("\n", $wordlist); $wordlist = array_filter($wordlist, array($this, '_array_filter')); $number = isset($_POST['qs-number']) && is_numeric($_POST['qs-number']) ? (int) $_POST['qs-number'] : 1; plugin_addoption('qspam', 'wordlist', $wordlist); plugin_addoption('qspam', 'number', $number); plugin_saveoptions('qspam'); $this->smarty->assign('success', 1); } else { $this->smarty->assign('success', -1); } return 2; }
function onsubmit() { global $fp_config; if (isset($_POST['saveopt'])) { $this->_config['mode'] = (int) $_POST['mode']; plugin_addoption('prettyurls', 'mode', $this->_config['mode']); if (plugin_saveoptions()) { $this->smarty->assign('success', 2); } else { $this->smarty->assign('success', -2); } } if (isset($_POST['htaccess-submit'])) { if (!empty($_POST['htaccess']) && io_write_file(ABS_PATH . '.htaccess', $_POST['htaccess'])) { $this->smarty->assign('success', 1); } else { $this->smarty->assign('success', -1); } } return 2; }