ctools.inc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * @file
  4. * Chaos tool suite module integration.
  5. */
  6. /**
  7. * Implements hook_custom_formatters_init() on behalf of ctools.module.
  8. */
  9. function ctools_custom_formatters_init() {
  10. if (strstr(request_uri(), 'system/ajax') && in_array($_POST['form_id'], array('ctools_export_ui_edit_item_form', 'custom_formatters_export_ui_export_form'))) {
  11. require_once drupal_get_path('module', 'custom_formatters') . '/plugins/export_ui/custom_formatters.inc';
  12. /**
  13. * Temporary fix for CTools #AJAX issue.
  14. * @See http://drupal.org/node/1142812
  15. */
  16. ctools_include('export');
  17. }
  18. }
  19. /**
  20. * Implements hook_ctools_plugin_api().
  21. */
  22. function custom_formatters_ctools_plugin_api() {
  23. list($module, $api) = func_get_args();
  24. if ($module == 'custom_formatters' && $api == 'custom_formatters') {
  25. return array('version' => 2);
  26. }
  27. }
  28. /**
  29. * Implements hook_ctools_plugin_directory().
  30. */
  31. function custom_formatters_ctools_plugin_directory($module, $plugin) {
  32. if ($module == 'ctools' && !empty($plugin)) {
  33. return "plugins/{$plugin}";
  34. }
  35. }
  36. /**
  37. * Implements hook_custom_formatters_theme_alter() on behalf of ctools.module.
  38. */
  39. function ctools_custom_formatters_theme_alter(&$theme) {
  40. $theme['custom_formatters_export_ui_form_preview'] = array(
  41. 'render element' => 'form',
  42. 'file' => 'custom_formatters.inc',
  43. 'path' => drupal_get_path('module', 'custom_formatters') . '/plugins/export_ui'
  44. );
  45. }