You are here

function nopremium_node_prepare in Node Option Premium 7

Implementation of hook_node_prepare(). Set up premium default value, if required.

File

./nopremium.module, line 140
Written by Henri MEDOT <henri.medot[AT]absyx[DOT]fr> http://www.absyx.fr

Code

function nopremium_node_prepare($node) {
  if (!isset($node->nid) || isset($node->is_new)) {
    $node_options = variable_get('node_options_' . $node->type, array());
    if (!isset($node->premium)) {
      $node->premium = (int) in_array('premium', $node_options);
    }
  }
}