fixed bugs in plugin config and asymmetry for plugin_getoptions(); fixed akismet consequently

This commit is contained in:
real_nowhereman 2007-11-06 18:57:10 +00:00
parent 846adeccf9
commit 1ebd86cfbd
4 changed files with 18 additions and 7 deletions

View File

@ -44,7 +44,6 @@
global $fp_config;
$conf_arr=$fp_config;
}
//print_r($conf_arr);
$arr = array('fp_config' => $conf_arr);
return system_save($conffile, $arr);

View File

@ -169,14 +169,23 @@
*
*/
function plugin_getoption($plugin, $key) {
function plugin_getoptions($plugin, $key=null) {
global $fp_config;
return $fp_config['plugins'][ $plugin ][ $key ];
if ($key)
return @$fp_config['plugins'][ $plugin ][ $key ];
return @$fp_config['plugins'][ $plugin ];
}
function plugin_addoption($plugin, $key, $val) {
global $fp_config;
return $fp_config['plugins'][ $plugin ][ $key ][ $val ];
if (!isset($fp_config['plugins']))
$fp_config['plugins'] = array();
if (!isset($fp_config['plugins'][$plugin]))
$fp_config['plugins'][$plugin] = array();
return $fp_config['plugins'][ $plugin ][ $key ] = $val ;
}
function plugin_saveoptions($null=null) {

View File

@ -57,7 +57,10 @@ if (class_exists('AdminPanelAction')){
$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;

View File

@ -8,7 +8,7 @@
{html_form}
<h4><label for="wp-apikey">{$plang.apikey}</label></h4>
<p><input id="wp-apikey" type="text" name="wp-apikey" value="{$fp_config.plugins.akismet.apikey}" />
<p><input id="wp-apikey" type="text" name="wp-apikey" value="{$akismetconf.apikey}" />
<input type="submit" value="{$plang.submit}"/> </p>
<p> {$plang.whatis} </p>