You are here

function action_node_touch_changed in Voting API 5

Touches the change date of a node. Useful for moderated nodes that should appear 'fresh' as soon as they're promoted.

File

./votingapi_actions.inc, line 363

Code

function action_node_touch_changed($op, $edit = array(), &$node) {
  switch ($op) {
    case 'do':
      $node->changed = time();
      if (!$edit['defer']) {
        node_save($node);
      }
      watchdog('action', t('Touched change date of node id %id', array(
        '%id' => intval($node->nid),
      )));
      break;
    case 'metadata':
      return array(
        'description' => t('Touch node change date'),
        'type' => t('Node'),
        'batchable' => true,
        'configurable' => false,
      );

    // return an HTML config form for the action
    case 'form':
      return '';

    // validate the HTML form
    case 'validate':
      return TRUE;

    // process the HTML form to store configuration
    case 'submit':
      return '';
  }
}