function cmf_admin_content_page in Content Management Filter 6
Same name and namespace in other branches
- 5 cmf.module \cmf_admin_content_page()
- 6.2 cmf.module \cmf_admin_content_page()
- 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 227 - @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', $_POST['nodes']);
}
else {
$output .= drupal_get_form('cmf_admin_nodes_form');
}
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');
}
break;
case 'both':
$output .= drupal_get_form('cmf_admin_both_form');
}
return $output;
}