mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-14 17:35:56 +00:00
add experimental key/value storage for plugins
This commit is contained in:
@@ -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>";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user