Back to PhocaDownloadFile class

Method getCSSFile

public static
getCSSFile
(mixed $id = 0, mixed $fullPath = 0)

Method getCSSFile - Source code

public static function getCSSFile($id = 0, $fullPath = 0)
{
    if ((int) $id > 0) {
        $db = Factory::getDBO();
        $query = 'SELECT a.filename as filename, a.type as type' . ' FROM #__phocadownload_styles AS a' . ' WHERE a.id = ' . (int) $id . ' ORDER BY a.id';
        $db->setQuery($query, 0, 1);
        $filename = $db->loadObject();
        if (isset($filename->filename) && $filename->filename != '') {
            if ($fullPath == 1 && isset($filename->type)) {
                return self::getCSSPath($filename->type) . $filename->filename;
            } else {
                return $filename->filename;
            }
        }
    }
    return false;
}