diff --git a/code/Model/SiteTreeFileExtension.php b/code/Model/SiteTreeFileExtension.php index 2fd0f41a..2996612e 100644 --- a/code/Model/SiteTreeFileExtension.php +++ b/code/Model/SiteTreeFileExtension.php @@ -10,6 +10,7 @@ use SilverStripe\ORM\DataExtension; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\ManyManyList; use SilverStripe\ORM\Versioning\Versioned; +use SilverStripe\View\SSViewer; use Subsite; /** @@ -38,6 +39,10 @@ class SiteTreeFileExtension extends DataExtension { 'BackLinkTracking' ); + private static $casting = array( + 'BackLinkHTMLList' => 'HTMLFragment' + ); + public function updateCMSFields(FieldList $fields) { $fields->insertAfter( 'LastEdited', @@ -57,25 +62,9 @@ class SiteTreeFileExtension extends DataExtension { * @return string */ public function BackLinkHTMLList() { - $html = '' . _t( - 'SiteTreeFileExtension.BACKLINK_LIST_DESCRIPTION', - 'This list shows all pages where the file has been added through a WYSIWYG editor.' - ) . ''; + $viewer = new SSViewer(["type" => "Includes", __CLASS__ . "_description"]); - $html .= '
<% _t('SiteTreeFileExtension.TITLE_INDEX', '#') %> | +<% _t('SiteTreeFileExtension.TITLE_USED_ON', 'Used on') %> | +<% _t('SiteTreeFileExtension.TITLE_TYPE', 'Type') %> | +
---|---|---|
$Pos | +$MenuTitle | ++ $i18n_singular_name + <% if $isPublished %> + Published + <% else %> + Draft + <% end_if %> + | +