Skip to content

Commit 35a4e23

Browse files
authored
Merge pull request #3 from resticDOG/fix-save-settings
fix(config): resolve error during configuration save
2 parents 89db7b3 + a5021ac commit 35a4e23

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

init.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ public function init($host) {
3030
return;
3131
}
3232

33-
$host->add_hook($host::HOOK_ARTICLE_FILTER, $this);
33+
$host->add_hook($host::HOOK_ARTICLE_FILTER, $this);
3434
$host->add_hook($host::HOOK_PREFS_EDIT_FEED, $this);
3535
$host->add_hook($host::HOOK_PREFS_SAVE_FEED, $this);
36-
$host->add_hook($host::HOOK_PREFS_TAB, $this);
36+
$host->add_hook($host::HOOK_PREFS_TAB, $this);
3737

3838
$host->add_filter_action($this, "ntfy", __("Send Notification"));
3939
}
@@ -54,6 +54,7 @@ public function hook_prefs_tab($args) {
5454
<h2> <?= __('Send feed notification via Ntfy') ?></h2>
5555

5656
<form dojoType="dijit.form.Form">
57+
<?= \Controls\pluginhandler_tags($this, "save") ?>
5758
<script type="dojo/method" event="onSubmit" args="evt">
5859
evt.preventDefault();
5960
if (this.validate()) {
@@ -66,20 +67,20 @@ public function hook_prefs_tab($args) {
6667

6768
<div class="alert alert-info"><?= __("You can enable notification for specific feeds in the feed editor") ?></div>
6869
<input dojoType="dijit.form.ValidationTextBox" required="1" name="ntfy_server" value="<?= $ntfy_server ?>"/>
69-
<label for="ntfy_server"><?= __("Your Ntfy server, including IP and port, e.g. http://ntfy.lan:8007") ?> </label>
70+
<label for="ntfy_server"><?= __("Your Ntfy server, including IP and port, e.g. http://ntfy.lan:8007. Alternatively, you can use the public server at https://ntfy.sh.") ?> </label>
7071
<br/>
7172
<input dojoType="dijit.form.ValidationTextBox" required="1" name="ntfy_topic" value="<?= $ntfy_topic ?>"/>
7273
<label for="ntfy_topic"><?= __("Your Ntfy topic, e.g. tt-rss") ?> </label>
7374
<br/>
74-
<input dojoType="dijit.form.ValidationTextBox" required="1" name="ntfy_token" value="<?= $ntfy_token ?>"/>
75-
<label for="ntfy_token"><?= __("Your Ntfy authentication token. Set it if you have enabled it") ?> </label>
75+
<input dojoType="dijit.form.ValidationTextBox" name="ntfy_token" value="<?= $ntfy_token ?>"/>
76+
<label for="ntfy_token"><?= __("Your Ntfy authentication token. Set it if authentication is enabled.") ?> </label>
7677
<br/>
7778

7879
<?= \Controls\submit_tag(__("Save")) ?>
7980

8081
</form>
8182
<hr />
82-
<?php
83+
<?php
8384

8485
$enabled_feeds = $this->host->get_array($this, "enabled_feeds");
8586
$enabled_feeds = $this->filter_unknown_feeds($enabled_feeds);
@@ -200,9 +201,9 @@ public function api_version() {
200201
}
201202

202203
private function clean_html($html) {
203-
$html = str_replace(array('<br>', '<br/>', '<br />'), "\n", $html);
204-
$cleaned_html = strip_tags($html);
205-
return $cleaned_html;
204+
$html = str_replace(array('<br>', '<br/>', '<br />'), "\n", $html);
205+
$cleaned_html = strip_tags($html);
206+
return $cleaned_html;
206207
}
207208

208209
private function filter_unknown_feeds($enabled_feeds) {

0 commit comments

Comments
 (0)