You are here

public function UcAddressesFieldHandler::checkContext in Ubercart Addresses 7

Same name and namespace in other branches
  1. 6.2 handlers/UcAddressesFieldHandler.class.php \UcAddressesFieldHandler::checkContext()

Checks if the field passes the context.

@access public

Return value

boolean TRUE if the field passes the context. FALSE otherwise.

1 call to UcAddressesFieldHandler::checkContext()
UcAddressesTestTextFieldHandler::checkContext in tests/handlers/uc_addresses.handlers.inc
Checks if field passes the context.
1 method overrides UcAddressesFieldHandler::checkContext()
UcAddressesTestTextFieldHandler::checkContext in tests/handlers/uc_addresses.handlers.inc
Checks if field passes the context.

File

handlers/UcAddressesFieldHandler.class.php, line 275
Contains the UcAddressesFieldHandler class.

Class

UcAddressesFieldHandler
Base class for fields used in Ubercart Addresses.

Code

public function checkContext() {
  $fields = uc_addresses_get_address_fields();
  if (isset($fields[$this->name])) {
    $display_settings = $fields[$this->name]['display_settings'];
    if (!isset($display_settings[$this->context]) && $display_settings['default'] || isset($display_settings[$this->context]) && $display_settings[$this->context] == TRUE) {
      return TRUE;
    }
    return FALSE;
  }
  return TRUE;
}