<?php
if ($scope->locally()->hasValue('BackLinkTracking', null, true)) { 
$val .= '
    <table class="table">
        <thead>
        <tr>
            <th>';

$val .= _t('SilverStripe\CMS\Model\SiteTreeFileExtension.TITLE_INDEX','#');
$val .= '</th>
            <th>';

$val .= _t('SilverStripe\CMS\Model\SiteTreeFileExtension.TITLE_USED_ON','Used on');
$val .= '</th>
            <th>';

$val .= _t('SilverStripe\CMS\Model\SiteTreeFileExtension.TITLE_TYPE','Type');
$val .= '</th>
        </tr>
        </thead>
        <tbody>
        ';

$scope->locally()->obj('BackLinkTracking', null, true); $scope->pushScope(); while (($key = $scope->next()) !== false) {
$val .= '
            <tr>
                <td>';

$val .= $scope->locally()->XML_val('Pos', null, true);
$val .= '</td>
                <td><a href="';

$val .= $scope->locally()->XML_val('CMSEditLink', null, true);
$val .= '">';

$val .= $scope->locally()->XML_val('MenuTitle', null, true);
$val .= '</a></td>
                <td>
                    ';

$val .= $scope->locally()->XML_val('i18n_singular_name', null, true);
$val .= '
                    ';

if ($scope->locally()->hasValue('isPublished', null, true)) { 
$val .= '
                        <span class="badge badge-success">Published</span>
                    ';


}else { 
$val .= '
                        <span class="badge status-addedtodraft">Draft</span>
                    ';


}
$val .= '
                </td>
            </tr>
        ';


}; $scope->popScope(); 
$val .= '
        </tbody>
    </table>
';


}
$val .= '
';

