mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
BUGFIX: Removed virtual pages tab from subsites. (sminnee, merged from r100426)
This commit is contained in:
parent
b8015edf75
commit
9ad409d5d4
@ -150,40 +150,6 @@ class SiteTreeSubsites extends SiteTreeDecorator {
|
||||
|
||||
$tab->push(new LiteralField('ReverseRelated', $text));
|
||||
}
|
||||
|
||||
$virtualPagesTable = new SubsiteAgnosticTableListField(
|
||||
'VirtualPageTracking',
|
||||
'SiteTree',
|
||||
array(
|
||||
'Title' => 'Title',
|
||||
'AbsoluteLink' => 'URL',
|
||||
'Subsite.Title' => 'Subsite'
|
||||
),
|
||||
'"CopyContentFromID" = ' . $this->owner->ID,
|
||||
''
|
||||
);
|
||||
$virtualPagesTable->setFieldFormatting(array(
|
||||
'Title' => '<a href=\"admin/show/$ID\">$Title</a>'
|
||||
));
|
||||
$virtualPagesTable->setPermissions(array(
|
||||
'show',
|
||||
'export'
|
||||
));
|
||||
|
||||
|
||||
|
||||
if ($tab = $fields->fieldByName('Root.VirtualPages')) {
|
||||
$tab->removeByName('VirtualPageTracking');
|
||||
$tab->push($virtualPagesTable);
|
||||
} else {
|
||||
if ($virtualPagesTable->TotalCount()) {
|
||||
$virtualPagesNote = new LiteralField('BackLinksNote', '<p>' . _t('SiteTree.VIRTUALPAGESLINKING', 'The following virtual pages pull from this page:') . '</p>');
|
||||
$fields->fieldByName('Root')->push($tabVirtualPages = new Tab('VirtualPages',
|
||||
$virtualPagesNote,
|
||||
$virtualPagesTable
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -83,19 +83,6 @@ class SiteTreeSubsitesTest extends SapphireTest {
|
||||
$this->assertEquals($link->RelatedPageAdminLink(), '<a href="admin/show/' . $contact->ID . '" class="cmsEditlink">Contact Us</a>');
|
||||
}
|
||||
|
||||
function testPageWithVirtualPagesGetsTable() {
|
||||
$importantpage = $this->objFromFixture('SiteTree', 'importantpage');
|
||||
|
||||
$link = new SubsitesVirtualPage();
|
||||
$link->CopyContentFromID = $importantpage->ID;
|
||||
$link->write();
|
||||
$link->doPublish();
|
||||
|
||||
$fields = $importantpage->getCMSFields();
|
||||
|
||||
$this->assertNotNull($fields->fieldByName('Root.VirtualPages'));
|
||||
}
|
||||
|
||||
function testCanEditSiteTree() {
|
||||
$admin = $this->objFromFixture('Member', 'admin');
|
||||
$subsite1member = $this->objFromFixture('Member', 'subsite1member');
|
||||
|
Loading…
x
Reference in New Issue
Block a user