Hash->extract($row, $field['data_path']); $alignments = ''; $canRemove = $this->request->getParam('prefix') !== 'Open'; if ($field['scope'] === 'individuals') { foreach ($raw_alignments as $alignment) { $alignments .= sprintf( '
', h($alignment['type']), sprintf( '%s', $baseurl, h($alignment['organisation']['id']), h($alignment['organisation']['name']) ), !$canRemove ? '' : sprintf( "UI.submissionModalForIndex(%s);", sprintf( "'/alignments/delete/%s'", h($alignment['id']) ) ) ); } } else if ($field['scope'] === 'organisations') { foreach ($raw_alignments as $alignment) { $alignments .= sprintf( '', h($alignment['type']), sprintf( '%s', $baseurl, h($alignment['individual']['id']), h($alignment['individual']['email']) ), !$canRemove ? '' : sprintf( "UI.submissionModalForIndex(%s);", sprintf( "'/alignments/delete/%s'", h($alignment['id']) ) ) ); } } echo $alignments;