You are here

function cmf_admin_content_page in Content Management Filter 5

Same name and namespace in other branches
  1. 6.2 cmf.module \cmf_admin_content_page()
  2. 6 cmf.module \cmf_admin_content_page()
  3. 7 cmf.module \cmf_admin_content_page()

Called when user goes to example.com/admin/content/filter

Return value

the HTML generated from the $form data structure

1 string reference to 'cmf_admin_content_page'
cmf_menu in ./cmf.module
Implementation of hook_menu().

File

./cmf.module, line 79
@brief Content management filter module file

Code

function cmf_admin_content_page() {
  if (!isset($_SESSION['cmf_content_kind'])) {
    $_SESSION['cmf_content_kind'] = 'node';
  }
  if (arg(0) == 'user' && is_numeric(arg(1)) && arg(1) > 0) {
    $true = TRUE;
  }
  $output = drupal_get_form('cmf_filter_form', $true);

  // Call the form first, to allow for the form_values array to be populated.
  switch ($_SESSION['cmf_content_kind']) {
    case 'node':
      if ($_POST['operation'] == 'delete' && $_POST['nodes']) {
        return drupal_get_form('node_multiple_delete_confirm');
      }
      else {
        $output .= drupal_get_form('cmf_admin_nodes_form');
      }
      break;
    case 'comment':
      if ($_POST['operation'] == 'delete' && $_POST['comments']) {
        return drupal_get_form('comment_multiple_delete_confirm');
      }
      else {
        $output .= drupal_get_form('cmf_admin_comments_form');
      }
      break;
    case 'both':
      $output .= drupal_get_form('cmf_admin_both_form');
  }
  return $output;
}