faqpage.inc in Panels Extras 7
File
faqpanels/plugins/content_types/faqpage.inc
View source
<?php
if (module_exists('faq')) {
$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',
'description' => t('Display the page generated by the faq module'),
'category' => t('Panels Extras'),
);
}
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'];
}
$block = new stdClass();
$block->module = 'form';
$block->delta = $tid;
$block->content = faq_page($tid, $faq_display);
return $block;
}
function faqpanels_faqpage_content_type_edit_form($form, &$form_state) {
return $form;
}
function faqpanels_faqpage_content_type_edit_form_submit($form, &$form_state) {
}
function faqpanels_faqpage_content_type_admin_title($subtype, $conf, $context) {
return t('FAQ Page');
}