You are here

function views_pdf_rules_action_save_form in Views PDF 6

File

./views_pdf.rules.inc, line 29
Rules integration of the mimemail and the PDF Views module.

Code

function views_pdf_rules_action_save_form($settings = array(), &$form) {
  $views = views_get_all_views();
  $view_options = array(
    ' ' => ' ',
  );

  // Filter only views with a pdf display
  foreach ($views as $key => $view) {
    foreach ($view->display as $id => $display) {
      if ($display->display_plugin == 'pdf') {
        $view_options[$key] = $view->name;
      }
    }
  }
  $form['settings']['views_pdf'] = array(
    '#type' => 'select',
    '#title' => t('View'),
    '#options' => $view_options,
    '#default_value' => $settings['views_pdf'],
  );
  $form['settings']['arguments'] = array(
    '#type' => 'textfield',
    '#title' => t('Arguments'),
    '#default_value' => $settings['arguments'],
    '#description' => t('Separate different arguments by commas.'),
  );
  $form['settings']['path'] = array(
    '#type' => 'textfield',
    '#title' => t('Path'),
    '#default_value' => $settings['path'],
    '#description' => t('Enter an absolute path where the view should be saved. You may use some tokens.'),
  );
}