Location: PHPKode > projects > Bradabra > bradabra/include/style.php
<?php
//****************************************************************************
//
// Copyright (C) 2001 Eric SEIGNE <hide@address.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
//****************************************************************************
//
// For more informations, get to the project's main source file.
//
//****************************************************************************

if(!defined("__style_php__")):
define("__style_php__", "1");


//----------------------------------------------------------------------------
// CSS related variables
//----------------------------------------------------------------------------
$css_fonts_sansserif    = "Verdana, Arial, Helvetica, sans-serif"; // if using HTMLDOC, do not leave any spaces in this string !
$css_fonts_mono         = "Courier, mono";                         // if using HTMLDOC, do not leave any spaces in this string !

$css_font_size_smallest = "10px";
$css_font_size_small    = "11px";
$css_font_size_normal   = "12px";
$css_font_size_big      = "14px";
$css_font_size_biggest  = "16px";

$css_font_weight_bold   = "600";

$css_text = "<!--
  body, td, tr, th, form, p, ul, ol {
    font-family   : ".$css_fonts_sansserif.";
    font-size     : ".$css_font_size_normal.";
    color         : ".COL_TEXT.";
    margin-left   : 0;
    margin-top    : 0;
    margin-right  : 0;
    margin-bottom : 0;
  }
  input, textarea {
    font-family : ".$css_fonts_mono.";
    font-size   : ".$css_font_size_small.";
  }
  select {
    font-family : ".$css_fonts_sansserif.";
    font-size   : ".$css_font_size_smallest.";
  }
  A:link, A:visited, A:active {
    color : ".COL_FRAME.";
  }
  A:hover {
    color : ".COL_TABLEHEADER.";
  }
  b {
    font-weight : ".$css_font_weight_bold.";
  }
  li, h1, h2, h3, h4, h5, h6 {
    font-family : ".$css_fonts_sansserif.";
  }
  .button {
    font-family : ".$css_fonts_sansserif.";
    font-size   : ".$css_font_size_smallest.";
  }
  .input_number {
    font-family : ".$css_fonts_mono.";
    font-size   : ".$css_font_size_small.";
    text-align  : right;
  }
  .popup {
    position   : absolute;
    visibility : hidden;
    left       : 0px;
    top        : 0px;
    width      : 200px;
    z-index    : 5;
  }
  .statusbox {
    font-family : ".$css_fonts_sansserif.";
    font-size   : ".$css_font_size_small.";
  }
-->\n";


//----------------------------------------------------------------------------
// HTML_Header
//----------------------------------------------------------------------------
function HTML_Header ($title, $background, $meta_author, $meta_desc, $meta_keywords, $on_load, $on_load_function)
{
  global $css_text;
  $text = "";

  $text .=
    "<html>\n" .
    "<head>\n" .
    "<title>".$title."</title>\n".
    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n";

  if(!empty($meta_author)) $text .=
    "<meta name=\"author\" content=\"".$meta_author."\">\n";

  if(!empty($meta_desc)) $text .=
    "<meta name=\"description\" content=\"".$meta_desc."\">\n";

  if(!empty($meta_keywords)) $text .=
    "<meta name=\"keywords\" content=\"".$meta_keywords."\">\n";

  $text .=
    "<style type=\"text/css\">\n".
    $css_text.
    "</style>\n";

  if(!empty($on_load_function)) $text .=
    "<script language=\"JavaScript\">".$on_load_function."</script>\n";

  $text .=
    "</head>\n".
    "<body text=\"".COL_TEXT."\" bgcolor=\"".COL_BACK."\" link=\"".COL_LINK."\" vlink=\"".COL_LINKV."\" alink=\"".COL_LINKA."\"";

  if(!empty($background)) $text .=
    " background=\"".$background."\"";

  if(!empty($on_load)) $text .=
    " onLoad=\"".$on_load."\"";

  $text .= ">\n";

  print($text);
}

//----------------------------------------------------------------------------
// HTML_Bottom
//----------------------------------------------------------------------------
function HTML_Bottom ()
{
  print(
    "</body>\n" .
    "</html>\n");
}

//----------------------------------------------------------------------------
// Style_FrameHeader
//----------------------------------------------------------------------------
function Style_FrameHeader ($width, $height, $border_size, $col_border, $col_back, $align, $valign)
{
  $text = "";


  $text .= "<table";

  if(!empty($width))
    $text .= " width=\"".$width."\"";

  if(!empty($height))
    $text .= " height=\"".$height."\"";

  $text .= " border=\"0\" cellspacing=\"";

  if(!empty($border_size))
    $text .= $border_size;
  else
    $text .= "1";

  $text .= "\" cellpadding=\"0\"";

  if(!empty($align))
    $text .= " align=\"".$align."\"";

  if(!empty($valign))
    $text .= " valign=\"".$valign."\"";

  if(!empty($col_border))
    $text .= " bgcolor=\"".$col_border."\"";

  $text .= "><tr><td>\n";

  $text .= "<table width=\"100%\" height=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\"";

  if(!empty($col_back))
    $text .= " bgcolor=\"".$col_back."\"";

  $text .= "><tr><td>\n";

  print($text);
}

//----------------------------------------------------------------------------
// Style_FrameBottom
//----------------------------------------------------------------------------
function Style_FrameBottom ()
{
  print(
    "</td></tr></table>\n" .
    "</td></tr></table>\n");
}

//----------------------------------------------------------------------------
// Style_PageTitle
//----------------------------------------------------------------------------
function Style_PageTitle ($title)
{
  print("<center><font color=".COL_PAGETITLE."><h2>".$title."</h2></font></center>\n");
}

//----------------------------------------------------------------------------
// Style_TableHeader
//----------------------------------------------------------------------------
function Style_TableHeader ($width="", $height="")
{
  $text = "";


  $text .= "<table ";

  if(!empty($width))
    $text .= "width=\"$width\" ";

  if(!empty($height))
    $text .= "height=\"$height\" ";

  $text .= "border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";

  print($text);
}

//----------------------------------------------------------------------------
// Style_TableBottom
//----------------------------------------------------------------------------
function Style_TableBottom ()
{
  print("</table>\n");
}

//----------------------------------------------------------------------------
// Style_TypicalTableHeader
//----------------------------------------------------------------------------
function Style_TypicalTableHeader ($title, $width)
{
  $text = "";


  $text .= "<table ";

  if(!empty($width))
    $text .= "width=\"".$width."\" ";

  $text .=
    "cellpadding=\"1\" cellspacing=\"0\" border=\"0\" bgcolor=\"".COL_FRAME."\"><tr><td>\n".
    "<table width=\"100%\" cellpadding=\"1\" cellspacing=\"".$cellspacing."\" border=\"0\" bgcolor=\"".COL_BACK."\">\n";

  if(!empty($title))
    $text .=
      "  <tr bgcolor=\"".COL_TABLEHEADER."\">\n".
      "    <td>\n".
      "      <font color=\"".COL_TABLEHEADER_TEXT."\"><b>".$title."</b></font>\n".
      "    </td>\n".
      "  </tr>\n";

  print($text);
}

//----------------------------------------------------------------------------
// Style_TypicalTableBottom
//----------------------------------------------------------------------------
function Style_TypicalTableBottom ()
{
  print(
    "</table></td></tr>\n".
    "</table>\n");
}


endif;
?>
Return current item: Bradabra