Merge pull request #2132 from dhensby/pulls/4.0/ssnaviagtor-casting

FIX Correct SilverStripeNavigator correctly in templates
This commit is contained in:
Robbie Averill 2018-04-04 11:37:39 +12:00 committed by GitHub
commit 3d2d607be1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -351,7 +351,7 @@ class ContentController extends Controller
} }
$viewPageIn = _t('SilverStripe\\CMS\\Controllers\\ContentController.VIEWPAGEIN', 'View Page in:'); $viewPageIn = _t('SilverStripe\\CMS\\Controllers\\ContentController.VIEWPAGEIN', 'View Page in:');
return <<<HTML $navigator = <<<HTML
<div id="SilverStripeNavigator"> <div id="SilverStripeNavigator">
<div class="holder"> <div class="holder">
<div id="logInStatus"> <div id="logInStatus">
@ -366,6 +366,7 @@ class ContentController extends Controller
</div> </div>
$message $message
HTML; HTML;
return DBField::create_field('HTMLFragment', $navigator);
// On live sites we should still see the archived message // On live sites we should still see the archived message
} else { } else {
@ -374,9 +375,9 @@ HTML;
/** @var DBDatetime $dateObj */ /** @var DBDatetime $dateObj */
$dateObj = DBField::create_field('Datetime', $date); $dateObj = DBField::create_field('Datetime', $date);
// $dateObj->setVal($date); // $dateObj->setVal($date);
return "<div id=\"SilverStripeNavigatorMessage\">" . return DBField::create_field('HTMLFragment', "<div id=\"SilverStripeNavigatorMessage\">" .
_t('SilverStripe\\CMS\\Controllers\\ContentController.ARCHIVEDSITEFROM', 'Archived site from') . _t('SilverStripe\\CMS\\Controllers\\ContentController.ARCHIVEDSITEFROM', 'Archived site from') .
"<br>" . $dateObj->Nice() . "</div>"; "<br>" . $dateObj->Nice() . "</div>");
} }
} }
return null; return null;