You are here

function hosting_task_confirm_form in Hosting 5

Same name and namespace in other branches
  1. 6.2 task/hosting_task.module \hosting_task_confirm_form()
  2. 7.4 task/hosting_task.module \hosting_task_confirm_form()
  3. 7.3 task/hosting_task.module \hosting_task_confirm_form()

Implementation of hook_form().

1 string reference to 'hosting_task_confirm_form'
hosting_task_menu in task/hosting_task.module
Implementation of hook_menu().

File

task/hosting_task.module, line 111
Web server node type is defined here.

Code

function hosting_task_confirm_form(&$node, $task) {
  $tasks = hosting_available_tasks($node);
  $form['help'] = array(
    '#value' => $tasks[$task]['description'],
  );
  $form['nid'] = array(
    '#type' => 'value',
    '#value' => $node->nid,
  );
  $form['task'] = array(
    '#type' => 'value',
    '#value' => $task,
  );
  $form['parameters'] = array(
    '#tree' => TRUE,
  );
  $func = 'hosting_task_' . $task . '_form';
  if (function_exists($func)) {
    $form['parameters'] += $func($node);
  }
  $func = $func . '_validate';
  if (function_exists($func)) {
    $form['#validate'][$func] = array(
      $node,
      $task,
    );
  }
  $question = t("Are you sure you want to @task @object?", array(
    '@task' => $task,
    '@object' => $node->title,
  ));
  return confirm_form($form, $question, 'node/' . $node->nid, '', $tasks[$task]['title']);
}