You are here

function theme_bbb_block_meeting in BigBlueButton 7

Same name and namespace in other branches
  1. 8 modules/bbb_node/bbb_node.module \theme_bbb_block_meeting()
  2. 6 bbb.module \theme_bbb_block_meeting()

Theme meeting details block

1 theme call to theme_bbb_block_meeting()
bbb_block_meeting in ./bbb.module
Meeting details block

File

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

Code

function theme_bbb_block_meeting($meeting) {
  $meeting = $meeting['meeting'];
  $output = '<div class="bbb-meeting-details">';
  if ($meeting->welcome) {
    $output .= '<div class="bbb-welcome">' . $meeting->welcome . '</div>';
  }
  $output .= theme('bbb_meeting_status', array(
    'meeting' => $meeting,
  ));

  // format links according to settings:
  $display_mode = variable_get('bbb_display_mode', BIGBLUEBUTTON_DISPLAY_MODE);

  // block links
  $attend = 'node/' . $meeting->nid . '/meeting/attend';
  $attend_options = array();
  $moderate = 'node/' . $meeting->nid . '/meeting/moderate';
  $moderate_options = array();
  if ($display_mode == 'blank') {

    // if it opens in a new window, make absolute paths and add some javascript
    global $base_url;
    $attend = $base_url . '/' . $attend;
    $attend_options = array(
      'attributes' => array(
        'onClick' => 'window.open(\'' . $attend . '\');return false',
        'html' => TRUE,
      ),
    );
    $moderate = $base_url . '/' . $moderate;
    $moderate_options = array(
      'attributes' => array(
        'onClick' => 'window.open(\'' . $moderate . '\');return false',
        'html' => TRUE,
      ),
    );
    $nolink = 'node/' . $meeting->nid;
  }
  if ($meeting->dialNumber) {
    $output .= '<div class="bbb-dial-number">' . t('Phone: @number', array(
      '@number' => $meeting->dialNumber,
    )) . '</div>';
  }
  if (user_access('attend meetings') || user_access('administer big blue button')) {
    $output .= '<div class="bbb-meeting-attend">' . l(t('Attend meeting'), $display_mode == 'blank' ? $nolink : $attend, $attend_options) . '</div>';
  }
  if (user_access('moderate meetings') || user_access('administer big blue button')) {
    $output .= '<div class="bbb-meeting-moderate">' . l(t('Moderate meeting'), $display_mode == 'blank' ? $nolink : $moderate, $moderate_options) . '</div>';
  }
  if (user_access('moderate meetings') || user_access('administer big blue button')) {
    $output .= '<div class="bbb-meeting-end">' . l(t('Terminate meeting'), 'node/' . $meeting->nid . '/meeting/end-confirm') . '</div>';
  }
  $output .= theme('bbb_meeting_record', array(
    'meeting' => $meeting,
  ));
  $output .= '</div>';
  return $output;
}