diff --git a/CRM/Civioffice/Upgrader.php b/CRM/Civioffice/Upgrader.php index b7e3d4d..0890baf 100644 --- a/CRM/Civioffice/Upgrader.php +++ b/CRM/Civioffice/Upgrader.php @@ -32,8 +32,28 @@ public function install() */ public function uninstall() { - // TODO: Remove civioffice_live_snippets option group. - // TODO: Remove settings created by this extension. + // Remove civioffice_live_snippets option group. + \Civi\Api4\OptionGroup::delete(false) + ->addWhere('name', '=', 'civioffice_live_snippets') + ->execute(); + // TODO: Revert contact settings for each live snippet. +// Civi::contactSettings()->revert('civioffice.live_snippets.' . $name); + + // Remove settings created by this extension. + Civi::settings()->revert(CRM_Civioffice_DocumentStore_Local::LOCAL_TEMP_PATH_SETTINGS_KEY); + Civi::settings()->revert(CRM_Civioffice_DocumentStore_Local::LOCAL_STATIC_PATH_SETTINGS_KEY); + Civi::settings()->revert(CRM_Civioffice_DocumentStore_Upload::UPLOAD_PRIVATE_ENABLED_SETTINGS_KEY); + Civi::settings()->revert(CRM_Civioffice_DocumentStore_Upload::UPLOAD_PUBLIC_ENABLED_SETTINGS_KEY); + // TODO: Revert contact settings. +// Civi::contactSettings()->revert(CRM_Civioffice_Form_DocumentFromSingleContact::UNOCONV_CREATE_SINGLE_ACTIVIY_ATTACHMENT); +// Civi::contactSettings()->revert(CRM_Civioffice_Form_DocumentFromSingleContact::UNOCONV_CREATE_SINGLE_ACTIVIY_TYPE); + + // Revert renderer settings. + foreach (Civi::settings()->get('civioffice_renderers') as $renderer_uri => $renderer_name) { + Civi::settings()->revert('civioffice_renderer_' . $renderer_uri); + } + Civi::settings()->revert('civioffice_renderers'); + // TODO: Clean-up file cache (rendered files), using a cleanup interface. }