mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
API Mark image tracking as owned
This commit is contained in:
parent
a737f9c901
commit
de6db9f5c6
@ -19,6 +19,16 @@ class SiteTreeFileExtension extends DataExtension {
|
|||||||
'BackLinkTracking' => 'SiteTree.ImageTracking' // {@see SiteTreeLinkTracking}
|
'BackLinkTracking' => 'SiteTree.ImageTracking' // {@see SiteTreeLinkTracking}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Images tracked by pages are owned by those pages
|
||||||
|
*
|
||||||
|
* @config
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private static $owned_by = array(
|
||||||
|
'BackLinkTracking'
|
||||||
|
);
|
||||||
|
|
||||||
public function updateCMSFields(FieldList $fields) {
|
public function updateCMSFields(FieldList $fields) {
|
||||||
$fields->insertAfter(
|
$fields->insertAfter(
|
||||||
ReadonlyField::create(
|
ReadonlyField::create(
|
||||||
|
@ -41,13 +41,23 @@ class SiteTreeLinkTracking extends DataExtension {
|
|||||||
|
|
||||||
private static $many_many = array(
|
private static $many_many = array(
|
||||||
"LinkTracking" => "SiteTree",
|
"LinkTracking" => "SiteTree",
|
||||||
"ImageTracking" => "File"
|
"ImageTracking" => "File" // {@see SiteTreeFileExtension}
|
||||||
);
|
);
|
||||||
|
|
||||||
private static $belongs_many_many = array(
|
private static $belongs_many_many = array(
|
||||||
"BackLinkTracking" => "SiteTree.LinkTracking"
|
"BackLinkTracking" => "SiteTree.LinkTracking"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tracked images are considered owned by this page
|
||||||
|
*
|
||||||
|
* @config
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private static $owns = array(
|
||||||
|
"ImageTracking"
|
||||||
|
);
|
||||||
|
|
||||||
private static $many_many_extraFields = array(
|
private static $many_many_extraFields = array(
|
||||||
"LinkTracking" => array("FieldName" => "Varchar"),
|
"LinkTracking" => array("FieldName" => "Varchar"),
|
||||||
"ImageTracking" => array("FieldName" => "Varchar")
|
"ImageTracking" => array("FieldName" => "Varchar")
|
||||||
|
Loading…
Reference in New Issue
Block a user