Witam, posiadam taki kod:
if($value = $form->values()):
if($value['acp_sl_owner']):
$owners = $value['acp_sl_owner'];
if(!($owners instanceof \IPS\Member)):
$return = [];
foreach(is_array($owners) ? $owners : explode(',', $owners) as $v):
if($v instanceof \IPS\Member):
$return[$v->member_id] = $v->member_id;
elseif($v):
$member = \IPS\Member::load($v);
if($member->member_id):
$return[$member->member_id] = $member->member_id;
endif;
endif;
endforeach;
if(!empty($return)):
$value['acp_sl_owner'] = implode(',', $return);
endif;
endif;
endif;
if($value = $form->values()):
if($value['acp_sl_guardian']):
$guardians = $value['acp_sl_guardian'];
if(!($guardians instanceof \IPS\Member)):
$return = [];
foreach(is_array($guardians) ? $guardians : explode(',', $guardians) as $v):
if($v instanceof \IPS\Member):
$return[$v->member_id] = $v->member_id;
elseif($v):
$member = \IPS\Member::load($v);
if($member->member_id):
$return[$member->member_id] = $member->member_id;
endif;
endif;
endforeach;
if(!empty($return)):
$value['acp_sl_guardian'] = implode(',', $return);
endif;
endif;
endif;
I dostaję taki błąd:
ParseError: syntax error, unexpected '}', expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) (0)
Więc jaki powinien być warunek nad:
if($value = $form->values()):
if($value['acp_sl_guardian']):
$guardians = $value['acp_sl_guardian'];