function fpm

6.x misc.inc fpm($var, $max_levels = 20)
7.x misc.inc fpm($var, $max_levels = 20)
4.x misc.inc fpm($var)
5.x misc.inc fpm($var, $max_levels = 20)

Uses fp_add_message, but in this case, it also adds in the filename and line number which the message came from!

Most useful for developers, tracking down issues. It's also only visible to administrators with the "view_fpm_debug" permission. So if you need to display a message only to admins, you can use fpm() as a shortcut.

Note: If you attempt to fpm() an array or object with too many levels of nesting, it may run out of memory and your script will die.

32 calls to fpm()
admin_apply_draft_changes_form_submit in modules/admin/admin.module
Handles the actual moving of draft courses into production.
admin_display_main in modules/admin/admin.module
This is the "main" page for the admin module. It's what the user first sees when the click to go to the Admin page.
advise_display_popup_group_select in modules/advise/advise.module
AdvisingScreen::display_group in classes/AdvisingScreen.php
This function displays a Group object on the degree plan. This is not the selection popup display. It will either show the group as multi rows, filled in with courses, or as a "blank row" for the user to click on.
AdvisingScreen::display_popup_group_select in classes/AdvisingScreen.php
This function displays the popup which lets a user select a course to be advised into a group.

... See full list

File

includes/misc.inc, line 2483
This file contains misc functions for FlightPath

Code

function fpm($var, $max_levels = 20) {

  if (!user_has_permission("view_fpm_debug")) {
    return;
  }

  // Complex variable?  Change it to print_r.
  $str = $var;
  if (is_array($str) || is_object($str)) {
    $str = "<div class='fp-html-print-r-wrapper'>" . fp_html_print_r($str, "", 0, $max_levels) . "</div>";
  }

  $arr = debug_backtrace();
  //pretty_print($arr);

  $t = 0;

  if (@$arr [1]['function'] == 'fpmct') {
    $t = 1;
  }

  $file = $arr [$t]["file"];
  if (strlen($file) > 70) {
    $file = "..." . substr($file, strlen($file) - 70);
  }
  $str .= "<div class='fp-message-backtrace'>line {$arr [$t]["line"]}: $file</div>";

  fp_add_message("&bull; " . $str);


}