function domain_node_import_fields in Node import 6
Implementation of hook_node_import_fields().
File
- supported/
domain/ domain.inc, line 11 - Support file for the Domain access.
Code
function domain_node_import_fields($type) {
$fields = array();
if (($node_type = node_import_type_is_node($type)) !== FALSE) {
global $_domain;
$fields['domain_site'] = array(
'title' => t('Send to all affiliates'),
'group' => t('Domain access options'),
'module' => 'domain',
'is_mappable' => user_access('administer content') || user_access('moderate content'),
'default_value' => 0,
);
$options = array();
foreach (domain_domains() as $data) {
// Cannot pass zero in checkboxes.
$data['domain_id'] == 0 ? $key = -1 : ($key = $data['domain_id']);
// The domain must be valid.
if ($data['valid'] || user_access('administer domains')) {
$options[$key] = $data['sitename'];
}
}
$fields['domains'] = array(
'title' => t('Publish to'),
'group' => t('Domain access options'),
'module' => 'domain',
'is_mappable' => user_access('administer content') || user_access('moderate content'),
'default_value' => array(
$_domain['domain_id'] == 0 ? -1 : $_domain['domain_id'],
),
// Can't use 0 as a checkbox value.
'has_multiple' => TRUE,
'is_checkboxes' => TRUE,
'allowed_values' => $options,
);
}
return $fields;
}