1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace XoopsModules\Pedigree\Form; |
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
|
|
|
* Module: Pedigree |
17
|
|
|
* |
18
|
|
|
* @category Module |
19
|
|
|
* @package pedigree |
20
|
|
|
* @author XOOPS Development Team <https://xoops.org> |
21
|
|
|
* @copyright {@link https://xoops.org/ XOOPS Project} |
22
|
|
|
* @license GPL 2.0 or later |
23
|
|
|
* @link https://xoops.org/ |
24
|
|
|
* @since 1.0.0 |
25
|
|
|
*/ |
26
|
|
|
|
27
|
|
|
use Xmf\Module\Helper\Permission; |
28
|
|
|
use XoopsFormButton; |
29
|
|
|
use XoopsFormHidden; |
30
|
|
|
use XoopsFormLabel; |
31
|
|
|
use XoopsFormSelectUser; |
32
|
|
|
use XoopsFormText; |
33
|
|
|
use XoopsModules\Pedigree\{ |
34
|
|
|
Helper |
35
|
|
|
}; |
36
|
|
|
use XoopsThemeForm; |
37
|
|
|
|
38
|
|
|
require_once \dirname(__DIR__, 2) . '/include/common.php'; |
39
|
|
|
|
40
|
|
|
$moduleDirName = \basename(\dirname(__DIR__, 2)); |
41
|
|
|
//$helper = Helper::getInstance(); |
42
|
|
|
$permHelper = new Permission(); |
43
|
|
|
|
44
|
|
|
\xoops_load('XoopsFormLoader'); |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* Class OwnerForm |
48
|
|
|
*/ |
49
|
|
|
class OwnerForm extends XoopsThemeForm |
50
|
|
|
{ |
51
|
|
|
public $targetObject; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Constructor |
55
|
|
|
* |
56
|
|
|
* @param $target |
57
|
|
|
*/ |
58
|
|
|
public function __construct($target) |
59
|
|
|
{ |
60
|
|
|
// global $helper; |
61
|
|
|
$this->helper = $target->helper; |
|
|
|
|
62
|
|
|
$this->targetObject = $target; |
63
|
|
|
|
64
|
|
|
$title = $this->targetObject->isNew() ? \sprintf(AM_PEDIGREE_OWNER_ADD) : \sprintf(AM_PEDIGREE_OWNER_EDIT); |
|
|
|
|
65
|
|
|
parent::__construct($title, 'form', \xoops_getenv('SCRIPT_NAME'), 'post', true); |
66
|
|
|
$this->setExtra('enctype="multipart/form-data"'); |
67
|
|
|
|
68
|
|
|
//include ID field, it's needed so the module knows if it is a new form or an edited form |
69
|
|
|
|
70
|
|
|
$hidden = new \XoopsFormHidden('id', $this->targetObject->getVar('id')); |
71
|
|
|
$this->addElement($hidden); |
72
|
|
|
unset($hidden); |
73
|
|
|
|
74
|
|
|
// Id |
75
|
|
|
$this->addElement(new \XoopsFormLabel(AM_PEDIGREE_OWNER_ID, $this->targetObject->getVar('id'), 'id')); |
|
|
|
|
76
|
|
|
// Firstname |
77
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_OWNER_FIRSTNAME, 'firstname', 50, 255, $this->targetObject->getVar('firstname')), false); |
|
|
|
|
78
|
|
|
// Lastname |
79
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_OWNER_LASTNAME, 'lastname', 50, 255, $this->targetObject->getVar('lastname')), false); |
|
|
|
|
80
|
|
|
// Postcode |
81
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_OWNER_POSTCODE, 'postcode', 50, 255, $this->targetObject->getVar('postcode')), false); |
|
|
|
|
82
|
|
|
// City |
83
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_OWNER_CITY, 'city', 50, 255, $this->targetObject->getVar('city')), false); |
|
|
|
|
84
|
|
|
// Streetname |
85
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_OWNER_STREETNAME, 'streetname', 50, 255, $this->targetObject->getVar('streetname')), false); |
|
|
|
|
86
|
|
|
// Housenumber |
87
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_OWNER_HOUSENUMBER, 'housenumber', 50, 255, $this->targetObject->getVar('housenumber')), false); |
|
|
|
|
88
|
|
|
// Phonenumber |
89
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_OWNER_PHONENUMBER, 'phonenumber', 50, 255, $this->targetObject->getVar('phonenumber')), false); |
|
|
|
|
90
|
|
|
// Emailadres |
91
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_OWNER_EMAILADRES, 'emailadres', 50, 255, $this->targetObject->getVar('emailadres')), false); |
|
|
|
|
92
|
|
|
// Website |
93
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_OWNER_WEBSITE, 'website', 50, 255, $this->targetObject->getVar('website')), false); |
|
|
|
|
94
|
|
|
// User |
95
|
|
|
$this->addElement(new \XoopsFormSelectUser(AM_PEDIGREE_OWNER_USER, 'user', false, $this->targetObject->getVar('user'), 1, false), false); |
|
|
|
|
96
|
|
|
|
97
|
|
|
$this->addElement(new \XoopsFormHidden('op', 'save')); |
98
|
|
|
$this->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit')); |
99
|
|
|
} |
100
|
|
|
} |
101
|
|
|
|