MINOR Removed hard dependency on SiteConfig and VirtualPage in LeftAndMain

This commit is contained in:
Ingo Schommer 2011-03-29 17:54:58 +13:00
parent a467eda0d2
commit b4affff38d

View File

@ -123,11 +123,6 @@ class LeftAndMain extends Controller {
_t('LeftAndMain.HELP', 'Help', PR_HIGH, 'Menu title'), _t('LeftAndMain.HELP', 'Help', PR_HIGH, 'Menu title'),
self::$help_link self::$help_link
); );
// set reading lang
if(Object::has_extension('SiteTree', 'Translatable') && !$this->isAjax()) {
Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree')));
}
// Allow customisation of the access check by a decorator // Allow customisation of the access check by a decorator
// Also all the canView() check to execute Director::redirect() // Also all the canView() check to execute Director::redirect()
@ -503,7 +498,9 @@ class LeftAndMain extends Controller {
if($p = $this->currentPage()) $obj->markToExpose($p); if($p = $this->currentPage()) $obj->markToExpose($p);
// NOTE: SiteTree/CMSMain coupling :-( // NOTE: SiteTree/CMSMain coupling :-(
SiteTree::prepopuplate_permission_cache('CanEditType', $obj->markedNodeIDs(), 'SiteTree::can_edit_multiple'); if(class_exists('SiteTree')) {
SiteTree::prepopuplate_permission_cache('CanEditType', $obj->markedNodeIDs(), 'SiteTree::can_edit_multiple');
}
// getChildrenAsUL is a flexible and complex way of traversing the tree // getChildrenAsUL is a flexible and complex way of traversing the tree
$titleEval = ' $titleEval = '
@ -659,11 +656,13 @@ class LeftAndMain extends Controller {
); );
// Update all dependent pages // Update all dependent pages
if($virtualPages = DataObject::get("VirtualPage", "\"CopyContentFromID\" = $node->ID")) { if(class_exists('VirtualPage')) {
foreach($virtualPages as $virtualPage) { if($virtualPages = DataObject::get("VirtualPage", "\"CopyContentFromID\" = $node->ID")) {
$statusUpdates['modified'][$virtualPage->ID] = array( foreach($virtualPages as $virtualPage) {
'TreeTitle' => $virtualPage->TreeTitle() $statusUpdates['modified'][$virtualPage->ID] = array(
); 'TreeTitle' => $virtualPage->TreeTitle()
);
}
} }
} }