function ctools_node_comment_form_content_type_render

cis7 node_comment_form.inc ctools_node_comment_form_content_type_render($subtype, $conf, $panel_args, $context)
cle7 node_comment_form.inc ctools_node_comment_form_content_type_render($subtype, $conf, $panel_args, $context)
elmsmedia7 node_comment_form.inc ctools_node_comment_form_content_type_render($subtype, $conf, $panel_args, $context)
icor7 node_comment_form.inc ctools_node_comment_form_content_type_render($subtype, $conf, $panel_args, $context)
meedjum_blog7 node_comment_form.inc ctools_node_comment_form_content_type_render($subtype, $conf, $panel_args, $context)
mooc7 node_comment_form.inc ctools_node_comment_form_content_type_render($subtype, $conf, $panel_args, $context)

File

sites/all/modules/ulmus/ctools/plugins/content_types/node_context/node_comment_form.inc, line 19

Code

function ctools_node_comment_form_content_type_render($subtype, $conf, $panel_args, $context) {
  $node = isset($context->data) ? clone($context->data) : NULL;
  $block = new stdClass();
  $block->module = 'comments';
  $block->delta = $node->nid;

  $block->title = t('Add comment');

  if (empty($node)) {
    $block->content = t('Comment form here.');
  }
  else if ($node->comment == COMMENT_NODE_OPEN) {
    if (user_access('post comments')) {
      $comment = new stdClass();
      $comment->nid = $node->nid;
      $comment->pid = NULL;
      $form_state = array(
        'ctools comment alter' => TRUE,
        'node' => $node,
        'build_info' => array(
          'args' => array(
            $comment,
          ),
        ),
      );
      $block->content = drupal_build_form('comment_node_' . $node->type . '_form', $form_state);
    }
    else if (!empty($conf['anon_links'])) {
      $block->content = theme('comment_post_forbidden', array('node' => $node));
    }
  }

  return $block;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.