You are here

function rb_misc_action_views_load_node_form in Rules Bonus Pack 6

Configuration form for 'rb_misc_action_views_load_node'.

File

./rb_misc.module, line 295
Miscellaneous conditions and actions for Rules.

Code

function rb_misc_action_views_load_node_form($settings, &$form) {
  $selectable_displays = array();
  foreach (views_get_all_views() as $view_name => $view) {
    if ($view->base_table == 'node') {
      foreach ($view->display as $display_name => $display) {
        $selectable_displays[$view_name . '|' . $display_name] = $view_name . '|' . check_plain($display->display_title);
      }
    }
  }
  $form['settings']['view'] = array(
    '#type' => 'select',
    '#options' => $selectable_displays,
    '#default_value' => $settings['view'],
    '#title' => t('Select view and display'),
    '#description' => t('Select the view and the view display you want to use to
      load a node. The first node listed in the view will be loaded.'),
  );
  $form['settings']['args'] = array(
    '#type' => 'textarea',
    '#default_value' => $settings['args'],
    '#title' => t('View arguments'),
    '#description' => t('Add any arguments you want to send to the view, one per
      line. You may use tokens.'),
  );
}