diff --git a/content_pager.install b/content_pager.install new file mode 100644 index 0000000..4d19bbe --- /dev/null +++ b/content_pager.install @@ -0,0 +1,35 @@ +getStorage('node_type')->loadMultiple(); + $typeSpecificConfig = array(); + foreach($contentTypes as $type) { + $typeId = $type->id(); + $typeSpecificConfig[$type][] = array( + 'content_pager.enabled_' . $typeId, + 'content_pager.field_' .$typeId, + 'content_pager.readMore_' . $typeId, + 'content_pager.changeTitle_' . $typeId, + 'content_pager.automaticMethod_' . $typeId, + 'content_pager.automaticMethodWords_' . $typeId, + 'content_pager.automaticMethodWordsOrphan_' . $typeId, + 'content_pager.automaticMethodChars_' . $typeId, + 'content_pager.automaticMethodCharsOrphan_' . $typeId + ); + } + foreach($configArray as $config) { + \Drupal::configFactory()->getEditable($config)->delete(); + } + foreach($typeSpecificConfig as $contentType) { + foreach($contentType as $val) { + \Drupal::configFactory()->getEditable($val)->delete(); + } + } +} \ No newline at end of file