You are here

function cmf_admin_content_page in Content Management Filter 6.2

Same name and namespace in other branches
  1. 5 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 273
@brief Content management filter module file

Code

function cmf_admin_content_page($user = NULL) {
  if (!isset($_SESSION['cmf_content_kind'])) {
    $_SESSION['cmf_content_kind'] = 'node';
  }
  $output = drupal_get_form('cmf_filter_form', $user);

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

        // The next line is because of http://drupal.org/node/521354.
        module_load_include('inc', 'comment', 'comment.admin');
        return drupal_get_form('comment_multiple_delete_confirm');
      }
      else {
        $output .= drupal_get_form('cmf_admin_comments_form', $user);
      }
      break;
    case 'both':
      $output .= drupal_get_form('cmf_admin_both_form', $user);
  }
  return $output;
}