function _node_entity_diff_additional_options_publishing_flags in Diff 7.3
Private callback function to render the status, sticky and published field.
File
- includes/
node.inc, line 105 - Provide diff functions for the node module.
Code
function _node_entity_diff_additional_options_publishing_flags($old_node, $new_node, $context) {
$row = array(
'#name' => t('Publishing options'),
'#states' => array(),
'#weight' => -3,
'#settings' => array(),
);
$old_options = array(
$old_node->status ? t('Published') : t('Unpublished'),
);
if ($old_node->promote) {
$old_options[] = t('Promoted to front page');
}
if ($old_node->sticky) {
$old_options[] = t('Sticky at top of lists');
}
$new_options = array(
$new_node->status ? t('Published') : t('Unpublished'),
);
if ($new_node->promote) {
$new_options[] = t('Promoted to front page');
}
if ($new_node->sticky) {
$new_options[] = t('Sticky at top of lists');
}
foreach ($context['states'] as $state) {
$row['#states'][$state] = array(
'#old' => $old_options,
'#new' => $new_options,
);
}
return $row;
}