1: <?php
2: /*
3: You may not change or alter any portion of this comment or credits
4: of supporting developers from this source code or any supporting source code
5: which is considered copyrighted (c) material of the original comment or credit authors.
6:
7: This program is distributed in the hope that it will be useful,
8: but WITHOUT ANY WARRANTY; without even the implied warranty of
9: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: */
11:
12: /**
13: * Publisher class
14: *
15: * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/
16: * @license GNU GPL V2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
17: * @package Publisher
18: * @since 1.0
19: * @author trabis <lusopoemas@gmail.com>
20: * @version $Id$
21: */
22:
23: /**
24: * Form that will output formatted as a HTML table
25: *
26: * No styles and no JavaScript to check for required fields.
27: */
28: class PublisherBlockForm extends Xoops\Form\Form
29: {
30: public function __construct()
31: {
32: parent::__construct('', '', '');
33: }
34:
35: /**
36: * @return string
37: */
38: public function render()
39: {
40: $ret = '<table border="0" width="100%">' . NWLINE;
41: /* @var $ele Xoops\Form\Element */
42: foreach ($this->getElements() as $ele) {
43: if (!$ele->isHidden()) {
44: $ret .= '<tr><td colspan="2">';
45: $ret .= '<span style="font-weight: bold;">' . $ele->getCaption() . '</span>';
46: $ret .= '</td></tr><tr><td>' . $ele->render() . '</td></tr>';
47: }
48: }
49: $ret .= '</table>';
50: return $ret;
51: }
52: }
53: