Projet

Général

Profil

Paste
Télécharger (569 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / feeds / tests / feeds_tests.rules.inc @ 31a5a6d6

1
<?php
2

    
3
/**
4
 * @file
5
 * Includes any rules integration provided by the module.
6
 */
7

    
8
/**
9
 * Implements hook_rules_action_info().
10
 */
11
function feeds_tests_rules_action_info() {
12
  $items['feeds_tests_create_node'] = array(
13
    'label' => t('Create a node'),
14
    'group' => t('Rules test'),
15
  );
16
  return $items;
17
}
18

    
19
/**
20
 * Rules action callback: creates a node.
21
 */
22
function feeds_tests_create_node() {
23
  $node = new stdClass();
24
  $node->title = 'Test node';
25
  $node->type = 'page';
26
  $node->status = 1;
27
  $node->uid = 0;
28
  node_object_prepare($node);
29
  node_save($node);
30
}