function uc_file_get_address_limit in Ubercart 7.3
Same name and namespace in other branches
- 8.4 uc_file/uc_file.module \uc_file_get_address_limit()
- 6.2 uc_file/uc_file.module \uc_file_get_address_limit()
Gets the maximum number of locations a file can be downloaded from.
If there are no file-specific location limits set, the function returns the global limits. Otherwise the limits from the file are returned.
Parameters
$file: A uc_file_products object.
Return value
The maximum number of locations.
2 calls to uc_file_get_address_limit()
- uc_file_action_order_renew in uc_file/
uc_file.rules.inc - Renews an orders product files.
- uc_file_uc_add_to_cart in uc_file/
uc_file.module - Implements hook_uc_add_to_cart().
File
- uc_file/
uc_file.module, line 1711 - Allows products to be associated with downloadable files.
Code
function uc_file_get_address_limit($file) {
if (!isset($file->address_limit) || $file->address_limit == UC_FILE_LIMIT_SENTINEL) {
return variable_get('uc_file_download_limit_addresses', NULL);
}
else {
return $file->address_limit;
}
}