ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilWorkflowArmerGUI Class Reference

@noinspection PhpIncludeInspection More...

+ Collaboration diagram for ilWorkflowArmerGUI:

Public Member Functions

 __construct ($form_action)
 ilWorkflowLauncherGUI constructor. More...
 
 getForm ($input_vars, $event_definition)
 
 getRepositoryObjectSelector ($config)
 
 addStaticInputItems ($lng, $input_vars, $form)
 
 addStartEventInputItems ($lng, $event, $form)
 

Protected Attributes

 $form_action
 
 $lng
 
 $tree
 

Detailed Description

@noinspection PhpIncludeInspection

Class ilWorkflowArmerGUI

GUI showed when 'arming' a workflow definition, preparing it to listen for incoming events.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

/

Definition at line 18 of file class.ilWorkflowArmerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilWorkflowArmerGUI::__construct (   $form_action)

ilWorkflowLauncherGUI constructor.

Parameters
string$form_action

Definition at line 34 of file class.ilWorkflowArmerGUI.php.

35 {
36 global $DIC;
37 $this->lng = $DIC['lng'];
38 $this->tree = $DIC['tree'];
39
40 $this->form_action = $form_action;
41 }
$DIC
Definition: xapitoken.php:46

References $DIC, and $form_action.

Member Function Documentation

◆ addStartEventInputItems()

ilWorkflowArmerGUI::addStartEventInputItems (   $lng,
  $event,
  $form 
)
Parameters
ilLanguage$lng
array$event
ilPropertyFormGUI$form

Definition at line 137 of file class.ilWorkflowArmerGUI.php.

138 {
140 $section->setTitle($lng->txt('start_event_form_header'));
141 $form->addItem($section);
142
143 $type_input = new ilTextInputGUI($lng->txt('type'), 'se_type');
144 $type_input->setValue($event['type']);
145 $type_input->setDisabled(true);
146 $form->addItem($type_input);
147
148 $content_input = new ilTextInputGUI($lng->txt('content'), 'se_content');
149 $content_input->setValue($event['content']);
150 $content_input->setDisabled(true);
151 $form->addItem($content_input);
152
153 $subject_type_input = new ilTextInputGUI($lng->txt('subject_type'), 'se_subject_type');
154 $subject_type_input->setValue($event['subject_type']);
155 $subject_type_input->setDisabled(true);
156 $form->addItem($subject_type_input);
157
158 $subject_selector = new ilRadioGroupInputGUI($lng->txt('subject_id'), 'se_subject_id');
159
160 $subject_by_id_selector = new ilRadioOption($lng->txt('subject_by_id'), 'se_subject_by_id');
161 $subject_id_input = new ilNumberInputGUI($lng->txt('subject_id'), 'se_subject_id');
162 $subject_id_input->setValue($event['subject_id']);
163 $subject_by_id_selector->addSubItem($subject_id_input);
164 $subject_selector->addOption($subject_by_id_selector);
165
166 $subject_by_mask_selector = new ilRadioOption($lng->txt('subject_by_mask'), 'se_subject_by_mask');
167 $subject_by_mask_selector->setValue($event['subject_id']);
168 $subject_selector->addOption($subject_by_mask_selector);
169
170 $subject_selector->setValue($event['subject_id']);
171 $form->addItem($subject_selector);
172
173 $context_type_input = new ilTextInputGUI($lng->txt('context_type'), 'se_context_type');
174 $context_type_input->setValue($event['context_type']);
175 $context_type_input->setDisabled(true);
176 $form->addItem($context_type_input);
177
178 $context_selector = new ilRadioGroupInputGUI($lng->txt('context_id'), 'se_context_id');
179
180 $context_by_id_selector = new ilRadioOption($lng->txt('context_by_id'), 'se_context_by_id');
181 $context_id_input = new ilNumberInputGUI($lng->txt('context_id'), 'se_context_id');
182 $context_id_input->setValue($event['context_id']);
183 $context_by_id_selector->addSubItem($context_id_input);
184 $context_selector->addOption($context_by_id_selector);
185
186 $context_by_mask_selector = new ilRadioOption($lng->txt('context_by_mask'), 'se_context_by_mask');
187 $context_by_mask_selector->setValue($event['subject_id']);
188 $context_selector->addOption($context_by_mask_selector);
189
190 $context_selector->setValue($event['subject_id']);
191 $form->addItem($context_selector);
192 }
$section
Definition: Utf8Test.php:83
This class represents a section header in a property form.
This class represents a number property in a property form.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a text property in a property form.

