contact.inc

  1. cis7 sites/all/modules/ulmus/ctools/plugins/content_types/contact/contact.inc
  2. cle7 sites/all/modules/ulmus/ctools/plugins/content_types/contact/contact.inc
  3. ecd7 sites/all/modules/ulmus/ctools/plugins/content_types/contact/contact.inc
  4. elmsmedia7 sites/all/modules/ulmus/ctools/plugins/content_types/contact/contact.inc
  5. harmony7 sites/all/modules/ulmus/ctools/plugins/content_types/contact/contact.inc
  6. icor7 sites/all/modules/ulmus/ctools/plugins/content_types/contact/contact.inc
  7. meedjum_blog7 sites/all/modules/ulmus/ctools/plugins/content_types/contact/contact.inc
  8. mooc7 sites/all/modules/ulmus/ctools/plugins/content_types/contact/contact.inc

Functions

Namesort descending Description
ctools_contact_content_type_admin_title Returns the administrative title for a type.
ctools_contact_content_type_edit_form Returns an edit form for custom type settings.
ctools_contact_content_type_edit_form_submit Submit handler for contact form.
ctools_contact_content_type_render Render the custom content type.

File

sites/all/modules/ulmus/ctools/plugins/content_types/contact/contact.inc
View source
  1. <?php
  2. if (module_exists('contact')) {
  3. /**
  4. * Plugins are described by creating a $plugin array which will be used
  5. * by the system that includes this file.
  6. */
  7. $plugin = array(
  8. 'single' => TRUE,
  9. 'title' => t('Contact form'),
  10. 'icon' => 'icon_contact.png',
  11. 'description' => t('The site contact form that allows users to send a message to site administrators.'),
  12. 'category' => t('Widgets'),
  13. );
  14. }
  15. /**
  16. * Render the custom content type.
  17. */
  18. function ctools_contact_content_type_render($subtype, $conf, $panel_args, $context) {
  19. if (!user_access('access site-wide contact form')) {
  20. return;
  21. }
  22. // Build the content type block.
  23. $block = new stdClass();
  24. $block->module = 'contact';
  25. $block->delta = 'form';
  26. $block->title = t('Contact');
  27. module_load_include('inc', 'contact', 'contact.pages');
  28. $block->content = drupal_get_form('contact_site_form');
  29. return $block;
  30. }
  31. /**
  32. * Returns an edit form for custom type settings.
  33. */
  34. function ctools_contact_content_type_edit_form($form, &$form_state) {
  35. // Empty so that we can have title override.
  36. return $form;
  37. }
  38. /**
  39. * Submit handler for contact form.
  40. */
  41. function ctools_contact_content_type_edit_form_submit($form, &$form_state) {
  42. // Copy everything from our defaults.
  43. /*
  44. foreach (array_keys($form_state['plugin']['defaults']) as $key) {
  45. $form_state['conf'][$key] = $form_state['values'][$key];
  46. }
  47. */
  48. }
  49. /**
  50. * Returns the administrative title for a type.
  51. */
  52. function ctools_contact_content_type_admin_title($subtype, $conf, $context) {
  53. return t('Contact form');
  54. }