function content_unpublish_content_form

7.x content.module content_unpublish_content_form($cid)
6.x content.module content_unpublish_content_form($cid)

File

modules/content/content.module, line 499

Code

function content_unpublish_content_form($cid) {

  $content = content_load($cid);

  fp_add_css(fp_get_module_path("content") . "/css/content.css");


  // Display a confirmation page


  $types = content_get_types();
  $type = $content->type;


  // We want to redirect correctly based on this type's options....
  // Are there any special settings for the title?
  if (isset($types [$type]['settings']) && isset($types [$type]['settings']['title'])) {

    if (is_array($types [$type]['settings']['#redirect'])) {
      $form ['#redirect'] = $types [$type]['settings']['#redirect'];
    }

  }

  $form ['cid'] = array(
    'type' => 'hidden',
    'value' => $cid,
  );

  $form ['mark_top'] = array(
    'type' => 'markup',
    'value' => "<h2>" . t("Are you sure you wish to remove <em>$content->title</em>?") . "</h2>
                <p>" . t("This action will cause the content to not appear in reports, and not be easily accessible. It can only be restored by an administrator.") . "</p>
                <hr>",

  );


  $form ['submit_confirm'] = array(
    'type' => 'submit',
    'value' => 'Confirm & Remove',
    'spinner' => TRUE,
    'attributes' => array('class' => 'content-submit-btn'),
  );

  $form ['submit_cancel'] = array(
    'type' => 'submit',
    'value' => 'Cancel',
    'attributes' => array('class' => 'content-delete-btn'),
  );


  return $form;
}