MINOR make showing virtual pages tab conditional

MINOR made virtual page tracking sitetree tablelistfield subsite agnostic (from r98005) (from r98223)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102630 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-13 02:29:51 +00:00
parent a2883d0354
commit 5ff636c6b4

View File

@ -1661,8 +1661,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
'AbsoluteLink' => 'URL'
),
'"CopyContentFromID" = ' . $this->ID,
''//,
// 'LEFT JOIN "SiteTree_LinkTracking" ON "SiteTree"."ID" = "SiteTree_LinkTracking"."SiteTreeID"'
''
);
$virtualPagesTable->setFieldFormatting(array(
'Title' => '<a href=\"admin/show/$ID\">$Title</a>'
@ -1674,7 +1673,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
// Lay out the fields
$fields = new FieldSet(
new TabSet("Root",
$rootTab = new TabSet("Root",
$tabContent = new TabSet('Content',
$tabMain = new Tab('Main',
new TextField("Title", $this->fieldLabel('Title')),
@ -1739,10 +1738,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$tabBacklinks = new Tab('Backlinks',
$backLinksNote,
$backLinksTable
),
$tabVirtualPages = new Tab('VirtualPages',
$virtualPagesNote,
$virtualPagesTable
)
),
$tabAccess = new Tab('Access',
@ -1762,6 +1757,13 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
)
);
if ($virtualPagesTable->TotalCount()) {
$rootTab->push($tabVirtualPages = new Tab('VirtualPages',
$virtualPagesNote,
$virtualPagesTable
));
}
// Make page location fields read-only if the user doesn't have the appropriate permission
if(!Permission::check("SITETREE_REORGANISE")) {
$fields->makeFieldReadonly('ParentType');