"",
'width' => "100%",
"height" => "100%",
"scrolling" => "no",
"classname" => "",
"id" => "iframe$_frameNo",
"offset" => "15"
);
for ($i = 0; $i < count($aParams); $i++) {
if ($i == 0) {
$iframe_params["url"] = $aParams[$i];
} else {
$param = explode("=", $aParams[$i]);
if ($params != "") {
$iframe_params[strtolower($param[0])] = str_replace('"', "", $param[1]);
}
}
}
$class = ($iframe_params["classname"] != "" ? "class='" . $iframe_params["classname"] . "'" : "");
$code = "";
if ($iframe_params["url"] == "") {
return "";
}
$code = "";
$url = theme('insertFrame_getURL', $iframe_params["url"],$iframe_params);
if ($iframe_params["height"] == "100%") {
$onload = "onload='adjustHeight(this," . $iframe_params["offset"] . ")'";
}
$customCode = theme("insertFrame_custom",$onload, $iframe_params);
$code = $code . '';
return "$code";
}
function theme_insertFrame_getURL($url, $iframe_params=null) {
return $url;
}
function theme_insertFrame_custom($onload, $iframe_params) {return $onload;}
function insertFrame_filter($op, $delta = 0, $format = -1, $text = '') {
$_frameNo = 0;
switch ($op) {
case 'list' :
return array (
0 => t('Include iFrame'
));
case 'description' :
return t('Include iFrame');
case 'prepare' :
return $text;
case "process" :
$text = preg_replace_callback("/\[\[\[(.*?)\]\]\]/", '_insertFrame_replacer', $text);
return $text;
default :
return $text;
}
}
function insertFrame_filter_tips($delta, $format, $long = false) {
$helpText = "[[[<url> width=<w> height=<h> scrolling=<yes|no|auto> className=<class> ID=<id> offset=<offset>]]] - insert a frame with url as source.
";
if ($long) {
$helpText .= " width ==> Size as css declaration (%,px,em)
";
$helpText .= " height ==> Height as css declaration (%,px,em)
";
$helpText .= " if height=100% and url is in the same domain as web site, the height will be ajusted to the real height of the source
";
$helpText .= " scrolling ==> Scrollbar settings. Values from IFRAME tag.
";
$helpText .= " className ==> Name of a CSS class
";
$helpText .= " ID ==> Id and name of the frame";
$helpText .= " offset ==> A number to add to correct (if needed) auto calculated height";
}
return t($helpText);
}