Login   Register  
PHP Classes
elePHPant
Icontem

File: class_body.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  >  Body  >  class_body.php  >  Download  
File: class_body.php
Role: Class source
Content type: text/plain
Description: Auto-close body-tag.
Class: Body
Author: By
Last change: My name removed for reasons.
Date: 10 years ago
Size: 1,125 bytes
 

Contents

Class file image Download
<?php

class Body
{
    
// description: Use with class_windowlink.php.
    //              Put the object-instantiation in the HEAD-part of an HTML-file.
    //              Calling Show_clean produces a normal body-tag.
    //              Calling Show_UPC produces a UPC-body-tag.
    //              The UPC-body-tag updates the parent-window 
    //              and closes the current form. Handy with database-updating.
    // version:     2.1
    // history:     13-2-2002 release version 1.0 (bug with reloads after new row)
    // history:     23-2-2002 release version 2.0 (no reload, new load of parent)
    // history:     28-2-2002 release version 2.1 AutoClose can be set on/off

    
function Body($Parent_page ""$AutoClose 1)
    {
        print
"<script language=javascript>\n";
        print
"function UpdateParentClose()\n";
        print
"{\n";
        print
"window.opener.location = \"".$Parent_page."\";\n";
        if (
$AutoClose == 1) print"window.close();\n";
        print
"}\n";
        print
"</script>\n";
    }

    function 
Show_clean()
    {
        print
"<body>";
    }

    function 
Show_UPC()
    {
        print
"<body onload='UpdateParentClose()'>";
    }
}

?>