You are here

function custom_pub_nodeapi in Custom Publishing Options 6

Implements hook_nodeapi().

File

./custom_pub.module, line 381
Adds the ability to add Custom publishing options to the node Add/Edit form.

Code

function custom_pub_nodeapi(&$node, $op) {
  $types = variable_get('custom_pub_types', array());
  if ($op == 'prepare') {

    // If this is a new node, fill in the default values.
    if (!isset($node->nid)) {
      $node_options = variable_get('node_options_' . $node->type, array(
        'status',
        'promote',
      ));
      foreach ($types as $key => $value) {
        $node->{$key} = in_array($key, $node_options);
      }
    }
  }
}