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 XoopsFormText; |
32
|
|
|
use XoopsFormTextArea; |
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 TempForm |
48
|
|
|
*/ |
49
|
|
|
class TempForm 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_TEMP_ADD) : \sprintf(AM_PEDIGREE_TEMP_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_TEMP_ID, $this->targetObject->getVar('id'), 'id')); |
|
|
|
|
76
|
|
|
// Pname |
77
|
|
|
$this->addElement(new \XoopsFormTextArea(AM_PEDIGREE_TEMP_PNAME, 'pname', $this->targetObject->getVar('pname'), 4, 47), false); |
|
|
|
|
78
|
|
|
// Id_owner |
79
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_TEMP_ID_OWNER, 'id_owner', 50, 255, $this->targetObject->getVar('id_owner')), false); |
|
|
|
|
80
|
|
|
// Id_breeder |
81
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_TEMP_ID_BREEDER, 'id_breeder', 50, 255, $this->targetObject->getVar('id_breeder')), false); |
|
|
|
|
82
|
|
|
// User |
83
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_TEMP_USER, 'user', 50, 255, $this->targetObject->getVar('user')), false); |
|
|
|
|
84
|
|
|
// Roft |
85
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_TEMP_ROFT, 'roft', 50, 255, $this->targetObject->getVar('roft')), false); |
|
|
|
|
86
|
|
|
// Mother |
87
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_TEMP_MOTHER, 'mother', 50, 255, $this->targetObject->getVar('mother')), false); |
|
|
|
|
88
|
|
|
// Father |
89
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_TEMP_FATHER, 'father', 50, 255, $this->targetObject->getVar('father')), false); |
|
|
|
|
90
|
|
|
// Foto |
91
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_TEMP_FOTO, 'foto', 50, 255, $this->targetObject->getVar('foto')), false); |
|
|
|
|
92
|
|
|
// Coi |
93
|
|
|
$this->addElement(new \XoopsFormText(AM_PEDIGREE_TEMP_COI, 'coi', 50, 255, $this->targetObject->getVar('coi')), false); |
|
|
|
|
94
|
|
|
|
95
|
|
|
$this->addElement(new \XoopsFormHidden('op', 'save')); |
96
|
|
|
$this->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit')); |
97
|
|
|
} |
98
|
|
|
} |
99
|
|
|
|