# Module: HTML
# html.inc Copyright (C) 2002 Sandino Araico Sánchez
/* --LICENSE IN US ENGLISH-----------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42-sandino-3):
* Sandino Araico Sánchez wrote this file.
* As long as you retain this notice you can do whatever you want with this
* software. If we meet some day, and you think this stuff is worth it, you can
* buy me a beer in return.
* Sandino Araico Sánchez
* --END LICENSE---------------------------------------------------------------
* --LICENCIA EN ESPAÑOL MEXICANO----------------------------------------------
* "LA LICENCIA BEER-WARE" (traducción al español de la revisión 42-sandino-3):
* Sandino Araico Sánchez escribió éste archivo.
* Siempre y cuando usted retenga éste aviso (en español y en inglés) usted
* puede hacer cualquier cosa con éste software. Si algún día nos encontramos y
* usted piensa que éste software vale la pena, usted puede invitarme una
* cerveza en recompensa.
* Sandino Araico Sánchez
* --FIN DE LICENCIA-----------------------------------------------------------
*/
# Changelog:
# 2002-01-29 Sandino Araico Sánchez - Functions for HTML
if(!defined("__HOPP_HTML"))
{
define ("__HOPP_HTML",1);
#---------------------------------------------------------------------
include "db/file/db-file.php";
#---------------------------------------------------------------------
function h_html_get_options_from_file($file_name, $selected='')
{
$array=h_db_get_basic_array_from_file($file_name);
if(!is_array($array))
return;
$str='';
foreach($array as $key => $value)
{
#s_log("key: $key\tvalue: $value");
$val=str_replace('"',"",$key);
$sel=$selected?($selected==$val?' selected':''):'';
$txt=htmlentities($value);
if($txt)
$str.="\n";
}
return $str;
}
function h_html_check_option_in_file($file_name, $str)
{
return h_db_find_key_in_file($file_name, str_replace('"',"",$str));
}
#---------------------------------------------------------------------
} //__HOPP_HTML
?>