Adding back previous value for SSViewer::theme_enabled

This commit is contained in:
Michael van Schaik 2017-06-02 09:17:39 +02:00 committed by Robbie Averill
parent dcc821f3c6
commit 091997027b

View File

@ -21,13 +21,19 @@ class UserFormRecipientItemRequest extends GridFieldDetailForm_ItemRequest
public function preview() public function preview()
{ {
// Enable theme for preview (may be needed for Shortcodes) // Enable theme for preview (may be needed for Shortcodes)
$previous_theme_enabled = Config::inst()->get('SSViewer', 'theme_enabled');
Config::inst()->update('SSViewer', 'theme_enabled', true); Config::inst()->update('SSViewer', 'theme_enabled', true);
return $this->customise(new ArrayData(array( $ret = $this->customise(new ArrayData(array(
'Body' => $this->record->getEmailBodyContent(), 'Body' => $this->record->getEmailBodyContent(),
'HideFormData' => $this->record->HideFormData, 'HideFormData' => $this->record->HideFormData,
'Fields' => $this->getPreviewFieldData() 'Fields' => $this->getPreviewFieldData()
)))->renderWith($this->record->EmailTemplate); )))->renderWith($this->record->EmailTemplate);
// reset theme preview value
Config::inst()->update('SSViewer', 'theme_enabled', $previous_theme_enabled);
return $ret;
} }
/** /**