ILIAS  release_8 Revision v8.24
ilMailOptionsFormGUI Class Reference

Class ilMailOptionsFormGUI. More...

+ Inheritance diagram for ilMailOptionsFormGUI:
+ Collaboration diagram for ilMailOptionsFormGUI:

Public Member Functions

 __construct (ilMailOptions $options, object $parentGui, string $positiveCmd)
 
 save ()
 
 populate ()
 
- Public Member Functions inherited from ilPropertyFormGUI
 __construct ()
 
 executeCommand ()
 
 setTableWidth (string $a_width)
 
 getTableWidth ()
 
 setMode (string $a_mode)
 
 getMode ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setTitleIcon (string $a_titleicon)
 
 getTitleIcon ()
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setShowTopButtons (bool $a_val)
 
 getShowTopButtons ()
 
 setForceTopButtons (bool $a_val)
 
 getForceTopButtons ()
 
 addItem ($a_item)
 
 removeItemByPostVar (string $a_post_var, bool $a_remove_unused_headers=false)
 
 getItemByPostVar (string $a_post_var)
 
 setItems (array $a_items)
 
 getItems ()
 
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively More...
 
 setDisableStandardMessage (bool $a_val)
 
 getDisableStandardMessage ()
 
 getHideLabels ()
 
 setHideLabels (bool $a_value=true)
 
 setValuesByArray (array $a_values, bool $a_restrict_to_value_keys=false)
 
 setValuesByPost ()
 
 checkInput ()
 
 getInput (string $a_post_var, bool $ensureValidation=true)
 Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-POST variable, identified by the passed postvar. More...
 
 addCommandButton (string $a_cmd, string $a_text, string $a_id="")
 
 getCommandButtons ()
 
 clearCommandButtons ()
 
 getContent ()
 
 insertItem ( $item, bool $a_sub_item=false)
 
 addAsyncOnloadCode (string $code)
 
 getHTML ()
 
 getHTMLAsync ()
 
 getFileUpload (string $a_field, ?string $a_index=null, ?string $a_sub_index=null)
 Get file upload data. More...
 
 hasFileUpload (string $a_field, ?string $a_index=null, ?string $a_sub_index=null)
 
 moveFileUpload (string $a_target_directory, string $a_field, ?string $a_target_name=null, ?string $a_index=null, ?string $a_sub_index=null)
 Move upload to target directory. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction (string $a_formaction)
 
 getFormAction ()
 
 setTarget (string $a_target)
 
 getTarget ()
 
 setMultipart (bool $a_multipart)
 
 getMultipart ()
 
 setId (string $a_id)
 
 getId ()
 
 setName (string $a_name)
 
 getName ()
 
 setKeepOpen (bool $a_keepopen)
 
 getKeepOpen ()
 
 setOpenTag (bool $a_open)
 
 getOpenTag ()
 
 setCloseTag (bool $a_val)
 
 getCloseTag ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 getHTML ()
 
 getContent ()
 

Protected Member Functions

 init ()
 
- Protected Member Functions inherited from ilPropertyFormGUI
 getRequestedPostVar ()
 
 getFileHash ()
 
 hideRequired (string $a_type)
 
 appendOnloadCode (string $html)
 
 rebuildUploadedFiles ()
 

Protected Attributes

object $parentGui
 
string $positiveCmd = ''
 
ilMailOptions $options
 
- Protected Attributes inherited from ilPropertyFormGUI
bool $required_text = false
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilTemplate $tpl
 
ilObjUser $user = null
 
ilSetting $settings = null
 
string $mode = "std"
 
bool $check_input_called = false
 
bool $disable_standard_message = false
 
string $top_anchor = "il_form_top"
 
string $title = ''
 
string $titleicon = ""
 
string $description = ""
 
string $tbl_width = ""
 
bool $show_top_buttons = true
 
bool $hide_labels = false
 
bool $force_top_buttons = false
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
ilGlobalTemplateInterface $global_tpl = null
 
 $onload_code = []
 
- Protected Attributes inherited from ilFormGUI
string $formaction = ""
 
bool $multipart = false
 
bool $keepopen = false
 
bool $opentag = true
 
string $id = ''
 
string $name = ''
 
string $target = ''
 
bool $prevent_double_submission = false
 

Detailed Description

Class ilMailOptionsFormGUI.

Definition at line 24 of file class.ilMailOptionsFormGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMailOptionsFormGUI::__construct ( ilMailOptions  $options,
object  $parentGui,
string  $positiveCmd 
)
Parameters
ilMailOptions$options
object$parentGui
string$positiveCmd

Definition at line 35 of file class.ilMailOptionsFormGUI.php.

