19 declare(strict_types=1);
40 string $a_postvar =
"" 44 $this->
lng = $DIC->language();
52 $this->items[
$id] = $item;
54 $this->labels[
$id] = $label;
60 if (isset($this->items[$id])) {
61 return $this->items[
$id];
68 if (isset($this->items[$id])) {
69 unset($this->items[$id]);
78 foreach ($this->items as
$id => $obj) {
79 if (method_exists($obj, $method)) {
80 $result[
$id] = call_user_func_array(array($obj, $method), $param);
89 foreach ($this->items as
$id => $obj) {
90 $result[
$id] = $obj->serializeData();
92 return serialize($result);
97 $data = unserialize($a_data);
100 foreach ($this->items as
$id => $obj) {
104 foreach ($this->items as
$id => $obj) {
105 if (method_exists($obj,
"setValue")) {
117 if (in_array($mode, array(self::COMPARISON_ASCENDING, self::COMPARISON_DESCENDING))) {
118 foreach ($this->items as $obj) {
119 if (!method_exists($obj,
"getPostValueForComparison")) {
123 $this->comparison_mode = $mode;
131 if (is_array($a_value)) {
132 foreach ($a_value as
$id => $value) {
133 if (isset($this->items[
$id])) {
134 if (method_exists($this->items[$id],
"setValue")) {
136 $value = is_float($value) ? (string) $value : $value;
137 $this->items[
$id]->setValue($value);
140 elseif (method_exists($this->items[$id],
"setDate")) {
141 $this->items[
$id]->setDate($value);
144 elseif (method_exists($this->items[$id],
"setMonths")) {
145 $this->items[
$id]->setMonths((
int) ($value[
'MM'] ?? 0));
146 $this->items[
$id]->setDays((
int) ($value[
'dd'] ?? 0));
147 $this->items[
$id]->setHours((
int) ($value[
'hh'] ?? 0));
148 $this->items[
$id]->setMinutes((
int) ($value[
'mm'] ?? 0));
149 $this->items[
$id]->setSeconds((
int) ($value[
'ss'] ?? 0));
153 } elseif ($a_value ===
null) {
154 foreach ($this->items as $item) {
155 if (method_exists($item,
"setValue")) {
156 $item->setValue(
null);
159 elseif (method_exists($item,
"setDate")) {
163 elseif (method_exists($item,
"setMonths")) {
167 $item->setMinutes(0);
168 $item->setSeconds(0);
177 foreach ($this->items as
$id => $obj) {
178 if (method_exists($obj,
"getValue")) {
179 $result[
$id] = $obj->getValue();
182 elseif (method_exists($obj,
"setDate")) {
183 $result[
$id] = $obj->getDate();
186 elseif (method_exists($obj,
'getValueAsArray')) {
187 $result[
$id] = $obj->getValueAsArray();
195 foreach ($this->items as $obj) {
196 $obj->setValueByArray($a_values);
205 if (
sizeof($this->items)) {
206 foreach ($this->items as $obj) {
207 if (!$obj->checkInput()) {
212 if ($this->comparison_mode !== self::COMPARISON_NONE) {
214 foreach ($this->items as $obj) {
215 $value = $obj->getPostValueForComparison();
217 if ($prev !==
null) {
218 if ($this->comparison_mode == self::COMPARISON_ASCENDING) {
219 if ($value < $prev) {
223 if ($value > $prev) {
248 $tpl =
new ilTemplate(
"tpl.prop_combination.html",
true,
true,
"components/ILIAS/Form");
250 if (
sizeof($this->items)) {
251 foreach ($this->items as
$id => $obj) {
253 if (isset($this->labels[
$id])) {
254 $tpl->setCurrentBlock(
"prop_combination_label");
255 $tpl->setVariable(
"LABEL", $this->labels[$id]);
256 $tpl->parseCurrentBlock();
259 $tpl->setCurrentBlock(
"prop_combination");
260 $tpl->setVariable(
"FIELD", $obj->render());
261 $tpl->parseCurrentBlock();
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setVariable($variable, $value='')
Sets a variable value.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)