1: | <?php |
2: | /** |
3: | * XOOPS simple form |
4: | * |
5: | * You may not change or alter any portion of this comment or credits |
6: | * of supporting developers from this source code or any supporting source code |
7: | * which is considered copyrighted (c) material of the original comment or credit authors. |
8: | * This program is distributed in the hope that it will be useful, |
9: | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10: | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
11: | * |
12: | * @copyright (c) 2000-2016 XOOPS Project (www.xoops.org) |
13: | * @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html) |
14: | * @package kernel |
15: | * @subpackage form |
16: | * @since 2.0.0 |
17: | * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ |
18: | */ |
19: | |
20: | defined('XOOPS_ROOT_PATH') || exit('Restricted access'); |
21: | |
22: | /** |
23: | * base class |
24: | */ |
25: | xoops_load('XoopsForm'); |
26: | |
27: | /** |
28: | * Form that will output as a simple HTML form with minimum formatting |
29: | */ |
30: | class XoopsSimpleForm extends XoopsForm |
31: | { |
32: | /** |
33: | * create HTML to output the form with minimal formatting |
34: | * |
35: | * @return string |
36: | */ |
37: | public function render() |
38: | { |
39: | $ret = $this->getTitle() . "\n<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n"; |
40: | foreach ($this->getElements() as $ele) { |
41: | if (!$ele->isHidden()) { |
42: | $ret .= '<strong>' . $ele->getCaption() . '</strong><br>' . $ele->render() . "<br>\n"; |
43: | } else { |
44: | $ret .= $ele->render() . "\n"; |
45: | } |
46: | } |
47: | $ret .= "</form>\n"; |
48: | |
49: | return $ret; |
50: | } |
51: | } |
52: |