You are here

function node_convert_convert_action_form in Node Convert 6

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

File

./node_convert.module, line 561
The node_convert module converts nodes from one type to another.

Code

function node_convert_convert_action_form($context) {
  $result = db_query("SELECT * FROM {node_convert_templates}");
  $templates = array(
    0 => 'none',
  );
  while ($row = db_fetch_array($result)) {
    $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' => $default_template,
  );
  return $form;
}