summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-12-27 16:55:25 +0400
committerAndrew Dolgov <[email protected]>2012-12-27 16:55:25 +0400
commitd8a1d2a25b2247e5a63f5b0ab7f0bd9423a217e5 (patch)
tree6f02c9cdc2d9a7ea869d87a6e93cbd6ee248520e /plugins
parent0f28f81f8911e432ae4bf50da7ed2c334618fd95 (diff)
add experimental key/value storage for plugins
Diffstat (limited to 'plugins')
-rw-r--r--plugins/example/example.php15
1 files changed, 12 insertions, 3 deletions
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 "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__("Example Pane")."\">";
+ print "<br/>";
+
+// print_r($this->host->set($this, "example", rand(0,100)));
+// print_r($this->host->get_all($this));
+
+ $value = $this->host->get($this, "example");
+
print "<form dojoType=\"dijit.form.Form\">";
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
@@ -47,7 +56,7 @@ class Example extends Plugin {
notify_info(transport.responseText);
}
});
- this.reset();
+ //this.reset();
}
</script>";
@@ -58,7 +67,7 @@ class Example extends Plugin {
print "<table width=\"100%\" class=\"prefPrefsList\">";
print "<tr><td width=\"40%\">".__("Sample value")."</td>";
- print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" name=\"example_value\"></td></tr>";
+ print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" name=\"example_value\" value=\"$value\"></td></tr>";
print "</table>";