From 02959136735f978cd99cd5307959e69bf24195cd Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 12 Jan 2010 23:41:03 +0000 Subject: [PATCH] MINOR track virtual pages that link to the current page (from r94700) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96768 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SiteTree.php | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index 1171c7b66..c961a1ae9 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -1578,7 +1578,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid 'BackLinkTracking', 'SiteTree', array( - 'Title' => 'Title' + 'Title' => 'Title', ), '"ChildID" = ' . $this->ID, '', @@ -1593,10 +1593,28 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid )); } + $virtualPagesNote = new LiteralField('BackLinksNote', '

' . _t('SiteTree.VIRTUALPAGESLINKING', 'The following virtual pages pull from this page:') . '

'); + $virtualPagesTable = new TableListField( + 'VirtualPageTracking', + 'SiteTree', + array( + 'Title' => 'Title', + 'AbsoluteLink' => 'URL' + ), + '"CopyContentFromID" = ' . $this->ID, + ''//, + // 'LEFT JOIN "SiteTree_LinkTracking" ON "SiteTree"."ID" = "SiteTree_LinkTracking"."SiteTreeID"' + ); + $virtualPagesTable->setFieldFormatting(array( + 'Title' => '$Title' + )); + $virtualPagesTable->setPermissions(array( + 'show', + 'export' + )); + // Lay out the fields $fields = new FieldSet( - // Add a field with a bit of metadata for concurrent editing. The fact that we're using - // non-standard attributes does not really matter, all modern UA's just ignore em. new TabSet("Root", $tabContent = new TabSet('Content', $tabMain = new Tab('Main', @@ -1672,6 +1690,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid $tabBacklinks = new Tab('Backlinks', $backLinksNote, $backLinksTable + ), + $tabVirtualPages = new Tab('VirtualPages', + $virtualPagesNote, + $virtualPagesTable ) ), $tabAccess = new Tab('Access',