function mobile_codes_init in Mobile Codes 7.2
Same name and namespace in other branches
- 6.2 mobile_codes.module \mobile_codes_init()
Implements hook_init().
File
- ./
mobile_codes.module, line 19 - Mobile Codes core functions.
Code
function mobile_codes_init() {
/**
* Temporary fix for CTools #AJAX issue.
*
* @See http://drupal.org/node/1142812
*/
if (strstr(request_uri(), 'system/ajax') && $_POST['form_id'] == 'ctools_export_ui_edit_item_form') {
ctools_include('export');
}
// Determine if CTools is available after Mobile Codes 1.x to 2.x upgrade.
if (!module_exists('ctools')) {
module_enable(array(
'ctools',
));
if (!module_exists('ctools')) {
drupal_set_message(t('Mobile Codes has been disabled as the required @ctools module is not present.', array(
'@ctools' => l(t('Chaos tool suite'), 'http://drupal.org/project/ctools'),
)), 'error');
module_disable(array(
'mobile_codes',
));
}
}
module_invoke_all('mobile_codes_init');
}