You are here

function quiz_take_pane_content_type_render in Quiz 7.6

Same name and namespace in other branches
  1. 7.4 plugins/content_types/quiztake_pane.inc \quiz_take_pane_content_type_render()

Run-time rendering of the body of the block (content type) See ctools_plugin_examples for more advanced info

1 string reference to 'quiz_take_pane_content_type_render'
quiztake_pane.inc in plugins/content_types/quiztake_pane.inc

File

plugins/content_types/quiztake_pane.inc, line 21

Code

function quiz_take_pane_content_type_render($subtype, $conf, $panel_args, $context = NULL) {
  if (!empty($context) && empty($context->data)) {
    return;
  }
  $node = isset($context->data) ? clone $context->data : NULL;
  $block = new stdClass();
  if (empty($node)) {
    $block->delta = 'placeholder';
    $block->title = t('Placeholder title.');
    $block->content = t('Placeholder content goes here.');
    return $block;
  }
  if (!quiz_take_access($node)) {
    return;
  }
  $block->module = 'node';
  $block->delta = $node->nid;

  //drupal_alter('quiz_take', $node);
  if (isset($node->rendered_content)) {
    $block->content = $node->rendered_content;
  }
  else {
    $block->content = quiz_take_quiz($node);
  }
  return $block;
}