From 1f9c4b329458be09af1399dbe231e4f25384136f Mon Sep 17 00:00:00 2001 From: Angela McMahon Date: Tue, 17 Oct 2017 10:03:53 -0500 Subject: [PATCH] Squashed commit of the following: commit efb5c2592abccb20692310c804011e40af4cc842 Author: Angela McMahon Date: Tue Oct 17 09:46:02 2017 -0500 INTERIM-140 Added fallback for sites without token_filter commit 77ff0e1125a7abe86f9184f2bef91dea270f6cc3 Author: Angela McMahon Date: Mon Oct 16 16:30:42 2017 -0500 INTERIM-140 Added token replacement capability to suitcase_interim_block text format --- theme-settings.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/theme-settings.php b/theme-settings.php index 757c637..cc503d9 100644 --- a/theme-settings.php +++ b/theme-settings.php @@ -206,10 +206,24 @@ function suitcase_interim_config_form_submit($form, &$form_state) { if (module_exists('block')) { if (!filter_format_exists('suitcase_interim_block')) { - $suitcase_interim_block_format = array( - 'format' => 'suitcase_interim_block', - 'name' => 'Suitcase Interim Block', - ); + if (module_exists('token_filter')) { + $suitcase_interim_block_format = array( + 'format' => 'suitcase_interim_block', + 'name' => 'Suitcase Interim Block', + 'filters' => array( + 'filter_tokens' => array( + 'weight' => 0, + 'status' => 1, + ), + ), + ); + } + else { + $suitcase_interim_block_format = array( + 'format' => 'suitcase_interim_block', + 'name' => 'Suitcase Interim Block', + ); + } $suitcase_interim_block_format = (object) $suitcase_interim_block_format; filter_format_save($suitcase_interim_block_format); }