I need to create a new rule for my app.
In hook_rules_action_info() we created ui of action we called.
Now i need entity reference with a widget of type autocomplete to all nodes and a drop down container or select list to all of content type.
How can write this component in message_sender_rules_action_info() ?

Comments

shrsa’s picture

In Message Notify module we have a rules that implement in file message_notify_rules.inc .

function message_notify_rules_action_info() {
  $items = array();
  $items['message_notify_process'] = array(
    'label' => t('Send Message with Message notify'),
    'group' => t('Message notify'),
    'parameter' => array(
      'message' => array(
        'type' => 'message',
        'label' => t('Message'),
        'description' => t('The message to be processed and sent using Message notify.'),
      ),
      'save_on_fail' => array(
        'type' => 'boolean',
        'label' => t('Save on fail'),
        'description' => t('Save message if sending failed.'),
        'default value' => TRUE,
        'optional' => TRUE,
        'restriction' => 'input',
      ),
      'save_on_success' => array(
        'type' => 'boolean',
        'label' => t('Save on success'),
        'description' => t('Save message if sending successed.'),
        'default value' => TRUE,
        'optional' => TRUE,
        'restriction' => 'input',
      ),
      'rendered_subject_field' => array(
        'type' => 'token',
        'label' => t('Rendered subject field'),
        'description' => t('The field to save the rendered subject.'),
        'default value' => FALSE,
        'optional' => TRUE,
        'options list' => 'message_notify_field_text_list',
      ),
      'rendered_body_field' => array(
        'type' => 'token',
        'label' => t('Body subject field'),
        'description' => t('The field to save the rendered body.'),
        'default value' => FALSE,
        'optional' => TRUE,
        'options list' => 'message_notify_field_text_list',
      ),
    ),
    'base' => 'message_notify_rules_process',
  );
  return $items;
}

Above code is where that message notify action page structured.
I need an entity reference with widget type of autocomplete to nodes and a drop down widget or select list widget to all of content type.
How can complete this function with above specifications ?
If any books or tutorials exists ,please send me.

bluegeek9’s picture

Issue summary: View changes
Status: Active » Closed (outdated)