version 1.19, 2002/10/29 12:35:43 |
version 1.20, 2002/10/29 15:25:03 |
|
|
* http://www.platon.sk/projects/phpMyEdit/ |
* http://www.platon.sk/projects/phpMyEdit/ |
*/ |
*/ |
|
|
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.18 2002/10/23 19:10:07 nepto Exp $ */ |
/* $Platon: phpMyEdit/phpMyEdit.class.php,v 1.19 2002/10/29 12:35:43 nepto Exp $ */ |
|
|
/* phpMyEdit intro {{{ */ |
/* phpMyEdit intro {{{ */ |
/* |
/* |
|
|
return $ret; |
return $ret; |
} /* }}} */ |
} /* }}} */ |
|
|
function htmlDisplay($field, $str, $usemask = true, $usecodec = true) /* {{{ */ |
function htmlDisplay($field, $str, $usemask = true, $usecodec = true, $disallow_empty = true) /* {{{ */ |
{ |
{ |
// undo the add slashes |
// undo the add slashes |
$str = stripslashes($str); |
$str = stripslashes($str); |
|
|
// if there's a field mask, use it as first arg to sprintf |
// if there's a field mask, use it as first arg to sprintf |
if (isset($field['mask']) && $usemask) |
if (isset($field['mask']) && $usemask) { |
$str = sprintf($field['mask'],$str); |
$str = sprintf($field['mask'],$str); |
|
} |
if ($usecodec) { |
if ($usecodec) { |
// if db codec is in effect, use it |
// if db codec is in effect, use it |
if (isset($field['dbdecode'])) { |
if (isset($field['dbdecode'])) { |
|
|
$str = htmlspecialchars($str); |
$str = htmlspecialchars($str); |
} |
} |
} |
} |
|
if ($disallow_empty) { |
|
strlen($str) <= 0 && $str = ' '; |
|
} |
|
|
return $str; |
return $str; |
} /* }}} */ |
} /* }}} */ |