ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 }
global $DIC

References $DIC, and $form_action.

Member Function Documentation

◆ addStartEventInputItems()

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

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

145 {
147 $section->setTitle($lng->txt('start_event_form_header'));
148 $form->addItem($section);
149
150 $type_input = new ilTextInputGUI($lng->txt('type'), 'se_type');
151 $type_input->setValue($event['type']);
152 $type_input->setDisabled(true);
153 $form->addItem($type_input);
154
155 $content_input = new ilTextInputGUI($lng->txt('content'), 'se_content');
156 $content_input->setValue($event['content']);
157 $content_input->setDisabled(true);
158 $form->addItem($content_input);
159
160 $subject_type_input = new ilTextInputGUI($lng->txt('subject_type'), 'se_subject_type');
161 $subject_type_input->setValue($event['subject_type']);
162 $subject_type_input->setDisabled(true);
163 $form->addItem($subject_type_input);
164
165 $subject_selector = new ilRadioGroupInputGUI($lng->txt('subject_id'), 'se_subject_id');
166
167 $subject_by_id_selector = new ilRadioOption($lng->txt('subject_by_id'), 'se_subject_by_id');
168 $subject_id_input = new ilNumberInputGUI($lng->txt('subject_id'), 'se_subject_id');
169 $subject_id_input->setValue($event['subject_id']);
170 $subject_by_id_selector->addSubItem($subject_id_input);
171 $subject_selector->addOption($subject_by_id_selector);
172
173 $subject_by_mask_selector = new ilRadioOption($lng->txt('subject_by_mask'), 'se_subject_by_mask');
174 $subject_by_mask_selector->setValue($event['subject_id']);
175 $subject_selector->addOption($subject_by_mask_selector);
176
177 $subject_selector->setValue($event['subject_id']);
178 $form->addItem($subject_selector);
179
180 $context_type_input = new ilTextInputGUI($lng->txt('context_type'), 'se_context_type');
181 $context_type_input->setValue($event['context_type']);
182 $context_type_input->setDisabled(true);
183 $form->addItem($context_type_input);
184
185 $context_selector = new ilRadioGroupInputGUI($lng->txt('context_id'), 'se_context_id');
186
187 $context_by_id_selector = new ilRadioOption($lng->txt('context_by_id'), 'se_context_by_id');
188 $context_id_input = new ilNumberInputGUI($lng->txt('context_id'), 'se_context_id');
189 $context_id_input->setValue($event['context_id']);
190 $context_by_id_selector->addSubItem($context_id_input);
191 $context_selector->addOption($context_by_id_selector);
192
193 $context_by_mask_selector = new ilRadioOption($lng->txt('context_by_mask'), 'se_context_by_mask');
194 $context_by_mask_selector->setValue($event['subject_id']);
195 $context_selector->addOption($context_by_mask_selector);
196
197 $context_selector->setValue($event['subject_id']);
198 $form->addItem($context_selector);
199 }
$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 107 of file class.ilWorkflowArmerGUI.php.

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

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 {
78 if (strtolower($config['allowedtype']) != $child['type'])
79 {
80 continue;
81 }
82
83 $path = $this->tree->getPathFull($child['child']);
84 $option_elements = array();
85 foreach ($path as $node)
86 {
87 if ($node['type'] == 'root')
88 {
89 continue;
90 }
91 $option_elements[] = $node['title'];
92 }
93
94 $options[ $child['child'] ] = implode(' / ', $option_elements);
95 }
96
97 $item->setOptions($options);
98
99 return $item;
100 }
$path
Definition: aliased.php:25
This class represents a selection list property in a property form.
if(!is_array($argv)) $options

References $config, $options, and $path.

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: