user_contact.inc

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

Functions

Namesort descending Description
ctools_user_contact_content_type_admin_title Returns the administrative title for a type.
ctools_user_contact_content_type_edit_form Returns an edit form for custom type settings.
ctools_user_contact_content_type_edit_form_submit Submit handler for contact form.
ctools_user_contact_content_type_render Render the custom content type.

File

sites/all/modules/ulmus/ctools/plugins/content_types/contact/user_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('User contact form'),
  10. 'icon' => 'icon_contact.png',
  11. 'description' => t('The site contact form that allows users to contact other users.'),
  12. 'category' => t('User'),
  13. 'required context' => new ctools_context_required(t('User'), 'user'),
  14. );
  15. }
  16. /**
  17. * Render the custom content type.
  18. */
  19. function ctools_user_contact_content_type_render($subtype, $conf, $panel_args, $context) {
  20. if (empty($context) || empty($context->data)) {
  21. return;
  22. }
  23. if (!_contact_personal_tab_access($context->data)) {
  24. return;
  25. }
  26. // Build the content type block.
  27. $block = new stdClass();
  28. $block->module = 'contact';
  29. $block->delta = 'form';
  30. $block->title = t('Contact @name', array('@name' => $context->data->name));
  31. module_load_include('inc', 'contact', 'contact.pages');
  32. $block->content = drupal_get_form('contact_personal_form', $context->data);
  33. return $block;
  34. }
  35. /**
  36. * Returns an edit form for custom type settings.
  37. */
  38. function ctools_user_contact_content_type_edit_form($form, &$form_state) {
  39. // Empty so that we can have title override.
  40. return $form;
  41. }
  42. /**
  43. * Submit handler for contact form.
  44. */
  45. function ctools_user_contact_content_type_edit_form_submit(&$form, &$form_state) {
  46. // Copy everything from our defaults.
  47. /*
  48. foreach (array_keys($form_state['plugin']['defaults']) as $key) {
  49. $form_state['conf'][$key] = $form_state['values'][$key];
  50. }
  51. */
  52. }
  53. /**
  54. * Returns the administrative title for a type.
  55. */
  56. function ctools_user_contact_content_type_admin_title($subtype, $conf, $context) {
  57. return t('User contact form');
  58. }
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.