1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
namespace XoopsModules\Tag; |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
You may not change or alter any portion of this comment or credits |
7
|
|
|
of supporting developers from this source code or any supporting source code |
8
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
9
|
|
|
|
10
|
|
|
This program is distributed in the hope that it will be useful, |
11
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
12
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
13
|
|
|
*/ |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* XOOPS tag management module |
17
|
|
|
* |
18
|
|
|
* @copyright {@link https://sourceforge.net/projects/xoops/ The XOOPS Project} |
19
|
|
|
* @license {@link https://www.fsf.org/copyleft/gpl.html GNU public license} |
20
|
|
|
* @author Taiwen Jiang <[email protected]> |
21
|
|
|
* @author susheng yang <[email protected]> |
22
|
|
|
* @since 2.33 |
23
|
|
|
*/ |
24
|
|
|
require_once $GLOBALS['xoops']->path('/class/xoopsformloader.php'); |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* Class BlockForm |
28
|
|
|
*/ |
29
|
|
|
class BlockForm extends \XoopsForm |
30
|
|
|
{ |
31
|
|
|
/** |
32
|
|
|
* create HTML to output the form as a table |
33
|
|
|
* |
34
|
|
|
* @return string HTML div containing element |
35
|
|
|
*/ |
36
|
|
|
public function render(): string |
37
|
|
|
{ |
38
|
|
|
// $ele_name = $this->getName(); |
39
|
|
|
$ret = "<div>\n"; |
40
|
|
|
$hidden = ''; |
41
|
|
|
foreach ($this->getElements() as $ele) { |
42
|
|
|
if (!\is_object($ele)) { |
43
|
|
|
$ret .= $ele; |
44
|
|
|
} elseif ($ele->isHidden()) { |
45
|
|
|
$hidden .= $ele->render(); |
|
|
|
|
46
|
|
|
} else { |
47
|
|
|
if ('' != ($caption = $ele->getCaption())) { |
48
|
|
|
$ret .= "<div class='xoops-form-element-caption" . ($ele->isRequired() ? '-required' : '') . "'>\n" . " <span class='caption-text'>{$caption}</span>\n" . " <span class='caption-marker'>*</span>\n" . "</div>\n"; |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
$ret .= "<div style='margin:5px 0 8px 0; '>" . $ele->render() . "</div>\n"; |
|
|
|
|
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
$ret .= "</div>\n"; |
55
|
|
|
$ret .= $this->renderValidationJS(true); |
56
|
|
|
|
57
|
|
|
return $ret; |
58
|
|
|
} |
59
|
|
|
} |
60
|
|
|
|
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.