Go to the source code of this file.
Functions | |
| panels_admin_content_types_node_comment_form () | |
| panels_admin_title_node_comment_form ($conf, $context) | |
| panels_content_node_comment_form ($conf, $panel_args, $context) | |
| panels_node_comment_form_panels_content_types () | |
| panels_admin_content_types_node_comment_form | ( | ) |
Return all content types available.
Definition at line 56 of file node_comment_form.inc.
References panels_get_path().
00056 { 00057 return array( 00058 'comment_form' => array( 00059 'title' => t('Comment form'), 00060 'icon' => 'icon_node.png', 00061 'path' => panels_get_path('content_types/node'), 00062 'description' => t('A form to add a new comment.'), 00063 'required context' => new panels_required_context(t('Node'), 'node'), 00064 'category' => array(t('Node context'), -9), 00065 ), 00066 ); 00067 }
| panels_admin_title_node_comment_form | ( | $ | conf, | |
| $ | context | |||
| ) |
| panels_content_node_comment_form | ( | $ | conf, | |
| $ | panel_args, | |||
| $ | context | |||
| ) |
Output function for the 'node' content type. Outputs a node based on the module and delta supplied in the configuration.
Definition at line 28 of file node_comment_form.inc.
00028 { 00029 $node = isset($context->data) ? drupal_clone($context->data) : NULL; 00030 $block = new stdClass(); 00031 $block->module = 'comments'; 00032 $block->delta = $node->nid; 00033 00034 $block->subject = t('Add comment'); 00035 00036 if (empty($node)) { 00037 $block->content = t('Comment form here.'); 00038 } 00039 else { 00040 if (user_access('post comments') && node_comment_mode($node->nid) == COMMENT_NODE_READ_WRITE) { 00041 $form = drupal_retrieve_form('comment_form', array('nid' => $node->nid)); 00042 $form['#action'] = url($_GET['q'], NULL, 'new'); 00043 $form['#redirect'] = array($_GET['q'], NULL, 'new'); 00044 drupal_process_form('comment_form', $form); 00045 drupal_prepare_form('comment_form', $form); 00046 $block->content = drupal_render_form('comment_form', $form); 00047 } 00048 } 00049 00050 return $block; 00051 }
| panels_node_comment_form_panels_content_types | ( | ) |
Callback function to supply a list of content types.
Definition at line 8 of file node_comment_form.inc.
00008 { 00009 if (module_exists('comment')) { 00010 $items['node_comment_form'] = array( 00011 'title' => t('Node comment form'), 00012 // only provides a single content type 00013 'single' => TRUE, 00014 'content_types' => 'panels_admin_content_types_node_comment_form', 00015 'render callback' => 'panels_content_node_comment_form', 00016 'add callback' => 'panels_admin_edit_node_comment_form', 00017 'edit callback' => 'panels_admin_edit_node_comment_form', 00018 'title callback' => 'panels_admin_title_node_comment_form', 00019 ); 00020 return $items; 00021 } 00022 }
1.5.6