ctools_node_form_attachments_content_type_render

  1. drupal
    1. 6 node_form_attachments.inc function
    2. 7 node_form_attachments.inc function
Drupal 7 ctools_node_form_attachments_content_type_render($subtype, $conf, $panel_args, &$context)

File

sites/all/modules/ctools/plugins/content_types/node_form/node_form_attachments.inc, line 18

Code

function ctools_node_form_attachments_content_type_render($subtype, $conf, $panel_args, &$context) {
  $block = new stdClass();
  $block->module = t('node_form');

  $block->title = t('Attach files');
  $block->delta = 'url-path-options';

  if (isset($context->form)) {
    if (isset($context->form['attachments'])) {
      $block->content = $context->form['attachments'];
      if (isset($block->content['attachments']['#group'])) {
        unset($block->content['attachments']['#pre_render']);
        unset($block->content['attachments']['#theme_wrappers']);
        $block->content['attachments']['#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['attachments']['#access'] = FALSE;
    }
  }
  else {
    $block->content = t('Attach files.');
  }
  return $block;
}