';
$filenameloader = $filenamedir . '/loader.gif';
if (file_exists($filenameloader)) {
$loader_url = AIP_URL_CUSTOM . '/loader.gif';
list($widthLoader, $heightLoader) = @getimagesize($loader_url);
// get the size
$html .= '';
} else {
$loader_url = AIP_IMGURL . '/loader.gif';
}
// div for the loader
$html .= '
';
}
if (!empty($hide_part_of_iframe)) {
$html_hide = '';
$rectangles = explode('|', $hide_part_of_iframe);
$div_width = $this->addPx($width);
if ($show_part_of_iframe === 'true') {
$div_width = $this->addPx($show_part_of_iframe_width);
}
$html .= '
';
for ($hi = 0; $hi < count($rectangles); ++$hi) {
$values = explode(',', $rectangles[$hi]);
$num_values = count($values);
if ($num_values === 6 || $num_values === 7 || $num_values === 8) {
// add px or %
$r_x = $this->addPx($values[0]);
$r_y = $this->addPx($values[1]);
$r_width = $this->addPx($values[2]);
$r_height = $this->addPx($values[3]);
$display_type = 'div';
$hide_href = '';
if ($num_values === 7 || $num_values === 8) {
$display_type = 'a';
$hrefValue = esc_url(trim($values[6]));
if ($hrefValue === 'changeViewport') {
$hide_href = ' href="javascript:setNewViewPort' . $id . '(0); "';
} else {
$hide_href = ' href="' . $hrefValue . '"';
}
}
if ($num_values === 8) {
$hide_href .= ' target="' . esc_html(trim($values[7])) . '"';
}
// bottom and right are extracted
$x_style = 'left';
$y_style = 'top';
if ($r_x[0] === 'r') {
$x_style = 'right';
$r_x = substr($r_x, 1);
}
if ($r_y[0] === 'b') {
$y_style = 'bottom';
$r_y = substr($r_y, 1);
}
// $values[4] does also support a html file which also includes a shortcode
// It is added with a $ after the color. html files needs to be in the custom folder.
// hide and hide1000 creade click events on close + automatic hide at a specific time.
$values_color = explode('$', $values[4]);
$bg_color = $values_color[0];
// file or shortcode
$div_content = '';
if (count($values_color) >= 2) {
if (count($values_color) === 3) {
$element = $values_color[1];
$hide = $values_color[2];
} else {
if ($this->ai_startsWith($values_color[1], 'hide')) {
$hide = $values_color[1];
$element = "not_used";
} else {
$element = $values_color[1];
$hide = "not_used";
}
}
if ($element != 'not_used') {
$filename = $filenamedir . '/hide_' . esc_html(trim($element)) . '.html';
// load file and show a message if it does not exist
if (file_exists($filename)) {
$div_content = trim(file_get_contents($filename));
// evaluate shortcodes
switch ($fullscreen_button_style) {
case 'black2':
$button_open = "fullscreen2_open.png";
$button_close = "fullscreen2_close.png";
break;
case 'white':
$button_open = "fullscreen_open-white.png";
$button_close = "fullscreen_close-white.png";
break;
case 'custom':
$button_open = "../../advanced-iframe-custom/fullscreen_open.png";
$button_close = "../../advanced-iframe-custom/fullscreen_close.png";
break;
default:
// we keep the existing settings
$button_open = "fullscreen_open.png";
$button_close = "fullscreen_close.png";
}
$div_content = do_shortcode($div_content);
$replacementsHide = array(
'fullscreen_open.png'=> $button_open,
'fullscreen_close.png'=> $button_close,
'{plugin_url}'=> AIP_URL,
'{x_style}'=> $x_style,
'{x_distance}'=> $r_x,
'{y_style}'=> $y_style,
'{y_distance}'=> $r_y,
'{width}'=> $r_width,
'{height}'=> $r_height,
'{id}'=> $id
);
$div_content = str_replace(array_keys($replacementsHide), array_values($replacementsHide), $div_content);
} else {
$content = 'The file "' . $filename . '" cannot be found.';
}
}
if ($hide != 'not_used') {
$error = false;
if ($this->ai_startsWith($hide, 'hide')) {
$html_hide = '';
if ($hide === 'hide') {
$html_hide .= '';
}
} else {
$error = true;
}
if ($error) {
$html = $error_css . '
' . __('ERROR: hide part of iframe only supports $hide or $hideXXX as last parameter.', 'advanced-iframe') . '
';
return $html;
}
}
}
$zIndex = $values[5];
$position = 'position:absolute';
if ($this->ai_startsWith($zIndex, 'f')) {
$position = 'position:fixed';
$zIndex = substr($zIndex, 1);
}
// replace § with , for rbga !
$bg_color = str_replace('§', ',', $bg_color);
$html .= '';
$html .= '<' . $display_type . $hide_href . ' id="wrapper-div-element-' . $id . '-' . $hi . '">' . $div_content . '' . $display_type . '>';
$html .= $html_hide;
} else {
if ($hide_part_of_iframe !== 'false') {
$html = $error_css . '
' . __('ERROR: hide part of iframe does not have the required parameters', 'advanced-iframe') . '
';
return $html;
}
}
}
}
if ($show_part_of_iframe === 'true') {
$html .= '
';
if ($fixChrome65) {
$html .= '
';
}
}
if (!empty($iframe_zoom)) {
$html .= '
';
}
if ($enable_lazy_load === 'true') {
$html .= '
';
}
if (!empty($iframe_zoom)) {
$html .= '
';
}
if ($show_part_of_iframe === 'true') {
if ($fixChrome65) {
$html .= '
';
}
$html .= '
';
}
if (!empty($hide_part_of_iframe)) {
$html .= '