function imagepicker_quota_ok in Image Picker 6.2
Same name and namespace in other branches
- 5.2 imagepicker.module \imagepicker_quota_ok()
- 7 imagepicker.functions.inc \imagepicker_quota_ok()
Checks quotas
Parameters
$src: Tells the function where the request is coming from
$account: Optional user account object.
$label: Optional label to pass through to the theme
$help: Optional help to pass through to the theme
Return value
Returns the quota message along with the upload form, all themed
3 calls to imagepicker_quota_ok()
File
- ./
imagepicker.functions.inc, line 2171 - Imagepicker functions
Code
function imagepicker_quota_ok($src, $account = FALSE, $label = "", $help = "") {
if ($account) {
$user = $account;
}
else {
global $user;
}
$ret = _imagepicker_quota_check($src, $account);
$quota_ok = $ret[0];
$message1 = $ret[1];
$message2 = $ret[2];
$form = '';
if ($quota_ok) {
if ($account) {
if ($src == 'admin') {
$form = drupal_get_form('imagepicker_upload_form', $user, TRUE);
}
elseif ($src == 'user') {
$form = drupal_get_form('imagepicker_upload_form', $user);
}
}
else {
$form = drupal_get_form('imagepicker_upload_form');
}
}
return theme('imagepicker_quota_message', $message1, $message2, $form, $label, $help);
}