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