"Fossies" - the Fresh Open Source Software Archive

Member "ide.php-1.5.3/Page.phpclass" (15 Sep 2007, 4865 Bytes) of package /linux/www/old/ide.php-1.5.3.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <?php
    2 /*******************************************************************************\
    3 *    IDE.PHP, a web based editor for quick PHP development                     *
    4 *    Copyright (C) 2000  Johan Ekenberg                                        *
    5 *                                                                              *
    6 *    This program is free software; you can redistribute it and/or modify      *
    7 *    it under the terms of the GNU General Public License as published by      *
    8 *    the Free Software Foundation; either version 2 of the License, or         *
    9 *    (at your option) any later version.                                       *
   10 *                                                                              *
   11 *    This program is distributed in the hope that it will be useful,           *
   12 *    but WITHOUT ANY WARRANTY; without even the implied warranty of            *
   13 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
   14 *    GNU General Public License for more details.                              *
   15 *                                                                              *
   16 *    You should have received a copy of the GNU General Public License         *
   17 *    along with this program; if not, write to the Free Software               *
   18 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *
   19 *                                                                              *
   20 *    To contact the author regarding this program,                             *
   21 *    please use this email address: <ide.php@ekenberg.se>                      *
   22 \*******************************************************************************/
   23 
   24 class Page {
   25    var $Bgcolor		= "#FFE56A";
   26    var $Box_bgcolor	= "#FFFFDD";
   27    var $Link_color	= "#0A0AA0";
   28    var $Alink_color	= "#0000CC";
   29    var $Vlink_color	= "#464686";
   30 
   31 function html_top() {
   32    $ret = "";
   33    $ret .= "<HTML><HEAD>\n";
   34    $ret .= "<TITLE>I D E . P H P</TITLE>\n";
   35    $ret .= "{$this->CSS_code}\n";
   36    $ret .= "{$this->JS_code}\n";
   37    $ret .= "</HEAD>\n";
   38    $ret .= "<BODY BGCOLOR='{$this->Bgcolor}' LINK='{$this->Link_color}' ALINK='{$this->Alink_color}' VLINK='{$this->Vlink_color}' onUnload='closeCodeWindow()'>\n";
   39    return ($ret);
   40 }
   41 
   42 function html_bottom() {
   43    return "</BODY></HTML>\n";
   44 }
   45 
   46 function begin_invisible_table($width, $attr="") {
   47    $ret  = "<TABLE WIDTH='$width' BORDER='0' ";
   48    $ret .= (is_array($attr) ? join(" ", $attr) : NULL) . ">\n";
   49    return ($ret);
   50 }
   51 
   52 function end_invisible_table() {
   53    $ret = "</TABLE>\n";
   54    return ($ret);
   55 }
   56 
   57 function start_box_table($attr="") {
   58    $ret .= "<TABLE BORDER='0' CELLPADDING='0' CELLSPACING='0' BGCOLOR='#000000' ALIGN='center' ";
   59    $ret .= (is_array($attr) ? join(" ", $attr) : NULL) . ">\n";
   60    $ret .= "<TR><TD>\n";
   61    $ret .= "<TABLE BORDER='0' CELLPADDING='3' CELLSPACING='1' BGCOLOR='#000000' ALIGN='center' WIDTH='100%'>\n";
   62    return ($ret);
   63 }
   64 
   65 function end_box_table() {
   66    $ret .= "</TABLE></TD></TR></TABLE>\n";
   67    return ($ret);
   68 }
   69 
   70 function info_box($width, $content) {
   71    $ret .= $this->start_box_table(array("WIDTH='$width'"));
   72    $ret .= "<TR BGCOLOR='{$this->Box_bgcolor}'><TD>\n";
   73    $ret .= $this->begin_invisible_table("100%", array("CELLPADDING='10'", "CELLSPACING='0'", "ALIGN='center'", "BGCOLOR='{$this->Box_bgcolor}'"));
   74    $ret .= "<TR><TD CLASS='netscapesucks'>\n";
   75    $ret .= $content;
   76    $ret .= "</TD></TR></TABLE>\n";
   77    $ret .= "</TD></TR>\n";
   78    $ret .= $this->end_box_table();
   79    return($ret);
   80 }
   81 
   82 function Page() {
   83    $this->CSS_code = "
   84    <STYLE TYPE='text/css'>
   85    <!--
   86    A {
   87       text-decoration: none;
   88    }
   89    A:HOVER {
   90       color: {$this->Alink_color};
   91    }
   92    BODY,INPUT {
   93       font-family: Arial, 'MS Sans Serif', Helvetica;
   94    }
   95    INPUT {
   96       font-size: 9pt;
   97    }
   98    H2,H4,P {
   99       font-family: Verdana,Geneva,Arial,Helvetica;
  100    }
  101    H2 {
  102       font-size: 20pt;
  103       font-weight: 500;
  104    }
  105    H4 {
  106       font-size: 14pt;
  107       font-style: Italic;
  108       font-weight: 500;
  109       margin-left: 20pt;
  110    }
  111    P {
  112       font-size: 10pt;
  113       text-indent: 10pt;
  114       margin-left: 10pt;
  115       margin-right: 15pt;
  116    }
  117    P.indentall {
  118       text-indent: 0pt;
  119       margin-left: 20pt;
  120    }
  121    P.noindent {
  122       text-indent: 0pt;
  123       margin-left: 0pt;
  124    }
  125    .netscapesucks {
  126       font-family: Arial, 'MS Sans Serif', Helvetica;
  127       font-size: 11pt;
  128    }
  129    .netscapesucks2 {
  130       font-family: monospace;
  131       font-size: 9pt;
  132    }
  133    -->
  134    </STYLE>\n";
  135 
  136    $this->JS_code = "
  137    <SCRIPT LANGUAGE='JavaScript'>
  138    function closeCodeWindow() {
  139       if (eval_window && typeof(eval_window) == 'object') {
  140          eval_window.close();
  141       }
  142    }
  143    </SCRIPT>\n";
  144 }
  145 
  146 }?>