ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
BaseForm.php
Go to the documentation of this file.
1
<?php
2
3
namespace
ILIAS\Modules\OrgUnit\ARHelper
;
4
10
abstract
class
BaseForm
extends
\ilPropertyFormGUI
11
{
12
16
protected
$parent_gui
;
20
protected
$DIC
;
24
protected
$object
;
25
26
33
public
function
__construct
(
BaseCommands
$parent_gui
, \
ActiveRecord
$object
)
34
{
35
$this->parent_gui =
$parent_gui
;
36
$this->
object
=
$object
;
37
$this->
dic
()->ctrl()->saveParameter($parent_gui,
'arid'
);
38
$this->
setFormAction
($this->
dic
()->ctrl()->
getFormAction
($this->parent_gui));
39
$this->
initFormElements
();
40
$this->
initButtons
();
41
$this->
setTarget
(
'_top'
);
42
parent::__construct();
43
}
44
45
46
abstract
protected
function
initFormElements
();
47
48
49
abstract
public
function
fillForm
();
50
51
52
abstract
protected
function
fillObject
();
53
54
58
public
function
saveObject
()
59
{
60
if
(!$this->
fillObject
()) {
61
return
false
;
62
}
63
if
($this->
object
->getId()) {
64
$this->
object
->update();
65
}
else
{
66
$this->
object
->create();
67
}
68
69
return
$this->
object
->getId();
70
}
71
72
73
protected
function
initButtons
()
74
{
75
if
(!$this->
object
->getId()) {
76
$this->
setTitle
($this->
txt
(
'create'
));
77
$this->
addCommandButton
(
BaseCommands::CMD_CREATE
, $this->
txt
(
BaseCommands::CMD_CREATE
));
78
$this->
addCommandButton
(
BaseCommands::CMD_CANCEL
, $this->
txt
(
BaseCommands::CMD_CANCEL
));
79
}
else
{
80
$this->
setTitle
($this->
txt
(
'update'
));
81
$this->
addCommandButton
(
BaseCommands::CMD_UPDATE
, $this->
txt
(
BaseCommands::CMD_UPDATE
));
82
$this->
addCommandButton
(
BaseCommands::CMD_CANCEL
, $this->
txt
(
BaseCommands::CMD_CANCEL
));
83
}
84
}
85
86
92
protected
function
txt
(
$key
)
93
{
94
return
$this->parent_gui->txt(
$key
);
95
}
96
97
103
protected
function
infoTxt
(
$key
)
104
{
105
return
$this->parent_gui->txt(
$key
.
'_info'
);
106
}
107
108
112
protected
function
dic
()
113
{
114
return
$GLOBALS
[
"DIC"
];
115
}
116
}
ILIAS\Modules\OrgUnit\ARHelper\BaseCommands
Interface BaseCommands.
Definition:
BaseCommands.php:10
ILIAS\Modules\OrgUnit\ARHelper\BaseCommands\CMD_CREATE
const CMD_CREATE
Definition:
BaseCommands.php:15
ilFormGUI\getFormAction
getFormAction()
Get FormAction.
Definition:
class.ilFormGUI.php:40
ilPropertyFormGUI
This class represents a property form user interface.
Definition:
class.ilPropertyFormGUI.php:47
ActiveRecord
Class ActiveRecord.
Definition:
class.ActiveRecord.php:24
ILIAS\Modules\OrgUnit\ARHelper\BaseForm\initButtons
initButtons()
Definition:
BaseForm.php:73
ILIAS\Modules\OrgUnit\ARHelper\BaseForm\fillObject
fillObject()
$GLOBALS
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Definition:
generate-standalone.php:18
ilFormGUI\setFormAction
setFormAction($a_formaction)
Set FormAction.
Definition:
class.ilFormGUI.php:30
ILIAS\Modules\OrgUnit\ARHelper\BaseForm\txt
txt($key)
Definition:
BaseForm.php:92
ILIAS\Modules\OrgUnit\ARHelper\BaseForm
Definition:
BaseForm.php:10
ILIAS\Modules\OrgUnit\ARHelper\BaseForm\__construct
__construct(BaseCommands $parent_gui, \ActiveRecord $object)
BaseForm constructor.
Definition:
BaseForm.php:33
ILIAS\Modules\OrgUnit\ARHelper\BaseForm\dic
dic()
Definition:
BaseForm.php:112
ilFormGUI\setTarget
setTarget($a_target)
Set Target.
Definition:
class.ilFormGUI.php:50
ilPropertyFormGUI\setTitle
setTitle($a_title)
Set Title.
Definition:
class.ilPropertyFormGUI.php:192
ILIAS\Modules\OrgUnit\ARHelper\BaseForm\initFormElements
initFormElements()
ILIAS\Modules\OrgUnit\ARHelper\BaseForm\$parent_gui
$parent_gui
Definition:
BaseForm.php:16
ilPropertyFormGUI\addCommandButton
addCommandButton($a_cmd, $a_text, $a_id="")
Add Command button.
Definition:
class.ilPropertyFormGUI.php:589
ILIAS\Modules\OrgUnit\ARHelper\BaseCommands\CMD_CANCEL
const CMD_CANCEL
Definition:
BaseCommands.php:20
ILIAS\Modules\OrgUnit\ARHelper
Definition:
BaseCommands.php:3
object
Create new PHPExcel object
obj_idprivate
Definition:
01pharSimple.php:37
ILIAS\Modules\OrgUnit\ARHelper\BaseForm\fillForm
fillForm()
ILIAS\Modules\OrgUnit\ARHelper\BaseCommands\CMD_UPDATE
const CMD_UPDATE
Definition:
BaseCommands.php:17
ILIAS\Modules\OrgUnit\ARHelper\BaseForm\infoTxt
infoTxt($key)
Definition:
BaseForm.php:103
ILIAS\Modules\OrgUnit\ARHelper\BaseForm\$object
$object
Definition:
BaseForm.php:24
ILIAS\Modules\OrgUnit\ARHelper\BaseForm\saveObject
saveObject()
Definition:
BaseForm.php:58
$key
$key
Definition:
croninfo.php:18
ILIAS\Modules\OrgUnit\ARHelper\BaseForm\$DIC
$DIC
Definition:
BaseForm.php:20
Modules
OrgUnit
classes
ARHelper
BaseForm.php
Generated on Sat Mar 1 2025 19:01:18 for ILIAS by
1.8.13 (using
Doxyfile
)