Minor - format code, update comments

remotes/angel/1.11.x
jmontoyaa 9 years ago
parent a32a3a251b
commit 6ee2856479
  1. 23
      main/inc/lib/internationalization.lib.php
  2. 8
      main/inc/lib/pear/PEAR.php
  3. 24
      plugin/bbb/lib/bbb.lib.php

@ -3,7 +3,7 @@
/**
* File: internationalization.lib.php
* Internationalization library for Chamilo 1.8.7 LMS
* Internationalization library for Chamilo 1.x LMS
* A library implementing internationalization related functions.
* License: GNU General Public License Version 3 (Free Software Foundation)ww
* @author Ivan Tcholakov, <ivantcholakov@gmail.com>, 2009, 2010
@ -275,7 +275,7 @@ function api_get_language_isocode($language = null, $default_code = 'en')
}
/**
* Gets language isocode column from the language table
* Gets language iso code column from the language table
*
* @return array An array with the current isocodes
*
@ -283,7 +283,8 @@ function api_get_language_isocode($language = null, $default_code = 'en')
function api_get_platform_isocodes()
{
$iso_code = array();
$sql_result = Database::query("SELECT isocode FROM ".Database::get_main_table(TABLE_MAIN_LANGUAGE)." ORDER BY isocode ");
$sql = "SELECT isocode FROM ".Database::get_main_table(TABLE_MAIN_LANGUAGE)." ORDER BY isocode ";
$sql_result = Database::query($sql);
if (Database::num_rows($sql_result)) {
while ($row = Database::fetch_array($sql_result)) {;
$iso_code[] = trim($row['isocode']);
@ -348,6 +349,7 @@ function api_get_timezones()
}
$null_option = array('' => '');
$result = array_merge($null_option, $out);
return $result;
}
@ -439,8 +441,12 @@ function api_get_utc_datetime($time = null, $return_null_if_invalid_date = false
*
* @author Guillaume Viguier <guillaume.viguier@beeznest.com>
*/
function api_get_local_time($time = null, $to_timezone = null, $from_timezone = null, $return_null_if_invalid_date = false)
{
function api_get_local_time(
$time = null,
$to_timezone = null,
$from_timezone = null,
$return_null_if_invalid_date = false
) {
// Determining the timezone to be converted from
if (is_null($from_timezone)) {
$from_timezone = 'UTC';
@ -471,8 +477,10 @@ function api_get_local_time($time = null, $to_timezone = null, $from_timezone =
try {
$date = new DateTime($time, new DateTimezone($from_timezone));
$date->setTimezone(new DateTimeZone($to_timezone));
return $date->format('Y-m-d H:i:s');
} catch (Exception $e) {
return null;
}
}
@ -480,8 +488,8 @@ function api_get_local_time($time = null, $to_timezone = null, $from_timezone =
/**
* Converts a string into a timestamp safely (handling timezones), using strtotime
*
* @param string String to be converted
* @param string Timezone (if null, the timezone will be determined based
* @param string $time to be converted
* @param string $timezone (if null, the timezone will be determined based
* on user preference, or timezone chosen by the admin for the platform)
* @return int Timestamp
*
@ -494,6 +502,7 @@ function api_strtotime($time, $timezone = null) {
}
$timestamp = strtotime($time);
date_default_timezone_set($system_timezone);
return $timestamp;
}

@ -253,7 +253,7 @@ class PEAR
$GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
}
// }}}
// }}}
// {{{ isError()
/**
@ -558,12 +558,6 @@ class PEAR
$ec = 'PEAR_Error';
}
if (intval(PHP_VERSION) < 5) {
// little non-eval hack to fix bug #12147
include 'PEAR/FixPHP5PEARWarnings.php';
return $a;
}
if ($skipmsg) {
$a = new $ec($code, $mode, $options, $userinfo);
} else {

@ -20,7 +20,7 @@ class bbb
public $url;
public $salt;
public $api;
public $user_complete_name = '';
public $userCompleteName = '';
public $protocol = 'http://';
public $debug = false;
public $logoutUrl = '';
@ -34,6 +34,7 @@ class bbb
* required for the connection to the video conference server)
* @param string $host
* @param string $salt
* @param bool $isGlobalConference
*/
public function __construct($host = '', $salt = '', $isGlobalConference = false)
{
@ -65,7 +66,7 @@ class bbb
if ($bbbPlugin === true) {
$userInfo = api_get_user_info();
$this->user_complete_name = $userInfo['complete_name'];
$this->userCompleteName = $userInfo['complete_name'];
$this->salt = $bbb_salt;
$info = parse_url($bbb_host);
$this->url = $bbb_host.'/bigbluebutton/';
@ -82,7 +83,7 @@ class bbb
$this->pluginEnabled = true;
}
}
/**
* @return bool
*/
@ -151,7 +152,8 @@ class bbb
# a user joins. If after this period, a user hasn't joined, the meeting is
# removed from memory.
defaultMeetingCreateJoinDuration=5
*
*
* @return mixed
*/
public function createMeeting($params)
{
@ -385,7 +387,7 @@ class bbb
if ($meetingInfoExists) {
$joinParams = array(
'meetingId' => $meetingData['remote_id'], // -- REQUIRED - A unique id for the meeting
'username' => $this->user_complete_name, //-- REQUIRED - The name that will display for the user in the meeting
'username' => $this->userCompleteName, //-- REQUIRED - The name that will display for the user in the meeting
'password' => $pass, //-- REQUIRED - The attendee or moderator password, depending on what's passed here
//'createTime' => api_get_utc_datetime(), //-- OPTIONAL - string. Leave blank ('') unless you set this correctly.
'userID' => api_get_user_id(), //-- OPTIONAL - string
@ -437,7 +439,7 @@ class bbb
{
$pass = $this->getUserMeetingPassword();
$courseId = api_get_course_int_id();
$sessionId = api_get_session_id();
$sessionId = api_get_session_id();
$conditions = array(
'where' => array(
@ -669,7 +671,7 @@ class bbb
if ($meetingDB['status'] == 1) {
$joinParams = array(
'meetingId' => $meetingDB['remote_id'], //-- REQUIRED - A unique id for the meeting
'username' => $this->user_complete_name, //-- REQUIRED - The name that will display for the user in the meeting
'username' => $this->userCompleteName, //-- REQUIRED - The name that will display for the user in the meeting
'password' => $pass, //-- REQUIRED - The attendee or moderator password, depending on what's passed here
'createTime' => '', //-- OPTIONAL - string. Leave blank ('') unless you set this correctly.
'userID' => '', // -- OPTIONAL - string
@ -928,7 +930,7 @@ class bbb
}
/**
* Checks if the videoconference server is running.
* Checks if the video conference server is running.
* Function currently disabled (always returns 1)
* @return bool True if server is running, false otherwise
* @assert () === false
@ -968,12 +970,6 @@ class bbb
header("Location: $url");
exit;
}
// js
/*echo '<script>';
echo 'window.location = "'.$url.'"';
echo '</script>';
exit;*/
}
/**

Loading…
Cancel
Save