2011-03-23 10:40:09 +13:00
|
|
|
<?php
|
2016-01-26 18:38:42 +13:00
|
|
|
|
2016-07-22 11:32:32 +12:00
|
|
|
namespace SilverStripe\CMS\Model;
|
|
|
|
|
2016-08-23 14:36:06 +12:00
|
|
|
use SilverStripe\Assets\File;
|
|
|
|
use SilverStripe\ORM\DataExtension;
|
2016-09-13 10:47:02 +12:00
|
|
|
use SilverStripe\View\SSViewer;
|
2016-06-16 16:57:19 +12:00
|
|
|
|
2011-03-23 10:40:09 +13:00
|
|
|
/**
|
2018-04-06 15:53:57 +12:00
|
|
|
* @deprecated 4.2..5.0 Link tracking is baked into File class now
|
2016-01-26 18:38:42 +13:00
|
|
|
* @property File $owner
|
2011-03-23 10:40:09 +13:00
|
|
|
*/
|
2017-01-26 09:59:25 +13:00
|
|
|
class SiteTreeFileExtension extends DataExtension
|
|
|
|
{
|
2018-04-06 15:53:57 +12:00
|
|
|
private static $casting = [
|
2017-01-26 09:59:25 +13:00
|
|
|
'BackLinkHTMLList' => 'HTMLFragment'
|
2018-04-06 15:53:57 +12:00
|
|
|
];
|
2017-01-26 09:59:25 +13:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Generate an HTML list which provides links to where a file is used.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function BackLinkHTMLList()
|
|
|
|
{
|
2017-07-13 15:45:35 +12:00
|
|
|
$viewer = SSViewer::create(["type" => "Includes", self::class . "_description"]);
|
2017-01-26 09:59:25 +13:00
|
|
|
return $viewer->process($this->owner);
|
|
|
|
}
|
2012-03-27 17:05:11 +13:00
|
|
|
}
|