You are here

function ctools_context_exists_ctools_access_check in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 plugins/access/context_exists.inc \ctools_context_exists_ctools_access_check()

Check for access

1 string reference to 'ctools_context_exists_ctools_access_check'
context_exists.inc in plugins/access/context_exists.inc

File

plugins/access/context_exists.inc, line 33

Code

function ctools_context_exists_ctools_access_check($conf, $context) {

  // xor returns false if the two bools are the same, and true if they are not.
  // i.e, if we asked for context_exists and it does, return true.
  // If we asked for context does not exist and it does, return false.
  return empty($context->data) xor !empty($conf['exists']);
}