From d8a1d2a25b2247e5a63f5b0ab7f0bd9423a217e5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 27 Dec 2012 16:55:25 +0400 Subject: add experimental key/value storage for plugins --- plugins/example/example.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'plugins/example/example.php') diff --git a/plugins/example/example.php b/plugins/example/example.php index eef604b4f..f3788ae8c 100644 --- a/plugins/example/example.php +++ b/plugins/example/example.php @@ -23,7 +23,9 @@ class Example extends Plugin { function save() { $example_value = db_escape_string($_POST["example_value"]); - echo "Value set to $example_value (not really)"; + $this->host->set($this, "example", $example_value); + + echo "Value set to $example_value"; } function get_prefs_js() { @@ -35,6 +37,13 @@ class Example extends Plugin { 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 ""; @@ -58,7 +67,7 @@ class Example extends Plugin { print ""; print ""; - print ""; + print ""; print "
".__("Sample value")."
"; -- cgit v1.2.3