attempt to fix config

This commit is contained in:
Rudis Muiznieks 2023-09-25 12:00:39 -05:00
parent f25928b988
commit a8601314e7
Signed by: rudism
GPG Key ID: CABF2F86EF7884F9
3 changed files with 5 additions and 6 deletions

View File

@ -1,13 +1,13 @@
<?php
$api_key = FreshRSS_Context::$user_conf->kagi_api_key;
$kagi_api_key = FreshRSS_Context::$user_conf->kagi_api_key;
?>
<form action="<?php echo _url('extension', 'configure', 'e', urlencode($this->getName())); ?>" method="post">
<input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" />
<div class="form-group">
<label class="group-name" for="api_key"><?php echo _t('ext.kagiSummarizer.configure.api_key'); ?></label>
<label class="group-name" for="kagi_api_key"><?php echo _t('ext.kagiSummarizer.configure.kagi_api_key'); ?></label>
<div class="group-controls">
<input type="text" name="api_key" id="api_key" value="<?php echo $api_key; ?>">
<input type="text" name="kagi_api_key" id="kagi_api_key" value="<?php echo $kagi_api_key; ?>">
</div>
</div>
<div class="form-group form-actions">

View File

@ -16,8 +16,7 @@ class KagiSummarizerExtension extends Minz_Extension {
$this->registerTranslates();
if (Minz_Request::isPost()) {
$api_key = Minz_Request::param('api_key', '');
FreshRSS_Context::$user_conf->kagi_api_key = $api_key;
FreshRSS_Context::$user_conf->kagi_api_key = Minz_Request::param('kagi_api_key', '');
FreshRSS_Context::$user_conf->save();
}
}

View File

@ -3,7 +3,7 @@
return array(
'kagiSummarizer' => array(
'configure' => array(
'api_key' => 'Kagi API Key'
'kagi_api_key' => 'Kagi API Key'
)
)
);