You are here

function drupalchat_app_settings in DrupalChat 6.2

Same name and namespace in other branches
  1. 7.2 drupalchat.admin.inc \drupalchat_app_settings()

@file Administrative functions to configure DrupalChat.

1 string reference to 'drupalchat_app_settings'
drupalchat_menu in ./drupalchat.module
Implementaiton of hook_menu()

File

./drupalchat.admin.inc, line 8
Administrative functions to configure DrupalChat.

Code

function drupalchat_app_settings() {
  global $user;
  if (isset($_SESSION['token']) && !empty($_SESSION['token'])) {
    $token = $_SESSION['token'];
  }
  else {
    $user_name = _drupalchat_get_username($user->uid);
    $json = (array) _drupalchat_get_auth($user_name, array());
    $token = $json['key'];
  }
  $drupalchat_host = DRUPALCHAT_EXTERNAL_A_HOST;
  $host = explode("/", $drupalchat_host);
  $host_name = $host[2];
  $dashboardUrl = "//cdn.iflychat.com/apps/dashboard/#/app-settings?sessid=" . $token . "&hostName=" . $host_name . "&hostPort=" . DRUPALCHAT_EXTERNAL_A_PORT;
  return '<iframe id = "app_settings" style = "width:100%; height:600px; border:none;" src = "' . $dashboardUrl . '"></iframe>';
}