diff options
author | Andrew Dolgov <[email protected]> | 2021-02-17 21:44:21 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-17 21:44:21 +0300 |
commit | e4609c18efceebb1e021d814f53061ada7f6489a (patch) | |
tree | 0968e0da3dc2d1b4cdc12c2a29549c27dc82ea14 /include | |
parent | b16abc157ee584f4be80a537ee24ec9e5ff25496 (diff) |
* add (disabled) shortcut syntax for plugin methods
* add controls shortcut for pluginhandler tags
* add similar shortcut for frontend
* allow plugins to selectively exclude their methods from CSRF checking
Diffstat (limited to 'include')
-rwxr-xr-x | include/controls.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/controls.php b/include/controls.php index 4c60d94f3..d8506877b 100755 --- a/include/controls.php +++ b/include/controls.php @@ -11,6 +11,17 @@ return $rv; } + // shortcut syntax (disabled) + /* function pluginhandler_tags(\Plugin $plugin, string $method) { + return hidden_tag("op", strtolower(get_class($plugin) . \PluginHost::PUBLIC_METHOD_DELIMITER . $method)); + } */ + + function pluginhandler_tags(\Plugin $plugin, string $method) { + return hidden_tag("op", "pluginhandler") . + hidden_tag("plugin", strtolower(get_class($plugin))) . + hidden_tag("method", $method); + } + function button_tag(string $value, string $type, array $attributes = []) { return "<button dojoType=\"dijit.form.Button\" ".attributes_to_string($attributes)." type=\"$type\">".htmlspecialchars($value)."</button>"; } @@ -155,4 +166,3 @@ return $ret; } - |