You are here

function oa_buttons_node_insert in Open Atrium Core 7.2

Implements hook_node_insert().

File

modules/oa_buttons/oa_buttons.module, line 247

Code

function oa_buttons_node_insert($node) {
  if ($node->type == OA_SPACE_TYPE) {
    oa_buttons_clear_section_button_cache(OA_BUTTONS_CLEAR_CACHE_ALL);
  }
  elseif ($node->type == OA_SECTION_TYPE) {
    $gid = !empty($node->{OG_AUDIENCE_FIELD}[LANGUAGE_NONE][0]['target_id']) ? $node->{OG_AUDIENCE_FIELD}[LANGUAGE_NONE][0]['target_id'] : OA_BUTTONS_CLEAR_CACHE_ALL;
    oa_buttons_clear_section_button_cache($gid);
  }
}