File: D:/web/itpartnership.net (cms)/modules/FeedbackForm/classes/UtilityFunctions.class.php
<?php
// Feedback Form. 02/2005 SjG <feedbackform_cmsmodule@fogbound.net>
// A Module for CMS Made Simple, (c)2005 by Ted Kulp (wishy@cmsmadesimple.org)
// This project's homepage is: http://www.cmsmadesimple.org
class ffUtilityFunctions
{
// ---------------------------------------------------------------------------------
// STUPID COMMON DATA MANIPULATION METHODS
// ---------------------------------------------------------------------------------
// returns true if a variable exists and has a non-null value, but could contain zero
function def(&$var)
{
if (!isset($var))
{
return false;
}
else if (is_null($var))
{
return false;
}
else if (!is_array($var) && empty($var))
{
return false;
}
else if (is_array($var) && count($var) == 0)
{
return false;
}
return true;
}
// creates a form-safe alias string
function MakeAlias($string, $isForm=false)
{
$string = trim($string);
$string = preg_replace("/[_-\W]+/", "_", $string);
$string = trim($string, '_');
if ($isForm)
{
return strtolower($string);
}
else
{
return 'ff'.strtolower($string);
}
}
}
?>