1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace XoopsModules\Suico\Form; |
4
|
|
|
|
5
|
|
|
use XoopsModules\Suico; |
6
|
|
|
use XoopsModules\Suico\Regstep; |
7
|
|
|
use XoopsThemeForm; |
8
|
|
|
use XoopsFormButton; |
9
|
|
|
use XoopsFormHidden; |
10
|
|
|
use XoopsFormLabel; |
11
|
|
|
use XoopsFormSelectUser; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* |
15
|
|
|
* @param Regstep $step {@link Regstep} to edit |
16
|
|
|
* @param bool $action |
17
|
|
|
*/ |
18
|
|
|
|
19
|
|
|
class StepForm extends XoopsThemeForm |
20
|
|
|
{ |
21
|
|
|
function __construct(Regstep $step = null, $action = false) |
|
|
|
|
22
|
|
|
{ |
23
|
|
|
if (!$action) { |
24
|
|
|
$action = $_SERVER['REQUEST_URI']; |
|
|
|
|
25
|
|
|
} |
26
|
|
|
if (empty($GLOBALS['xoopsConfigUser'])) { |
27
|
|
|
/* @var \XoopsConfigHandler $configHandler */ |
28
|
|
|
$configHandler = xoops_getHandler('config'); |
29
|
|
|
$GLOBALS['xoopsConfigUser'] = $configHandler->getConfigsByCat(XOOPS_CONF_USER); |
30
|
|
|
} |
31
|
|
|
include_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); |
32
|
|
|
parent::__construct(_AM_SUICO_STEP, 'stepform', 'step.php', 'post', true); |
33
|
|
|
if (!$step->isNew()) { |
|
|
|
|
34
|
|
|
$this->addElement(new XoopsFormHidden('id', $step->getVar('step_id'))); |
|
|
|
|
35
|
|
|
} |
36
|
|
|
$this->addElement(new XoopsFormHidden('op', 'save')); |
37
|
|
|
$this->addElement(new \XoopsFormText(_AM_SUICO_STEPNAME, 'step_name', 25, 255, $step->getVar('step_name', 'e'))); |
|
|
|
|
38
|
|
|
$this->addElement(new \XoopsFormText(_AM_SUICO_STEPINTRO, 'step_desc', 25, 255, $step->getVar('step_desc', 'e'))); |
39
|
|
|
$this->addElement(new \XoopsFormText(_AM_SUICO_STEPORDER, 'step_order', 10, 10, $step->getVar('step_order', 'e'))); |
40
|
|
|
$this->addElement(new \XoopsFormRadioYN(_AM_SUICO_STEPSAVE, 'step_save', $step->getVar('step_save', 'e'))); |
|
|
|
|
41
|
|
|
$this->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); |
42
|
|
|
} |
43
|
|
|
} |
44
|
|
|
|
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.