Filter:   InfoImg
download html.php
Language: PHP
LOC: 82
Project Info
Virtual Photo Album(vphotoalb)
Server: SourceForge
Type: cvs
...alb\vphotoalb\html\include\
   .htaccess
   antispam.php
   constants.php
   db.php
   db_my.php
   db_pg.php
   db_schema.php
   faq_strings.php
   form.php
   functions.php
   globals.php
   html.php
   html_verifier.php
   ImageProcessing.php
   input.php
   mime.php
   originals.php
   PictureFinder.php
   queries.php
   read_exif_data.php
   read_tiff_data.php
   SearchParameters.php
   security.php
   strings.en.php
   strings.fr.php
   strings.php
   tables.php

<?php
/* HTML tag functions.
 *
 * Written by: Chris Studholme
 * Copyright:  GPL (http://www.fsf.org/copyleft/gpl.html)
 * $Id: html.php,v 1.1 2003/12/23 06:07:15 cstudhol Exp $
 */


$HTML_VERIFIER = false;
if ($DEBUG_LEVEL>0) {
  require("include/html_verifier.php");
  $HTML_VERIFIER = new HTMLVerifier();
}


/* Full tag.  This function also accepts the prototype tag($tag,$content).
 */
function tag($tag,$attributes=false,$content=false) {
  $result = "<".$tag;
  if (is_array($attributes)) {
    reset($attributes);
    while (list($key,$value)=each($attributes)) {
      if (!is_bool($value)) {
	if (!ereg("\"",$value))
	  $result .= " ".$key."=\"".$value."\"";
	else
	  $result .= " ".$key."='".$value."'";
      }
      else if ($value)
	$result .= " ".$key;
    }
  }
  else if ($content==false)
    $content = $attributes;

  $result.=">".$content."</".$tag.">";

  global $HTML_VERIFIER;
  if ($HTML_VERIFIER)
    $HTML_VERIFIER->check_tag($tag,$attributes,$content,$result);

  return $result;
}

/* singleton tag (no end tag)
 */
function stag($tag,$attributes=false) {
  $result = "<".$tag;
  if (is_array($attributes)) {
    reset($attributes);
    while (list($key,$value)=each($attributes)) {
      if (!is_bool($value)) {
	if (!ereg("\"",$value))
	  $result .= " ".$key."=\"".$value."\"";
	else
	  $result .= " ".$key."='".$value."'";
      }
      else if ($value)
	$result .= " ".$key;
    }
  }
  $result.=">";

  global $HTML_VERIFIER;
  if ($HTML_VERIFIER)
    $HTML_VERIFIER->check_stag($tag,$attributes,$result);

  return $result;
}

/* begin tag
 */
function btag($tag,$attributes=false) {
  $result = "<".$tag;
  if (is_array($attributes)) {
    reset($attributes);
    while (list($key,$value)=each($attributes)) {
      if (!is_bool($value))
	$result .= " ".$key."=\"".
	  ereg_replace("\"","\\\"",$value)."\"";
      else if ($value)
	$result .= " ".$key;
    }
  }
  $result.=">";

  global $HTML_VERIFIER;
  if ($HTML_VERIFIER)
    $HTML_VERIFIER->check_btag($tag,$attributes,$result);

  return $result;
}

/* end tag
 */
function etag($tag) {
  $result="</".$tag.">";

  global $HTML_VERIFIER;
  if ($HTML_VERIFIER)
    $HTML_VERIFIER->check_etag($tag,$result);

  return $result;
}

// create a script to automatically reload the parent of this window
function html_reload_parent() {
  //return tag("script","window.opener.location=window.opener.location;");
  return tag("script","window.opener.location.reload();");
}

// create script to automatically close a popup window
function html_close_popup() {
  echo tag("script","window.close();")."\n"; 
}

?>