You are here

function sheetnode_import_template in Sheetnode 6

Same name and namespace in other branches
  1. 5 sheetnode.module \sheetnode_import_template()
  2. 7.2 sheetnode.module \sheetnode_import_template()
  3. 7 sheetnode.module \sheetnode_import_template()

Form function for node/add/sheetnode_template.

1 string reference to 'sheetnode_import_template'
sheetnode_menu in ./sheetnode.module
Implementation of hook_menu().

File

./sheetnode.module, line 483

Code

function sheetnode_import_template(&$form_state, $tid = NULL) {
  if (!empty($tid)) {
    $form_state['values']['template'] = $tid;
    sheetnode_import_template_submit(NULL, $form_state);
    drupal_goto($form_state['redirect']);
  }
  $options[0] = t('- Select a template -');
  $result = db_query("SELECT tid, name FROM {sheetnode_template}");
  while ($template = db_fetch_object($result)) {
    $options[$template->tid] = $template->name;
  }
  $form['template'] = array(
    '#type' => 'select',
    '#title' => t('Template'),
    '#description' => t('Please select the template to load into your new sheetnode.'),
    '#options' => $options,
    '#default_value' => 0,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  return $form;
}