diff --git a/wallabag_v2/init.php b/wallabag_v2/init.php index eaeae33..64a12b3 100644 --- a/wallabag_v2/init.php +++ b/wallabag_v2/init.php @@ -22,55 +22,52 @@ function init($host) { function hook_prefs_tab($args) { if ($args != "prefPrefs") return; - $w_user = $this->host->get($this, "wallabag_username"); - $w_pass = $this->host->get($this, "wallabag_password"); - $w_url = $this->host->get($this, "wallabag_url"); - $w_cid = $this->host->get($this, "wallabag_client_id"); - $w_csec = $this->host->get($this, "wallabag_client_secret"); - $w_access = $this->host->get($this, "wallabag_access_token"); + $w_user = $this->host->get($this, "wallabag_username"); + $w_pass = $this->host->get($this, "wallabag_password"); + $w_url = $this->host->get($this, "wallabag_url"); + $w_cid = $this->host->get($this, "wallabag_client_id"); + $w_csec = $this->host->get($this, "wallabag_client_secret"); + $w_access = $this->host->get($this, "wallabag_access_token"); - print "
share ".__("Wallabag v2")."\">"; - print "
"; - print "
"; + ?> +
+
+ - print ""; + - print_hidden("op", "pluginhandler"); - print_hidden("method", "save"); - print_hidden("plugin", "wallabag_v2"); - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print "
".__("Wallabag URL (No trailing slash!)")."
".__("Wallabag Username")."
".__("Wallabag Password")."
".__("Wallabag Client ID")."
".__("Wallabag Client Secret")."
"; - print "

"; - if($w_access == null || $w_access == false|| $w_access == "") { - print " Alert: No OAuth tokens in Database! Submit Username and Password to retrieve new tokens."; - } else { - print " Submit this form without a Username and Password to reset the Wallabag OAuth Tokens to a null value."; - } - print "

"; - print "
"; #pane + + + + + + + + + + + +
+ + + + Alert: No OAuth tokens in Database! Submit Username and Password to retrieve new tokens. + + Submit this form without a Username and Password to reset the Wallabag OAuth Tokens to a null value. + + +
+ " + ti.title + ""); - } else { - Notify.error("Error saving to Wallabag!: ("+ti.status+": "+ti.error+") "+ti.error_msg+""); - } - } else { - Notify.error("The Wallabag_v2 plugin needs to be configured. See the README for help", true); + (reply) => { + if (reply.status) { + if (reply.status=="200") { + Notify.info("Saved to Wallabag: " + reply.title + ""); + } else { + Notify.error("Error saving to Wallabag!: ("+reply.status+": "+reply.error+") "+reply.error_msg+""); } - } - }); + } else { + Notify.error("The Wallabag_v2 plugin needs to be configured. See the README for help", true); + } + }); } catch (e) { - exception_error("wallabagArticle", e); + Notify.error("wallabagArticle", e); } }