X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffunctions.php;h=d9a2388fcb08bff8c790d39f182ef296fb475c5c;hb=572e4b0f128dc3e7c44331d21f366fb8b19665e4;hp=2f1f10302237a13f0a533805513c6ec9528a6051;hpb=f01652b7b8efac92d97889e312402c4a845c2f14;p=mailer.git diff --git a/inc/functions.php b/inc/functions.php index 2f1f103022..d9a2388fcb 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -588,16 +588,20 @@ function TRANSLATE_GENDER ($gender) { } // function GET_POOL_TYPE($PT) { - switch ($PT) - { - case "TEMP" : $ret = POOL_TEMP; break; - case "SEND" : $ret = POOL_SEND; break; - case "NEW" : $ret = POOL_NEW; break; - case "ADMIN" : $ret = POOL_ADMIN; break; - case "ACTIVE" : $ret = POOL_ACTIVE; break; - case "DELETED": $ret = POOL_DELETED; break; - default : $ret = POOL_UNKNOWN." (".$PT.")"; break; - } + // Unknown pool type is default + $ret = POOL_UNKNOWN." (".$PT.")"; + + // Generate constant name + $constantName = sprintf("POOL_%s", $PT); + + // Is the type known? + if (defined($constantName)) { + // Prepare eval command + $eval = sprintf("\$ret = %s;", $constantName); + eval($eval); + } // END - if + + // Return result return $ret; } //