text_formats_report.field_page.inc 853 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * @file
  4. */
  5. module_load_include('inc', 'text_formats_report', 'inc/text_formats_report');
  6. /**
  7. * Menu callback.
  8. */
  9. function text_formats_report_field_page($field_name) {
  10. if (!isset($_GET['formats']) || empty($_GET['formats'])) {
  11. return drupal_not_found();
  12. }
  13. $field_name = check_plain($field_name);
  14. $filter_formats = $_GET['formats'];
  15. // In case only one format passed via url.
  16. if (is_string($filter_formats)) {
  17. $filter_formats = array($filter_formats);
  18. }
  19. foreach ($filter_formats as $key => $format) {
  20. $filter_formats[$key] = check_plain($format);
  21. }
  22. $records = text_formats_report_get_field_usage($field_name, $filter_formats);
  23. return theme('text_formats_report_field_stats', array(
  24. 'stats' => $records,
  25. 'filter_formats' => $filter_formats,
  26. 'field_name' => $field_name
  27. )
  28. );
  29. }