You are here

function node_convert_convert_action_form in Node Convert 7

Same name and namespace in other branches
  1. 6 node_convert.module \node_convert_convert_action_form()

Node convert action form.

File

./node_convert.module, line 276

Code

function node_convert_convert_action_form($context) {
  $result = db_query("SELECT * FROM {node_convert_templates}");
  $templates = array(
    0 => 'none',
  );
  foreach ($result as $row) {
    $access = node_convert_check_template_permission_user(array(
      'template_id' => $row->nctid,
    ));
    if ($access == TRUE) {
      $templates[$row->nctid] = $row->name;
    }
  }
  if (isset($context['template'])) {
    $default_template = $context['template'];
  }
  $form['template'] = array(
    '#type' => 'select',
    '#title' => t("Template"),
    '#description' => t("Convesion template to use when the action is fired."),
    '#options' => $templates,
    '#default_value' => isset($default_template) ? $default_template : '',
  );
  return $form;
}