foreach(array_keys($params['enableComponentIDs'],(int)CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_component WHERE name = 'CiviGrant'"),TRUE)as$key){
unset($params['enableComponentIDs'][$key]);
}
CRM_Core_BAO_ConfigSetting::create($params);
return_grantprograms_civix_civicrm_uninstall();
}
...
...
@@ -63,6 +48,7 @@ function grantprograms_civicrm_uninstall() {
* Implementation of hook_civicrm_enable
*/
functiongrantprograms_civicrm_enable(){
grantprograms_addRemoveMenu(TRUE);
return_grantprograms_civix_civicrm_enable();
}
...
...
@@ -70,6 +56,7 @@ function grantprograms_civicrm_enable() {
* Implementation of hook_civicrm_disable
*/
functiongrantprograms_civicrm_disable(){
grantprograms_addRemoveMenu(FALSE);
return_grantprograms_civix_civicrm_disable();
}
...
...
@@ -1000,3 +987,23 @@ function grantprograms_define($extensionsDir) {
fclose($file);
return;
}
functiongrantprograms_addRemoveMenu($enable){
$config_backend=unserialize(CRM_Core_DAO::singleValueQuery('SELECT config_backend FROM civicrm_domain WHERE id = 1'));
foreach(array_keys($params['enableComponentIDs'],(int)CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_component WHERE name = 'CiviGrant'"),TRUE)as$key){