You are here

function casetracker_is_project in Case Tracker 7

Same name and namespace in other branches
  1. 6 casetracker.module \casetracker_is_project()

API function for checking whether a node type is a casetracker project.

5 calls to casetracker_is_project()
casetracker_case_form_common in ./casetracker.module
Common form elements for cases, generic enough for use either in a full node display, or in comment displays and updating. Default values are calculated based on an existing $form['nid']['#value'].
casetracker_node_delete in ./casetracker.module
Implements hook_node_delete().
casetracker_node_validate in ./casetracker.module
Implements hook_node_validate().
casetracker_node_view in ./casetracker.module
Implements hook_node_view().
casetracker_notifications_notifications_object_node in casetracker_notifications/casetracker_notifications.module
Implements hook_notifications_object_node().

File

./casetracker.module, line 1297
Enables the handling of projects and their cases.

Code

function casetracker_is_project($node) {
  if (is_object($node) && !empty($node->type)) {
    $type = $node->type;
  }
  else {
    if (is_string($node)) {
      $type = $node;
    }
  }
  if (isset($type)) {
    return in_array($type, variable_get('casetracker_project_node_types', array(
      'casetracker_basic_project',
    )), TRUE);
  }
  return FALSE;
}