You are here

function bbb_meeting_moderate in BigBlueButton 6

Same name and namespace in other branches
  1. 7 bbb.module \bbb_meeting_moderate()

Redirect to big blue button instance; Menu callback

Parameters

OBJECT $node: A Drupal node object

1 string reference to 'bbb_meeting_moderate'
bbb_menu in ./bbb.module
Implement HOOK_menu().

File

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

Code

function bbb_meeting_moderate($node) {
  global $user;
  $url = array();
  $mode = 'moderate';
  $meeting = bbb_get_meeting($node->nid);
  $params = array(
    'meetingID' => $meeting->meetingID,
    'password' => $meeting->moderatorPW,
  );
  $status = bbb_api_getMeetingInfo($params);
  if ($status->hasBeenForciblyEnded == 'true') {
    drupal_set_message('The meeting has been terminated and is not available for reopening.');
    drupal_goto('node/' . $node->nid);
  }
  drupal_set_title($node->title);

  // Implicitly create meeting
  if (empty($meeting->initialized)) {
    if ($data = bbb_create_meeting($node, (array) $params)) {

      // Update local data
      bbb_update_meeting($node, array_merge((array) $meeting, (array) $data));
    }
  }
  if (BBB_DISPLAY_MODE == 'blank') {
    bbb_redirect($node, $mode);
  }
  return theme('bbb_meeting', $meeting, $mode, BBB_DISPLAY_HEIGHT, BBB_DISPLAY_WIDTH);
}