1 | <?php |
||||||
2 | |||||||
3 | namespace XoopsModules\Wgsitenotice\Common; |
||||||
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 | * Feedback plugin for xoops modules |
||||||
17 | * |
||||||
18 | * @copyright XOOPS Project (https://xoops.org) |
||||||
19 | * @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
||||||
20 | * @author Michael Beck <[email protected]> |
||||||
21 | * @author Wedega - Email:<[email protected]> |
||||||
22 | * @author Fernando Santos (topet05) <[email protected]> |
||||||
23 | */ |
||||||
24 | \defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
||||||
25 | |||||||
26 | /** |
||||||
27 | * Class Object ModuleFeedback |
||||||
28 | */ |
||||||
29 | class ModuleFeedback extends \XoopsObject |
||||||
0 ignored issues
–
show
|
|||||||
30 | { |
||||||
31 | public $name = ''; |
||||||
32 | public $email = ''; |
||||||
33 | public $site = ''; |
||||||
34 | public $type = ''; |
||||||
35 | public $content = ''; |
||||||
36 | |||||||
37 | /** |
||||||
38 | * Constructor |
||||||
39 | * |
||||||
40 | * @param null |
||||||
41 | */ |
||||||
42 | public function __construct() |
||||||
43 | { |
||||||
44 | } |
||||||
45 | |||||||
46 | /** |
||||||
47 | * @static function &getInstance |
||||||
48 | * |
||||||
49 | * @param null |
||||||
50 | */ |
||||||
51 | public static function getInstance() |
||||||
52 | { |
||||||
53 | static $instance = false; |
||||||
54 | if (!$instance) { |
||||||
55 | $instance = new self(); |
||||||
56 | } |
||||||
57 | } |
||||||
58 | |||||||
59 | /** |
||||||
60 | * @public function getFormFeedback: |
||||||
61 | * provide form for sending a feedback to module author |
||||||
62 | * @return \XoopsThemeForm |
||||||
63 | */ |
||||||
64 | public function getFormFeedback() |
||||||
65 | { |
||||||
66 | $moduleDirName = \basename(\dirname(__DIR__, 2)); |
||||||
67 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
||||||
68 | // Get Theme Form |
||||||
69 | \xoops_load('XoopsFormLoader'); |
||||||
0 ignored issues
–
show
The function
xoops_load was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
70 | $form = new \XoopsThemeForm(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_FORM_TITLE'), 'formfeedback', 'feedback.php', 'post', true); |
||||||
0 ignored issues
–
show
The type
XoopsThemeForm was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
71 | $form->setExtra('enctype="multipart/form-data"'); |
||||||
72 | |||||||
73 | $recipient = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_RECIPIENT'), 'recipient', 50, 255, $GLOBALS['xoopsModule']->getInfo('author_mail')); |
||||||
0 ignored issues
–
show
The type
XoopsFormText was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
74 | $recipient->setExtra('disabled="disabled"'); |
||||||
75 | $form->addElement($recipient); |
||||||
76 | $your_name = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME'), 'your_name', 50, 255, $this->name); |
||||||
77 | $your_name->setExtra('placeholder="' . \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME_PLACEHOLER') . '"'); |
||||||
78 | $form->addElement($your_name); |
||||||
79 | $your_site = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE'), 'your_site', 50, 255, $this->site); |
||||||
80 | $your_site->setExtra('placeholder="' . \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE_PLACEHOLER') . '"'); |
||||||
81 | $form->addElement($your_site); |
||||||
82 | $your_mail = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL'), 'your_mail', 50, 255, $this->email); |
||||||
83 | $your_mail->setExtra('placeholder="' . \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL_PLACEHOLER') . '"'); |
||||||
84 | $form->addElement($your_mail); |
||||||
85 | |||||||
86 | $fbtypeSelect = new \XoopsFormSelect(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE'), 'fb_type', $this->type); |
||||||
0 ignored issues
–
show
The type
XoopsFormSelect was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
87 | $fbtypeSelect->addOption(''); |
||||||
88 | $fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_SUGGESTION'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_SUGGESTION')); |
||||||
89 | $fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_BUGS'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_BUGS')); |
||||||
90 | $fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_TESTIMONIAL'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_TESTIMONIAL')); |
||||||
91 | $fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_FEATURES'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_FEATURES')); |
||||||
92 | $fbtypeSelect->addOption(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_OTHERS'), \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_OTHERS')); |
||||||
93 | $form->addElement($fbtypeSelect, true); |
||||||
94 | |||||||
95 | $editorConfigs = []; |
||||||
96 | $editorConfigs['name'] = 'fb_content'; |
||||||
97 | $editorConfigs['value'] = $this->content; |
||||||
98 | $editorConfigs['rows'] = 5; |
||||||
99 | $editorConfigs['cols'] = 40; |
||||||
100 | $editorConfigs['width'] = '100%'; |
||||||
101 | $editorConfigs['height'] = '400px'; |
||||||
102 | $moduleHandler = \xoops_getHandler('module'); |
||||||
0 ignored issues
–
show
The function
xoops_getHandler was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
103 | $module = $moduleHandler->getByDirname('system'); |
||||||
104 | $configHandler = \xoops_getHandler('config'); |
||||||
105 | $config = &$configHandler->getConfigsByCat(0, $module->getVar('mid')); |
||||||
106 | $editorConfigs['editor'] = $config['general_editor']; |
||||||
107 | $editor = new \XoopsFormEditor(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_CONTENT'), 'fb_content', $editorConfigs); |
||||||
0 ignored issues
–
show
The type
XoopsFormEditor was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
108 | $form->addElement($editor, true); |
||||||
109 | |||||||
110 | $form->addElement(new \XoopsFormHidden('op', 'send')); |
||||||
0 ignored issues
–
show
The type
XoopsFormHidden was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
111 | $form->addElement(new \XoopsFormButtonTray('', \_SUBMIT, 'submit', '', false)); |
||||||
0 ignored issues
–
show
The type
XoopsFormButtonTray was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||||
112 | |||||||
113 | return $form; |
||||||
114 | } |
||||||
115 | } |
||||||
116 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths