function fp_url

7.x misc.inc fp_url($path, $query = "", $include_base_path = TRUE)
6.x misc.inc fp_url($path, $query = "", $include_base_path = TRUE)
4.x misc.inc fp_url($path, $query = "", $include_base_path = TRUE)
5.x misc.inc fp_url($path, $query = "", $include_base_path = TRUE)

This function will take a path, ex: "admin/config/module" and a query, ex: "nid=5&whatever=yes" And join them together, respecting whether or not clean URL's are enabled.

44 calls to fp_url()
admin_display_degrees in modules/admin/admin.degrees.inc
admin_display_edit_degree in modules/admin/admin.degrees.inc
This screen displays the form which allows the user to actually edit a degree.
admin_display_groups in modules/admin/admin.groups.inc
This function will display a list of all our groups.
admin_display_groups_popup_edit_definition in modules/admin/admin.groups.inc
admin_display_watchdog in modules/admin/admin.module
Displays recent watchdog entries, from the watchdog table

... See full list

File

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

Code

function fp_url($path, $query = "", $include_base_path = TRUE) {

  // If clean URLs are enabled, we should begin with a ?, if not, use an &

  $rtn = "";
  if ($include_base_path) {
    $rtn .= base_path() . "/";
  }


  // Make sure that $rtn isn't now "//".  This can happen if our
  // site is hosted on a bare domain.  Ex:  http://fp.example.com
  // And we have set the base_path to simply "/"
  if ($rtn == "//") {
    $rtn = "/";
  }

  $bool_clean_urls = variable_get("clean_urls", FALSE);
  if (!$bool_clean_urls) {
    // Clean URLs are NOT enabled!  Let's make sure the URL contains "index.php?q="
    $rtn .= "index.php?q=";
  }


  $rtn .= $path;

  if ($query != "") {
    // Is there a ? already in the $rtn?  If not, add a ?.  If so, use a &.
    if (!strstr($rtn, "?")) {
      $rtn .= "?";
    }
    else {
      $rtn .= "&";
    }

    $rtn .= $query;
  }

  return $rtn;

}