. */ class Popup { private $title; private $content; private $top = -1; private $left = -1; private $height = -1; private $width = -1; public function __construct($title, $content) { $this->title = $title; $this->content = $content; } public function __destruct() { } public function createPopup() { $data = "
getStyle().">"; $data .= "
".$this->title; $data .= "\"Close"; $data .= "
"; $data .= "
getStyleContent().">".$this->content."
"; $data .= "
"; $data .= "
getStyleOverlay().">\"Loading\"".$this-getStyleOverlayLoaderImg().">
"; return $data; } public function setTitle($title) { $this->title = $title; return $this; } public function getTitle() { return $this->title; } public function setContent($content) { $this->content = $content; return $this; } public function getContent() { return $this->content; } public function setTop($top) { $this->top = $top; return $this; } public function getTop() { return $this->top; } public function setLeft($left) { $this->left = $left; return $this; } public function getLeft() { return $this->left; } public function setHeight($height) { $this->height = $height; return $this; } public function getHeight() { return $this->height; } public function setWidth($width) { $this->width = $width; return $this; } public function getWidth() { return $this->width; } private function getStyle() { $style = ""; if( $this->left >= 0 ) { $style .= "left: ".$this->left."px; "; } if( $this->top >= 0 ) { $style .= "top: ".$this->top."px; "; } if( $this->width >= 0 ) { $style .= "width: ".$this->width."px; "; } if( $this->height >= 0 ) { $style .= "height: ".$this->height."px; "; } if( strlen($style) > 0 ) { return " style=\"".$style."\""; }else { return ""; } } private function getStyleContent() { $style = ""; if( $this->width >= 0 ) { $style .= "width: ".($this->width-20)."px; "; } if( $this->height >= 0 ) { $style .= "height: ".($this->height-48)."px; "; } if( strlen($style) > 0 ) { return " style=\"".$style."\""; }else { return ""; } } private function getStyleOverlay() { $style = ""; if( $this->left >= 0 ) { $style .= "left: ".$this->left."px; "; } if( $this->top >= 0 ) { $style .= "top: ".$this->top."px; "; } if( $this->width >= 0 ) { $style .= "width: ".($this->width+4)."px; "; } if( $this->height >= 0 ) { $style .= "height: ".($this->height+4)."px; "; } if( strlen($style) > 0 ) { return " style=\"".$style."\""; }else { return ""; } } private function getStyleOverlayLoaderImg() { $style = ""; if( $this->width >= 0 ) { $style .= "left: ".($this->width/2-25)."px; "; } if( $this->height >= 0 ) { $style .= "top: ".($this->height/2-23)."px; "; } if( strlen($style) > 0 ) { return " style=\"".$style."\""; }else { return ""; } } } ?>