You are here

function bbb_nodeapi in BigBlueButton 6

Implement HOOK_nodeapi().

File

./bbb.module, line 361
Big Blue Button - Enables universities and colleges to deliver a high-quality learning experience.

Code

function bbb_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  global $user;
  if (!bbb_is_meeting_type($node->type)) {
    return;
  }
  switch ($op) {
    case 'insert':

      // local storage
      bbb_store_meeting($node, (array) $node->bbb);
      break;
    case 'update':

      // local update
      bbb_update_meeting($node, $node->bbb);
      break;
    case 'view':

      //$status = bbb_get_user_status($node->nid, $user->uid);
      if (!variable_get('bbb_content_type_show_status_' . $node->type, FALSE)) {
        return;
      }
      $meeting = bbb_get_meeting($node->nid);
      $node->content['bbb_meeting_status'] = array(
        '#value' => theme('bbb_meeting_status', $meeting),
        '#weight' => 10,
      );
      $node->content['bbb_meeting_start'] = array(
        '#value' => theme('bbb_meeting_start', $meeting),
        '#weight' => 10,
      );
      break;
    case 'load':
      if (bbb_is_meeting_type($node->type)) {
        $node->bbb = bbb_get_meeting($node->nid);
      }
      break;
    case 'delete':
      bbb_delete_meeting($node->nid);
      break;
  }
}