You are here

contactemailform.inc in Panels Extras 6

File

emailpanels/plugins/content_types/contactemailform.inc
View source
<?php

// $Id$ contactmailform.inc,v 1.0 2011/01/28 16:50:48 chriscalip Exp $

/**
 * @file
 * Provides additional content type CCK Email Contact form for panels use
 */
if (module_exists('email')) {

  /**
   * Plugins are described by creating a $plugin array which will be used
   * by the system that includes this file.
   */
  $plugin = array(
    'single' => TRUE,
    'title' => t('CCK Email Contact form'),
    // @todo provide png file

    //'icon' => 'icon_goes_here.png',
    'description' => t('Display the contact form generated by the cck email module. must be in email/node/field_name path'),
    'category' => t('Widgets'),
  );
}

/**
 * Render the custom content type.
 */
function emailpanels_contactemailform_content_type_render($subtype, $conf, $panel_args, $context) {

  // Build the content type block.
  $block = new stdClass();
  $block->module = 'form';
  $block->delta = $panel_args['nid'];
  $block->content = email_mail_page($panel_args['nid'], $panel_args['field_name']);
  return $block;
}

/**
 * Returns an edit form for custom type settings.
 */
function emailpanels_contactemailform_content_type_edit_form(&$form, &$form_state) {

  // @todo placeholder stuff for now
}

/**
 * Submit handler for contact form.
 */
function emailpanels_contactemailform_content_type_edit_form_submit(&$form, &$form_state) {

  // @todo placeholder stuff for now
}

/**
 * Returns the administrative title for a type.
 */
function emailpanels_contactemailform_content_type_admin_title($subtype, $conf, $context) {
  return t('CCK Email Contact form');
}

Functions

Namesort descending Description
emailpanels_contactemailform_content_type_admin_title Returns the administrative title for a type.
emailpanels_contactemailform_content_type_edit_form Returns an edit form for custom type settings.
emailpanels_contactemailform_content_type_edit_form_submit Submit handler for contact form.
emailpanels_contactemailform_content_type_render Render the custom content type.