silverstripe-cms/code/Model/SiteTreeFileExtension.php

30 lines
688 B
PHP
Raw Normal View History

<?php
2016-07-22 01:32:32 +02:00
namespace SilverStripe\CMS\Model;
use SilverStripe\Assets\File;
use SilverStripe\ORM\DataExtension;
2016-09-13 00:47:02 +02:00
use SilverStripe\View\SSViewer;
/**
* @deprecated 4.2..5.0 Link tracking is baked into File class now
* @property File $owner
*/
2017-01-25 21:59:25 +01:00
class SiteTreeFileExtension extends DataExtension
{
private static $casting = [
2017-01-25 21:59:25 +01:00
'BackLinkHTMLList' => 'HTMLFragment'
];
2017-01-25 21:59:25 +01:00
/**
* Generate an HTML list which provides links to where a file is used.
*
* @return string
*/
public function BackLinkHTMLList()
{
2022-01-17 00:29:25 +01:00
$viewer = SSViewer::create(['type' => 'Includes', self::class . '_description']);
2017-01-25 21:59:25 +01:00
return $viewer->process($this->owner);
}
}