Completed
Push — 1.10.x ( a32a3a...6ee285 )
by
unknown
54:10
created
main/inc/lib/internationalization.lib.php 1 patch
Doc Comments   +20 added lines, -14 removed lines patch added patch discarded remove patch
@@ -437,6 +437,7 @@  discard block
 block discarded – undo
437 437
  * If null, the timezone will be determined based on user preference,
438 438
  * or timezone chosen by the admin for the platform.
439 439
  * @param string The timezone to be converted from. If null, UTC will be assumed.
440
+ * @param string $to_timezone
440 441
  * @return string The converted time formatted as Y-m-d H:i:s
441 442
  *
442 443
  * @author Guillaume Viguier <[email protected]>
@@ -793,6 +794,7 @@  discard block
 block discarded – undo
793 794
  * @param mixed The time to be converted
794 795
  * @param mixed Format to be used (TIME_NO_SEC_FORMAT, DATE_FORMAT_SHORT, DATE_FORMAT_LONG, DATE_TIME_FORMAT_LONG)
795 796
  * @param string Timezone to be converted from. If null, UTC will be assumed.
797
+ * @param string $from_timezone
796 798
  * @return string Converted and localized date
797 799
  *
798 800
  * @author Guillaume Viguier <[email protected]>
@@ -862,7 +864,7 @@  discard block
 block discarded – undo
862 864
  * @param int/string $format (optional)	The person name format. It may be a pattern-string (for example '%t %l, %f' or '%T %F %L', ...) or some of the constants PERSON_NAME_COMMON_CONVENTION (default), PERSON_NAME_WESTERN_ORDER, PERSON_NAME_EASTERN_ORDER, PERSON_NAME_LIBRARY_ORDER.
863 865
  * @param string $language (optional)	The language id. If it is omitted, the current interface language is assumed. This parameter has meaning with the format PERSON_NAME_COMMON_CONVENTION only.
864 866
  * @param string $encoding (optional)	The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
865
- * @return bool							The result is sort of full name of the person.
867
+ * @return string							The result is sort of full name of the person.
866 868
  * Sample results:
867 869
  * Peter Ustinoff or Dr. Peter Ustinoff     - the Western order
868 870
  * Ustinoff Peter or Dr. Ustinoff Peter     - the Eastern order
@@ -956,7 +958,7 @@  discard block
 block discarded – undo
956 958
 
957 959
 /**
958 960
  * Checks whether a given format represents person name in Western order (for which first name is first).
959
- * @param int/string $format (optional)	The person name format. It may be a pattern-string (for example '%t. %l, %f') or some of the constants PERSON_NAME_COMMON_CONVENTION (default), PERSON_NAME_WESTERN_ORDER, PERSON_NAME_EASTERN_ORDER, PERSON_NAME_LIBRARY_ORDER.
961
+ * @param integer $format (optional)	The person name format. It may be a pattern-string (for example '%t. %l, %f') or some of the constants PERSON_NAME_COMMON_CONVENTION (default), PERSON_NAME_WESTERN_ORDER, PERSON_NAME_EASTERN_ORDER, PERSON_NAME_LIBRARY_ORDER.
960 962
  * @param string $language (optional)	The language id. If it is omitted, the current interface language is assumed. This parameter has meaning with the format PERSON_NAME_COMMON_CONVENTION only.
961 963
  * @return bool							The result TRUE means that the order is first_name last_name, FALSE means last_name first_name.
962 964
  * Note: You may use this function for determing the order of the fields or columns "First name" and "Last name" in forms, tables and reports.
@@ -1184,8 +1186,8 @@  discard block
 block discarded – undo
1184 1186
 
1185 1187
 /**
1186 1188
  * This function returns a string or an array with all occurrences of search in subject (ignoring case) replaced with the given replace value.
1187
- * @param mixed $search					String or array of strings to be found.
1188
- * @param mixed $replace				String or array of strings used for replacement.
1189
+ * @param string $search					String or array of strings to be found.
1190
+ * @param string $replace				String or array of strings used for replacement.
1189 1191
  * @param mixed $subject				String or array of strings being searched.
1190 1192
  * @param int $count (optional)			The number of matched and replaced needles will be returned in count, which is passed by reference.
1191 1193
  * @param string $encoding (optional)	The used internally by this function character encoding.
@@ -1248,10 +1250,10 @@  discard block
 block discarded – undo
1248 1250
 /**
1249 1251
  * Finds first occurrence of a string within another, case insensitive.
1250 1252
  * @param string $haystack					The string from which to get the first occurrence.
1251
- * @param mixed $needle						The string to be found.
1253
+ * @param string $needle						The string to be found.
1252 1254
  * @param bool $before_needle (optional)	Determines which portion of $haystack this function returns. The default value is FALSE.
1253 1255
  * @param string $encoding (optional)		The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
1254
- * @return mixed							Returns the portion of $haystack, or FALSE if $needle is not found.
1256
+ * @return false|string							Returns the portion of $haystack, or FALSE if $needle is not found.
1255 1257
  * Notes:
1256 1258
  * If $needle is not a string, it is converted to an integer and applied as the ordinal value (codepoint if the encoding is UTF-8) of a character.
1257 1259
  * If $before_needle is set to TRUE, the function returns all of $haystack from the beginning to the first occurrence of $needle.
@@ -1307,7 +1309,7 @@  discard block
 block discarded – undo
1307 1309
  * @param mixed $needle						The string which first character is to be found.
1308 1310
  * @param bool $before_needle (optional)	Determines which portion of $haystack this function returns. The default value is FALSE.
1309 1311
  * @param string $encoding (optional)		The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
1310
- * @return mixed							Returns the portion of $haystack, or FALSE if the first character from $needle is not found.
1312
+ * @return false|string							Returns the portion of $haystack, or FALSE if the first character from $needle is not found.
1311 1313
  * Notes:
1312 1314
  * If $needle is not a string, it is converted to an integer and applied as the ordinal value (codepoint if the encoding is UTF-8) of a character.
1313 1315
  * If $before_needle is set to TRUE, the function returns all of $haystack from the beginning to the first occurrence.
@@ -1357,7 +1359,7 @@  discard block
 block discarded – undo
1357 1359
  * @param string $needle				The string to be found.
1358 1360
  * @param int $offset (optional)		$offset may be specified to begin searching an arbitrary position. Negative values will stop searching at an arbitrary point prior to the end of the string.
1359 1361
  * @param string $encoding (optional)	The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
1360
- * @return mixed						Returns the numeric position of the first occurrence of $needle in the $haystack, or FALSE if $needle is not found.
1362
+ * @return integer|null						Returns the numeric position of the first occurrence of $needle in the $haystack, or FALSE if $needle is not found.
1361 1363
  * Note: The first character's position is 0, the second character position is 1, and so on.
1362 1364
  * This function is aimed at replacing the functions strrpos() and mb_strrpos() for human-language strings.
1363 1365
  * @link http://php.net/manual/en/function.strrpos
@@ -1374,7 +1376,7 @@  discard block
 block discarded – undo
1374 1376
  * @param mixed $needle						The string to be found.
1375 1377
  * @param bool $before_needle (optional)	Determines which portion of $haystack this function returns. The default value is FALSE.
1376 1378
  * @param string $encoding (optional)		The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
1377
- * @return mixed							Returns the portion of $haystack, or FALSE if $needle is not found.
1379
+ * @return false|string							Returns the portion of $haystack, or FALSE if $needle is not found.
1378 1380
  * Notes:
1379 1381
  * If $needle is not a string, it is converted to an integer and applied as the ordinal value (codepoint if the encoding is UTF-8) of a character.
1380 1382
  * If $before_needle is set to TRUE, the function returns all of $haystack from the beginning to the first occurrence of $needle.
@@ -1517,7 +1519,7 @@  discard block
 block discarded – undo
1517 1519
  * 										Note that this changes the return value in an array where every element is an array consisting of the matched string at index 0 and its string offset into subject at index 1.
1518 1520
  * @param int $offset (optional)		Normally, the search starts from the beginning of the subject string. The optional parameter offset can be used to specify the alternate place from which to start the search.
1519 1521
  * @param string $encoding (optional)	The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
1520
- * @return int|boolean					Returns the number of times pattern matches or FALSE if an error occurred.
1522
+ * @return integer					Returns the number of times pattern matches or FALSE if an error occurred.
1521 1523
  * @link http://php.net/preg_match
1522 1524
  */
1523 1525
 function api_preg_match($pattern, $subject, &$matches = null, $flags = 0, $offset = 0, $encoding = null) {
@@ -1540,7 +1542,7 @@  discard block
 block discarded – undo
1540 1542
  * If no order flag is given, PREG_PATTERN_ORDER is assumed.
1541 1543
  * @param int $offset (optional)		Normally, the search starts from the beginning of the subject string. The optional parameter offset can be used to specify the alternate place from which to start the search.
1542 1544
  * @param string $encoding (optional)	The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
1543
- * @return int|boolean					Returns the number of full pattern matches (which might be zero), or FALSE if an error occurred.
1545
+ * @return integer					Returns the number of full pattern matches (which might be zero), or FALSE if an error occurred.
1544 1546
  * @link http://php.net/preg_match_all
1545 1547
  */
1546 1548
 function api_preg_match_all($pattern, $subject, &$matches, $flags = PREG_PATTERN_ORDER, $offset = 0, $encoding = null) {
@@ -1555,8 +1557,8 @@  discard block
 block discarded – undo
1555 1557
 
1556 1558
 /**
1557 1559
  * Performs a regular expression search and replace, UTF-8 aware when it is applicable.
1558
- * @param string|array $pattern			The pattern to search for. It can be either a string or an array with strings.
1559
- * @param string|array $replacement		The string or an array with strings to replace.
1560
+ * @param string $pattern			The pattern to search for. It can be either a string or an array with strings.
1561
+ * @param string $replacement		The string or an array with strings to replace.
1560 1562
  * @param string|array $subject			The string or an array with strings to search and replace.
1561 1563
  * @param int $limit					The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).
1562 1564
  * @param int &$count					If specified, this variable will be filled with the number of replacements done.
@@ -1808,6 +1810,7 @@  discard block
 block discarded – undo
1808 1810
 /**
1809 1811
  * Checks a string for UTF-8 validity.
1810 1812
  *
1813
+ * @param string $string
1811 1814
  */
1812 1815
 function api_is_valid_utf8(&$string)
1813 1816
 {
@@ -1950,7 +1953,7 @@  discard block
 block discarded – undo
1950 1953
 /**
1951 1954
  * Replaces non-valid formats for person names with the default (English) format.
1952 1955
  * @param string $format	The input format to be verified.
1953
- * @return bool				Returns the same format if is is valid, otherwise returns a valid English format.
1956
+ * @return string				Returns the same format if is is valid, otherwise returns a valid English format.
1954 1957
  */
1955 1958
 function _api_validate_person_name_format($format) {
1956 1959
     if (empty($format) || stripos($format, '%f') === false || stripos($format, '%l') === false) {
@@ -2077,6 +2080,9 @@  discard block
 block discarded – undo
2077 2080
 
2078 2081
 // This function checks whether the function _api_convert_encoding() (the php-
2079 2082
 // implementation) is able to convert from/to a given encoding.
2083
+/**
2084
+ * @param string $encoding
2085
+ */
2080 2086
 function _api_convert_encoding_supports($encoding) {
2081 2087
     static $supports = array();
2082 2088
     if (!isset($supports[$encoding])) {
Please login to merge, or discard this patch.
plugin/bbb/lib/bbb.lib.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -166,13 +166,13 @@  discard block
 block discarded – undo
166 166
         }
167 167
 
168 168
         $params['attendee_pw'] = isset($params['moderator_pw']) ? $params['moderator_pw'] : $courseCode;
169
-        $attendeePassword =  $params['attendee_pw'];
169
+        $attendeePassword = $params['attendee_pw'];
170 170
         $params['moderator_pw'] = isset($params['moderator_pw']) ? $params['moderator_pw'] : $this->getModMeetingPassword();
171 171
         $moderatorPassword = $params['moderator_pw'];
172 172
 
173 173
         $params['record'] = api_get_course_setting('big_blue_button_record_and_store', $courseCode) == 1 ? true : false;
174 174
         $max = api_get_course_setting('big_blue_button_max_students_allowed', $courseCode);
175
-        $max =  isset($max) ? $max : -1;
175
+        $max = isset($max) ? $max : -1;
176 176
 
177 177
         $params['status'] = 1;
178 178
         // Generate a pseudo-global-unique-id to avoid clash of conferences on
@@ -203,23 +203,23 @@  discard block
 block discarded – undo
203 203
             $duration = 300;
204 204
 
205 205
             $bbbParams = array(
206
-                'meetingId' => $params['remote_id'], 					// REQUIRED
207
-                'meetingName' => $meetingName, 	// REQUIRED
208
-                'attendeePw' => $attendeePassword, 					// Match this value in getJoinMeetingURL() to join as attendee.
209
-                'moderatorPw' => $moderatorPassword, 					// Match this value in getJoinMeetingURL() to join as moderator.
210
-                'welcomeMsg' => $welcomeMessage, 					// ''= use default. Change to customize.
211
-                'dialNumber' => '', 					// The main number to call into. Optional.
212
-                'voiceBridge' => $params['voice_bridge'], 					// PIN to join voice. Required.
213
-                'webVoice' => '', 						// Alphanumeric to join voice. Optional.
206
+                'meetingId' => $params['remote_id'], // REQUIRED
207
+                'meetingName' => $meetingName, // REQUIRED
208
+                'attendeePw' => $attendeePassword, // Match this value in getJoinMeetingURL() to join as attendee.
209
+                'moderatorPw' => $moderatorPassword, // Match this value in getJoinMeetingURL() to join as moderator.
210
+                'welcomeMsg' => $welcomeMessage, // ''= use default. Change to customize.
211
+                'dialNumber' => '', // The main number to call into. Optional.
212
+                'voiceBridge' => $params['voice_bridge'], // PIN to join voice. Required.
213
+                'webVoice' => '', // Alphanumeric to join voice. Optional.
214 214
                 'logoutUrl' =>  $this->logoutUrl,
215
-                'maxParticipants' => $max, 				// Optional. -1 = unlimitted. Not supported in BBB. [number]
216
-                'record' => $record, 					// New. 'true' will tell BBB to record the meeting.
217
-                'duration' => $duration, 				// Default = 0 which means no set duration in minutes. [number]
215
+                'maxParticipants' => $max, // Optional. -1 = unlimitted. Not supported in BBB. [number]
216
+                'record' => $record, // New. 'true' will tell BBB to record the meeting.
217
+                'duration' => $duration, // Default = 0 which means no set duration in minutes. [number]
218 218
                 //'meta_category' => '', 				// Use to pass additional info to BBB server. See API docs.
219 219
             );
220 220
 
221 221
             if ($this->debug) {
222
-                error_log("create_meeting params: ".print_r($bbbParams,1));
222
+                error_log("create_meeting params: ".print_r($bbbParams, 1));
223 223
             }
224 224
 
225 225
             $status = false;
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
                 if (isset($result) && strval($result['returncode']) == 'SUCCESS') {
233 233
                     if ($this->debug) {
234 234
                         error_log(
235
-                            "create_meeting result: " . print_r($result, 1)
235
+                            "create_meeting result: ".print_r($result, 1)
236 236
                         );
237 237
                     }
238 238
                     $meeting = $this->joinMeeting($meetingName, true);
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 
264 264
         $courseId = api_get_course_int_id();
265 265
         $sessionId = api_get_session_id();
266
-        $conditions =  array(
266
+        $conditions = array(
267 267
             'where' => array(
268 268
                 'c_id = ? AND session_id = ? AND meeting_name = ? AND status = 1 ' =>
269 269
                     array($courseId, $sessionId, $meetingName)
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
         if ($this->hasGroupSupport()) {
274 274
             $groupId = api_get_group_id();
275
-            $conditions =  array(
275
+            $conditions = array(
276 276
                 'where' => array(
277 277
                     'c_id = ? AND session_id = ? AND meeting_name = ? AND group_id = ? AND status = 1 ' =>
278 278
                         array($courseId, $sessionId, $meetingName, $groupId)
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 
370 370
             if ($this->debug) {
371 371
                 error_log(
372
-                    "meeting is running: " . intval($meetingInfoExists)
372
+                    "meeting is running: ".intval($meetingInfoExists)
373 373
                 );
374 374
             }
375 375
 
@@ -386,11 +386,11 @@  discard block
 block discarded – undo
386 386
 
387 387
         if ($meetingInfoExists) {
388 388
             $joinParams = array(
389
-                'meetingId' => $meetingData['remote_id'],	//	-- REQUIRED - A unique id for the meeting
390
-                'username' => $this->userCompleteName,	//-- REQUIRED - The name that will display for the user in the meeting
391
-                'password' => $pass,			//-- REQUIRED - The attendee or moderator password, depending on what's passed here
389
+                'meetingId' => $meetingData['remote_id'], //	-- REQUIRED - A unique id for the meeting
390
+                'username' => $this->userCompleteName, //-- REQUIRED - The name that will display for the user in the meeting
391
+                'password' => $pass, //-- REQUIRED - The attendee or moderator password, depending on what's passed here
392 392
                 //'createTime' => api_get_utc_datetime(),			//-- OPTIONAL - string. Leave blank ('') unless you set this correctly.
393
-                'userID' => api_get_user_id(),				//-- OPTIONAL - string
393
+                'userID' => api_get_user_id(), //-- OPTIONAL - string
394 394
                 'webVoiceConf' => ''	//	-- OPTIONAL - string
395 395
             );
396 396
             $url = $this->api->getJoinMeetingURL($joinParams);
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
             $url = $this->logoutUrl;
400 400
         }
401 401
         if ($this->debug) {
402
-            error_log("return url :" . $url);
402
+            error_log("return url :".$url);
403 403
         }
404 404
 
405 405
         return $url;
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
         $courseId = api_get_course_int_id();
442 442
         $sessionId = api_get_session_id();
443 443
 
444
-        $conditions =  array(
444
+        $conditions = array(
445 445
             'where' => array(
446 446
                 'c_id = ? AND session_id = ? ' => array(
447 447
                     $courseId,
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 
453 453
         if ($this->hasGroupSupport()) {
454 454
             $groupId = api_get_group_id();
455
-            $conditions =  array(
455
+            $conditions = array(
456 456
                 'where' => array(
457 457
                     'c_id = ? AND session_id = ? AND group_id = ? ' =>
458 458
                         array($courseId, $sessionId, $groupId)
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
             }
488 488
             $meetingBBB['end_url'] = $this->endUrl($meetingDB);
489 489
 
490
-            if ((string)$meetingBBB['returncode'] == 'FAILED') {
490
+            if ((string) $meetingBBB['returncode'] == 'FAILED') {
491 491
                 if ($meetingDB['status'] == 1 && $this->isConferenceManager()) {
492 492
                     $this->endMeeting($meetingDB['id']);
493 493
                 }
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
                     $item['action_links'] = implode('<br />', $actionLinksArray);
658 658
                 }
659 659
                 //var_dump($recordArray);
660
-                $item['show_links']  = implode('<br />', $recordArray);
660
+                $item['show_links'] = implode('<br />', $recordArray);
661 661
                 $item['action_links'] = implode('<br />', $actionLinksArray);
662 662
             }
663 663
 
@@ -670,11 +670,11 @@  discard block
 block discarded – undo
670 670
 
671 671
             if ($meetingDB['status'] == 1) {
672 672
                 $joinParams = array(
673
-                    'meetingId' => $meetingDB['remote_id'],		//-- REQUIRED - A unique id for the meeting
674
-                    'username' => $this->userCompleteName,	//-- REQUIRED - The name that will display for the user in the meeting
675
-                    'password' => $pass,			//-- REQUIRED - The attendee or moderator password, depending on what's passed here
676
-                    'createTime' => '',			//-- OPTIONAL - string. Leave blank ('') unless you set this correctly.
677
-                    'userID' => '',			//	-- OPTIONAL - string
673
+                    'meetingId' => $meetingDB['remote_id'], //-- REQUIRED - A unique id for the meeting
674
+                    'username' => $this->userCompleteName, //-- REQUIRED - The name that will display for the user in the meeting
675
+                    'password' => $pass, //-- REQUIRED - The attendee or moderator password, depending on what's passed here
676
+                    'createTime' => '', //-- OPTIONAL - string. Leave blank ('') unless you set this correctly.
677
+                    'userID' => '', //	-- OPTIONAL - string
678 678
                     'webVoiceConf' => ''	//	-- OPTIONAL - string
679 679
                 );
680 680
                 $item['go_url'] = $this->protocol.$this->api->getJoinMeetingURL($joinParams);
@@ -735,8 +735,8 @@  discard block
 block discarded – undo
735 735
         $pass = $this->getUserMeetingPassword();
736 736
 
737 737
         $endParams = array(
738
-            'meetingId' => $meetingData['remote_id'],   // REQUIRED - We have to know which meeting to end.
739
-            'password' => $pass,        // REQUIRED - Must match moderator pass for meeting.
738
+            'meetingId' => $meetingData['remote_id'], // REQUIRED - We have to know which meeting to end.
739
+            'password' => $pass, // REQUIRED - Must match moderator pass for meeting.
740 740
         );
741 741
         $this->api->endMeetingWithXmlResponseArray($endParams);
742 742
         Database::update(
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
      */
962 962
     public function redirectToBBB($url)
963 963
     {
964
-        if (file_exists(__DIR__ . '/../config.vm.php')) {
964
+        if (file_exists(__DIR__.'/../config.vm.php')) {
965 965
             // Using VM
966 966
             echo Display::url(get_lang('ClickToContinue'), $url);
967 967
             exit;
Please login to merge, or discard this patch.