<?php

$hideLabels = $this->view->get('hideLabels');

if (count($this->data)) {
    foreach ($this->data as $item) {
        foreach ($item['attributes'] as $field => $name) {
            if ((isset($item['text'][$field]) && ($value = $item['text'][$field]))) {
                if (!$hideLabels) {
                    echo sprintf($GLOBALS['TL_LANG']['MSC']['field_label'], $name) . ' ';
                }
                echo $value . PHP_EOL;
            }
        }

        foreach ($item['actions'] as $action) {
            echo sprintf(
                '%s: %s%s',
                $action['label'],
                $action['href'],
                PHP_EOL
            );
        }
    }
} else {
    echo $this->noItemsMsg;
}