References $lng, and $section.

Referenced by getForm().

+ Here is the caller graph for this function:

◆ addStaticInputItems()

ilWorkflowArmerGUI::addStaticInputItems (   $lng,
  $input_vars,
  $form 
)
Parameters
ilLanguage$lng
array$input_vars
ilPropertyFormGUI$form

Definition at line 103 of file class.ilWorkflowArmerGUI.php.

104 {
105 if (count($input_vars)) {
107 $section->setTitle($lng->txt('static_input_form_header'));
108 $form->addItem($section);
109 }
110
111 foreach ($input_vars as $input_var) {
112 $item = null;
113
114 switch (strtolower($input_var['type'])) {
115 case 'robjselect':
116 $item = $this->getRepositoryObjectSelector($input_var);
117 break;
118
119 case 'text':
120 default:
121 $item = new ilTextInputGUI($input_var['caption'], $input_var['name']);
122 break;
123
124 }
125
126 $item->setRequired($input_var['requirement'] == 'required' ? true : false);
127 $item->setInfo($input_var['description']);
128 $form->addItem($item);
129 }
130 }

References $lng, $section, and getRepositoryObjectSelector().

Referenced by getForm().

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

◆ getForm()

ilWorkflowArmerGUI::getForm (   $input_vars,
  $event_definition 
)
Parameters
array$input_vars
array$event_definition
Returns
\ilPropertyFormGUI

Definition at line 49 of file class.ilWorkflowArmerGUI.php.

50 {
51 $form = new ilPropertyFormGUI();
52 $form->setTitle($this->lng->txt('input_variables_required'));
53 $form->setDescription($this->lng->txt('input_static_variables_desc'));
54
55 $process_id_input = new ilHiddenInputGUI('process_id');
56 $process_id_input->setValue(stripslashes($_GET['process_id']));
57 $form->addItem($process_id_input);
58
59 $event = $event_definition[0];
60 $this->addStartEventInputItems($this->lng, $event, $form);
61
62 $this->addStaticInputItems($this->lng, $input_vars, $form);
63
64 $form->addCommandButton('listen', $this->lng->txt('start_listening'));
65 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
66 return $form;
67 }
$_GET["client_id"]
This class represents a hidden form property in a property form.
This class represents a property form user interface.
addStartEventInputItems($lng, $event, $form)
addStaticInputItems($lng, $input_vars, $form)

References $_GET, addStartEventInputItems(), and addStaticInputItems().

+ Here is the call graph for this function:

◆ getRepositoryObjectSelector()

ilWorkflowArmerGUI::getRepositoryObjectSelector (   $config)

Definition at line 69 of file class.ilWorkflowArmerGUI.php.

70 {
71 $item = new ilSelectInputGUI($config['caption'], $config['name']);
72
73 $children = $this->tree->getFilteredSubTree($this->tree->getRootId());
74
75 $options = array();
76 foreach ($children as $child) {
77 if (strtolower($config['allowedtype']) != $child['type']) {
78 continue;
79 }
80
81 $path = $this->tree->getPathFull($child['child']);
82 $option_elements = array();
83 foreach ($path as $node) {
84 if ($node['type'] == 'root') {
85 continue;
86 }
87 $option_elements[] = $node['title'];
88 }
89
90 $options[ $child['child'] ] = implode(' / ', $option_elements);
91 }
92
93 $item->setOptions($options);
94
95 return $item;
96 }
This class represents a selection list property in a property form.
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68

References $config.

Referenced by addStaticInputItems().

+ Here is the caller graph for this function:

Field Documentation

◆ $form_action

string ilWorkflowArmerGUI::$form_action
protected

Definition at line 21 of file class.ilWorkflowArmerGUI.php.

Referenced by __construct().

◆ $lng

ilLanguage ilWorkflowArmerGUI::$lng
protected

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

Referenced by addStartEventInputItems(), and addStaticInputItems().

◆ $tree

ilTree ilWorkflowArmerGUI::$tree
protected

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


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