ClassXoopsCode::getClassXoopsFormRadio()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 6
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace XoopsModules\Tdmcreate\Files\Classes;
4
5
use XoopsModules\Tdmcreate;
6
7
/*
8
 You may not change or alter any portion of this comment or credits
9
 of supporting developers from this source code or any supporting source code
10
 which is considered copyrighted (c) material of the original comment or credit authors.
11
12
 This program is distributed in the hope that it will be useful,
13
 but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
 */
16
/**
17
 * tdmcreate module.
18
 *
19
 * @copyright       XOOPS Project (https://xoops.org)
20
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
21
 *
22
 * @since           2.5.0
23
 *
24
 * @author          Txmod Xoops http://www.txmodxoops.org
25
 *
26
 */
27
28
/**
29
 * Class ClassXoopsCode.
30
 */
31
class ClassXoopsCode
32
{
33
    /*
34
    *  @static function getInstance
35
    *  @param null
36
    */
37
38
    /**
39
     * @return ClassXoopsCode
40
     */
41
    public static function getInstance()
42
    {
43
        static $instance = false;
44
        if (!$instance) {
45
            $instance = new self();
46
        }
47
48
        return $instance;
49
    }
50
51
    /**
52
     * @public function getClassAdd
53
     *
54
     * @param string $paramLeft
55
     * @param string $paramRight
56
     * @param string $var
57
     * @param string $t
58
     *
59
     * @return string
60
     */
61
    public function getClassInitVar($paramLeft = '', $paramRight = '', $var = 'this', $t = "\t\t")
62
    {
63
        $stuParamRight = mb_strtoupper($paramRight);
64
65
        return "{$t}\${$var}->initVar('{$paramLeft}', XOBJ_DTYPE_{$stuParamRight});\n";
66
    }
67
68
    /**
69
     * @public function getClassXoopsPageNav
70
     *
71
     * @param        $var
72
     * @param        $param1
73
     * @param null   $param2
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $param2 is correct as it would always require null to be passed?
Loading history...
74
     * @param null   $param3
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $param3 is correct as it would always require null to be passed?
Loading history...
75
     * @param null   $param4
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $param4 is correct as it would always require null to be passed?
Loading history...
76
     * @param null   $param5
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $param5 is correct as it would always require null to be passed?
Loading history...
77
     * @param bool   $isParam
78
     * @param string $t
79
     *
80
     * @return string
81
     */
82
    public function getClassXoopsPageNav($var, $param1, $param2 = null, $param3 = null, $param4 = null, $param5 = null, $isParam = false, $t = '')
83
    {
84
        $xPageNav = 'new \XoopsPageNav(';
85
        if (false === $isParam) {
86
            $ret = "{$t}\${$var} = {$xPageNav}\${$param1}, \${$param2}, \${$param3}, '{$param4}', {$param5});\n";
87
        } else {
88
            $ret = "{$xPageNav}\${$param1}, \${$param2}, \${$param3}, '{$param4}', {$param5})";
89
        }
90
91
        return $ret;
92
    }
93
94
    /**
95
     * @public function getXoopsSimpleForm
96
     *
97
     * @param string $left
98
     * @param string $element
99
     * @param string $elementsContent
100
     * @param string $caption
101
     * @param string $var
102
     * @param string $filename
103
     * @param string $type
104
     * @param string $t
105
     *
106
     * @return string
107
     */
108
    public function getXoopsSimpleForm($left = '', $element = '', $elementsContent = '', $caption = '', $var = '', $filename = '', $type = 'post', $t = '')
109
    {
110
        $ret = "{$t}\${$left} = new \XoopsSimpleForm({$caption}, '{$var}', '{$filename}.php', '{$type}');\n";
111
        if (!empty($elementsContent)) {
112
            $ret .= $elementsContent;
113
        }
114
        $ret .= "{$t}\${$left}->addElement(\${$element});\n";
115
        $ret .= "{$t}\${$left}->display();\n";
116
117
        return $ret;
118
    }
119
120
    /**
121
     * @public function getClassXoopsThemeForm
122
     *
123
     * @param        $var
124
     * @param        $param1
125
     * @param null   $param2
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $param2 is correct as it would always require null to be passed?
Loading history...
126
     * @param null   $param3
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $param3 is correct as it would always require null to be passed?
Loading history...
127
     * @param null   $param4
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $param4 is correct as it would always require null to be passed?
Loading history...
128
     * @param bool   $isParam
129
     * @param string $t
130
     *
131
     * @return string
132
     */
133
    public function getClassXoopsThemeForm($var, $param1, $param2 = null, $param3 = null, $param4 = null, $isParam = false, $t = "\t\t")
134
    {
135
        $themeForm = 'new \XoopsThemeForm(';
136
        if (false === $isParam) {
137
            $ret = "{$t}\${$var} = {$themeForm}\${$param1}, '{$param2}', \${$param3}, '{$param4}', true);\n";
138
        } else {
139
            $ret = "{$themeForm}\${$param1}, '{$param2}', \${$param3}, '{$param4}', true)";
140
        }
141
142
        return $ret;
143
    }
144
145
    /**
146
     * @public function XoopsFormElementTray
147
     *
148
     * @param        $var
149
     * @param        $param1
150
     * @param string $param2
151
     * @param string $t
152
     *
153
     * @return string
154
     */
155
    public function getClassXoopsFormElementTray($var, $param1, $param2 = '', $t = "\t\t")
156
    {
157
        return "{$t}\${$var} = new \XoopsFormElementTray({$param1}, '{$param2}' );\n";
158
    }
159
160
    /**
161
     * @public function getClassXoopsFormLabel
162
     *
163
     * @param        $var
164
     * @param string $param1
165
     * @param null $param2
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $param2 is correct as it would always require null to be passed?
Loading history...
166
     * @param bool $isParam
167
     * @param string $t
168
     *
169
     * @param bool $useParam
170
     * @return string
171
     */
172
    public function getClassXoopsFormLabel($var, $param1 = '', $param2 = null, $isParam = false, $t = "\t\t", $useParam = false)
173
    {
174
        $label  = 'new \XoopsFormLabel(';
175
        if (false === $useParam) {
176
            $params = null != $param2 ? "{$param1}, {$param2}" : $param1;
0 ignored issues
show
introduced by
The condition null != $param2 is always false.
Loading history...
177
        } else {
178
            $params = null != $param2 ? "{$param1}, \${$param2}" : $param1;
0 ignored issues
show
introduced by
The condition null != $param2 is always false.
Loading history...
179
        }
180
        if (false === $isParam) {
181
            $ret = "{$t}\${$var} = {$label}{$params});\n";
182
        } else {
183
            $ret = "{$label}{$params})";
184
        }
185
186
        return $ret;
187
    }
188
189
    /**
190
     * @public function getClassXoopsFormFile
191
     *
192
     * @param        $var
193
     * @param        $param1
194
     * @param        $param2
195
     * @param        $param3
196
     * @param bool   $isParam
197
     * @param string $t
198
     *
199
     * @return string
200
     */
201
    public function getClassXoopsFormFile($var, $param1, $param2, $param3, $isParam = false, $t = "\t\t")
202
    {
203
        $file = 'new \XoopsFormFile( ';
204
        if (false === $isParam) {
205
            $ret = "{$t}\${$var} = {$file}{$param1}, '{$param2}', {$param3} );\n";
206
        } else {
207
            $ret = "{$file}{$param1}, '{$param2}', {$param3} )";
208
        }
209
210
        return $ret;
211
    }
212
213
    /**
214
     * @public function getClassXoopsFormHidden
215
     *
216
     * @param        $var
217
     * @param        $param1
218
     * @param        $param2
219
     * @param bool $isForm
220
     * @param bool $isParam
221
     * @param string $t
222
     *
223
     * @param bool $useParam
224
     * @return string
225
     */
226
    public function getClassXoopsFormHidden($var, $param1, $param2, $isForm = false, $isParam = false, $t = "\t\t", $useParam = false)
227
    {
228
        $hidden       = 'new \XoopsFormHidden( ';
229
        $getVarHidden = Tdmcreate\Files\CreateXoopsCode::getInstance()->getXcGetVar('', 'this', $param2, true);
230
        $ret          = '';
231
        if (false === $isParam) {
232
            $ret .= "{$t}\${$var} = {$hidden}{$param1}, {$getVarHidden} );\n";
233
        } else {
234
            if (false === $isForm) {
235
                $ret .= "{$hidden}{$param1}, {$param2} )";
236
            } else {
237
                if (false === $useParam) {
238
                    $ret .= "{$hidden}'{$param1}', '{$param2}' )";
239
                } else {
240
                    $ret .= "{$hidden}'{$param1}', \${$param2} )";
241
                }
242
            }
243
        }
244
245
        return $ret;
246
    }
247
248
    /**
249
     * @public function getClassXoopsFormText
250
     *
251
     * @param        $var
252
     * @param        $param1
253
     * @param        $param2
254
     * @param int    $param3
255
     * @param int    $param4
256
     * @param        $param5
257
     * @param bool   $isParam
258
     * @param string $t
259
     *
260
     * @return string
261
     */
262
    public function getClassXoopsFormText($var, $param1, $param2, $param3, $param4, $param5, $isParam = false, $t = "\t\t")
263
    {
264
        $text = 'new \XoopsFormText( ';
265
        if (false === $isParam) {
266
            $ret = "{$t}\${$var} = {$text}{$param1}, '{$param2}', {$param3}, {$param4}, \${$param5} );\n";
267
        } else {
268
            $ret = "{$text}{$param1}, '{$param2}', {$param3}, {$param4}, \${$param5} )";
269
        }
270
271
        return $ret;
272
    }
273
274
    /**
275
     * @public function getClassXoopsFormTextArea
276
     *
277
     * @param        $var
278
     * @param        $param1
279
     * @param        $param2
280
     * @param        $param3
281
     * @param        $param4
282
     * @param bool   $isParam
283
     * @param string $t
284
     *
285
     * @return string
286
     */
287
    public function getClassXoopsFormTextArea($var, $param1, $param2, $param3, $param4, $isParam = false, $t = "\t\t")
288
    {
289
        $area           = 'new \XoopsFormTextArea( ';
290
        $getVarTextArea = Tdmcreate\Files\CreateXoopsCode::getInstance()->getXcGetVar('', 'this', $param2, true);
291
        if (false === $isParam) {
292
            $ret = "{$t}\${$var} = {$area}{$param1}, '{$param2}', {$getVarTextArea}, {$param3}, {$param4} );\n";
293
        } else {
294
            $ret = "{$area}{$param1}, '{$param2}', {$getVarTextArea}, {$param3}, {$param4} )";
295
        }
296
297
        return $ret;
298
    }
299
300
    /**
301
     * @public function getClassXoopsFormColorPicker
302
     *
303
     * @param        $var
304
     * @param        $param1
305
     * @param        $param2
306
     * @param        $param3
307
     * @param bool   $isParam
308
     * @param string $t
309
     *
310
     * @return string
311
     */
312
    public function getClassXoopsFormColorPicker($var, $param1, $param2, $param3, $isParam = false, $t = "\t\t")
313
    {
314
        $picker = 'new \XoopsFormColorPicker( ';
315
        if (false === $isParam) {
316
            $ret = "{$t}\${$var} = {$picker}{$param1}, '{$param2}', {$param3} );\n";
317
        } else {
318
            $ret = "{$picker}{$param1}, '{$param2}', {$param3} )";
319
        }
320
321
        return $ret;
322
    }
323
324
    /**
325
     * @public function getClassXoopsFormSelectUser
326
     *
327
     * @param        $var
328
     * @param        $param1
329
     * @param        $param2
330
     * @param string $param3
331
     * @param        $param4
332
     * @param bool   $isParam
333
     * @param string $t
334
     *
335
     * @return string
336
     */
337
    public function getClassXoopsFormSelectUser($var, $param1, $param2, $param3, $param4, $isParam = false, $t = "\t\t")
338
    {
339
        $user             = 'new \XoopsFormSelectUser( ';
340
        $getVarSelectUser = Tdmcreate\Files\CreateXoopsCode::getInstance()->getXcGetVar('', 'this', $param4, true);
341
        if (false === $isParam) {
342
            $ret = "{$t}\${$var} = {$user}{$param1}, '{$param2}', {$param3}, {$getVarSelectUser} );\n";
343
        } else {
344
            $ret = "{$user}{$param1}, '{$param2}', {$param3}, {$getVarSelectUser} )";
345
        }
346
347
        return $ret;
348
    }
349
350
    /**
351
     * @public function getClassXoopsFormTextDateSelect
352
     *
353
     * @param        $var
354
     * @param        $param1
355
     * @param        $param2
356
     * @param string $param3
357
     * @param        $param4
358
     * @param bool   $isParam
359
     * @param string $t
360
     *
361
     * @return string
362
     */
363
    public function getClassXoopsFormTextDateSelect($var, $param1, $param2, $param3, $param4, $isParam = false, $t = "\t\t")
364
    {
365
        $tdate                = 'new \XoopsFormTextDateSelect( ';
366
        $getVarTextDateSelect = Tdmcreate\Files\CreateXoopsCode::getInstance()->getXcGetVar('', 'this', $param3, true);
367
        if (false === $isParam) {
368
            $ret = "{$t}\${$var} = {$tdate}{$param1}, '{$param2}', '', {$getVarTextDateSelect} );\n";
369
        } else {
370
            $ret = "{$tdate}{$param1}, '{$param2}', '', \${$param4} )";
371
        }
372
373
        return $ret;
374
    }
375
376
    /**
377
     * @public function getClassXoopsFormDateTime
378
     *
379
     * @param        $var
380
     * @param        $param1
381
     * @param        $param2
382
     * @param string $param3
383
     * @param        $param4
384
     * @param bool   $isParam
385
     * @param string $t
386
     *
387
     * @return string
388
     */
389
    public function getClassXoopsFormDateTime($var, $param1, $param2, $param3, $param4, $isParam = false, $t = "\t\t")
390
    {
391
        $tdate                = 'new \XoopsFormDateTime( ';
392
        $getVarTextDateSelect = Tdmcreate\Files\CreateXoopsCode::getInstance()->getXcGetVar('', 'this', $param3, true);
393
        if (false === $isParam) {
394
            $ret = "{$t}\${$var} = {$tdate}{$param1}, '{$param2}', '', {$getVarTextDateSelect} );\n";
395
        } else {
396
            $ret = "{$tdate}{$param1}, '{$param2}', '', \${$param4} )";
397
        }
398
399
        return $ret;
400
    }
401
402
    /**
403
     * @public function getClassXoopsFormEditor
404
     *
405
     * @param        $var
406
     * @param        $param1
407
     * @param        $param2
408
     * @param        $param3
409
     * @param bool   $isParam
410
     * @param string $t
411
     *
412
     * @return string
413
     */
414
    public function getClassXoopsFormEditor($var, $param1, $param2, $param3, $isParam = false, $t = "\t\t")
415
    {
416
        $editor = 'new \XoopsFormEditor( ';
417
        if (false === $isParam) {
418
            $ret = "{$t}\${$var} = {$editor}{$param1}, '{$param2}', \${$param3});\n";
419
        } else {
420
            $ret = "{$editor}{$param1}, '{$param2}', \${$param3})";
421
        }
422
423
        return $ret;
424
    }
425
426
    /**
427
     * @public function getClassXoopsFormCheckBox
428
     *
429
     * @param        $var
430
     * @param        $param1
431
     * @param        $param2
432
     * @param        $param3
433
     * @param bool   $isParam
434
     * @param string $t
435
     *
436
     * @return string
437
     */
438
    public function getClassXoopsFormCheckBox($var, $param1, $param2, $param3, $isParam = false, $t = "\t\t")
439
    {
440
        $checkBox = 'new \XoopsFormCheckBox( ';
441
        if (false === $isParam) {
442
            $ret = "{$t}\${$var} = {$checkBox}{$param1}, '{$param2}', {$param3});\n";
443
        } else {
444
            $ret = "{$checkBox}{$param1}, '{$param2}', {$param3})";
445
        }
446
447
        return $ret;
448
    }
449
450
    /**
451
     * @public function getClassXoopsFormRadioYN
452
     *
453
     * @param        $var
454
     * @param        $param1
455
     * @param        $param2
456
     * @param        $param3
457
     * @param bool   $isParam
458
     * @param string $t
459
     *
460
     * @return string
461
     */
462
    public function getClassXoopsFormRadioYN($var, $param1, $param2, $param3, $isParam = false, $t = "\t\t")
463
    {
464
        $radioYN = 'new \XoopsFormRadioYN( ';
465
        if (false === $isParam) {
466
            $ret = "{$t}\${$var} = {$radioYN}{$param1}, '{$param2}', \${$param3});\n";
467
        } else {
468
            $ret = "{$radioYN}{$param1}, '{$param2}', \${$param3})";
469
        }
470
471
        return $ret;
472
    }
473
474
    /**
475
     * @public function getClassXoopsFormRadioYN
476
     *
477
     * @param        $var
478
     * @param        $param1
479
     * @param        $param2
480
     * @param        $param3
481
     * @param bool   $isParam
482
     * @param string $t
483
     *
484
     * @return string
485
     */
486
    public function getClassXoopsFormRadio($var, $param1, $param2, $param3, $isParam = false, $t = "\t\t")
487
    {
488
        $radioYN = 'new \XoopsFormRadio( ';
489
        if (false === $isParam) {
490
            $ret = "{$t}\${$var} = {$radioYN}{$param1}, '{$param2}', \${$param3});\n";
491
        } else {
492
            $ret = "{$radioYN}{$param1}, '{$param2}', \${$param3})";
493
        }
494
495
        return $ret;
496
    }
497
498
    /**
499
     * @public function getClassXoopsFormSelect
500
     *
501
     * @param        $var
502
     * @param        $param1
503
     * @param        $param2
504
     * @param        $param3
505
     * @param null   $param4
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $param4 is correct as it would always require null to be passed?
Loading history...
506
     * @param null   $param5
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $param5 is correct as it would always require null to be passed?
Loading history...
507
     * @param bool   $isParam
508
     * @param string $t
509
     *
510
     * @return string
511
     */
512
    public function getClassXoopsFormSelect($var, $param1, $param2, $param3, $param4 = null, $param5 = null, $isParam = false, $t = "\t\t")
513
    {
514
        $otherParam = null != $param4 ? ", {$param4}" : (null != $param5 ? ", {$param5}" : '');
0 ignored issues
show
introduced by
The condition null != $param5 is always false.
Loading history...
introduced by
The condition null != $param4 is always false.
Loading history...
515
        $select     = 'new \XoopsFormSelect( ';
516
        if (false === $isParam) {
517
            $ret = "{$t}\${$var} = {$select}{$param1}, '{$param2}', \${$param3}{$otherParam});\n";
518
        } else {
519
            $ret = "{$select}{$param1}, '{$param2}', \${$param3}{$otherParam})";
520
        }
521
522
        return $ret;
523
    }
524
525
    /**
526
     * @public function getClassXoopsFormTag
527
     *
528
     * @param        $var
529
     * @param        $param1
530
     * @param        $param2
531
     * @param        $param3
532
     * @param        $param4
533
     * @param int    $param5
534
     * @param bool   $isParam
535
     * @param string $t
536
     *
537
     * @return string
538
     */
539
    public function getClassXoopsFormTag($var, $param1, $param2, $param3, $param4, $param5 = 0, $isParam = false, $t = "\t\t")
540
    {
541
        $tag = 'new \XoopsFormTag( ';
542
        if (false === $isParam) {
543
            $ret = "{$t}\${$var} = {$tag}'{$param1}', {$param2}, {$param3}, \${$param4}, {$param5} );\n";
544
        } else {
545
            $ret = "{$tag}'{$param1}', {$param2}, {$param3}, \${$param4}, {$param5} )";
546
        }
547
548
        return $ret;
549
    }
550
551
    /**
552
     * @public function getClassXoopsFormButton
553
     *
554
     * @param        $var
555
     * @param        $param1
556
     * @param        $param2
557
     * @param        $param3
558
     * @param        $param4
559
     * @param bool   $isParam
560
     * @param string $t
561
     *
562
     * @return string
563
     */
564
    public function getClassXoopsFormButton($var, $param1, $param2, $param3, $param4, $isParam = false, $t = "\t\t")
565
    {
566
        $button = 'new \XoopsFormButton( ';
567
        if (false === $isParam) {
568
            $ret = "{$t}\${$var} = {$button}'{$param1}', '{$param2}', {$param3}, '{$param4}');\n";
569
        } else {
570
            $ret = "{$button}'{$param1}', '{$param2}', {$param3}, '{$param4}')";
571
        }
572
573
        return $ret;
574
    }
575
576
    /**
577
     * @public function getClassXoopsFormPassword
578
     *
579
     * @param        $var
580
     * @param        $param1
581
     * @param        $param2
582
     * @param string $param3
583
     * @param        $param4
584
     * @param bool   $isParam
585
     * @param string $t
586
     *
587
     * @return string
588
     */
589
    public function getClassXoopsFormPassword($var, $param1, $param2, $param3, $param4, $isParam = false, $t = "\t\t")
590
    {
591
        $tpassword                = 'new \XoopsFormPassword( ';
592
        $getVarPassword = Tdmcreate\Files\CreateXoopsCode::getInstance()->getXcGetVar('', 'this', $param3, true);
593
        if (false === $isParam) {
594
            $ret = "{$t}\${$var} = {$tpassword}{$param1}, '{$param2}', '', {$getVarPassword} );\n";
595
        } else {
596
            $ret = "{$tpassword}{$param1}, '{$param2}', {$param3}, {$param4} )";
597
        }
598
599
        return $ret;
600
    }
601
602
    /**
603
     * @public function getClassXoopsFormSelectCountry
604
     *
605
     * @param        $var
606
     * @param        $param1
607
     * @param        $param2
608
     * @param        $param3
609
     * @param null   $param4
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $param4 is correct as it would always require null to be passed?
Loading history...
610
     * @param null   $param5
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $param5 is correct as it would always require null to be passed?
Loading history...
611
     * @param bool   $isParam
612
     * @param string $t
613
     *
614
     * @return string
615
     */
616
    public function getClassXoopsFormSelectCountry($var, $param1, $param2, $param3, $param4 = null, $param5 = null, $isParam = false, $t = "\t\t")
617
    {
618
        $otherParam = null != $param4 ? ", {$param4}" : (null != $param5 ? ", {$param5}" : '');
0 ignored issues
show
introduced by
The condition null != $param5 is always false.
Loading history...
introduced by
The condition null != $param4 is always false.
Loading history...
619
        $select     = 'new \XoopsFormSelectCountry( ';
620
        if (false === $isParam) {
621
            $ret = "{$t}\${$var} = {$select}{$param1}, '{$param2}', \${$param3}{$otherParam});\n";
622
        } else {
623
            $ret = "{$select}{$param1}, '{$param2}', \${$param3}{$otherParam})";
624
        }
625
626
        return $ret;
627
    }
628
629
    /**
630
     * @public   function getClassXoopsObjectTree
631
     *
632
     * @param string $var
633
     * @param        $param1
634
     * @param        $param2
635
     * @param        $param3
636
     * @param string $t
637
     *
638
     * @return string
639
     */
640
    public function getClassXoopsObjectTree($var, $param1, $param2, $param3, $t = '')
641
    {
642
        $ret = "{$t}\${$var} = new \XoopsObjectTree(\${$param1}, '{$param2}', '{$param3}');\n";
643
644
        return $ret;
645
    }
646
647
    /**
648
     * @public function getClassXoopsMakeSelBox
649
     *
650
     * @param        $var
651
     * @param        $anchor
652
     * @param        $param1
653
     * @param        $param2
654
     * @param string $param3
655
     * @param        $param4
656
     * @param string $t
657
     *
658
     * @return string
659
     */
660
    public function getClassXoopsMakeSelBox($var, $anchor, $param1, $param2, $param3, $param4, $t = '')
661
    {
662
        $getVar = Tdmcreate\Files\CreateXoopsCode::getInstance()->getXcGetVar('', 'this', $param4, true);
663
        $ret    = "{$t}\${$var} = \${$anchor}->makeSelBox( '{$param1}', '{$param2}', '{$param3}', {$getVar}, true );\n";
664
665
        return $ret;
666
    }
667
668
    /**
669
     * @public function getClassAddOption
670
     *
671
     * @param        $var
672
     * @param        $params
673
     * @param string $t
674
     *
675
     * @return string
676
     */
677
    public function getClassAddOption($var, $params, $t = "\t\t")
678
    {
679
        return "{$t}\${$var}->addOption({$params});\n";
680
    }
681
682
    /**
683
     * @public function getClassAddOptionArray
684
     *
685
     * @param        $var
686
     * @param        $params
687
     * @param string $t
688
     *
689
     * @return string
690
     */
691
    public function getClassAddOptionArray($var, $params, $t = "\t\t")
692
    {
693
        return "{$t}\${$var}->addOptionArray({$params});\n";
694
    }
695
696
    /**
697
     * @public function getClassAddElement
698
     *
699
     * @param string $var
700
     * @param string $params
701
     * @param string $t
702
     *
703
     * @return string
704
     */
705
    public function getClassAddElement($var = '', $params = '', $t = "\t\t")
706
    {
707
        return "{$t}\${$var}->addElement({$params});\n";
708
    }
709
710
    /**
711
     * @public function getClassSetDescription
712
     *
713
     * @param        $var
714
     * @param        $params
715
     * @param string $t
716
     *
717
     * @return string
718
     */
719
    public function getClassSetDescription($var, $params, $t = "\t\t")
720
    {
721
        return "{$t}\${$var}->setDescription({$params});\n";
722
    }
723
724
    /**
725
     * @public function getClassSetExtra
726
     *
727
     * @param        $var
728
     * @param        $params
729
     * @param string $t
730
     *
731
     * @return string
732
     */
733
    public function getClassSetExtra($var, $params, $t = "\t\t")
734
    {
735
        return "{$t}\${$var}->setExtra({$params});\n";
736
    }
737
}
738