function ctools_node_attachments_content_type_render

File

plugins/content_types/node_context/node_attachments.inc, line 18

Code

function ctools_node_attachments_content_type_render($subtype, $conf, $panel_args, $context) {
    $node = isset($context->data) ? clone $context->data : NULL;
    $block = new stdClass();
    $block->module = 'attachments';
    $block->title = t('Attached files');
    if ($node) {
        if (!empty($node->files)) {
            $block->content = theme('upload_attachments', $node->files);
        }
        $block->delta = $node->nid;
    }
    else {
        $block->content = t('Attached files go here.');
        $block->delta = 'unknown';
    }
    return $block;
}