user_contact.inc in Chaos Tool Suite (ctools) 6
File
plugins/content_types/contact/user_contact.inc
View source
<?php
if (module_exists('contact')) {
$plugin = array(
'single' => TRUE,
'title' => t('User contact form'),
'icon' => 'icon_contact.png',
'description' => t('The site contact form that allows users to contact other users.'),
'category' => t('User'),
'required context' => new ctools_context_required(t('User'), 'user'),
);
}
function ctools_user_contact_content_type_render($subtype, $conf, $panel_args, $context) {
if (empty($context) || empty($context->data)) {
return;
}
if (!_contact_user_tab_access($context->data)) {
return;
}
$block = new stdClass();
$block->module = 'contact';
$block->delta = 'form';
$block->title = t('Contact @name', array(
'@name' => $context->data->name,
));
module_load_include('inc', 'contact', 'contact.pages');
$block->content = contact_user_page($context->data);
return $block;
}
function ctools_user_contact_content_type_edit_form(&$form, &$form_state) {
}
function ctools_user_contact_content_type_edit_form_submit(&$form, &$form_state) {
}
function ctools_user_contact_content_type_admin_title($subtype, $conf, $context) {
return t('User contact form');
}