You are here

function arrange_fields_init in Arrange Fields 7

Same name and namespace in other branches
  1. 6 arrange_fields.module \arrange_fields_init()

hook_init()

The init function is executed at the beginning of every page load. Here, I'm just trying to see if the webform module has been installed, and if so, I set a global variable I can access later.

File

./arrange_fields.module, line 525

Code

function arrange_fields_init() {

  // Init our global variables in case they do not already exist.  This prevents
  // PHP from throwing "notices" at the user.
  if (!isset($GLOBALS["arrange_fields_editing_type"])) {
    $GLOBALS["arrange_fields_editing_type"] = " ";
  }
  if (!isset($GLOBALS["arrange_fields_editing"])) {
    $GLOBALS["arrange_fields_editing"] = " ";
  }
  if (!isset($GLOBALS["arrange_fields_editing_field"])) {
    $GLOBALS["arrange_fields_editing_field"] = FALSE;
  }

  // is webform installed?
  if (function_exists("webform_menu")) {
    $GLOBALS["arrange_fields_webform_installed"] = TRUE;
  }
  else {
    $GLOBALS["arrange_fields_webform_installed"] = FALSE;
  }
}