PHP Classes
elePHPant
Icontem

File: class_windowlink.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Frits Bergman  >  WindowLink  >  class_windowlink.php  >  Download  
File: class_windowlink.php
Role: Class source
Content type: text/plain
Description: opens a new window
Class: WindowLink
Author: By
Last change: Bugfix - focus lost after popup.
Date: 10 years ago
Size: 1,399 bytes
 

Contents

Class file image Download
<?php

class WindowLink
{
   
// description: Opens a new window with a click on a link or picture.
    // Use class Body to automatically close a window after submit.
    // history:
    // 15-03-2002 added Extra_URI. (1.1)
    // 26-03-2002 debug Extra_URI. (1.2)
    // 02-12-2004 added WindowStyle, added for keeping background-focus. (1.3)

   
var $URL = "www.php.net";
    var
$Image = "";
    var
$Hint = "";
    var
$Description = "description";
    var
$Toolbar = "no";
    var
$Scrollbar = "no";
    var
$Width = 500;
    var
$Height = 300;
    var
$Left = 200;
    var
$Top = 200;
    var
$Extra_URI = ""; // for sending extra vars to the opened window
   
var $WindowStyle = 0;

    function
Show()
    {
        if (
$this->WindowStyle == 0)
        {
           
// show window-link
           
print "<A Href='#' onClick=\"window.open('".$this->URL.$this->Extra_URI."','','toolbar=".$this->Toolbar.",scrollbars=".$this->Scrollbar.",width=".$this->Width.",height=".$this->Height.",left=".$this->Left.",top=".$this->Top."')\">";
        }
        else if (
$this->WindowStyle == 1)
        {
            print
"<a href='".$this->URL.$this->Extra_URI."' target='_blank'>";
        }
       
// toon image
       
print $this->Description;
       
// toon image
       
if ($this->Image != "")
        {
            print
"<img src='".$this->Image."' ";
            if (
$this->Hint != "") print"title='".$this->Hint."' ";
            print
"border=0>";
        }
        print
"</a>";

    }
}

?>