From: Andrew Dolgov Date: Sun, 23 Dec 2012 12:15:44 +0000 (+0400) Subject: add example plugin X-Git-Tag: 1.7.0~152 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b9546011d61665c26842ed133bae46c355ce19d5;p=tt-rss.git add example plugin --- diff --git a/plugins/example/example.js b/plugins/example/example.js new file mode 100644 index 00000000..a31f2c2a --- /dev/null +++ b/plugins/example/example.js @@ -0,0 +1,3 @@ +function example(value) { + alert("Value saved: " + value); +} diff --git a/plugins/example/example.php b/plugins/example/example.php new file mode 100644 index 00000000..e49ee5f2 --- /dev/null +++ b/plugins/example/example.php @@ -0,0 +1,66 @@ +link = $host->get_link(); + $this->host = $host; + + $host->add_hook($host::HOOK_PREFS_TAB, $this); + } + + function save() { + $example_value = db_escape_string($_POST["example_value"]); + + echo "Value set to $example_value (not really)"; + } + + function get_prefs_js() { + return file_get_contents(dirname(__FILE__) . "/example.js"); + } + + function hook_prefs_tab($args) { + if ($args != "prefPrefs") return; + + print "
"; + + print "
"; + + print ""; + + print ""; + print ""; + print ""; + + print ""; + + print ""; + print ""; + + print "
".__("Sample value")."
"; + + print "

"; + + print "

"; + + print "
"; #pane + } +} +?>