X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fform.php;h=fcccb9c7524b4f4f78f4a5f35ec91842923485ec;hb=489099ca917d74ee2bdc406cb26f9e3269ade625;hp=f6501dc6daf699b0b190f748c459d34a064638f9;hpb=4b98edf75f4e255f8c61087bd1525d89653a521f;p=quix0rs-gnu-social.git diff --git a/lib/form.php b/lib/form.php index f6501dc6da..fcccb9c752 100644 --- a/lib/form.php +++ b/lib/form.php @@ -91,7 +91,9 @@ class Form extends Widget function sessionToken() { - $this->out->hidden('token', common_session_token()); + if (strtolower($this->method()) == 'post') { + $this->out->hidden('token-' . $this->id() ?: common_random_hexstr(3), common_session_token(), 'token'); + } } /** @@ -172,7 +174,13 @@ class Form extends Widget } /** - * Class of the form. + * Class of the form. May include space-separated list of multiple classes. + * + * If 'ajax' is included, the form will automatically be submitted with + * an 'ajax=1' parameter added, and the resulting form or error message + * will replace the form after submission. + * + * It's up to you to make sure that the target action supports this! * * @return string the form's class */ @@ -182,9 +190,9 @@ class Form extends Widget return 'form'; } - function li() + function li($class=null) { - $this->out->elementStart('li'); + $this->out->elementStart('li', $class); } function unli()