diff --git a/lib/util/ktutil.inc b/lib/util/ktutil.inc index af7e854..1c67a47 100644 --- a/lib/util/ktutil.inc +++ b/lib/util/ktutil.inc @@ -158,7 +158,7 @@ class KTUtil { } // }}} - // {{{ + // {{{ copyDirectory function copyDirectory($sSrc, $sDst, $bMove = false) { if (file_exists($sDst)) { return PEAR::raiseError("Destination directory already exists."); @@ -260,6 +260,20 @@ class KTUtil { } } // }}} + + // {{{ getTableName + /** + * The one true way to get the correct name for a table whilst + * respecting the administrator's choice of table naming. + */ + function getTableName($sTable) { + $sTable = $sTable . "_table"; + if (isset($GLOBALS['default']->$sTable)) { + return $GLOBALS['default']->$sTable; + } + return PEAR::raiseError('Could not find table: ' . $sTable); + } + // }}} } ?>