You are here

faqpage.inc in Panels Extras 7

Same filename and directory in other branches
  1. 6 faqpanels/plugins/content_types/faqpage.inc

File

faqpanels/plugins/content_types/faqpage.inc
View source
<?php

// $Id$ .inc,v 1.0 2011/07/25 16:34:07 chriscalip Exp $

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

  /**
   * 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('FAQ page'),
    'content_types' => array(
      'faqpanels_faqpage_content_type',
    ),
    'render callback' => 'faqpanels_faqpage_content_type_render',
    'edit form' => 'faqpanels_faqpage_content_type_edit_form',
    'admin title' => 'faqpanels_faqpage_content_type_admin_title',
    // @todo provide png file

    //'icon' => 'icon_goes_here.png',
    'description' => t('Display the page generated by the faq module'),
    'category' => t('Panels Extras'),
  );
}

/**
 * Render the custom content type.
 */
function faqpanels_faqpage_content_type_render($subtype, $conf, $panel_args, $context) {
  $tid = 0;
  $faq_display = '';
  if (@(!empty($panel_args['tid']))) {
    $tid = $panel_args['tid'];
  }
  if (@(!empty($panel_args['faq_display']))) {
    $faq_display = $panel_args['faq_display'];
  }

  // Build the content type block.
  $block = new stdClass();
  $block->module = 'form';
  $block->delta = $tid;
  $block->content = faq_page($tid, $faq_display);
  return $block;
}

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

  // @todo placeholder stuff for now
  return $form;
}

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

  // @todo placeholder stuff for now
}

/**
 * Returns the administrative title for a type.
 */
function faqpanels_faqpage_content_type_admin_title($subtype, $conf, $context) {
  return t('FAQ Page');
}

Functions

Namesort descending Description
faqpanels_faqpage_content_type_admin_title Returns the administrative title for a type.
faqpanels_faqpage_content_type_edit_form Returns an edit form for custom type settings.
faqpanels_faqpage_content_type_edit_form_submit Submit handler for contact form.
faqpanels_faqpage_content_type_render Render the custom content type.