<?php $htmls = $texts = [] ?>
<?php foreach ($serverPartCellDatas['types'] as $type): ?>
    <?php $htmls[$type] = [] ?>
    <?php $texts[$type] = []; ?>
    <?php foreach ($serverPartCellDatas['entities'][$type] as $entities): ?>
        <?php foreach ($entities as $entity): ?>
            <?php $serverPartCellDatas['entity'] = $entity ?>
            <?php $htmls[$type][] = $serverPartCellDatas['service']->getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas) ?>
            <?php $texts[$type][] = $serverPartCellDatas['service']->getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas, ['return' => 'onlyText']) ?>
        <?php endforeach ?>
    <?php endforeach ?>
<?php endforeach ?>
<?php $view_htmls = [$serverPartCellDatas['service']->getHelper()->getFieldView('SERVER', "", $serverPartCellDatas)] ?>
<?php foreach ($htmls as $type => $datas): ?>
    <?php $view_htmls[] = $serverPartCellDatas['service']->getHelper()->getListButton($type, '', $serverPartCellDatas) . implode(",", $datas) ?>
<?php endforeach ?>
<?php $view_texts = [!$serverPartCellDatas['serverEntity'] ? "" : $serverPartCellDatas['serverEntity']->getCode()] ?>
<?php foreach ($texts as $type => $datas): ?>
    <?php $view_texts[] = implode(',', $datas) ?>
<?php endforeach ?>
<div class="text-nowrap">
    <?php $text = implode(" / ", $view_texts) ?>
    <span class="rounded border border-primary" style="cursor:pointer;" onClick="copyServerPartToClipboard('<?= $text ?>')" text-data="<?= $text ?>">📋</span>
    <?= implode(" / ", $view_htmls) ?>
    <?php if ($serverPartCellDatas['serverEntity']): ?>
        <a href="/admin/customer/service/terminateServer/<?= $serverPartCellDatas['serverEntity']->getServiceInfoUID() ?>?serverinfo_uid=<?= $serverPartCellDatas['serverEntity']->getPK() ?>">❌</a>
    <?php endif ?>
</div>