function main() { $bbconf = plugin_getoptions('bbcode'); // pass sane values to form... is this really needed? $this->smarty->assign('bbchecked', array(isset($bbconf['escape-html']) && $bbconf['escape-html'] ? 1 : 0, isset($bbconf['escape-html']) && $bbconf['comments'] ? 1 : 0, isset($bbconf['escape-html']) && $bbconf['editor'] ? 1 : 0)); $bbconf['number'] = isset($bbconf['url-maxlen']) && is_numeric($bbconf['url-maxlen']) ? $bbconf['url-maxlen'] : 40; $this->smarty->assign('bbconf', $bbconf); } /** * 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; } } admin_addpanelaction('plugin', 'bbcode', true); }
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; } /** * Array filter callback function. Culls empty array values. * Life is hell ._. * * @param string $str * @return boolean */ function _array_filter($str) { return strlen(trim($str)) > 0; } } admin_addpanelaction('plugin', 'qspam', true); }
} return true; } if (class_exists('AdminPanelAction')) { class admin_plugin_akismet extends AdminPanelAction { var $langres = 'plugin:akismet'; function setup() { $this->smarty->assign('admin_resource', "plugin:akismet/admin.plugin.akismet"); } function main() { $akismetconf = plugin_getoptions('akismet'); $this->smarty->assign('akismetconf', $akismetconf); } 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; } } admin_addpanelaction('plugin', 'akismet', true); }
RewriteRule . {$blogroot}index.php [L] </IfModule> STR; } $this->smarty->assign('cantsave', !is_writable(ABS_PATH) || file_exists($f) && !is_writable($f)); $this->smarty->assign('htaccess', $txt); } 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; } } admin_addpanelaction('plugin', 'prettyurls', true); }
$this->smarty->assign('success', $success); return PANEL_REDIRECT_CURRENT; } 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; } function setup() { $this->smarty->assign('admin_resource', "plugin:blockparser/admin.plugin.blockparser"); $this->smarty->assign('enabledlist', $this->bp_enabled = plugin_getoptions('blockparser', 'pages')); } function main() { global $fp_config; // $this->smarty->assign_by_ref('enabledpages', plugin_getoptions('blockparser')); $this->smarty->assign('statics', $assign = static_getlist()); } } admin_addpanelaction('widgets', 'blockparser', true); }