comment.inc in Node import 5
File
supported/comment.inc
View source
<?php
function comment_node_import_fields($type) {
$fields = array();
if (user_access('administer nodes')) {
$fields = array(
'comment' => t('Node: Comment options'),
);
}
return $fields;
}
function comment_node_import_prepare(&$node, $preview = FALSE) {
$errors = array();
if (isset($node->comment) && !empty($node->comment)) {
if (!is_numeric($node->comment) or $node->comment < 0 || $node->comment > 2) {
$errors[] = t('The comment option %comment is not a valid option. Valid options are: 0 (disabled), 1 (read only), 2 (read/write).', array(
'%comment' => $node->comment,
));
}
}
else {
$node->comment = variable_get('comment_' . $node->type, COMMENT_NODE_READ_WRITE);
}
return $errors;
}