Commit 22e705e2 authored by Jamie McClelland's avatar Jamie McClelland

updating generated civix file.

parent 8ade641c
......@@ -4,6 +4,8 @@
/**
* (Delegated) Implementation of hook_civicrm_config
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_config
*/
function _petitionemail_civix_civicrm_config(&$config = NULL) {
static $configured = FALSE;
......@@ -29,6 +31,7 @@ function _petitionemail_civix_civicrm_config(&$config = NULL) {
* (Delegated) Implementation of hook_civicrm_xmlMenu
*
* @param $files array(string)
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_xmlMenu
*/
function _petitionemail_civix_civicrm_xmlMenu(&$files) {
foreach (_petitionemail_civix_glob(__DIR__ . '/xml/Menu/*.xml') as $file) {
......@@ -38,6 +41,8 @@ function _petitionemail_civix_civicrm_xmlMenu(&$files) {
/**
* Implementation of hook_civicrm_install
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_install
*/
function _petitionemail_civix_civicrm_install() {
_petitionemail_civix_civicrm_config();
......@@ -48,6 +53,8 @@ function _petitionemail_civix_civicrm_install() {
/**
* Implementation of hook_civicrm_uninstall
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_uninstall
*/
function _petitionemail_civix_civicrm_uninstall() {
_petitionemail_civix_civicrm_config();
......@@ -58,6 +65,8 @@ function _petitionemail_civix_civicrm_uninstall() {
/**
* (Delegated) Implementation of hook_civicrm_enable
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_enable
*/
function _petitionemail_civix_civicrm_enable() {
_petitionemail_civix_civicrm_config();
......@@ -70,6 +79,8 @@ function _petitionemail_civix_civicrm_enable() {
/**
* (Delegated) Implementation of hook_civicrm_disable
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_disable
*/
function _petitionemail_civix_civicrm_disable() {
_petitionemail_civix_civicrm_config();
......@@ -88,6 +99,8 @@ function _petitionemail_civix_civicrm_disable() {
*
* @return mixed based on op. for 'check', returns array(boolean) (TRUE if upgrades are pending)
* for 'enqueue', returns void
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_upgrade
*/
function _petitionemail_civix_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
if ($upgrader = _petitionemail_civix_upgrader()) {
......@@ -95,6 +108,9 @@ function _petitionemail_civix_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL
}
}
/**
* @return CRM_Petitionemail_Upgrader
*/
function _petitionemail_civix_upgrader() {
if (!file_exists(__DIR__.'/CRM/Petitionemail/Upgrader.php')) {
return NULL;
......@@ -144,6 +160,8 @@ function _petitionemail_civix_find_files($dir, $pattern) {
* (Delegated) Implementation of hook_civicrm_managed
*
* Find any *.mgd.php files, merge their content, and return.
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_managed
*/
function _petitionemail_civix_civicrm_managed(&$entities) {
$mgdFiles = _petitionemail_civix_find_files(__DIR__, '*.mgd.php');
......@@ -158,6 +176,35 @@ function _petitionemail_civix_civicrm_managed(&$entities) {
}
}
/**
* (Delegated) Implementation of hook_civicrm_caseTypes
*
* Find any and return any files matching "xml/case/*.xml"
*
* Note: This hook only runs in CiviCRM 4.4+.
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_caseTypes
*/
function _petitionemail_civix_civicrm_caseTypes(&$caseTypes) {
if (!is_dir(__DIR__ . '/xml/case')) {
return;
}
foreach (_petitionemail_civix_glob(__DIR__ . '/xml/case/*.xml') as $file) {
$name = preg_replace('/\.xml$/', '', basename($file));
if ($name != CRM_Case_XMLProcessor::mungeCaseType($name)) {
$errorMessage = sprintf("Case-type file name is malformed (%s vs %s)", $name, CRM_Case_XMLProcessor::mungeCaseType($name));
CRM_Core_Error::fatal($errorMessage);
// throw new CRM_Core_Exception($errorMessage);
}
$caseTypes[$name] = array(
'module' => 'cc.tadpole.petitionemail',
'name' => $name,
'file' => $file,
);
}
}
/**
* Glob wrapper which is guaranteed to return an array.
*
......@@ -166,7 +213,7 @@ function _petitionemail_civix_civicrm_managed(&$entities) {
* result for an empty match is sometimes array() and sometimes FALSE.
* This wrapper provides consistency.
*
* @see http://php.net/glob
* @link http://php.net/glob
* @param string $pattern
* @return array, possibly empty
*/
......@@ -213,3 +260,19 @@ function _petitionemail_civix_insert_navigation_menu(&$menu, $path, $item, $pare
return $found;
}
}
/**
* (Delegated) Implementation of hook_civicrm_alterSettingsFolders
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_alterSettingsFolders
*/
function _petitionemail_civix_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
static $configured = FALSE;
if ($configured) return;
$configured = TRUE;
$settingsDir = __DIR__ . DIRECTORY_SEPARATOR . 'settings';
if(is_dir($settingsDir) && !in_array($settingsDir, $metaDataFolders)) {
$metaDataFolders[] = $settingsDir;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment