1
0
Fork 0

Some rewrites:

- max_proccesses_reach() and maxload_reached() (why no _ behind max?) are called
  both way, static and with object reference.
- this is strongly discouraged and should be avoided as its support (in PHP) may
  be dropped in future releases.
- used $a = get_app(); to encapsulate code (even when the function does
  currently the same, it may be changed later)

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2016-12-13 10:16:36 +01:00
commit 293436e5fd
27 changed files with 69 additions and 67 deletions

View file

@ -149,6 +149,8 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){
}
function oembed_format_object($j){
$a = get_app();
require_once("mod/proxy.php");
$embedurl = $j->embedurl;
@ -165,7 +167,7 @@ function oembed_format_object($j){
$th=120; $tw = $th*$tr;
$tpl=get_markup_template('oembed_video.tpl');
$ret.=replace_macros($tpl, array(
'$baseurl' => App::get_baseurl(),
'$baseurl' => $a->get_baseurl(),
'$embedurl'=>$embedurl,
'$escapedhtml'=>base64_encode($jhtml),
'$tw'=>$tw,
@ -255,12 +257,14 @@ function oembed_format_object($j){
* @see oembed_format_object()
*/
function oembed_iframe($src, $width, $height) {
$a = get_app();
if (!$height || strstr($height,'%')) {
$height = '200';
}
$width = '100%';
$s = App::get_baseurl() . '/oembed/'.base64url_encode($src);
$s = $a->get_baseurl() . '/oembed/'.base64url_encode($src);
return '<iframe onload="resizeIframe(this);" class="embed_rich" height="' . $height . '" width="' . $width . '" src="' . $s . '" allowfullscreen scrolling="no" frameborder="no">' . t('Embedded content') . '</iframe>';
}