guiId = $applicationId;
$this->id = $row["e_id"];
$this->pos = $row["e_pos"];
$this->isPublic = $row["e_public"];
$this->comment = $row["e_comment"];
$this->title = $row["e_title"];
$this->element = $row["e_element"];
$this->src = $row["e_src"];
$this->attributes = $row["e_attributes"];
$this->left = $row["e_left"];
$this->top = $row["e_top"];
$this->width = $row["e_width"];
$this->height = $row["e_height"];
$this->zIndex = $row["e_z_index"];
$this->moreStyles = $row["e_more_styles"];
$this->content = $row["e_content"];
$this->closeTag = $row["e_closetag"];
$this->jsFile = $row["e_js_file"];
$this->mbMod = $row["e_mb_mod"];
$this->target = $row["e_target"];
$this->requires = $row["e_requires"];
$this->helpUrl = $row["e_url"];
return true;
}
return false;
}
public function __toString () {
return $this->toHtml();
}
public function getJavaScriptModules () {
$jsArray = array();
if ($this->mbMod != "") {
$moduleArray = explode(",", $this->mbMod);
for ($i = 0; $i < count($moduleArray); $i++) {
$currentFile = dirname(__FILE__) . "/../javascripts/" . trim($moduleArray[$i]);
if (file_exists($currentFile)) {
array_push($jsArray, $currentFile);
}
else {
$e = new mb_exception("Javascript module not found: " . $currentFile);
}
}
}
return $jsArray;
}
public function toHtmlArray () {
if ($this->isPublic) {
return array($this->getHtmlOpenTag(), $this->getHtmlContent(), $this->getHtmlCloseTag());
}
return array("", "", "");
}
public function toHtml () {
if ($this->isPublic) {
return implode("", $this->toHtmlArray());
}
return "";
}
private function getHtmlOpenTag () {
$openTag = "";
if (!$this->element) {
return "";
}
if ($this->id) {
// tag name
$openTag .= "<" . $this->element . " ";
// id and name
$openTag .= "id='" . $this->id . "' ";
$validTags = array(
"form",
"iframe",
"img",
"applet",
"button",
"frame",
"input",
"map",
"object",
"param",
"select",
"textarea"
);
if (in_array($this->element, $validTags)) {
$openTag .= "name='" . htmlentities($this->id, ENT_QUOTES, CHARSET) . "' ";
}
// attributes
if ($this->attributes) {
$openTag .= stripslashes($this->replaceSessionStringByUrlParameters($this->attributes)) . " ";
}
if ($this->element === "img" && !preg_match("/alt( )*=/", $this->attributes)) {
$openTag .= "alt='" . htmlentities($this->title, ENT_QUOTES, CHARSET) . "' ";
}
// title
if ($this->title) {
$openTag .= "title='" . htmlentities($this->title, ENT_QUOTES, CHARSET) . "' ";
}
else {
// add a title for iframes
if ($this->element === "iframe") {
$openTag .= "title='" . $this->id . "' ";
}
}
// src
if ($this->src) {
$openTag .= "src = '" . $this->replaceSessionStringByUrlParameters(
htmlentities($this->src, ENT_QUOTES, CHARSET)
);
// for iframes which are not "loadData",
// add additional parameters
if ($this->closeTag == "iframe" && $this->id != "loadData") {
if(mb_strpos($this->src, "?")) {
$openTag .= "&";
}
else {
$openTag .= "?";
}
$openTag .= "e_id_css=" . $this->id . "&" .
"e_id=" . $this->id . "&" .
"e_target=" . $this->target . "&" .
$this->getUrlParameters();
}
$openTag .= "' ";
}
// style
$openTag .= " style = '";
if ($this->top != "" && $this->left != "") {
$openTag .= "position:absolute;" .
"left:" . $this->left . ";" .
"top:" . $this->top . ";";
}
if ($this->width != "" && $this->height != "") {
$openTag .= "width:" . $this->width . ";" .
"height:" . $this->height . ";";
}
if ($this->zIndex) {
$openTag .= "z-index:" . $this->zIndex . ";";
}
if ($this->moreStyles) {
$openTag .= $this->moreStyles;
}
$openTag .= "'>";
if ($this->element == "body") {
$e_id = "body";
$gui_id = $this->guiId;
include(dirname(__FILE__)."/../include/dyn_php.php");
$splashScreen = "";
if (isset($use_load_message)) {
$this->isBodyAndUsesSplashScreen = true;
if (isset($htmlWhileLoading) && $htmlWhileLoading != '') {
$splashScreen .= $htmlWhileLoading;
} elseif (isset($includeWhileLoading) && $includeWhileLoading != '' && file_exists(dirname(__FILE__)."/".$includeWhileLoading)) {
ob_start();
include(dirname(__FILE__)."/".$includeWhileLoading);
$splashScreen .= ob_get_contents();
ob_end_clean();
}
else {
$splashScreen .= " " .
"Mapbender " .
MB_VERSION_NUMBER . " " . strtolower(MB_VERSION_APPENDIX) . "..." .
"loading application '" . $this->guiId . "'";
}
}
$openTag .= "