initial commit
This commit is contained in:
commit
0b916786c2
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
$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>
|
||||||
|
<div class="group-controls">
|
||||||
|
<input type="text" name="api_key" id="api_key" maxlength="1" value="<?php echo $kagi_api_key; ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group form-actions">
|
||||||
|
<div class="group-controls">
|
||||||
|
<button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class KagiSummarizerExtension extends Minz_Extension {
|
||||||
|
public function init() {
|
||||||
|
$this->registerTranslates();
|
||||||
|
|
||||||
|
Minz_View::appendScript($this->getFileUrl('script.js', 'js'), false, false, false);
|
||||||
|
Minz_View::appendStyle($this->getFileUrl('style.css', 'css'));
|
||||||
|
Minz_View::appendScript(_url('kagiSummarizer', 'jsVars', false, true, false);
|
||||||
|
|
||||||
|
$this->registerController('kagiSummarizer');
|
||||||
|
$this->registerViews();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handleConfigureAction() {
|
||||||
|
$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->save();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'kagiSummarizer' => array(
|
||||||
|
'configure' => array(
|
||||||
|
'api_key' => 'Kagi API Key'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"name": "Kagi Summarizer",
|
||||||
|
"author": "Rudis Muiznieks",
|
||||||
|
"description": "Add a button to summarize articles with the Kagi Universal Summarizer.",
|
||||||
|
"version": 0.1,
|
||||||
|
"entrypoint": "KagiSummarizer",
|
||||||
|
"type": "user"
|
||||||
|
}
|
Loading…
Reference in New Issue