From b9546011d61665c26842ed133bae46c355ce19d5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 23 Dec 2012 16:15:44 +0400 Subject: [PATCH] add example plugin --- plugins/example/example.js | 3 ++ plugins/example/example.php | 66 +++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 plugins/example/example.js create mode 100644 plugins/example/example.php 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 + } +} +?>