function persistentUrl($params) { if (defined('PERSISTENT_UPLOAD_URLS') && PERSISTENT_UPLOAD_URLS) { $url_path = NDownload::cleanUrl($params['file']); $parts = NDownload::getAssetAttributes($url_path); NDownload::setAssetAttributes($parts); $model_name = NDownload::getAssetModelName(); $url = UPLOAD_DIR . '/' . $model_name . '/' . $params['field'] . '/' . $params['id']; return $url; } else { return $params['file']; } }