36 {
37 if (!method_exists($parentGui, 'executeCommand')) {
38 throw new InvalidArgumentException(sprintf(
39 'Parameter $parentGui must be ilCtrlInterface enabled by implementing executeCommand(), %s given.',
40 get_class($parentGui)
41 ));
42 }
43
45
46 $this->options = $options;
47 $this->parentGui = $parentGui;
48 $this->positiveCmd = $positiveCmd;
49
50 $this->init();
51 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $options, $parentGui, $positiveCmd, ILIAS\GlobalScreen\Provider\__construct(), and init().

+ Here is the call graph for this function:

Member Function Documentation

◆ init()

ilMailOptionsFormGUI::init ( )
protected

Definition at line 53 of file class.ilMailOptionsFormGUI.php.

53 : void
54 {
55 $this->setTitle($this->lng->txt('mail_settings'));
56 $this->setFormAction($this->ctrl->getFormAction($this->parentGui, $this->positiveCmd));
57
58 if ($this->options->maySeeIndividualTransportSettings()) {
59 $incoming_mail_gui = new ilIncomingMailInputGUI(
60 $this->lng->txt('mail_incoming'),
61 'incoming_type',
62 false
63 );
64 $this->addItem($incoming_mail_gui);
65 }
66
67 $options = [];
68 for ($i = 50; $i <= 80; $i++) {
69 $options[$i] = $i;
70 }
71 $si = new ilSelectInputGUI($this->lng->txt('linebreak'), 'linebreak');
72 $si->setOptions($options);
73 $this->addItem($si);
74
75 $ta = new ilTextAreaInputGUI($this->lng->txt('signature'), 'signature');
76 $ta->setRows(10);
77 $ta->setCols(60);
78 $this->addItem($ta);
79
80 if ($this->settings->get('mail_notification', '0')) {
81 $cb = new ilCheckboxInputGUI(
82 $this->lng->txt('cron_mail_notification'),
83 'cronjob_notification'
84 );
85 $cb->setInfo($this->lng->txt('mail_cronjob_notification_info'));
86 $cb->setValue('1');
87 $this->addItem($cb);
88 }
89
90 $this->addCommandButton($this->positiveCmd, $this->lng->txt('save'));
91 }
This class represents a checkbox property in a property form.
setFormAction(string $a_formaction)
Class ilIncomingMailInputGUI.
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
This class represents a selection list property in a property form.
This class represents a text area property in a property form.
$i
Definition: metadata.php:41

References $i, $options, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), ILIAS\Repository\settings(), and ilPropertyFormGUI\setTitle().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populate()

ilMailOptionsFormGUI::populate ( )

Definition at line 128 of file class.ilMailOptionsFormGUI.php.

128 : void
129 {
130 $data = [
131 'linebreak' => $this->options->getLinebreak(),
132 'signature' => $this->options->getSignature(),
133 'cronjob_notification' => $this->options->isCronJobNotificationEnabled(),
134 ];
135
136 if ($this->options->maySeeIndividualTransportSettings()) {
137 $data['incoming_type'] = $this->options->getIncomingType();
138
139 $mail_address_option = $this->options->getEmailAddressMode();
140
141 $data['mail_address_option'] = $mail_address_option;
142 $data['mail_address_option_both'] = $mail_address_option;
143 }
144
145 $this->setValuesByArray($data);
146 }
setValuesByArray(array $a_values, bool $a_restrict_to_value_keys=false)

References $data, and ilPropertyFormGUI\setValuesByArray().

Referenced by ilMailOptionsGUI\showOptions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilMailOptionsFormGUI::save ( )

Definition at line 93 of file class.ilMailOptionsFormGUI.php.

93 : bool
94 {
95 if (!$this->checkInput()) {
96 return false;
97 }
98
99 if ($this->options->mayModifyIndividualTransportSettings()) {
100 $incoming_type = (int) $this->getInput('incoming_type');
101
102 $mail_address_option = $this->options->getEmailAddressMode();
103 switch ($incoming_type) {
105 $mail_address_option = (int) $this->getInput('mail_address_option');
106 break;
107
109 $mail_address_option = (int) $this->getInput('mail_address_option_both');
110 break;
111 }
112 } else {
113 $incoming_type = $this->options->getIncomingType();
114 $mail_address_option = $this->options->getEmailAddressMode();
115 }
116
117 $this->options->setLinebreak((int) $this->getInput('linebreak'));
118 $this->options->setSignature($this->getInput('signature'));
119 $this->options->setIsCronJobNotificationStatus((bool) $this->getInput('cronjob_notification'));
120 $this->options->setIncomingType($incoming_type);
121 $this->options->setEmailAddressMode($mail_address_option);
122
123 $this->options->updateOptions();
124
125 return true;
126 }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...

References ilPropertyFormGUI\checkInput(), ilPropertyFormGUI\getInput(), ilMailOptions\INCOMING_BOTH, ilMailOptions\INCOMING_EMAIL, and ILIAS\Repository\int().

Referenced by ilMailOptionsGUI\saveOptions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $options

ilMailOptions ilMailOptionsFormGUI::$options
protected

Definition at line 28 of file class.ilMailOptionsFormGUI.php.

Referenced by __construct(), and init().

◆ $parentGui

object ilMailOptionsFormGUI::$parentGui
protected

Definition at line 26 of file class.ilMailOptionsFormGUI.php.

Referenced by __construct().

◆ $positiveCmd

string ilMailOptionsFormGUI::$positiveCmd = ''
protected

Definition at line 27 of file class.ilMailOptionsFormGUI.php.

Referenced by __construct().


The documentation for this class was generated from the following file: