From e938b1de117cfde17a5773fe0c6fc92185c873fe Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 30 Dec 2012 13:36:40 +0400 Subject: rename plugin main class files --- plugins/example/init.php | 82 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 plugins/example/init.php (limited to 'plugins/example/init.php') diff --git a/plugins/example/init.php b/plugins/example/init.php new file mode 100644 index 000000000..f3788ae8c --- /dev/null +++ b/plugins/example/init.php @@ -0,0 +1,82 @@ +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"]); + + $this->host->set($this, "example", $example_value); + + echo "Value set to $example_value"; + } + + function get_prefs_js() { + return file_get_contents(dirname(__FILE__) . "/example.js"); + } + + function hook_prefs_tab($args) { + if ($args != "prefPrefs") return; + + print "
"; + + print "
"; + +// print_r($this->host->set($this, "example", rand(0,100))); +// print_r($this->host->get_all($this)); + + $value = $this->host->get($this, "example"); + + print "
"; + + print ""; + + print ""; + print ""; + print ""; + + print ""; + + print ""; + print ""; + + print "
".__("Sample value")."
"; + + print "

"; + + print "

"; + + print "
"; #pane + } +} +?> -- cgit v1.2.3-54-g00ecf