You are here

function fbconnect_invite_friends_page in Facebook Connect 6.2

Same name and namespace in other branches
  1. 8.2 fbconnect_invite/fbconnect_invite.module \fbconnect_invite_friends_page()
  2. 7.2 fbconnect_invite/fbconnect_invite.module \fbconnect_invite_friends_page()

Render the facebook friends invite form.

1 string reference to 'fbconnect_invite_friends_page'
fbconnect_invite_menu in fbconnect_invite/fbconnect_invite.module
Implements hook_menu().

File

fbconnect_invite/fbconnect_invite.module, line 108
@todo.

Code

function fbconnect_invite_friends_page() {
  global $base_url;
  global $user;
  $site = variable_get('site_name', $base_url);
  $type = check_plain(variable_get('fbconnect_invite_name', $site));
  $join_btn = check_plain(variable_get('fbconnect_invite_label', t('Become a Member!')));
  $invite_msg = check_plain(variable_get('fbconnect_invite_msg', t('Enjoy!')));
  $action_txt = check_plain(t('Please select the Facebook friends you want to invite'));
  $invite_dest = isset($_REQUEST['destination']) ? $_REQUEST['destination'] : '';
  $accept_url = url('fbconnect/invite/accept/' . $user->uid, array(
    'absolute' => TRUE,
    'query' => 'destionation=' . urlencode($invite_dest),
  ));
  $content = "{$invite_msg} <fb:req-choice url=\"{$accept_url}\" label=\"{$join_btn}\" />";
  $request_form_attributes = array(
    'method' => 'POST',
    'action' => url($invite_dest, array(
      'absolute' => TRUE,
    )),
    'type' => $type,
    'content' => $content,
    'invite' => TRUE,
  );
  $friends_selector_attributes = array(
    'cols' => "6",
    'rows' => "6",
    'max' => "35",
    'showborder' => "false",
    'actiontext' => $action_txt,
    'bypass' => "cancel",
  );
  return theme('fbconnect_invite_form', $request_form_attributes, $friends_selector_attributes);
}