X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FSystem.php;h=41646c5ef31a8ee0cf6bf1c50f496124721222d9;hb=293d50b4211dcd40bd421da0047f7fb4833fdcbf;hp=00f3f71426311330e217626a5ae478c9cbf3fa88;hpb=edae2a2c7bc01f231eb72a9f385d133d757c1bec;p=civicrm-core.git diff --git a/api/v3/System.php b/api/v3/System.php index 00f3f71426..41646c5ef3 100644 --- a/api/v3/System.php +++ b/api/v3/System.php @@ -427,3 +427,21 @@ function civicrm_api3_system_createmissinglogtables() { } return civicrm_api3_create_success(1); } + +/** + * Rebuild Multilingual Schema + * + */ +function civicrm_api3_system_rebuildmultilingualschema() { + $domain = new CRM_Core_DAO_Domain(); + $domain->find(TRUE); + + if ($domain->locales) { + $locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales); + CRM_Core_I18n_Schema::rebuildMultilingualSchema($locales); + return civicrm_api3_create_success(1); + } + else { + throw new API_Exception('Cannot call rebuild Multilingual schema on non Multilingual database'); + } +}