1 | <?php |
||
27 | /** |
||
28 | * Creates a text field with jquery ui calendar & time select popup |
||
29 | */ |
||
30 | class FormDateTimePicker extends \XoopsFormText |
||
31 | { |
||
32 | /** |
||
33 | * Contains the maximum field size |
||
34 | */ |
||
35 | public const MAXSIZE = 25; |
||
36 | |||
37 | /** |
||
38 | * Constructor to build FormDateTimePicker object |
||
39 | * @param mixed $caption HTML description to display for the element |
||
40 | * @param mixed $name HTML element name (ie. name='$name') |
||
41 | * @param mixed $size size of field to display |
||
42 | * @param mixed $value timestamp of date/time to show |
||
43 | */ |
||
44 | public function __construct($caption, $name, $size, $value) |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * Generate the HTML <input> to display the date/time field |
||
54 | * @return string HTML code used to display in a form |
||
55 | */ |
||
56 | public function render() |
||
57 | { |
||
58 | static $included = false; |
||
59 | |||
60 | $ele_name = $this->getName(); |
||
61 | $ele_value = $this->getValue(true); |
||
62 | // if (is_string($ele_value)) { |
||
63 | if (!\is_numeric($ele_value)) { |
||
64 | $display_value = $ele_value; |
||
65 | $ele_value = \time(); |
||
66 | } else { |
||
67 | // $display_value = ''; |
||
68 | // $display_value = formatTimestamp($ele_value, 'm'); |
||
69 | $display_value = \ucfirst(\date(_MEDIUMDATESTRING, $ele_value)); |
||
70 | } |
||
71 | |||
72 | if (\is_object($GLOBALS['xoTheme'])) { |
||
73 | $moduleHandler = \xoops_getHandler('module'); |
||
74 | $sys_module = $moduleHandler->getByDirname('system'); |
||
75 | $configHandler = \xoops_getHandler('config'); |
||
76 | $moduleConfig = $configHandler->getConfigsByCat(0, $sys_module->getVar('mid')); |
||
77 | $jq_theme_dir = $moduleConfig['jquery_theme']; |
||
78 | |||
79 | $GLOBALS['xoTheme']->addStylesheet($GLOBALS['xoops']->url("modules/system/css/ui/{$jq_theme_dir}/ui.all.css")); |
||
80 | $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/jquery.js'); |
||
81 | $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js'); |
||
82 | $GLOBALS['xoTheme']->addScript('browse.php?modules/xoopspoll/assets/js/jquery-ui-timepicker-addon.js'); |
||
83 | $GLOBALS['xoTheme']->addScript('browse.php?modules/xoopspoll/assets/js/jquery-ui-sliderAccess.js'); |
||
84 | $GLOBALS['xoTheme']->addStylesheet($GLOBALS['xoops']->url('modules/xoopspoll/assets/css/datetimepicker.css')); |
||
85 | |||
86 | if (!$included) { |
||
87 | $included = true; |
||
88 | \xoops_loadLanguage('admin', 'xoopspoll'); |
||
89 | // setup regional date variables |
||
90 | $reg_values = "closeText: '" |
||
91 | . \_AM_XOOPSPOLL_DTP_CLOSETEXT |
||
92 | . "'," |
||
93 | . "prevText: '" |
||
94 | . \_AM_XOOPSPOLL_DTP_PREVTEXT |
||
95 | . "'," |
||
96 | . "nextText: '" |
||
97 | . \_AM_XOOPSPOLL_DTP_NEXTTEXT |
||
98 | . "'," |
||
99 | . "currentText: '" |
||
100 | . \_AM_XOOPSPOLL_DTP_CURRENTTEXT |
||
101 | . "'," |
||
102 | . 'monthNames: [' |
||
103 | . \_AM_XOOPSPOLL_DTP_MONTHNAMES |
||
104 | . '],' |
||
105 | . 'monthNamesShort: [' |
||
106 | . \_AM_XOOPSPOLL_DTP_MONTHNAMESSHORT |
||
107 | . '],' |
||
108 | . 'dayNames: [' |
||
109 | . \_AM_XOOPSPOLL_DTP_DAYNAMES |
||
110 | . '],' |
||
111 | . 'dayNamesShort: [' |
||
112 | . \_AM_XOOPSPOLL_DTP_DAYNAMESSHORT |
||
177 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.