|
1
|
|
|
<?php namespace XoopsModules\Tdmcreate\Form; |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
You may not change or alter any portion of this comment or credits |
|
5
|
|
|
of supporting developers from this source code or any supporting source code |
|
6
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
|
7
|
|
|
|
|
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
|
|
|
/** |
|
13
|
|
|
* Tab - a form tab. |
|
14
|
|
|
* |
|
15
|
|
|
* @category XoopsFormTab |
|
16
|
|
|
* |
|
17
|
|
|
* @author trabis <[email protected]> |
|
18
|
|
|
* @copyright 2012-2014 XOOPS Project (https://xoops.org) |
|
19
|
|
|
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) |
|
20
|
|
|
* |
|
21
|
|
|
* @link https://xoops.org |
|
22
|
|
|
* @since 2.0.0 |
|
23
|
|
|
*/ |
|
24
|
|
|
\XoopsLoad::load('XoopsFormElementTray'); |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* Class Tdmcreate\FormTab. |
|
28
|
|
|
*/ |
|
29
|
|
|
class FormTab extends \XoopsFormElementTray |
|
30
|
|
|
{ |
|
31
|
|
|
/** |
|
32
|
|
|
* __construct. |
|
33
|
|
|
* |
|
34
|
|
|
* @param string $caption tab caption |
|
35
|
|
|
* @param string $name unique identifier for this tab |
|
36
|
|
|
*/ |
|
37
|
|
|
public function __construct($caption, $name) |
|
38
|
|
|
{ |
|
39
|
|
|
$this->setName($name); |
|
40
|
|
|
$this->setCaption($caption); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* render. |
|
45
|
|
|
* |
|
46
|
|
|
* @return string |
|
47
|
|
|
*/ |
|
48
|
|
|
public function render() |
|
49
|
|
|
{ |
|
50
|
|
|
$ret = ''; |
|
51
|
|
|
/* @var $ele \XoopsFormElement */ |
|
52
|
|
|
foreach ($this->getElements() as $ele) { |
|
53
|
|
|
$ret .= NWLINE; |
|
54
|
|
|
$ret .= '<tr>'.NWLINE; |
|
55
|
|
|
$ret .= '<td class="head" width="30%">'.NWLINE; |
|
56
|
|
|
$required = $ele->isRequired() ? '-required' : ''; |
|
57
|
|
|
$ret .= '<div class="xoops-form-element-caption'.$required.'">'.NWLINE; |
|
58
|
|
|
$ret .= '<span class="caption-text">'.$ele->getCaption().'</span>'.NWLINE; |
|
59
|
|
|
$ret .= '<span class="caption-marker">*</span>'.NWLINE; |
|
60
|
|
|
$ret .= '</div>'.NWLINE; |
|
61
|
|
|
$description = $ele->getDescription(); |
|
62
|
|
|
if ($description) { |
|
63
|
|
|
$ret .= '<div style="font-weight: normal">'.NWLINE; |
|
64
|
|
|
$ret .= $description.NWLINE; |
|
65
|
|
|
$ret .= '</div>'.NWLINE; |
|
66
|
|
|
} |
|
67
|
|
|
$ret .= '</td>'.NWLINE; |
|
68
|
|
|
$ret .= '<td class="even">'.NWLINE; |
|
69
|
|
|
$ret .= $ele->render().NWLINE; |
|
|
|
|
|
|
70
|
|
|
$ret .= '<span class="form-horizontal">'.$ele->getDescription().'</span>'; |
|
71
|
|
|
$ret .= '</td>'.NWLINE; |
|
72
|
|
|
$ret .= '</tr>'.NWLINE; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
return $ret; |
|
76
|
|
|
} |
|
77
|
|
|
} |
|
78
|
|
|
|
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.