function ctools_node_form_attachments_content_type_render
File
-
plugins/
content_types/ node_form/ node_form_attachments.inc, line 22
Code
function ctools_node_form_attachments_content_type_render($subtype, $conf, $panel_args, &$context) {
$block = new stdClass();
$block->module = '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;
}