You are here

function twitter_post_twitter_post_content_type_render in Twitter 7.5

CTools content type callback to output this pane.

File

twitter_post/plugins/content_types/twitter_post.inc, line 19

Code

function twitter_post_twitter_post_content_type_render($subtype, $conf, $panel_args, &$context) {
  $block = new stdClass();
  $block->title = t('Post to Twitter');
  $block->module = 'twitter_post';
  $block->delta = 'twitter_post';
  if (isset($context->form)) {
    if (isset($context->form['twitter'])) {
      $block->content['twitter'] = $context->form['twitter'];
      unset($block->content['twitter']['#pre_render']);
      unset($block->content['twitter']['#theme_wrappers']);
      $block->content['twitter']['#type'] = '';

      // Set access to false on the original rather than removing so that
      // vertical tabs doesn't clone it. I think this is due to references.
      $context->form['twitter']['#access'] = FALSE;
    }
  }
  else {
    $block->content = t('Post to Twitter.');
  }
  return $block;
}