function _node_expire_node_prepare in Node expire 7
Same name and namespace in other branches
- 8 node_expire.nodeapi.inc \_node_expire_node_prepare()
Implements hook_node_prepare().
2 calls to _node_expire_node_prepare()
- node_expire_node_prepare in ./
node_expire.module - Implements hook_node_prepare().
- _node_expire_node_update_insert in ./
node_expire.nodeapi.inc - Implements hook_node_update() and hook_node_insert().
File
- ./
node_expire.nodeapi.inc, line 53 - Node API integration.
Code
function _node_expire_node_prepare(&$ntype, $node) {
// To prevent default value 1969-12-31 check also $ntypes['default'].
if (!isset($node->expire) && $ntype['default']) {
$node->expire = format_date(strtotime($ntype['default']), 'custom', NODE_EXPIRE_FORMAT);
}
// This gives a way to users without edit exipration permission
// to update nodes with default expiration.
if (isset($node->expire) && !user_access('edit node expire')) {
$node->expire = format_date(strtotime($ntype['default']), 'custom', NODE_EXPIRE_FORMAT);
}
}