X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fform.php;h=f6501dc6daf699b0b190f748c459d34a064638f9;hb=7ca57e32aa25daae3bbf69987d2ec12899e4e173;hp=61c20fd48bdc127031a264a40c9af9d7b1439569;hpb=d35b2d3f3c2128b147a6fa897032262c1f632262;p=quix0rs-gnu-social.git diff --git a/lib/form.php b/lib/form.php index 61c20fd48b..f6501dc6da 100644 --- a/lib/form.php +++ b/lib/form.php @@ -21,14 +21,14 @@ * * @category Widget * @package StatusNet - * @author Evan Prodromou - * @author Sarven Capadisli + * @author Evan Prodromou + * @author Sarven Capadisli * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -42,8 +42,8 @@ require_once INSTALLDIR.'/lib/widget.php'; * * @category Widget * @package StatusNet - * @author Evan Prodromou - * @author Sarven Capadisli + * @author Evan Prodromou + * @author Sarven Capadisli * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ * @@ -67,7 +67,7 @@ class Form extends Widget { $attributes = array('id' => $this->id(), 'class' => $this->formClass(), - 'method' => 'post', + 'method' => $this->method(), 'action' => $this->action()); if (!empty($this->enctype)) { @@ -119,6 +119,18 @@ class Form extends Widget { } + /** + * HTTP method used to submit the form + * + * Defaults to post. Subclasses can override if they need to. + * + * @return string the method to use for submitting + */ + function method() + { + return 'post'; + } + /** * Buttons for form actions * @@ -169,4 +181,14 @@ class Form extends Widget { return 'form'; } + + function li() + { + $this->out->elementStart('li'); + } + + function unli() + { + $this->out->elementEnd('li'); + } }