You are here

function comment_deploy_operations_add_form_submit in Deploy - Content Staging 6

Submit handler for comment_deploy_operations_add_form().

File

modules/comment_deploy/comment_deploy.pages.inc, line 53
Deployment API which enables modules to deploy items between servers.

Code

function comment_deploy_operations_add_form_submit($form, &$form_state) {
  $result = db_query("SELECT cid, subject FROM {comments} WHERE cid IN (%s)", $form_state['values']['cids']);
  $pid = $form_state['values']['pid'];
  while ($row = db_fetch_array($result)) {
    if (!deploy_item_is_in_plan($pid, 'comment', $row['cid'])) {
      deploy_add_to_plan($pid, 'comment', $row['subject'], $row['cid'], 0, DEPLOY_COMMENT_GROUP_WEIGHT);
    }
  }
  $form_state['redirect'] = "admin/build/deploy/list/{$pid}";
}